From bc390fa0e02fc5691b652d1f8e2b9885087ffc72 Mon Sep 17 00:00:00 2001 From: drcrazy Date: Thu, 7 Sep 2017 00:13:37 +0300 Subject: [PATCH] Fixed missing nuke textures --- .../java/techreborn/blocks/BlockNuke.java | 9 ++++++++ .../assets/techreborn/blockstates/nuke.json | 22 ++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/main/java/techreborn/blocks/BlockNuke.java b/src/main/java/techreborn/blocks/BlockNuke.java index cc968af31..040428d66 100644 --- a/src/main/java/techreborn/blocks/BlockNuke.java +++ b/src/main/java/techreborn/blocks/BlockNuke.java @@ -38,9 +38,12 @@ import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.Explosion; import net.minecraft.world.World; +import prospector.shootingstar.ShootingStar; +import prospector.shootingstar.model.ModelCompound; import reborncore.common.BaseBlock; import techreborn.client.TechRebornCreativeTabMisc; import techreborn.entities.EntityNukePrimed; +import techreborn.lib.ModInfo; /** * Created by Mark on 13/03/2016. @@ -53,6 +56,7 @@ public class BlockNuke extends BaseBlock { setUnlocalizedName("techreborn.nuke"); setCreativeTab(TechRebornCreativeTabMisc.instance); this.setDefaultState(this.blockState.getBaseState().withProperty(OVERLAY, false)); + ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this)); } public void explode(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase igniter) { @@ -75,6 +79,7 @@ public class BlockNuke extends BaseBlock { } } + @Override public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if (!worldIn.isRemote && entityIn instanceof EntityArrow) { EntityArrow entityarrow = (EntityArrow) entityIn; @@ -87,6 +92,7 @@ public class BlockNuke extends BaseBlock { } } + @Override public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { super.onBlockAdded(worldIn, pos, state); if (worldIn.isBlockPowered(pos)) { @@ -112,14 +118,17 @@ public class BlockNuke extends BaseBlock { return false; } + @Override public int getMetaFromState(IBlockState state) { return state.getValue(OVERLAY) ? 1 : 0; } + @Override public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(OVERLAY, (meta & 1) > 0); } + @Override protected BlockStateContainer createBlockState() { return new BlockStateContainer(this, OVERLAY); } diff --git a/src/main/resources/assets/techreborn/blockstates/nuke.json b/src/main/resources/assets/techreborn/blockstates/nuke.json index 39ca72d16..510cc9f0d 100644 --- a/src/main/resources/assets/techreborn/blockstates/nuke.json +++ b/src/main/resources/assets/techreborn/blockstates/nuke.json @@ -5,10 +5,30 @@ "model": "orientable", "textures": { "particle": "techreborn:blocks/nuke_side", - "bottom": "techreborn:blocks/nuke_bottom", + "bottom": "techreborn:blocks/nuke_top", "top": "techreborn:blocks/nuke_top", "front": "techreborn:blocks/nuke_front", "side": "techreborn:blocks/nuke_side" } + }, + "variants": { + "inventory": { + "transform": "forge:default-block", + "textures": { + } + }, + "normal": [ + {} + ], + "overlay": { + "true": { + "textures": { + } + }, + "false": { + "textures": { + } + } + } } } \ No newline at end of file