change map color & entity size of TNTs for vanilla parity

This commit is contained in:
Jenny 2025-06-13 17:55:49 +02:00
parent ddb1515134
commit 40eb6be20f
Signed by: Jenny
GPG Key ID: 2072A14E40940632
4 changed files with 34 additions and 33 deletions

View File

@ -12,7 +12,7 @@ mapping_version=2023.09.03-1.20.1
mod_id=enhancedexplosives mod_id=enhancedexplosives
mod_name=Enhanced Explosives mod_name=Enhanced Explosives
mod_license=All Rights Reserved mod_license=All Rights Reserved
mod_version=0.13.2 mod_version=0.14.0
mod_group_id=com.jenny mod_group_id=com.jenny
mod_authors=Jenny mod_authors=Jenny
mod_description=strong & throwable explosives mod_description=strong & throwable explosives

View File

@ -1,9 +1,9 @@
package com.jenny.enhancedexplosives.blocks; package com.jenny.enhancedexplosives.blocks;
import com.jenny.enhancedexplosives.items.BlockItemTooltip; import com.jenny.enhancedexplosives.items.BlockItemTooltip;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.material.MapColor; import net.minecraft.world.level.material.MapColor;
import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.eventbus.api.IEventBus;
@ -14,49 +14,51 @@ import net.minecraftforge.registries.RegistryObject;
import static com.jenny.enhancedexplosives.EnhancedExplosives.MODID; import static com.jenny.enhancedexplosives.EnhancedExplosives.MODID;
public class blocks { public class blocks {
private static final BlockBehaviour.Properties DEFAULT_PROPS = BlockBehaviour.Properties.of().mapColor(MapColor.FIRE).instabreak().sound(SoundType.GRASS).ignitedByLava();
public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, MODID); public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, MODID);
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MODID); public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MODID);
public static final RegistryObject<Block> TNT_8 = BLOCKS.register("tnt_8", () -> new strongerTNTBlock(BlockBehaviour.Properties.of().mapColor(MapColor.STONE), 8.0f, 80)); public static final RegistryObject<Block> TNT_8 = BLOCKS.register("tnt_8", () -> new strongerTNTBlock(DEFAULT_PROPS, 8.0f, 80));
public static final RegistryObject<Item> TNT_8_ITEM = ITEMS.register("tnt_8", () -> new BlockItemTooltip(TNT_8.get(), new Item.Properties())); public static final RegistryObject<Item> TNT_8_ITEM = ITEMS.register("tnt_8", () -> new BlockItemTooltip(TNT_8.get(), new Item.Properties()));
public static final RegistryObject<Block> TNT_16 = BLOCKS.register("tnt_16", () -> new strongerTNTBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_RED), 16.0f, 80)); public static final RegistryObject<Block> TNT_16 = BLOCKS.register("tnt_16", () -> new strongerTNTBlock(DEFAULT_PROPS, 16.0f, 80));
public static final RegistryObject<Item> TNT_16_ITEM = ITEMS.register("tnt_16", () -> new BlockItemTooltip(TNT_16.get(), new Item.Properties())); public static final RegistryObject<Item> TNT_16_ITEM = ITEMS.register("tnt_16", () -> new BlockItemTooltip(TNT_16.get(), new Item.Properties()));
public static final RegistryObject<Block> TNT_32 = BLOCKS.register("tnt_32", () -> new strongerTNTBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_RED), 32.0f, 80)); public static final RegistryObject<Block> TNT_32 = BLOCKS.register("tnt_32", () -> new strongerTNTBlock(DEFAULT_PROPS, 32.0f, 80));
public static final RegistryObject<Item> TNT_32_ITEM = ITEMS.register("tnt_32", () -> new BlockItemTooltip(TNT_32.get(), new Item.Properties())); public static final RegistryObject<Item> TNT_32_ITEM = ITEMS.register("tnt_32", () -> new BlockItemTooltip(TNT_32.get(), new Item.Properties()));
public static final RegistryObject<Block> TNT_64 = BLOCKS.register("tnt_64", () -> new strongerTNTBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_RED), 64.0f, 80)); public static final RegistryObject<Block> TNT_64 = BLOCKS.register("tnt_64", () -> new strongerTNTBlock(DEFAULT_PROPS, 64.0f, 80));
public static final RegistryObject<Item> TNT_64_ITEM = ITEMS.register("tnt_64", () -> new BlockItemTooltip(TNT_64.get(), new Item.Properties())); public static final RegistryObject<Item> TNT_64_ITEM = ITEMS.register("tnt_64", () -> new BlockItemTooltip(TNT_64.get(), new Item.Properties()));
public static final RegistryObject<Block> TNT_128 = BLOCKS.register("tnt_128", () -> new strongerTNTBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_RED), 128.0f, 80)); public static final RegistryObject<Block> TNT_128 = BLOCKS.register("tnt_128", () -> new strongerTNTBlock(DEFAULT_PROPS, 128.0f, 80));
public static final RegistryObject<Item> TNT_128_ITEM = ITEMS.register("tnt_128", () -> new BlockItemTooltip(TNT_128.get(), new Item.Properties())); public static final RegistryObject<Item> TNT_128_ITEM = ITEMS.register("tnt_128", () -> new BlockItemTooltip(TNT_128.get(), new Item.Properties()));
public static final RegistryObject<Block> TNT_CLUSTER_2 = BLOCKS.register("tnt_cluster_2", () -> new ClusterTNTBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_RED), 4.0f, 80, 2, 10)); public static final RegistryObject<Block> TNT_CLUSTER_2 = BLOCKS.register("tnt_cluster_2", () -> new ClusterTNTBlock(DEFAULT_PROPS, 4.0f, 80, 2, 10));
public static final RegistryObject<Item> TNT_CLUSTER_2_ITEM = ITEMS.register("tnt_cluster_2", () -> new BlockItemTooltip(TNT_CLUSTER_2.get(), new Item.Properties())); public static final RegistryObject<Item> TNT_CLUSTER_2_ITEM = ITEMS.register("tnt_cluster_2", () -> new BlockItemTooltip(TNT_CLUSTER_2.get(), new Item.Properties()));
public static final RegistryObject<Block> TNT_CLUSTER_4 = BLOCKS.register("tnt_cluster_4", () -> new ClusterTNTBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_RED), 4.0f, 80, 4, 10)); public static final RegistryObject<Block> TNT_CLUSTER_4 = BLOCKS.register("tnt_cluster_4", () -> new ClusterTNTBlock(DEFAULT_PROPS, 4.0f, 80, 4, 10));
public static final RegistryObject<Item> TNT_CLUSTER_4_ITEM = ITEMS.register("tnt_cluster_4", () -> new BlockItemTooltip(TNT_CLUSTER_4.get(), new Item.Properties())); public static final RegistryObject<Item> TNT_CLUSTER_4_ITEM = ITEMS.register("tnt_cluster_4", () -> new BlockItemTooltip(TNT_CLUSTER_4.get(), new Item.Properties()));
public static final RegistryObject<Block> TNT_CLUSTER_8 = BLOCKS.register("tnt_cluster_8", () -> new ClusterTNTBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_RED), 4.0f, 80, 8, 10)); public static final RegistryObject<Block> TNT_CLUSTER_8 = BLOCKS.register("tnt_cluster_8", () -> new ClusterTNTBlock(DEFAULT_PROPS, 4.0f, 80, 8, 10));
public static final RegistryObject<Item> TNT_CLUSTER_8_ITEM = ITEMS.register("tnt_cluster_8", () -> new BlockItemTooltip(TNT_CLUSTER_8.get(), new Item.Properties())); public static final RegistryObject<Item> TNT_CLUSTER_8_ITEM = ITEMS.register("tnt_cluster_8", () -> new BlockItemTooltip(TNT_CLUSTER_8.get(), new Item.Properties()));
public static final RegistryObject<Block> TNT_HOMING = BLOCKS.register("tnt_homing", () -> new homingTNTBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_RED), 4.0f, 80, 1)); public static final RegistryObject<Block> TNT_HOMING = BLOCKS.register("tnt_homing", () -> new homingTNTBlock(DEFAULT_PROPS, 4.0f, 80, 1));
public static final RegistryObject<Item> TNT_HOMING_ITEM = ITEMS.register("tnt_homing", () -> new BlockItemTooltip(TNT_HOMING.get(), new Item.Properties())); public static final RegistryObject<Item> TNT_HOMING_ITEM = ITEMS.register("tnt_homing", () -> new BlockItemTooltip(TNT_HOMING.get(), new Item.Properties()));
public static final RegistryObject<Block> TNT_BLACK_HOLE = BLOCKS.register("tnt_black_hole", () -> new blackHoleTNTBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_RED), 4.0f, 80, 1)); public static final RegistryObject<Block> TNT_BLACK_HOLE = BLOCKS.register("tnt_black_hole", () -> new blackHoleTNTBlock(DEFAULT_PROPS, 4.0f, 80, 1));
public static final RegistryObject<Item> TNT_BLACK_HOLE_ITEM = ITEMS.register("tnt_black_hole", () -> new BlockItemTooltip(TNT_BLACK_HOLE.get(), new Item.Properties())); public static final RegistryObject<Item> TNT_BLACK_HOLE_ITEM = ITEMS.register("tnt_black_hole", () -> new BlockItemTooltip(TNT_BLACK_HOLE.get(), new Item.Properties()));
public static final RegistryObject<Block> TNT_CLAYMORE = BLOCKS.register("tnt_claymore", () -> new claymoreTNTBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_RED), 2.0f, 20, 256)); public static final RegistryObject<Block> TNT_CLAYMORE = BLOCKS.register("tnt_claymore", () -> new claymoreTNTBlock(DEFAULT_PROPS, 2.0f, 20, 256));
public static final RegistryObject<Item> TNT_CLAYMORE_ITEM = ITEMS.register("tnt_claymore", () -> new BlockItemTooltip(TNT_CLAYMORE.get(), new Item.Properties())); public static final RegistryObject<Item> TNT_CLAYMORE_ITEM = ITEMS.register("tnt_claymore", () -> new BlockItemTooltip(TNT_CLAYMORE.get(), new Item.Properties()));
public static final RegistryObject<Block> TNT_SELECTIVE = BLOCKS.register("tnt_selective", () -> new selectiveTNTBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_RED), 32.0f, 80)); public static final RegistryObject<Block> TNT_SELECTIVE = BLOCKS.register("tnt_selective", () -> new selectiveTNTBlock(DEFAULT_PROPS, 32.0f, 80));
public static final RegistryObject<Item> TNT_SELECTIVE_ITEM = ITEMS.register("tnt_selective", () -> new BlockItemTooltip(TNT_SELECTIVE.get(), new Item.Properties())); public static final RegistryObject<Item> TNT_SELECTIVE_ITEM = ITEMS.register("tnt_selective", () -> new BlockItemTooltip(TNT_SELECTIVE.get(), new Item.Properties()));
public static final RegistryObject<Block> TNT_ENDER = BLOCKS.register("tnt_ender", () -> new enderTNTBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_RED), 4.0f, 80)); public static final RegistryObject<Block> TNT_ENDER = BLOCKS.register("tnt_ender", () -> new enderTNTBlock(DEFAULT_PROPS, 4.0f, 80));
public static final RegistryObject<Item> TNT_ENDER_ITEM = ITEMS.register("tnt_ender", () -> new BlockItemTooltip(TNT_ENDER.get(), new Item.Properties())); public static final RegistryObject<Item> TNT_ENDER_ITEM = ITEMS.register("tnt_ender", () -> new BlockItemTooltip(TNT_ENDER.get(), new Item.Properties()));
public static final RegistryObject<Block> TNT_REPULSIVE = BLOCKS.register("tnt_repulsive", () -> new repulsiveTNTBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_RED), 4.0f, 80, 1)); public static final RegistryObject<Block> TNT_REPULSIVE = BLOCKS.register("tnt_repulsive", () -> new repulsiveTNTBlock(DEFAULT_PROPS, 4.0f, 80, 1));
public static final RegistryObject<Item> TNT_REPULSIVE_ITEM = ITEMS.register("tnt_repulsive", () -> new BlockItemTooltip(TNT_REPULSIVE.get(), new Item.Properties())); public static final RegistryObject<Item> TNT_REPULSIVE_ITEM = ITEMS.register("tnt_repulsive", () -> new BlockItemTooltip(TNT_REPULSIVE.get(), new Item.Properties()));

View File

@ -4,7 +4,6 @@ import com.jenny.enhancedexplosives.entities.arrows.*;
import com.jenny.enhancedexplosives.entities.client.*; import com.jenny.enhancedexplosives.entities.client.*;
import com.jenny.enhancedexplosives.entities.throwable.dynamite; import com.jenny.enhancedexplosives.entities.throwable.dynamite;
import com.jenny.enhancedexplosives.entities.tnt.*; import com.jenny.enhancedexplosives.entities.tnt.*;
import net.minecraft.client.renderer.entity.EntityRenderers; import net.minecraft.client.renderer.entity.EntityRenderers;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MobCategory; import net.minecraft.world.entity.MobCategory;
@ -21,35 +20,35 @@ public class entities {
public static final RegistryObject<EntityType<homingPrimedTNT>> TNT_HOMING = public static final RegistryObject<EntityType<homingPrimedTNT>> TNT_HOMING =
ENTITY_TYPES.register("tnt_homing", () -> EntityType.Builder.<homingPrimedTNT>of(homingPrimedTNT::new, MobCategory.MISC) ENTITY_TYPES.register("tnt_homing", () -> EntityType.Builder.<homingPrimedTNT>of(homingPrimedTNT::new, MobCategory.MISC)
.sized(0.98F, 0.7F).fireImmune().clientTrackingRange(8).build("tnt_homing")); .fireImmune().sized(0.98F, 0.98F).clientTrackingRange(10).updateInterval(10).build("tnt_homing"));
public static final RegistryObject<EntityType<StrongerPrimedTNT>> TNT_STRONGER = public static final RegistryObject<EntityType<StrongerPrimedTNT>> TNT_STRONGER =
ENTITY_TYPES.register("tnt_stronger", () -> EntityType.Builder.<StrongerPrimedTNT>of(StrongerPrimedTNT::new, MobCategory.MISC) ENTITY_TYPES.register("tnt_stronger", () -> EntityType.Builder.<StrongerPrimedTNT>of(StrongerPrimedTNT::new, MobCategory.MISC)
.sized(0.98F, 0.7F).fireImmune().clientTrackingRange(8).build("tnt_stronger")); .fireImmune().sized(0.98F, 0.98F).clientTrackingRange(10).updateInterval(10).build("tnt_stronger"));
public static final RegistryObject<EntityType<ClusterPrimedTNT>> TNT_CLUSTER = public static final RegistryObject<EntityType<ClusterPrimedTNT>> TNT_CLUSTER =
ENTITY_TYPES.register("tnt_cluster", () -> EntityType.Builder.<ClusterPrimedTNT>of(ClusterPrimedTNT::new, MobCategory.MISC) ENTITY_TYPES.register("tnt_cluster", () -> EntityType.Builder.<ClusterPrimedTNT>of(ClusterPrimedTNT::new, MobCategory.MISC)
.sized(0.48F, 0.48F).fireImmune().clientTrackingRange(8).build("tnt_cluster")); .sized(0.48F, 0.48F).fireImmune().clientTrackingRange(10).updateInterval(10).build("tnt_cluster"));
public static final RegistryObject<EntityType<blackHolePrimedTNT>> TNT_BLACK_HOLE = public static final RegistryObject<EntityType<blackHolePrimedTNT>> TNT_BLACK_HOLE =
ENTITY_TYPES.register("tnt_blackhole", () -> EntityType.Builder.<blackHolePrimedTNT>of(blackHolePrimedTNT::new, MobCategory.MISC) ENTITY_TYPES.register("tnt_blackhole", () -> EntityType.Builder.<blackHolePrimedTNT>of(blackHolePrimedTNT::new, MobCategory.MISC)
.sized(0.98F, 0.7F).fireImmune().clientTrackingRange(8).build("tnt_blackhole")); .fireImmune().sized(0.98F, 0.98F).clientTrackingRange(10).updateInterval(10).build("tnt_blackhole"));
public static final RegistryObject<EntityType<selectivePrimedTNT>> TNT_SELECTIVE = public static final RegistryObject<EntityType<selectivePrimedTNT>> TNT_SELECTIVE =
ENTITY_TYPES.register("tnt_selective", () -> EntityType.Builder.<selectivePrimedTNT>of(selectivePrimedTNT::new, MobCategory.MISC) ENTITY_TYPES.register("tnt_selective", () -> EntityType.Builder.<selectivePrimedTNT>of(selectivePrimedTNT::new, MobCategory.MISC)
.sized(0.98F, 0.7F).fireImmune().clientTrackingRange(8).build("tnt_selective")); .fireImmune().sized(0.98F, 0.98F).clientTrackingRange(10).updateInterval(10).build("tnt_selective"));
public static final RegistryObject<EntityType<claymorePrimedTNT>> TNT_CLAYMORE = public static final RegistryObject<EntityType<claymorePrimedTNT>> TNT_CLAYMORE =
ENTITY_TYPES.register("tnt_claymore", () -> EntityType.Builder.<claymorePrimedTNT>of(claymorePrimedTNT::new, MobCategory.MISC) ENTITY_TYPES.register("tnt_claymore", () -> EntityType.Builder.<claymorePrimedTNT>of(claymorePrimedTNT::new, MobCategory.MISC)
.sized(0.98F, 0.7F).fireImmune().clientTrackingRange(8).build("tnt_claymore")); .fireImmune().sized(0.98F, 0.98F).clientTrackingRange(10).updateInterval(10).build("tnt_claymore"));
public static final RegistryObject<EntityType<enderPrimedTNT>> TNT_ENDER = public static final RegistryObject<EntityType<enderPrimedTNT>> TNT_ENDER =
ENTITY_TYPES.register("tnt_ender", () -> EntityType.Builder.<enderPrimedTNT>of(enderPrimedTNT::new, MobCategory.MISC) ENTITY_TYPES.register("tnt_ender", () -> EntityType.Builder.<enderPrimedTNT>of(enderPrimedTNT::new, MobCategory.MISC)
.sized(0.98F, 0.7F).fireImmune().clientTrackingRange(8).build("tnt_ender")); .fireImmune().sized(0.98F, 0.98F).clientTrackingRange(10).updateInterval(10).build("tnt_ender"));
public static final RegistryObject<EntityType<repulsivePrimedTNT>> TNT_REPULSIVE = public static final RegistryObject<EntityType<repulsivePrimedTNT>> TNT_REPULSIVE =
ENTITY_TYPES.register("tnt_repulsive", () -> EntityType.Builder.<repulsivePrimedTNT>of(repulsivePrimedTNT::new, MobCategory.MISC) ENTITY_TYPES.register("tnt_repulsive", () -> EntityType.Builder.<repulsivePrimedTNT>of(repulsivePrimedTNT::new, MobCategory.MISC)
.sized(0.98F, 0.7F).fireImmune().clientTrackingRange(8).build("tnt_repulsive")); .fireImmune().sized(0.98F, 0.98F).clientTrackingRange(10).updateInterval(10).build("tnt_repulsive"));
public static final RegistryObject<EntityType<tntArrow>> ARROW_TNT = public static final RegistryObject<EntityType<tntArrow>> ARROW_TNT =
ENTITY_TYPES.register("arrow_tnt", () -> EntityType.Builder.<tntArrow>of(tntArrow::new, MobCategory.MISC) ENTITY_TYPES.register("arrow_tnt", () -> EntityType.Builder.<tntArrow>of(tntArrow::new, MobCategory.MISC)

View File

@ -25,20 +25,20 @@ public abstract class basePrimedTNT extends Entity implements TraceableEntity {
public basePrimedTNT(EntityType<? extends basePrimedTNT> pEntityType, @NotNull Level pLevel, @Nullable LivingEntity owner) { public basePrimedTNT(EntityType<? extends basePrimedTNT> pEntityType, @NotNull Level pLevel, @Nullable LivingEntity owner) {
super(pEntityType, pLevel); super(pEntityType, pLevel);
commonInit(pLevel, owner);
this.fuse = getFuse();
}
private void commonInit(@NotNull Level pLevel, @Nullable LivingEntity owner) {
double d0 = pLevel.random.nextDouble() * (double)((float)Math.PI * 2F);
this.setDeltaMovement(-Math.sin(d0) * 0.02D, (double)0.2F, -Math.cos(d0) * 0.02D);
this.blocksBuilding = true; this.blocksBuilding = true;
this.setOwner(owner); this.setOwner(owner);
this.fuse = getFuse();
} }
public basePrimedTNT(EntityType<? extends basePrimedTNT> pEntityType, @NotNull Level pLevel, @Nullable LivingEntity owner, Vec3 pos, int fuse, float power) { public basePrimedTNT(EntityType<? extends basePrimedTNT> pEntityType, @NotNull Level pLevel, @Nullable LivingEntity owner, Vec3 pos, int fuse, float power) {
super(pEntityType, pLevel); super(pEntityType, pLevel);
commonInit(pLevel, owner); this.blocksBuilding = true;
this.setOwner(owner);
double d0 = pLevel.random.nextDouble() * (double) ((float) Math.PI * 2F);
this.setDeltaMovement(-Math.sin(d0) * 0.02D, (double) 0.2F, -Math.cos(d0) * 0.02D);
xo = pos.x;
yo = pos.y;
zo = pos.z;
setPos(pos); setPos(pos);
setFuse(fuse); setFuse(fuse);
setPower(power); setPower(power);