diff --git a/README.md b/README.md index 491df44..7e73865 100644 Binary files a/README.md and b/README.md differ diff --git a/image.png b/image.png new file mode 100644 index 0000000..9152354 Binary files /dev/null and b/image.png differ diff --git a/src/main/java/com/nuclearcrackhead/serverboss/SVBCR.java b/src/main/java/com/nuclearcrackhead/serverboss/SVBCR.java index 49374e0..7004d5e 100644 --- a/src/main/java/com/nuclearcrackhead/serverboss/SVBCR.java +++ b/src/main/java/com/nuclearcrackhead/serverboss/SVBCR.java @@ -3,6 +3,7 @@ import com.nuclearcrackhead.serverboss.registry.ModBlocks; import com.nuclearcrackhead.serverboss.registry.ModFluids; import com.nuclearcrackhead.serverboss.registry.ModItems; +import com.nuclearcrackhead.serverboss.registry.ModDamageTypes; import net.fabricmc.api.ModInitializer; import net.minecraft.util.Identifier; @@ -23,5 +24,6 @@ public void onInitialize() { ModItems.init(); ModFluids.init(); ModBlocks.init(); + ModDamageTypes.init(); } } \ No newline at end of file diff --git a/src/main/java/com/nuclearcrackhead/serverboss/content/block/Agony.java b/src/main/java/com/nuclearcrackhead/serverboss/content/block/Agony.java index b3b8ef4..d8a3d44 100644 --- a/src/main/java/com/nuclearcrackhead/serverboss/content/block/Agony.java +++ b/src/main/java/com/nuclearcrackhead/serverboss/content/block/Agony.java @@ -1,13 +1,16 @@ package com.nuclearcrackhead.serverboss.content.block; +import com.nuclearcrackhead.serverboss.registry.ModDamageTypes; import net.minecraft.block.AbstractBlock; import net.minecraft.block.Block; import com.mojang.serialization.MapCodec; import net.minecraft.block.BlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; +import net.minecraft.registry.RegistryKeys; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraft.entity.damage.DamageSource; public class Agony extends Block { public static final MapCodec CODEC = createCodec(Agony::new); @@ -22,7 +25,11 @@ public Agony(AbstractBlock.Settings settings) { public void onSteppedOn(World world, BlockPos pos, BlockState state, Entity entity) { if (!entity.bypassesSteppingEffects() && entity instanceof LivingEntity livingEntity) { - livingEntity.serverDamage(world.getDamageSources().hotFloor(), livingEntity.getMaxHealth() / 7); + //DamageSource damageSource = new DamageSource( + // world.getRegistryManager() + // .get(RegistryKeys.DAMAGE_TYPE) //incoherent as hell + // .entryOf(ModDamageTypes.AGONY_DAMAGE)); + livingEntity.serverDamage(entity.getDamageSources().create(ModDamageTypes.AGONY_DAMAGE, null), livingEntity.getMaxHealth() / 7); } super.onSteppedOn(world, pos, state, entity); diff --git a/src/main/java/com/nuclearcrackhead/serverboss/registry/ModDamageTypes.java b/src/main/java/com/nuclearcrackhead/serverboss/registry/ModDamageTypes.java new file mode 100644 index 0000000..d5d7ea3 --- /dev/null +++ b/src/main/java/com/nuclearcrackhead/serverboss/registry/ModDamageTypes.java @@ -0,0 +1,16 @@ +package com.nuclearcrackhead.serverboss.registry; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.damage.DamageSource; +import net.minecraft.entity.damage.DamageType; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.util.Identifier; + +public class ModDamageTypes { + + public static void init() {} + + public static final RegistryKey AGONY_DAMAGE = RegistryKey.of(RegistryKeys.DAMAGE_TYPE, Identifier.of("svbcr", "agony")); + +} diff --git a/src/main/resources/assets/svbcr/lang/en_us.json b/src/main/resources/assets/svbcr/lang/en_us.json index 81045ce..d792613 100644 --- a/src/main/resources/assets/svbcr/lang/en_us.json +++ b/src/main/resources/assets/svbcr/lang/en_us.json @@ -1,9 +1,11 @@ { "block.svbcr.example_block": "Example Block", "block.svbcr.agony": "Agony", + "item.svbcr.example_item": "Example Item", "block.svbcr.radioactive": "Radioactive Waste", "block.svbcr.sludge": "Sludge", "block.svbcr.wastebarrel": "Large Radioactive Waste Barrel", "item.svbcr.radioactive_bucket": "Radioactive Waste Barrel", - "item.svbcr.example_item": "Example Item" + "death.attack.agony": "%s was crushed by grief", + "death.attack.agony.player": "%s was crushed by grief whilst trying to escape %s" } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/damage_type/no_knockback.json b/src/main/resources/data/minecraft/tags/damage_type/no_knockback.json new file mode 100644 index 0000000..a51bb88 --- /dev/null +++ b/src/main/resources/data/minecraft/tags/damage_type/no_knockback.json @@ -0,0 +1,5 @@ +{ + "values": [ + "svbcr:agony" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/svbcr/damage_type/agony.json b/src/main/resources/data/svbcr/damage_type/agony.json new file mode 100644 index 0000000..ca4f36c --- /dev/null +++ b/src/main/resources/data/svbcr/damage_type/agony.json @@ -0,0 +1,5 @@ +{ + "exhaustion": 0.3, + "message_id": "agony", + "scaling": "never" +} \ No newline at end of file