Skip to content

Commit

Permalink
Fixed bug with tnt not causing damage to entities
Browse files Browse the repository at this point in the history
  • Loading branch information
RebelKeithy committed Aug 23, 2021
1 parent 38c9ee2 commit afc2773
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,10 @@
import com.teammetallurgy.metallurgyclassic.machines.crusher.CrusherComponent;
import com.teammetallurgy.metallurgyclassic.machines.furnace.MetalFurnaceComponent;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.block.Block;
import net.minecraft.block.Material;
import net.minecraft.entity.EntityDimensions;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.SpawnGroup;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemGroup;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

Expand All @@ -26,7 +20,7 @@ public class MetallurgyClassic implements ModInitializer {
public static final EntityType<CustomizableTntEntity> TNT_ENTITY_TYPE = Registry.register(
Registry.ENTITY_TYPE,
new Identifier("metallurgyclassic", "metal_tnt"),
FabricEntityTypeBuilder.<CustomizableTntEntity>create(SpawnGroup.MISC, CustomizableTntEntity::new).build()
FabricEntityTypeBuilder.<CustomizableTntEntity>create(SpawnGroup.MISC, CustomizableTntEntity::new).dimensions(EntityDimensions.changing(0.98F, 0.7F)).build()
);

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void tick() {
}

private void explode() {
this.world.createExplosion(this, this.getX(), this.getBodyY(0.1625D), this.getZ(), this.tntSettings.power, false, this.tntSettings.destructionType);
this.world.createExplosion(this, this.getX(), this.getBodyY(0.0625D), this.getZ(), this.tntSettings.power, false, Explosion.DestructionType.BREAK);
}

protected void writeCustomDataToNbt(NbtCompound nbt) {
Expand Down

0 comments on commit afc2773

Please sign in to comment.