Compare commits
1 Commits
master
...
1.19.2-bac
Author | SHA1 | Date | |
---|---|---|---|
1417563435 |
@ -1,18 +1,17 @@
|
||||
org.gradle.jvmargs=-Xmx3G
|
||||
org.gradle.daemon=false
|
||||
|
||||
minecraft_version=1.20.1
|
||||
minecraft_version_range=[1.20.1,1.20.2]
|
||||
forge_version=47.3.22
|
||||
forge_version_range=[47,)
|
||||
loader_version_range=[47,)
|
||||
minecraft_version=1.19.2
|
||||
minecraft_version_range=[1.19.2]
|
||||
forge_version=43.5.0
|
||||
forge_version_range=[43,)
|
||||
loader_version_range=[43,)
|
||||
mapping_channel=parchment
|
||||
mapping_version=2023.09.03-1.20.1
|
||||
mapping_version=2022.11.27-1.19.2
|
||||
|
||||
mod_id=enhancedexplosives
|
||||
mod_name=Enhanced Explosives
|
||||
mod_license=All Rights Reserved
|
||||
mod_version=0.13.2
|
||||
mod_version=0.14
|
||||
mod_group_id=com.jenny
|
||||
mod_authors=Jenny
|
||||
mod_description=strong & throwable explosives
|
||||
|
@ -36,7 +36,6 @@ public class EnhancedExplosives {
|
||||
particles.register(modEventBus);
|
||||
blocks.register(modEventBus);
|
||||
items.register(modEventBus);
|
||||
creativeTab.register(modEventBus);
|
||||
entities.register(modEventBus);
|
||||
|
||||
// Register ourselves for server and other game events we are interested in
|
||||
|
@ -67,7 +67,7 @@ public class ClusterTNTBlock extends TntBlock {
|
||||
if (!level.isClientSide) {
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
int ft = (short) (level.random.nextInt(fuseTime / 4) + fuseTime / 8);
|
||||
ClusterPrimedTNT primedtnt = new ClusterPrimedTNT(level, (double) blockPos.getX() + (double) 0.5F, (double) blockPos.getY(), (double) blockPos.getZ() + (double) 0.5F, pExplosion.getIndirectSourceEntity(), pRadius, ft, getMove(level, childRange));
|
||||
ClusterPrimedTNT primedtnt = new ClusterPrimedTNT(level, (double) blockPos.getX() + (double) 0.5F, (double) blockPos.getY(), (double) blockPos.getZ() + (double) 0.5F, pExplosion.getSourceMob(), pRadius, ft, getMove(level, childRange));
|
||||
level.addFreshEntity(primedtnt);
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ public class blackHoleTNTBlock extends TntBlock {
|
||||
@Override
|
||||
public void wasExploded(Level level, @NotNull BlockPos blockPos, @NotNull Explosion pExplosion) {
|
||||
if (!level.isClientSide) {
|
||||
blackHolePrimedTNT primedtnt = new blackHolePrimedTNT(level, (double) blockPos.getX() + (double) 0.5F, (double) blockPos.getY(), (double) blockPos.getZ() + (double) 0.5F, pExplosion.getIndirectSourceEntity(), pRadius, fuseTime, speed);
|
||||
blackHolePrimedTNT primedtnt = new blackHolePrimedTNT(level, (double) blockPos.getX() + (double) 0.5F, (double) blockPos.getY(), (double) blockPos.getZ() + (double) 0.5F, pExplosion.getSourceMob(), pRadius, fuseTime, speed);
|
||||
int i = primedtnt.getFuse();
|
||||
primedtnt.setFuse((short) (level.random.nextInt(i / 4) + i / 8));
|
||||
level.addFreshEntity(primedtnt);
|
||||
|
@ -1,63 +1,66 @@
|
||||
package com.jenny.enhancedexplosives.blocks;
|
||||
|
||||
import com.jenny.enhancedexplosives.items.BlockItemTooltip;
|
||||
|
||||
import net.minecraft.world.item.Item;
|
||||
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.material.MapColor;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
import static com.jenny.enhancedexplosives.EnhancedExplosives.MODID;
|
||||
import static com.jenny.enhancedexplosives.creativeTab.CREATIVE_MODE_TAB;
|
||||
|
||||
public class blocks {
|
||||
private static final BlockBehaviour.Properties DEFAULT_PROPS = BlockBehaviour.Properties.of(Material.EXPLOSIVE).instabreak().sound(SoundType.GRASS);
|
||||
|
||||
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 RegistryObject<Block> TNT_8 = BLOCKS.register("tnt_8", () -> new strongerTNTBlock(BlockBehaviour.Properties.of().mapColor(MapColor.STONE), 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<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().tab(CREATIVE_MODE_TAB)));
|
||||
|
||||
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<Item> TNT_16_ITEM = ITEMS.register("tnt_16", () -> new BlockItemTooltip(TNT_16.get(), new Item.Properties()));
|
||||
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().tab(CREATIVE_MODE_TAB)));
|
||||
|
||||
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<Item> TNT_32_ITEM = ITEMS.register("tnt_32", () -> new BlockItemTooltip(TNT_32.get(), new Item.Properties()));
|
||||
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().tab(CREATIVE_MODE_TAB)));
|
||||
|
||||
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<Item> TNT_64_ITEM = ITEMS.register("tnt_64", () -> new BlockItemTooltip(TNT_64.get(), new Item.Properties()));
|
||||
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().tab(CREATIVE_MODE_TAB)));
|
||||
|
||||
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<Item> TNT_128_ITEM = ITEMS.register("tnt_128", () -> new BlockItemTooltip(TNT_128.get(), new Item.Properties()));
|
||||
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().tab(CREATIVE_MODE_TAB)));
|
||||
|
||||
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<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_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().tab(CREATIVE_MODE_TAB)));
|
||||
|
||||
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<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_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().tab(CREATIVE_MODE_TAB)));
|
||||
|
||||
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<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_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().tab(CREATIVE_MODE_TAB)));
|
||||
|
||||
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<Item> TNT_HOMING_ITEM = ITEMS.register("tnt_homing", () -> new BlockItemTooltip(TNT_HOMING.get(), new Item.Properties()));
|
||||
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().tab(CREATIVE_MODE_TAB)));
|
||||
|
||||
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<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_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().tab(CREATIVE_MODE_TAB)));
|
||||
|
||||
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<Item> TNT_CLAYMORE_ITEM = ITEMS.register("tnt_claymore", () -> new BlockItemTooltip(TNT_CLAYMORE.get(), new Item.Properties()));
|
||||
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().tab(CREATIVE_MODE_TAB)));
|
||||
|
||||
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<Item> TNT_SELECTIVE_ITEM = ITEMS.register("tnt_selective", () -> new BlockItemTooltip(TNT_SELECTIVE.get(), new Item.Properties()));
|
||||
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().tab(CREATIVE_MODE_TAB)));
|
||||
|
||||
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<Item> TNT_ENDER_ITEM = ITEMS.register("tnt_ender", () -> new BlockItemTooltip(TNT_ENDER.get(), new Item.Properties()));
|
||||
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().tab(CREATIVE_MODE_TAB)));
|
||||
|
||||
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<Item> TNT_REPULSIVE_ITEM = ITEMS.register("tnt_repulsive", () -> new BlockItemTooltip(TNT_REPULSIVE.get(), new Item.Properties()));
|
||||
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().tab(CREATIVE_MODE_TAB)));
|
||||
|
||||
|
||||
public static void register(IEventBus bus) {
|
||||
|
@ -52,7 +52,7 @@ public class claymoreTNTBlock extends TntBlock {
|
||||
public void wasExploded(Level level, @NotNull BlockPos blockPos, @NotNull Explosion pExplosion) {
|
||||
if (!level.isClientSide) {
|
||||
int ft = (short) (level.random.nextInt(fuseTime / 4) + fuseTime / 8);
|
||||
claymorePrimedTNT primedtnt = new claymorePrimedTNT(level, (double) blockPos.getX() + (double) 0.5F, (double) blockPos.getY(), (double) blockPos.getZ() + (double) 0.5F, pExplosion.getIndirectSourceEntity(), pRadius, ft, projectileCount);
|
||||
claymorePrimedTNT primedtnt = new claymorePrimedTNT(level, (double) blockPos.getX() + (double) 0.5F, (double) blockPos.getY(), (double) blockPos.getZ() + (double) 0.5F, pExplosion.getSourceMob(), pRadius, ft, projectileCount);
|
||||
level.addFreshEntity(primedtnt);
|
||||
}
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ public class enderTNTBlock extends TntBlock {
|
||||
if (!level.isClientSide) {
|
||||
BlockPos pos = getSpawnPos(level, blockPos);
|
||||
if (pos != null) {
|
||||
enderPrimedTNT primedtnt = new enderPrimedTNT(level, pos.getX() + 0.5F, pos.getY(), pos.getZ() + 0.5F, pExplosion.getIndirectSourceEntity(), pRadius, fuseTime);
|
||||
enderPrimedTNT primedtnt = new enderPrimedTNT(level, pos.getX() + 0.5F, pos.getY(), pos.getZ() + 0.5F, pExplosion.getSourceMob(), pRadius, fuseTime);
|
||||
int i = primedtnt.getFuse();
|
||||
primedtnt.setFuse((short) (level.random.nextInt(i / 4) + i / 8));
|
||||
level.addFreshEntity(primedtnt);
|
||||
|
@ -51,7 +51,7 @@ public class homingTNTBlock extends TntBlock {
|
||||
@Override
|
||||
public void wasExploded(Level level, @NotNull BlockPos blockPos, @NotNull Explosion pExplosion) {
|
||||
if (!level.isClientSide) {
|
||||
homingPrimedTNT primedtnt = new homingPrimedTNT(level, (double) blockPos.getX() + (double) 0.5F, (double) blockPos.getY(), (double) blockPos.getZ() + (double) 0.5F, pExplosion.getIndirectSourceEntity(), pRadius, fuseTime, speed);
|
||||
homingPrimedTNT primedtnt = new homingPrimedTNT(level, (double) blockPos.getX() + (double) 0.5F, (double) blockPos.getY(), (double) blockPos.getZ() + (double) 0.5F, pExplosion.getSourceMob(), pRadius, fuseTime, speed);
|
||||
int i = primedtnt.getFuse();
|
||||
primedtnt.setFuse((short) (level.random.nextInt(i / 4) + i / 8));
|
||||
level.addFreshEntity(primedtnt);
|
||||
|
@ -50,7 +50,7 @@ public class repulsiveTNTBlock extends TntBlock {
|
||||
@Override
|
||||
public void wasExploded(Level level, @NotNull BlockPos blockPos, @NotNull Explosion pExplosion) {
|
||||
if (!level.isClientSide) {
|
||||
repulsivePrimedTNT primedtnt = new repulsivePrimedTNT(level, (double) blockPos.getX() + (double) 0.5F, (double) blockPos.getY(), (double) blockPos.getZ() + (double) 0.5F, pExplosion.getIndirectSourceEntity(), pRadius, fuseTime, speed);
|
||||
repulsivePrimedTNT primedtnt = new repulsivePrimedTNT(level, (double) blockPos.getX() + (double) 0.5F, (double) blockPos.getY(), (double) blockPos.getZ() + (double) 0.5F, pExplosion.getSourceMob(), pRadius, fuseTime, speed);
|
||||
int i = primedtnt.getFuse();
|
||||
primedtnt.setFuse((short) (level.random.nextInt(i / 4) + i / 8));
|
||||
level.addFreshEntity(primedtnt);
|
||||
|
@ -51,7 +51,7 @@ public class selectiveTNTBlock extends TntBlock {
|
||||
public void wasExploded(Level level, @NotNull BlockPos blockPos, @NotNull Explosion pExplosion) {
|
||||
if (!level.isClientSide) {
|
||||
int ft = (short) (level.random.nextInt(fuseTime / 4) + fuseTime / 8);
|
||||
selectivePrimedTNT primedtnt = new selectivePrimedTNT(level, (double) blockPos.getX() + (double) 0.5F, (double) blockPos.getY(), (double) blockPos.getZ() + (double) 0.5F, pExplosion.getIndirectSourceEntity(), pRadius, ft);
|
||||
selectivePrimedTNT primedtnt = new selectivePrimedTNT(level, (double) blockPos.getX() + (double) 0.5F, (double) blockPos.getY(), (double) blockPos.getZ() + (double) 0.5F, pExplosion.getSourceMob(), pRadius, ft);
|
||||
level.addFreshEntity(primedtnt);
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ public class strongerTNTBlock extends TntBlock {
|
||||
public void wasExploded(Level level, @NotNull BlockPos blockPos, @NotNull Explosion pExplosion) {
|
||||
if (!level.isClientSide) {
|
||||
int ft = (short) (level.random.nextInt(fuseTime / 4) + fuseTime / 8);
|
||||
StrongerPrimedTNT primedtnt = new StrongerPrimedTNT(level, (double) blockPos.getX() + (double) 0.5F, (double) blockPos.getY(), (double) blockPos.getZ() + (double) 0.5F, pExplosion.getIndirectSourceEntity(), pRadius, ft);
|
||||
StrongerPrimedTNT primedtnt = new StrongerPrimedTNT(level, (double) blockPos.getX() + (double) 0.5F, (double) blockPos.getY(), (double) blockPos.getZ() + (double) 0.5F, pExplosion.getSourceMob(), pRadius, ft);
|
||||
level.addFreshEntity(primedtnt);
|
||||
}
|
||||
}
|
||||
|
@ -1,50 +1,14 @@
|
||||
package com.jenny.enhancedexplosives;
|
||||
|
||||
import com.jenny.enhancedexplosives.blocks.blocks;
|
||||
|
||||
import com.jenny.enhancedexplosives.items.items;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.item.CreativeModeTab;
|
||||
import net.minecraft.world.item.CreativeModeTabs;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import static com.jenny.enhancedexplosives.EnhancedExplosives.MODID;
|
||||
|
||||
public class creativeTab {
|
||||
public static final DeferredRegister<CreativeModeTab> CREATIVE_MODE_TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, MODID);
|
||||
public static final RegistryObject<CreativeModeTab> CREATIVE_TAB = CREATIVE_MODE_TABS.register("enhancedexplosives", () -> CreativeModeTab.builder().withTabsBefore(CreativeModeTabs.SPAWN_EGGS).icon(() -> blocks.TNT_8_ITEM.get().getDefaultInstance()).displayItems((parameters, output) -> {
|
||||
output.acceptAll(Arrays.stream(getBlocks()).toList());
|
||||
output.acceptAll(Arrays.stream(getItems()).toList());
|
||||
}).title(Component.literal("Enhanced Explosives")).build());
|
||||
|
||||
public static void register(IEventBus bus) {
|
||||
CREATIVE_MODE_TABS.register(bus);
|
||||
}
|
||||
|
||||
public static ItemStack[] getBlocks() {
|
||||
ItemStack[] ret = new ItemStack[blocks.ITEMS.getEntries().size()];
|
||||
int i = 0;
|
||||
for (RegistryObject<Item> item : blocks.ITEMS.getEntries()) {
|
||||
ret[i] = item.get().getDefaultInstance();
|
||||
i++;
|
||||
public static final CreativeModeTab CREATIVE_MODE_TAB = new CreativeModeTab("enhancedexplosives") {
|
||||
@Override
|
||||
public ItemStack makeIcon() {
|
||||
return new ItemStack(blocks.TNT_8_ITEM.get());
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static ItemStack[] getItems() {
|
||||
ItemStack[] ret = new ItemStack[items.ITEMS.getEntries().size()];
|
||||
int i = 0;
|
||||
for (RegistryObject<Item> item : items.ITEMS.getEntries()) {
|
||||
ret[i] = item.get().getDefaultInstance();
|
||||
i++;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -1,27 +0,0 @@
|
||||
package com.jenny.enhancedexplosives.datagen;
|
||||
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.data.DataGenerator;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import net.minecraftforge.data.event.GatherDataEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import static com.jenny.enhancedexplosives.EnhancedExplosives.MODID;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
|
||||
public class DataGenerators {
|
||||
@SubscribeEvent
|
||||
public static void gatherData(@NotNull GatherDataEvent event) {
|
||||
DataGenerator generator = event.getGenerator();
|
||||
PackOutput packOutput = generator.getPackOutput();
|
||||
ExistingFileHelper existingFileHelper = event.getExistingFileHelper();
|
||||
CompletableFuture<HolderLookup.Provider> lookupProvider = event.getLookupProvider();
|
||||
|
||||
generator.addProvider(event.includeClient(), new ModBlockStateProvider(packOutput, existingFileHelper));
|
||||
generator.addProvider(event.includeClient(), new ModItemModelProvider(packOutput, existingFileHelper));
|
||||
}
|
||||
}
|
@ -1,97 +0,0 @@
|
||||
package com.jenny.enhancedexplosives.datagen;
|
||||
|
||||
import com.jenny.enhancedexplosives.blocks.blocks;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraftforge.client.model.generators.BlockStateProvider;
|
||||
import net.minecraftforge.client.model.generators.ConfiguredModel;
|
||||
import net.minecraftforge.client.model.generators.ModelFile;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.jenny.enhancedexplosives.EnhancedExplosives.MODID;
|
||||
|
||||
public class ModBlockStateProvider extends BlockStateProvider {
|
||||
public ModBlockStateProvider(PackOutput output, ExistingFileHelper exFileHelper) {
|
||||
super(output, MODID, exFileHelper);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerStatesAndModels() {
|
||||
sideTopBottom(blocks.TNT_8);
|
||||
sideTopBottom(blocks.TNT_16);
|
||||
sideTopBottom(blocks.TNT_32);
|
||||
sideTopBottom(blocks.TNT_64);
|
||||
sideTopBottom(blocks.TNT_128);
|
||||
sideTopBottom(blocks.TNT_ENDER);
|
||||
sideTopBottom(blocks.TNT_CLAYMORE);
|
||||
SideTop(blocks.TNT_BLACK_HOLE);
|
||||
SideTop(blocks.TNT_REPULSIVE);
|
||||
SideOnlyTNT(blocks.TNT_CLUSTER_2);
|
||||
SideOnlyTNT(blocks.TNT_CLUSTER_4);
|
||||
SideOnlyTNT(blocks.TNT_CLUSTER_8);
|
||||
SideOnlyTNT(blocks.TNT_SELECTIVE);
|
||||
SideOnlyTNT(blocks.TNT_HOMING);
|
||||
}
|
||||
|
||||
private void blockWithItem(@NotNull RegistryObject<Block> blockRegistryObject) {
|
||||
simpleBlockWithItem(blockRegistryObject.get(), cubeAll(blockRegistryObject.get()));
|
||||
}
|
||||
|
||||
private void SideTop(@NotNull RegistryObject<Block> blockRegistryObject) {
|
||||
simpleBlockWithItem(blockRegistryObject.get(), topSide(blockRegistryObject.get()));
|
||||
}
|
||||
|
||||
private void blockItem(@NotNull RegistryObject<Block> blockRegistryObject) {
|
||||
simpleBlockItem(blockRegistryObject.get(), new ModelFile.UncheckedModelFile(MODID +
|
||||
":block/" + Objects.requireNonNull(ForgeRegistries.BLOCKS.getKey(blockRegistryObject.get())).getPath()));
|
||||
}
|
||||
|
||||
private void topBottom2Sides(@NotNull RegistryObject<Block> blockRegistryObject) {
|
||||
simpleBlockWithItem(blockRegistryObject.get(), northEastTopBottom(blockRegistryObject.get()));
|
||||
}
|
||||
|
||||
private ResourceLocation key(Block block) {
|
||||
return ForgeRegistries.BLOCKS.getKey(block);
|
||||
}
|
||||
|
||||
private @NotNull String name(Block block) {
|
||||
return key(block).getPath();
|
||||
}
|
||||
|
||||
private ResourceLocation extend(@NotNull ResourceLocation rl, String suffix) {
|
||||
return new ResourceLocation(rl.getNamespace(), rl.getPath() + suffix);
|
||||
}
|
||||
|
||||
public void sideTopBottom(@NotNull RegistryObject<Block> blockRegistryObject) {
|
||||
Block block = blockRegistryObject.get();
|
||||
ModelFile model = models().cubeBottomTop(name(block), extend(blockTexture(block), "_side"), extend(blockTexture(block), "_bottom"), extend(blockTexture(block), "_top"));
|
||||
this.getVariantBuilder(block).forAllStates(blockState -> ConfiguredModel.builder().modelFile(model).build());
|
||||
simpleBlockItem(block, model);
|
||||
}
|
||||
|
||||
public void SideOnlyTNT(@NotNull RegistryObject<Block> blockRegistryObject) {
|
||||
Block block = blockRegistryObject.get();
|
||||
ModelFile model = models().cubeBottomTop(name(block), extend(blockTexture(block), "_side"), extend(blockTexture(Blocks.TNT), "_bottom"), extend(blockTexture(Blocks.TNT), "_top"));
|
||||
this.getVariantBuilder(block).forAllStates(blockState -> ConfiguredModel.builder().modelFile(model).build());
|
||||
simpleBlockItem(block, model);
|
||||
}
|
||||
|
||||
public ModelFile northEastTopBottom(Block block) {
|
||||
return models().cube(name(block), extend(blockTexture(block), "_bottom"), extend(blockTexture(block), "_top"), extend(blockTexture(block), "_nw"), extend(blockTexture(block), "_se"), extend(blockTexture(block), "_se"), extend(blockTexture(block), "_nw")).texture("particle", extend(blockTexture(block), "_se"));
|
||||
}
|
||||
|
||||
public ModelFile cube(Block block) {
|
||||
return models().cube(name(block), extend(blockTexture(block), "_bottom"), extend(blockTexture(block), "_top"), extend(blockTexture(block), "_north"), extend(blockTexture(block), "_south"), extend(blockTexture(block), "_east"), extend(blockTexture(block), "_west")).texture("particle", extend(blockTexture(block), "_north"));
|
||||
}
|
||||
|
||||
public ModelFile topSide(Block block) {
|
||||
return models().cubeColumn(name(block), extend(blockTexture(block), "_side"), extend(blockTexture(block), "_top"));
|
||||
}
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
package com.jenny.enhancedexplosives.datagen;
|
||||
|
||||
import com.jenny.enhancedexplosives.items.items;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraftforge.client.model.generators.ItemModelProvider;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
import static com.jenny.enhancedexplosives.EnhancedExplosives.MODID;
|
||||
|
||||
public class ModItemModelProvider extends ItemModelProvider {
|
||||
public ModItemModelProvider(PackOutput output, ExistingFileHelper existingFileHelper) {
|
||||
super(output, MODID, existingFileHelper);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerModels() {
|
||||
simpleItem(items.TNT_ARROW);
|
||||
simpleItem(items.CONCUSSIVE_ARROW);
|
||||
simpleItem(items.CARPET_ARROW);
|
||||
simpleItem(items.TUNNEL_ARROW);
|
||||
}
|
||||
|
||||
private void simpleItem(RegistryObject<Item> item) {
|
||||
withExistingParent(item.getId().getPath(),
|
||||
new ResourceLocation("item/generated")).texture("layer0",
|
||||
new ResourceLocation(MODID,"item/" + item.getId().getPath()));
|
||||
}
|
||||
}
|
@ -55,4 +55,8 @@ public class baseArrow extends AbstractArrow {
|
||||
public int getTick() {
|
||||
return this.tick;
|
||||
}
|
||||
|
||||
public Level level() {
|
||||
return level;
|
||||
}
|
||||
}
|
||||
|
@ -5,11 +5,10 @@ import com.jenny.enhancedexplosives.config.ConfigServer;
|
||||
import com.jenny.enhancedexplosives.entities.entities;
|
||||
import com.jenny.enhancedexplosives.items.items;
|
||||
import com.jenny.enhancedexplosives.particles.particles;
|
||||
import net.minecraft.world.damagesource.DamageSource;
|
||||
import net.minecraft.world.damagesource.DamageTypes;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Explosion;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -38,16 +37,11 @@ public class carpetArrowPart extends baseArrow {
|
||||
|
||||
public void explode() {
|
||||
if (!level().isClientSide) {
|
||||
level().explode(this, getX(), getY(), getZ(), 8.0f, Level.ExplosionInteraction.NONE);
|
||||
level().explode(this, getX(), getY(), getZ(), 8.0f, Explosion.BlockInteraction.BREAK);
|
||||
}
|
||||
discard();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hurt(@NotNull DamageSource pSource, float pAmount) {
|
||||
return super.hurt(pSource, pAmount) || pSource.is(DamageTypes.EXPLOSION);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected ItemStack getPickupItem() {
|
||||
return new ItemStack(items.CONCUSSIVE_ARROW.get());
|
||||
|
@ -3,6 +3,7 @@ package com.jenny.enhancedexplosives.entities.arrows;
|
||||
import com.jenny.enhancedexplosives.config.ConfigServer;
|
||||
import com.jenny.enhancedexplosives.entities.entities;
|
||||
import com.jenny.enhancedexplosives.items.items;
|
||||
import net.minecraft.world.damagesource.DamageSource;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
@ -17,13 +18,17 @@ public class claymoreArrow extends baseArrow{
|
||||
|
||||
}
|
||||
|
||||
public claymoreArrow(@NotNull Level pLevel, @NotNull LivingEntity pShooter) {
|
||||
public claymoreArrow(@NotNull Level pLevel) {
|
||||
super(entities.ARROW_CLAYMORE.get(), pLevel);
|
||||
}
|
||||
|
||||
public claymoreArrow(@NotNull Level pLevel, @NotNull LivingEntity pShooter) {
|
||||
super(pLevel, pShooter, entities.ARROW_CLAYMORE.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doPostHurtEffects(@NotNull LivingEntity pTarget) {
|
||||
pTarget.hurt(damageSources().mobProjectile(this, (LivingEntity) getOwner()), 15);
|
||||
pTarget.hurt(DamageSource.arrow(this, getOwner()), 15);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -7,6 +7,7 @@ import com.jenny.enhancedexplosives.particles.particles;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Explosion;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -24,14 +25,14 @@ public class concussiveArrow extends baseArrow{
|
||||
public void tick() {
|
||||
super.tick();
|
||||
if (this.inGround) {
|
||||
this.level().explode(this, getX(), getY(), getZ(), 8.0f, Level.ExplosionInteraction.NONE);
|
||||
this.level().explode(this, getX(), getY(), getZ(), 8.0f, Explosion.BlockInteraction.NONE);
|
||||
this.discard();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doPostHurtEffects(@NotNull LivingEntity pTarget) {
|
||||
this.level().explode(this, getX(), getY(), getZ(), 8.0f, Level.ExplosionInteraction.NONE);
|
||||
this.level().explode(this, getX(), getY(), getZ(), 8.0f, Explosion.BlockInteraction.NONE);
|
||||
this.discard();
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@ import com.jenny.enhancedexplosives.particles.particles;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Explosion;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -24,14 +25,14 @@ public class tntArrow extends baseArrow {
|
||||
public void tick() {
|
||||
super.tick();
|
||||
if (this.inGround) {
|
||||
this.level().explode(this, this.getX(), this.getY(), this.getZ(), 2, Level.ExplosionInteraction.TNT);
|
||||
this.level().explode(this, this.getX(), this.getY(), this.getZ(), 2, Explosion.BlockInteraction.BREAK);
|
||||
this.discard();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doPostHurtEffects(@NotNull LivingEntity pTarget) {
|
||||
this.level().explode(this, this.getX(), this.getY(), this.getZ(), 2, Level.ExplosionInteraction.TNT);
|
||||
this.level().explode(this, this.getX(), this.getY(), this.getZ(), 2, Explosion.BlockInteraction.BREAK);
|
||||
this.discard();
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ import com.jenny.enhancedexplosives.particles.particles;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.level.Explosion;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -47,7 +48,7 @@ public class tunnelArrow extends baseArrow{
|
||||
for (int i = 0; i < explosionCount; i++) {
|
||||
Vec3 pos = position().add(rot.multiply(i * spacing, i * spacing, i * spacing));
|
||||
level().explode(this, pos.x, pos.y, pos.z,
|
||||
power, Level.ExplosionInteraction.TNT);
|
||||
power, Explosion.BlockInteraction.BREAK);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ package com.jenny.enhancedexplosives.entities.client;
|
||||
|
||||
import com.jenny.enhancedexplosives.entities.tnt.basePrimedTNT;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.math.Axis;
|
||||
import com.mojang.math.Vector3f;
|
||||
import net.minecraft.client.renderer.MultiBufferSource;
|
||||
import net.minecraft.client.renderer.block.BlockRenderDispatcher;
|
||||
import net.minecraft.client.renderer.entity.EntityRenderer;
|
||||
@ -34,9 +34,9 @@ public class BaseTNTRenderer<T extends basePrimedTNT> extends EntityRenderer<T>
|
||||
float f1 = 1.0F + f * 0.3F;
|
||||
pPoseStack.scale(f1, f1, f1);
|
||||
}
|
||||
pPoseStack.mulPose(Axis.YP.rotationDegrees(-90.0F));
|
||||
pPoseStack.mulPose(Vector3f.YP.rotationDegrees(-90.0F));
|
||||
pPoseStack.translate(-0.5F, -0.5F, 0.5F);
|
||||
pPoseStack.mulPose(Axis.YP.rotationDegrees(90.0F));
|
||||
pPoseStack.mulPose(Vector3f.YP.rotationDegrees(90.0F));
|
||||
TntMinecartRenderer.renderWhiteSolidBlock(this.blockRenderer, pEntity.renderBlock().defaultBlockState(), pPoseStack, pBuffer, pPackedLight, i / 5 % 2 == 0);
|
||||
pPoseStack.popPose();
|
||||
super.render(pEntity, pEntityYaw, pPartialTicks, pPoseStack, pBuffer, pPackedLight);
|
||||
|
@ -2,7 +2,7 @@ package com.jenny.enhancedexplosives.entities.client;
|
||||
|
||||
import com.jenny.enhancedexplosives.entities.tnt.selectivePrimedTNT;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.math.Axis;
|
||||
import com.mojang.math.Vector3f;
|
||||
import net.minecraft.client.renderer.MultiBufferSource;
|
||||
import net.minecraft.client.renderer.block.BlockRenderDispatcher;
|
||||
import net.minecraft.client.renderer.entity.EntityRenderer;
|
||||
@ -35,9 +35,9 @@ public class SelectiveTNTRenderer<T extends selectivePrimedTNT> extends EntityRe
|
||||
float f1 = 1.0F + f * 0.3F;
|
||||
pPoseStack.scale(f1, f1, f1);
|
||||
}
|
||||
pPoseStack.mulPose(Axis.YP.rotationDegrees(-90.0F));
|
||||
pPoseStack.mulPose(Vector3f.YP.rotationDegrees(-90.0F));
|
||||
pPoseStack.translate(-0.5F, -0.5F, 0.5F);
|
||||
pPoseStack.mulPose(Axis.YP.rotationDegrees(90.0F));
|
||||
pPoseStack.mulPose(Vector3f.YP.rotationDegrees(90.0F));
|
||||
Block block = (i / 5 % 2 == 0) ? pEntity.renderBlockBeneath(): pEntity.renderBlock();
|
||||
TntMinecartRenderer.renderWhiteSolidBlock(this.blockRenderer, block.defaultBlockState(), pPoseStack, pBuffer, pPackedLight, false);
|
||||
pPoseStack.popPose();
|
||||
|
@ -2,7 +2,7 @@ package com.jenny.enhancedexplosives.entities.client;
|
||||
|
||||
import com.jenny.enhancedexplosives.entities.arrows.baseArrow;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.math.Axis;
|
||||
import com.mojang.math.Vector3f;
|
||||
import net.minecraft.client.renderer.MultiBufferSource;
|
||||
import net.minecraft.client.renderer.block.BlockRenderDispatcher;
|
||||
import net.minecraft.client.renderer.entity.EntityRenderer;
|
||||
@ -28,9 +28,9 @@ public class TNTArrowRenderer extends EntityRenderer<baseArrow> {
|
||||
pPoseStack.translate(0.0F, 0.5F, 0.0F);
|
||||
pPoseStack.scale(0.5f, 0.5f, 0.5f);
|
||||
int i = pEntity.getTick();
|
||||
pPoseStack.mulPose(Axis.YP.rotationDegrees(-90.0F));
|
||||
pPoseStack.mulPose(Vector3f.YP.rotationDegrees(-90.0F));
|
||||
pPoseStack.translate(-0.5F, -0.5F, 0.5F);
|
||||
pPoseStack.mulPose(Axis.YP.rotationDegrees(90.0F));
|
||||
pPoseStack.mulPose(Vector3f.YP.rotationDegrees(90.0F));
|
||||
TntMinecartRenderer.renderWhiteSolidBlock(this.blockRenderer, Blocks.TNT.defaultBlockState(), pPoseStack, pBuffer, pPackedLight, i / 5 % 2 == 0);
|
||||
pPoseStack.popPose();
|
||||
super.render(pEntity, pEntityYaw, pPartialTicks, pPoseStack, pBuffer, pPackedLight);
|
||||
|
@ -4,7 +4,6 @@ import net.minecraft.client.renderer.entity.ArrowRenderer;
|
||||
import net.minecraft.client.renderer.entity.EntityRendererProvider;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.projectile.AbstractArrow;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static net.minecraft.client.renderer.entity.TippableArrowRenderer.NORMAL_ARROW_LOCATION;
|
||||
|
@ -2,7 +2,7 @@ package com.jenny.enhancedexplosives.entities.client;
|
||||
|
||||
import com.jenny.enhancedexplosives.entities.tnt.basePrimedTNT;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.math.Axis;
|
||||
import com.mojang.math.Vector3f;
|
||||
import net.minecraft.client.renderer.MultiBufferSource;
|
||||
import net.minecraft.client.renderer.block.BlockRenderDispatcher;
|
||||
import net.minecraft.client.renderer.entity.EntityRenderer;
|
||||
@ -38,9 +38,9 @@ public class clusterTNTRenderer extends EntityRenderer<basePrimedTNT> {
|
||||
pPoseStack.scale(0.5f, 0.5f, 0.5f);
|
||||
}
|
||||
|
||||
pPoseStack.mulPose(Axis.YP.rotationDegrees(-90.0F));
|
||||
pPoseStack.mulPose(Vector3f.YP.rotationDegrees(-90.0F));
|
||||
pPoseStack.translate(-0.5F, -1.0F, 0.5F);
|
||||
pPoseStack.mulPose(Axis.YP.rotationDegrees(90.0F));
|
||||
pPoseStack.mulPose(Vector3f.YP.rotationDegrees(90.0F));
|
||||
TntMinecartRenderer.renderWhiteSolidBlock(this.blockRenderer, pEntity.renderBlock().defaultBlockState(), pPoseStack, pBuffer, pPackedLight, i / 5 % 2 == 0);
|
||||
pPoseStack.popPose();
|
||||
super.render(pEntity, pEntityYaw, pPartialTicks, pPoseStack, pBuffer, pPackedLight);
|
||||
|
@ -4,7 +4,6 @@ import com.jenny.enhancedexplosives.entities.arrows.*;
|
||||
import com.jenny.enhancedexplosives.entities.client.*;
|
||||
import com.jenny.enhancedexplosives.entities.throwable.dynamite;
|
||||
import com.jenny.enhancedexplosives.entities.tnt.*;
|
||||
|
||||
import net.minecraft.client.renderer.entity.EntityRenderers;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.MobCategory;
|
||||
@ -21,35 +20,35 @@ public class entities {
|
||||
|
||||
public static final RegistryObject<EntityType<homingPrimedTNT>> TNT_HOMING =
|
||||
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 =
|
||||
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 =
|
||||
ENTITY_TYPES.register("tnt_cluster", () -> EntityType.Builder.<ClusterPrimedTNT>of(ClusterPrimedTNT::new, MobCategory.MISC)
|
||||
.sized(0.48F, 0.48F).fireImmune().clientTrackingRange(8).build("tnt_cluster"));
|
||||
.fireImmune().sized(0.48F, 0.48F).clientTrackingRange(10).updateInterval(10).build("tnt_cluster"));
|
||||
|
||||
public static final RegistryObject<EntityType<blackHolePrimedTNT>> TNT_BLACK_HOLE =
|
||||
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 =
|
||||
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 =
|
||||
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 =
|
||||
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 =
|
||||
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 =
|
||||
ENTITY_TYPES.register("arrow_tnt", () -> EntityType.Builder.<tntArrow>of(tntArrow::new, MobCategory.MISC)
|
||||
|
@ -20,7 +20,7 @@ public class dynamite extends basePrimedTNT {
|
||||
}
|
||||
|
||||
public dynamite(EntityType<dynamite> entityType, Level level) {
|
||||
super(entityType, level, null);
|
||||
super(entityType, level);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -31,7 +31,7 @@ public class dynamite extends basePrimedTNT {
|
||||
Vec3 beforeMove = getDeltaMovement();
|
||||
this.move(MoverType.SELF, this.getDeltaMovement());
|
||||
this.setDeltaMovement(this.getDeltaMovement().scale(0.98D));
|
||||
if (this.onGround()) {
|
||||
if (this.onGround) {
|
||||
this.setDeltaMovement(this.getDeltaMovement().multiply(0.7D, 0, 0.7D).add(0, (-beforeMove.y) * 0.5, 0));
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ public class dynamite extends basePrimedTNT {
|
||||
Vec3 vec = new Vec3(f, f1, f2).multiply(pVelocity, pVelocity, pVelocity);
|
||||
this.setDeltaMovement(vec);
|
||||
Vec3 vec3 = pShooter.getDeltaMovement();
|
||||
this.setDeltaMovement(this.getDeltaMovement().add(vec3.x, pShooter.onGround() ? 0.0D : vec3.y, vec3.z));
|
||||
this.setDeltaMovement(this.getDeltaMovement().add(vec3.x, pShooter.isOnGround() ? 0.0D : vec3.y, vec3.z));
|
||||
}
|
||||
|
||||
public Block renderBlock() {
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.jenny.enhancedexplosives.entities.tnt;
|
||||
|
||||
import com.jenny.enhancedexplosives.entities.entities;
|
||||
import com.jenny.enhancedexplosives.util;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.level.Level;
|
||||
@ -14,11 +15,11 @@ public class ClusterPrimedTNT extends basePrimedTNT {
|
||||
|
||||
public ClusterPrimedTNT (Level pLevel, double pX, double pY, double pZ, @Nullable LivingEntity pOwner, float power, int fuse, Vec3 move) {
|
||||
super(entities.TNT_CLUSTER.get(), pLevel, pOwner, new Vec3(pX, pY, pZ), fuse, power);
|
||||
this.addDeltaMovement(move);
|
||||
util.addDeltaMovement(this, move);
|
||||
}
|
||||
|
||||
public ClusterPrimedTNT(EntityType<ClusterPrimedTNT> entityType, Level level) {
|
||||
super(entityType, level, null);
|
||||
super(entityType, level);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -17,7 +17,7 @@ public class StrongerPrimedTNT extends basePrimedTNT {
|
||||
}
|
||||
|
||||
public StrongerPrimedTNT(EntityType<StrongerPrimedTNT> entityType, Level level) {
|
||||
super(entityType, level, null);
|
||||
super(entityType, level);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -3,10 +3,13 @@ package com.jenny.enhancedexplosives.entities.tnt;
|
||||
import com.jenny.enhancedexplosives.config.ConfigClient;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.protocol.Packet;
|
||||
import net.minecraft.network.protocol.game.ClientboundAddEntityPacket;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.network.syncher.EntityDataSerializers;
|
||||
import net.minecraft.network.syncher.SynchedEntityData;
|
||||
import net.minecraft.world.entity.*;
|
||||
import net.minecraft.world.level.Explosion;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
@ -15,7 +18,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public abstract class basePrimedTNT extends Entity implements TraceableEntity {
|
||||
public abstract class basePrimedTNT extends Entity {
|
||||
private static final EntityDataAccessor<Integer> DATA_FUSE_ID = SynchedEntityData.defineId(basePrimedTNT.class, EntityDataSerializers.INT);
|
||||
private static final EntityDataAccessor<Float> DATA_POWER_ID = SynchedEntityData.defineId(basePrimedTNT.class, EntityDataSerializers.FLOAT);
|
||||
|
||||
@ -23,30 +26,26 @@ public abstract class basePrimedTNT extends Entity implements TraceableEntity {
|
||||
private LivingEntity owner;
|
||||
private int fuse = 0;
|
||||
|
||||
public basePrimedTNT(EntityType<? extends basePrimedTNT> pEntityType, @NotNull Level pLevel, @Nullable LivingEntity owner) {
|
||||
public basePrimedTNT(EntityType<? extends basePrimedTNT> pEntityType, @NotNull Level 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.setOwner(owner);
|
||||
}
|
||||
|
||||
public basePrimedTNT(EntityType<? extends basePrimedTNT> pEntityType, @NotNull Level pLevel, @Nullable LivingEntity owner, Vec3 pos, int fuse, float power) {
|
||||
super(pEntityType, pLevel);
|
||||
commonInit(pLevel, owner);
|
||||
this(pEntityType, pLevel);
|
||||
setPos(pos);
|
||||
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.setOwner(owner);
|
||||
this.xo = pos.x;
|
||||
this.yo = pos.y;
|
||||
this.zo = pos.z;
|
||||
setFuse(fuse);
|
||||
setPower(power);
|
||||
this.fuse = getFuse();
|
||||
}
|
||||
|
||||
protected void explode() {
|
||||
this.level().explode(this, this.getX(), this.getY(0.0625D), this.getZ(), this.getPower(), Level.ExplosionInteraction.TNT);
|
||||
this.level().explode(this, this.getX(), this.getY(0.0625D), this.getZ(), this.getPower(), Explosion.BlockInteraction.BREAK);
|
||||
}
|
||||
|
||||
public int getFuse() {
|
||||
@ -66,6 +65,13 @@ public abstract class basePrimedTNT extends Entity implements TraceableEntity {
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
if (!level().isClientSide) {
|
||||
System.out.println("Server: " + tickCount + "|x=" + (getX() - 0.5F) + "|y=" + getY() + "|z=" + (getZ() - 0.5F));
|
||||
} else {
|
||||
System.out.println("Client: " + tickCount + "|x=" + (getX() - 0.5F) + "|y=" + getY() + "|z=" + (getZ() - 0.5F));
|
||||
}
|
||||
|
||||
|
||||
if (level().isClientSide) {
|
||||
if (ConfigClient.tntParticles.get()) {
|
||||
spawnParticles();
|
||||
@ -77,7 +83,7 @@ public abstract class basePrimedTNT extends Entity implements TraceableEntity {
|
||||
|
||||
this.move(MoverType.SELF, this.getDeltaMovement());
|
||||
this.setDeltaMovement(this.getDeltaMovement().scale(0.98D));
|
||||
if (this.onGround()) {
|
||||
if (this.onGround) {
|
||||
this.setDeltaMovement(this.getDeltaMovement().multiply(0.7D, -0.5D, 0.7D));
|
||||
}
|
||||
|
||||
@ -141,4 +147,12 @@ public abstract class basePrimedTNT extends Entity implements TraceableEntity {
|
||||
public void spawnParticles() {
|
||||
level().addParticle(ParticleTypes.SMOKE, getX(), getY(), getZ(), 0, 0, 0);
|
||||
}
|
||||
|
||||
public Level level() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public Packet<?> getAddEntityPacket() {
|
||||
return new ClientboundAddEntityPacket(this);
|
||||
}
|
||||
}
|
||||
|
@ -2,11 +2,14 @@ package com.jenny.enhancedexplosives.entities.tnt;
|
||||
|
||||
import com.jenny.enhancedexplosives.blocks.blocks;
|
||||
import com.jenny.enhancedexplosives.entities.entities;
|
||||
import com.jenny.enhancedexplosives.util;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.network.syncher.EntityDataSerializers;
|
||||
import net.minecraft.network.syncher.SynchedEntityData;
|
||||
import net.minecraft.world.entity.*;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
@ -24,7 +27,7 @@ public class blackHolePrimedTNT extends basePrimedTNT {
|
||||
}
|
||||
|
||||
public blackHolePrimedTNT(EntityType<blackHolePrimedTNT> entityType, Level level) {
|
||||
super(entityType, level, null);
|
||||
super(entityType, level);
|
||||
this.setSpeed(this.getSpeed());
|
||||
}
|
||||
|
||||
@ -57,7 +60,7 @@ public class blackHolePrimedTNT extends basePrimedTNT {
|
||||
@Override
|
||||
public void tick() {
|
||||
for (Entity e : findTargets()) {
|
||||
e.addDeltaMovement(targetVector(e));
|
||||
util.addDeltaMovement(e, targetVector(e));
|
||||
}
|
||||
super.tick();
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ public class claymorePrimedTNT extends basePrimedTNT {
|
||||
}
|
||||
|
||||
public claymorePrimedTNT(EntityType<claymorePrimedTNT> entityType, Level level) {
|
||||
super(entityType, level, null);
|
||||
super(entityType, level);
|
||||
}
|
||||
|
||||
public Vec3 targetVector(RandomSource rng) {
|
||||
@ -42,10 +42,12 @@ public class claymorePrimedTNT extends basePrimedTNT {
|
||||
RandomSource rng = level().getRandom();
|
||||
for (int i = 0; i < getPCount(); i++) {
|
||||
Vec3 target = targetVector(rng);
|
||||
assert this.getOwner() != null;
|
||||
Projectile e = new claymoreArrow(level(), this.getOwner());
|
||||
Projectile e = new claymoreArrow(level());
|
||||
e.setPos(position().add(0, 0.5, 0));
|
||||
e.setDeltaMovement(target);
|
||||
if (getOwner() != null) {
|
||||
e.setOwner(getOwner());
|
||||
}
|
||||
level().addFreshEntity(e);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ public class enderPrimedTNT extends basePrimedTNT {
|
||||
}
|
||||
|
||||
public enderPrimedTNT(EntityType<enderPrimedTNT> entityType, Level level) {
|
||||
super(entityType, level, null);
|
||||
super(entityType, level);
|
||||
}
|
||||
|
||||
public Block renderBlock() {
|
||||
|
@ -4,6 +4,7 @@ import com.jenny.enhancedexplosives.blocks.blocks;
|
||||
import com.jenny.enhancedexplosives.config.ConfigClient;
|
||||
import com.jenny.enhancedexplosives.config.ConfigServer;
|
||||
import com.jenny.enhancedexplosives.entities.entities;
|
||||
import com.jenny.enhancedexplosives.util;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
@ -32,7 +33,7 @@ public class homingPrimedTNT extends basePrimedTNT {
|
||||
}
|
||||
|
||||
public homingPrimedTNT(EntityType<homingPrimedTNT> entityType, Level level) {
|
||||
super(entityType, level, null);
|
||||
super(entityType, level);
|
||||
}
|
||||
|
||||
private Vec3 targetVector() {
|
||||
@ -89,7 +90,11 @@ public class homingPrimedTNT extends basePrimedTNT {
|
||||
findTarget();
|
||||
}
|
||||
else {
|
||||
if (getTargetDist() > 15) {target = null;} else {addDeltaMovement(targetVector());}
|
||||
if (getTargetDist() > 15) {
|
||||
target = null;
|
||||
} else {
|
||||
util.addDeltaMovement(this, targetVector());
|
||||
}
|
||||
}
|
||||
|
||||
super.tick();
|
||||
|
@ -2,6 +2,7 @@ package com.jenny.enhancedexplosives.entities.tnt;
|
||||
|
||||
import com.jenny.enhancedexplosives.blocks.blocks;
|
||||
import com.jenny.enhancedexplosives.entities.entities;
|
||||
import com.jenny.enhancedexplosives.util;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.network.syncher.EntityDataSerializers;
|
||||
@ -26,7 +27,7 @@ public class repulsivePrimedTNT extends basePrimedTNT {
|
||||
}
|
||||
|
||||
public repulsivePrimedTNT(EntityType<repulsivePrimedTNT> entityType, Level level) {
|
||||
super(entityType, level, null);
|
||||
super(entityType, level);
|
||||
this.setSpeed(this.getSpeed());
|
||||
}
|
||||
|
||||
@ -52,7 +53,7 @@ public class repulsivePrimedTNT extends basePrimedTNT {
|
||||
@Override
|
||||
public void tick() {
|
||||
for (Entity e : findTargets()) {
|
||||
e.addDeltaMovement(targetVector(e));
|
||||
util.addDeltaMovement(e, targetVector(e));
|
||||
}
|
||||
super.tick();
|
||||
}
|
||||
@ -60,7 +61,7 @@ public class repulsivePrimedTNT extends basePrimedTNT {
|
||||
@Override
|
||||
public void explode() {
|
||||
for (Entity e : findTargets()) {
|
||||
e.addDeltaMovement(targetVector(e).scale(3));
|
||||
util.addDeltaMovement(e, targetVector(e).scale(3));
|
||||
}
|
||||
super.explode();
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.jenny.enhancedexplosives.entities.tnt;
|
||||
import com.jenny.enhancedexplosives.blocks.blocks;
|
||||
import com.jenny.enhancedexplosives.entities.entities;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.damagesource.DamageSource;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
@ -34,12 +35,12 @@ public class selectivePrimedTNT extends basePrimedTNT {
|
||||
}
|
||||
|
||||
public selectivePrimedTNT(EntityType<selectivePrimedTNT> entityType, Level level) {
|
||||
super(entityType, level, null);
|
||||
super(entityType, level);
|
||||
}
|
||||
@Override
|
||||
protected void explode() {
|
||||
SelectiveExplosionCalculator dmgCalc = new SelectiveExplosionCalculator(getBlock());
|
||||
this.level().explode(this, null, dmgCalc, position(), getPower(), false, Level.ExplosionInteraction.TNT);
|
||||
this.level().explode(this, DamageSource.explosion(getOwner()), dmgCalc, getX(), getY(), getZ(), getPower(), false, Explosion.BlockInteraction.BREAK);
|
||||
}
|
||||
|
||||
public String getBlock() {
|
||||
|
@ -18,15 +18,16 @@ import net.minecraftforge.registries.RegistryObject;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static com.jenny.enhancedexplosives.EnhancedExplosives.MODID;
|
||||
import static com.jenny.enhancedexplosives.creativeTab.CREATIVE_MODE_TAB;
|
||||
|
||||
public class items {
|
||||
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MODID);
|
||||
|
||||
public static final RegistryObject<Item> TNT_ARROW = ITEMS.register("arrow_tnt", () -> new ArrowTNT(new Item.Properties()));
|
||||
public static final RegistryObject<Item> CONCUSSIVE_ARROW = ITEMS.register("arrow_concussive", () -> new ArrowConcussive(new Item.Properties()));
|
||||
public static final RegistryObject<Item> CARPET_ARROW = ITEMS.register("arrow_carpet", () -> new ArrowCarpet(new Item.Properties()));
|
||||
public static final RegistryObject<Item> TUNNEL_ARROW = ITEMS.register("arrow_tunnel", () -> new ArrowTunnel(new Item.Properties()));
|
||||
public static final RegistryObject<Item> DYNAMITE = ITEMS.register("dynamite", () -> new Dynamite(new Item.Properties()));
|
||||
public static final RegistryObject<Item> CONCUSSIVE_ARROW = ITEMS.register("arrow_concussive", () -> new ArrowConcussive(new Item.Properties().tab(CREATIVE_MODE_TAB)));
|
||||
public static final RegistryObject<Item> CARPET_ARROW = ITEMS.register("arrow_carpet", () -> new ArrowCarpet(new Item.Properties().tab(CREATIVE_MODE_TAB)));
|
||||
public static final RegistryObject<Item> TUNNEL_ARROW = ITEMS.register("arrow_tunnel", () -> new ArrowTunnel(new Item.Properties().tab(CREATIVE_MODE_TAB)));
|
||||
public static final RegistryObject<Item> DYNAMITE = ITEMS.register("dynamite", () -> new Dynamite(new Item.Properties().tab(CREATIVE_MODE_TAB)));
|
||||
|
||||
public static void register(IEventBus bus) {
|
||||
ITEMS.register(bus);
|
||||
|
10
src/main/java/com/jenny/enhancedexplosives/util.java
Normal file
10
src/main/java/com/jenny/enhancedexplosives/util.java
Normal file
@ -0,0 +1,10 @@
|
||||
package com.jenny.enhancedexplosives;
|
||||
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
public class util {
|
||||
public static void addDeltaMovement(Entity entity, Vec3 movement) {
|
||||
entity.setDeltaMovement(movement.add(entity.getDeltaMovement()));
|
||||
}
|
||||
}
|
@ -1,4 +1,6 @@
|
||||
{
|
||||
"itemGroup.enhancedexplosives": "Enhanced Explosives",
|
||||
|
||||
"block.enhancedexplosives.tnt_8": "Compressed TNT",
|
||||
"block.enhancedexplosives.tnt_16": "Double Compressed TNT",
|
||||
"block.enhancedexplosives.tnt_32": "Triple Compressed TNT",
|
||||
|
Loading…
x
Reference in New Issue
Block a user