diff --git a/client/src/main/java/client/renderer/layers/LayerArmor.java b/client/src/main/java/client/renderer/layers/LayerArmor.java index cd6fed79..1025c63e 100755 --- a/client/src/main/java/client/renderer/layers/LayerArmor.java +++ b/client/src/main/java/client/renderer/layers/LayerArmor.java @@ -2,6 +2,7 @@ package client.renderer.layers; import org.lwjgl.opengl.GL11; +import client.Client; import client.renderer.GlState; import client.renderer.entity.RendererLivingEntity; import client.renderer.model.ModelArmor; @@ -14,14 +15,14 @@ public class LayerArmor implements LayerRenderer { protected static final String ENCHANTED_ITEM_GLINT_RES = "textures/glint.png"; - protected ModelBiped modelLeggings; - protected ModelBiped modelArmor; + protected ModelArmor modelLeggings; + protected ModelArmor modelArmor; private final RendererLivingEntity renderer; private float alpha = 1.0F; private float colorR = 1.0F; private float colorG = 1.0F; private float colorB = 1.0F; - private boolean skipRenderGlint; +// private boolean skipRenderGlint; // private static final Map ARMOR_TEXTURE_RES_MAP = Maps.newHashMap(); public LayerArmor(RendererLivingEntity rendererIn, int arms, int legs) @@ -32,12 +33,12 @@ public class LayerArmor implements LayerRenderer this.modelArmor = new ModelArmor(1.0F, arms, legs); } - public void doRenderLayer(EntityLiving entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) + public void doRenderLayer(EntityLiving entity, float limbSwing, float limbSwingAmount, float partial, float yaw, float pitch, float factor, float scale) { - this.renderLayer(entitylivingbaseIn, p_177141_2_, p_177141_3_, partialTicks, p_177141_5_, p_177141_6_, p_177141_7_, scale, 4); - this.renderLayer(entitylivingbaseIn, p_177141_2_, p_177141_3_, partialTicks, p_177141_5_, p_177141_6_, p_177141_7_, scale, 3); - this.renderLayer(entitylivingbaseIn, p_177141_2_, p_177141_3_, partialTicks, p_177141_5_, p_177141_6_, p_177141_7_, scale, 2); - this.renderLayer(entitylivingbaseIn, p_177141_2_, p_177141_3_, partialTicks, p_177141_5_, p_177141_6_, p_177141_7_, scale, 1); + this.renderLayer(entity, limbSwing, limbSwingAmount, partial, yaw, pitch, factor, scale, 4); + this.renderLayer(entity, limbSwing, limbSwingAmount, partial, yaw, pitch, factor, scale, 3); + this.renderLayer(entity, limbSwing, limbSwingAmount, partial, yaw, pitch, factor, scale, 2); + this.renderLayer(entity, limbSwing, limbSwingAmount, partial, yaw, pitch, factor, scale, 1); } public boolean shouldCombineTextures() @@ -45,19 +46,23 @@ public class LayerArmor implements LayerRenderer return false; } - private void renderLayer(EntityLiving entitylivingbaseIn, float p_177182_2_, float p_177182_3_, float partialTicks, float p_177182_5_, float p_177182_6_, float p_177182_7_, float scale, int armorSlot) + private void renderLayer(EntityLiving entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partial, float yaw, float pitch, float factor, float scale, int armorSlot) { ItemStack itemstack = this.getCurrentArmor(entitylivingbaseIn, armorSlot); if (itemstack != null && itemstack.getItem() instanceof ItemArmor) { ItemArmor itemarmor = (ItemArmor)itemstack.getItem(); - ModelBiped t = this.getArmorModel(armorSlot); - t.setModelAttributes(this.renderer.getMainModel()); - t.setLivingAnimations(entitylivingbaseIn, p_177182_2_, p_177182_3_, partialTicks); + ModelArmor t = this.getArmorModel(armorSlot); + t.setModelAttributes(this.renderer != null ? this.renderer.getMainModel() : null); + t.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partial); this.setModelPartVisible(t, armorSlot); boolean flag = this.isSlotForLeggings(armorSlot); - this.renderer.bindTexture(this.getArmorResource(itemarmor, flag, null)); + String tex = this.getArmorResource(itemarmor, flag, null); + if(this.renderer != null) + this.renderer.bindTexture(tex); + else + Client.CLIENT.getTextureManager().bindTexture(tex); if (itemarmor.getArmorMaterial().canBeDyed()) { @@ -66,8 +71,12 @@ public class LayerArmor implements LayerRenderer float f1 = (float)(i >> 8 & 255) / 255.0F; float f2 = (float)(i & 255) / 255.0F; GlState.color(this.colorR * f, this.colorG * f1, this.colorB * f2, this.alpha); - t.render(entitylivingbaseIn, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, scale); - this.renderer.bindTexture(this.getArmorResource(itemarmor, flag, "overlay")); + t.render(entitylivingbaseIn, limbSwing, limbSwingAmount, yaw, pitch, factor, scale); + String overlay = this.getArmorResource(itemarmor, flag, "overlay"); + if(this.renderer != null) + this.renderer.bindTexture(overlay); + else + Client.CLIENT.getTextureManager().bindTexture(overlay); } // case CHAIN: @@ -76,13 +85,13 @@ public class LayerArmor implements LayerRenderer // case DIAMOND: if(itemarmor.getArmorMaterial().hasArmor()) { GlState.color(this.colorR, this.colorG, this.colorB, this.alpha); - t.render(entitylivingbaseIn, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, scale); + t.render(entitylivingbaseIn, limbSwing, limbSwingAmount, yaw, pitch, factor, scale); } // default: - if (!this.skipRenderGlint && itemstack.isItemEnchanted()) + if (itemstack.isItemEnchanted()) { - this.renderGlint(entitylivingbaseIn, t, p_177182_2_, p_177182_3_, partialTicks, p_177182_5_, p_177182_6_, p_177182_7_, scale); + this.renderGlint(entitylivingbaseIn, t, limbSwing, limbSwingAmount, partial, yaw, pitch, factor, scale); } } } @@ -92,7 +101,7 @@ public class LayerArmor implements LayerRenderer return entitylivingbaseIn.getArmor(armorSlot - 1); } - public ModelBiped getArmorModel(int armorSlot) + public ModelArmor getArmorModel(int armorSlot) { return this.isSlotForLeggings(armorSlot) ? this.modelLeggings : this.modelArmor; } @@ -102,10 +111,13 @@ public class LayerArmor implements LayerRenderer return armorSlot == 2; } - private void renderGlint(EntityLiving entitylivingbaseIn, ModelBiped modelbaseIn, float p_177183_3_, float p_177183_4_, float partialTicks, float p_177183_6_, float p_177183_7_, float p_177183_8_, float scale) + private void renderGlint(EntityLiving entitylivingbaseIn, ModelArmor modelbaseIn, float p_177183_3_, float p_177183_4_, float partialTicks, float p_177183_6_, float p_177183_7_, float p_177183_8_, float scale) { - float f = (float)entitylivingbaseIn.ticksExisted + partialTicks; - this.renderer.bindTexture(ENCHANTED_ITEM_GLINT_RES); + float f = entitylivingbaseIn == null ? (float)(System.currentTimeMillis() % 1000000L) / 50.0f : (float)entitylivingbaseIn.ticksExisted + partialTicks; + if(this.renderer != null) + this.renderer.bindTexture(ENCHANTED_ITEM_GLINT_RES); + else + Client.CLIENT.getTextureManager().bindTexture(ENCHANTED_ITEM_GLINT_RES); GlState.enableBlend(); GlState.depthFunc(GL11.GL_EQUAL); GlState.depthMask(false); diff --git a/client/src/main/java/client/renderer/model/ModelBiped.java b/client/src/main/java/client/renderer/model/ModelBiped.java index 32801ca4..fee7e02e 100755 --- a/client/src/main/java/client/renderer/model/ModelBiped.java +++ b/client/src/main/java/client/renderer/model/ModelBiped.java @@ -114,12 +114,12 @@ public abstract class ModelBiped extends ModelBase { this.bipedHead.rotateAngleY = netHeadYaw / (180F / (float)Math.PI); this.bipedHead.rotateAngleX = headPitch / (180F / (float)Math.PI); - this.bipedRightArm.rotateAngleX = ((EntityLiving)entityIn).getArmRotation() * ExtMath.cos(limbSwing * 0.6662F + (float)Math.PI) * /* 2.0F * */ limbSwingAmount; // * 0.5F; - this.bipedLeftArm.rotateAngleX = ((EntityLiving)entityIn).getArmRotation() * ExtMath.cos(limbSwing * 0.6662F) * /* 2.0F * */ limbSwingAmount; // * 0.5F; + this.bipedRightArm.rotateAngleX = (entityIn == null ? 1.0f : ((EntityLiving)entityIn).getArmRotation()) * ExtMath.cos(limbSwing * 0.6662F + (float)Math.PI) * /* 2.0F * */ limbSwingAmount; // * 0.5F; + this.bipedLeftArm.rotateAngleX = (entityIn == null ? 1.0f : ((EntityLiving)entityIn).getArmRotation()) * ExtMath.cos(limbSwing * 0.6662F) * /* 2.0F * */ limbSwingAmount; // * 0.5F; this.bipedRightArm.rotateAngleZ = 0.0F; this.bipedLeftArm.rotateAngleZ = 0.0F; - this.bipedRightLeg.rotateAngleX = ((EntityLiving)entityIn).getLegRotation() * ExtMath.cos(limbSwing * 0.6662F) /* * 1.4F */ * limbSwingAmount; - this.bipedLeftLeg.rotateAngleX = ((EntityLiving)entityIn).getLegRotation() * ExtMath.cos(limbSwing * 0.6662F + (float)Math.PI) /* * 1.4F */ * limbSwingAmount; + this.bipedRightLeg.rotateAngleX = (entityIn == null ? 1.4f : ((EntityLiving)entityIn).getLegRotation()) * ExtMath.cos(limbSwing * 0.6662F) /* * 1.4F */ * limbSwingAmount; + this.bipedLeftLeg.rotateAngleX = (entityIn == null ? 1.4f : ((EntityLiving)entityIn).getLegRotation()) * ExtMath.cos(limbSwing * 0.6662F + (float)Math.PI) /* * 1.4F */ * limbSwingAmount; this.bipedRightLeg.rotateAngleY = 0.0F; this.bipedLeftLeg.rotateAngleY = 0.0F; @@ -231,7 +231,8 @@ public abstract class ModelBiped extends ModelBase public void setModelAttributes(ModelBase model) { - super.setModelAttributes(model); + if(model != null) + super.setModelAttributes(model); if (model instanceof ModelBiped) { diff --git a/client/src/main/java/client/renderer/tileentity/TileEntityItemStackRenderer.java b/client/src/main/java/client/renderer/tileentity/TileEntityItemStackRenderer.java index 03b63dc5..412dcd4a 100755 --- a/client/src/main/java/client/renderer/tileentity/TileEntityItemStackRenderer.java +++ b/client/src/main/java/client/renderer/tileentity/TileEntityItemStackRenderer.java @@ -1,8 +1,18 @@ package client.renderer.tileentity; +import org.lwjgl.opengl.GL11; + +import client.renderer.GlState; +import client.renderer.layers.LayerArmor; import common.block.tech.BlockChest; +import common.block.tile.BlockSign; +import common.block.tile.BlockStandingSign; +import common.entity.types.EntityLiving; import common.item.ItemStack; +import common.item.block.ItemSign; +import common.item.tool.ItemArmor; import common.tileentity.TileEntityChest; +import common.tileentity.TileEntitySign; import common.util.Facing; import common.world.State; @@ -10,6 +20,7 @@ public class TileEntityItemStackRenderer { public static TileEntityItemStackRenderer instance = new TileEntityItemStackRenderer(); private State state; + private ItemStack stack; private final TileEntityChest chest = new TileEntityChest(0) { public boolean hasWorldObj() { @@ -21,10 +32,58 @@ public class TileEntityItemStackRenderer { } }; + private final TileEntitySign sign = new TileEntitySign() { + public boolean hasWorldObj() { + return true; + } + + public State getBlockState() { + return TileEntityItemStackRenderer.this.state; + } + }; + private final LayerArmor armor = new LayerArmor(null, 12, 12) { + public ItemStack getCurrentArmor(EntityLiving entitylivingbaseIn, int armorSlot) { + return ((ItemArmor)TileEntityItemStackRenderer.this.stack.getItem()).armorType.getIndex() == armorSlot ? TileEntityItemStackRenderer.this.stack : null; + } + }; + public void renderByItem(ItemStack stack) { if(stack.getItem() != null && stack.getItem().getBlock() instanceof BlockChest chest) { this.state = chest.getState().withProperty(BlockChest.FACING, Facing.SOUTH); TileEntityRendererDispatcher.instance.renderTileEntityAt(this.chest, 0.0D, 0.0D, 0.0D, 0.0F); } + else if(stack.getItem() instanceof ItemSign sign) { + this.state = sign.getBlock().getState().withProperty(BlockStandingSign.ROTATION, 8); + TileEntityRendererDispatcher.instance.renderTileEntityAt(this.sign, 0.0D, 0.0D, 0.0D, 0.0F); + } + else if(stack.getItem() instanceof ItemArmor armor) { + this.stack = stack; + GL11.glPushMatrix(); + float offset = 0.0f; + switch(armor.armorType) { + case HEAD: + offset = -0.15f; + break; + case BODY: + offset = 0.45f; + break; + case LEGS: + offset = 1.35f; + break; + case FEET: + offset = 1.7f; + break; + } + GL11.glTranslatef(1.0f, offset, 0.0f); + GL11.glRotatef(180.0f, 0.0f, 1.0f, 0.0f); + GL11.glScalef(1.4f, -1.4f, 1.4f); + boolean cull = GlState.isCullEnabled(); + if(cull) + GlState.disableCull(); + this.armor.doRenderLayer(null, 0.0f, 0.0f, 0.0f, 0, 0, 0.0f, 0.0625F); + if(cull) + GlState.enableCull(); + GL11.glPopMatrix(); + } } } diff --git a/client/src/main/java/client/renderer/tileentity/TileEntitySignRenderer.java b/client/src/main/java/client/renderer/tileentity/TileEntitySignRenderer.java index f100d7b8..d3da4f57 100755 --- a/client/src/main/java/client/renderer/tileentity/TileEntitySignRenderer.java +++ b/client/src/main/java/client/renderer/tileentity/TileEntitySignRenderer.java @@ -22,12 +22,11 @@ public class TileEntitySignRenderer extends TileEntitySpecialRenderer FACING = PropertyEnum.create("facing", Facing.class, Facing.DOWN, Facing.NORTH, Facing.SOUTH, Facing.WEST, Facing.EAST); -} diff --git a/common/src/main/java/common/block/DirectionalUp.java b/common/src/main/java/common/block/DirectionalUp.java deleted file mode 100644 index c3f8dc37..00000000 --- a/common/src/main/java/common/block/DirectionalUp.java +++ /dev/null @@ -1,8 +0,0 @@ -package common.block; - -import common.properties.PropertyEnum; -import common.util.Facing; - -public interface DirectionalUp { - public static final PropertyEnum FACING = PropertyEnum.create("facing", Facing.class, Facing.UP, Facing.NORTH, Facing.SOUTH, Facing.WEST, Facing.EAST); -} diff --git a/common/src/main/java/common/block/foliage/BlockCocoa.java b/common/src/main/java/common/block/foliage/BlockCocoa.java deleted file mode 100755 index 909716dc..00000000 --- a/common/src/main/java/common/block/foliage/BlockCocoa.java +++ /dev/null @@ -1,259 +0,0 @@ -package common.block.foliage; - -import common.block.Block; -import common.block.Rotatable; -import common.color.DyeColor; -import common.block.Material; -import common.entity.types.EntityLiving; -import common.init.Blocks; -import common.item.Item; -import common.item.ItemStack; -import common.item.material.ItemDye; -import common.model.BlockLayer; -import common.model.Model; -import common.model.ModelProvider; -import common.model.ModelRotation; -import common.model.Transform; -import common.properties.Property; -import common.properties.PropertyInteger; -import common.rng.Random; -import common.util.BlockPos; -import common.util.BoundingBox; -import common.util.Facing; -import common.vars.Vars; -import common.world.IWorldAccess; -import common.world.State; -import common.world.World; -import common.world.AWorldServer; - -public class BlockCocoa extends Block implements Rotatable, IGrowable -{ - public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 2); - - public BlockCocoa() - { - super(Material.PLANT); - this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH).withProperty(AGE, Integer.valueOf(0))); - this.setTickRandomly(); - } - - public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) - { - if (!this.canBlockStay(worldIn, pos, state)) - { - this.dropBlock(worldIn, pos, state); - } - else if (Vars.cocoaGrowth > 0 && worldIn.rand.chance(Vars.cocoaGrowth)) - { - int i = ((Integer)state.getValue(AGE)).intValue(); - - if (i < 2) - { - worldIn.setState(pos, state.withProperty(AGE, Integer.valueOf(i + 1)), 2); - } - } - } - - public boolean canBlockStay(World worldIn, BlockPos pos, State state) - { - pos = pos.offset((Facing)state.getValue(FACING)); - State iblockstate = worldIn.getState(pos); - return iblockstate.getBlock() == Blocks.jungle_log; // && iblockstate.getValue(BlockPlanks.VARIANT) == BlockPlanks.EnumType.JUNGLE; - } - - public boolean isFullCube() - { - return false; - } - - /** - * Used to determine ambient occlusion and culling when rebuilding chunks for render - */ - public boolean isOpaqueCube() - { - return false; - } - - public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state) - { - this.setBlockBoundsBasedOnState(worldIn, pos); - return super.getCollisionBoundingBox(worldIn, pos, state); - } - - public BoundingBox getSelectedBoundingBox(World worldIn, BlockPos pos) - { - this.setBlockBoundsBasedOnState(worldIn, pos); - return super.getSelectedBoundingBox(worldIn, pos); - } - - - public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos) - { - State iblockstate = worldIn.getState(pos); - Facing enumfacing = (Facing)iblockstate.getValue(FACING); - int i = ((Integer)iblockstate.getValue(AGE)).intValue(); - int j = 4 + i * 2; - int k = 5 + i * 2; - float f = (float)j / 2.0F; - - switch (enumfacing) - { - case SOUTH: - this.setBlockBounds((8.0F - f) / 16.0F, (12.0F - (float)k) / 16.0F, (15.0F - (float)j) / 16.0F, (8.0F + f) / 16.0F, 0.75F, 0.9375F); - break; - - case NORTH: - this.setBlockBounds((8.0F - f) / 16.0F, (12.0F - (float)k) / 16.0F, 0.0625F, (8.0F + f) / 16.0F, 0.75F, (1.0F + (float)j) / 16.0F); - break; - - case WEST: - this.setBlockBounds(0.0625F, (12.0F - (float)k) / 16.0F, (8.0F - f) / 16.0F, (1.0F + (float)j) / 16.0F, 0.75F, (8.0F + f) / 16.0F); - break; - - case EAST: - this.setBlockBounds((15.0F - (float)j) / 16.0F, (12.0F - (float)k) / 16.0F, (8.0F - f) / 16.0F, 0.9375F, 0.75F, (8.0F + f) / 16.0F); - } - } - - /** - * Called by ItemBlocks after a block is set in the world, to allow post-place logic - */ - public void onBlockPlacedBy(World worldIn, BlockPos pos, State state, EntityLiving placer) - { - Facing enumfacing = Facing.fromAngle((double)placer.rotYaw); - worldIn.setState(pos, state.withProperty(FACING, enumfacing), 2); - } - - /** - * Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the - * IBlockstate - */ - public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer) - { - if (!facing.getAxis().isHorizontal()) - { - facing = Facing.NORTH; - } - - return this.getState().withProperty(FACING, facing.getOpposite()).withProperty(AGE, Integer.valueOf(0)); - } - - /** - * Called when a neighboring block changes. - */ - public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock) - { - if (!this.canBlockStay(worldIn, pos, state)) - { - this.dropBlock(worldIn, pos, state); - } - } - - private void dropBlock(World worldIn, BlockPos pos, State state) - { - worldIn.setState(pos, Blocks.air.getState(), 3); - this.dropBlockAsItem(worldIn, pos, state, 0); - } - - /** - * Spawns this Block's drops into the World as EntityItems. - */ - public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, State state, float chance, int fortune) - { - int i = ((Integer)state.getValue(AGE)).intValue(); - int j = 1; - - if (i >= 2) - { - j = 3; - } - - for (int k = 0; k < j; ++k) - { - spawnAsEntity(worldIn, pos, new ItemStack(this.getItem())); - } - } - - /** - * Whether this IGrowable can grow - */ - public boolean canGrow(World worldIn, BlockPos pos, State state, boolean isClient) - { - return ((Integer)state.getValue(AGE)).intValue() < 2; - } - - public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, State state) - { - return true; - } - - public void grow(AWorldServer worldIn, Random rand, BlockPos pos, State state) - { - worldIn.setState(pos, state.withProperty(AGE, Integer.valueOf(((Integer)state.getValue(AGE)).intValue() + 1)), 2); - } - - public BlockLayer getBlockLayer() - { - return BlockLayer.CUTOUT; - } - - protected Property[] getProperties() - { - return new Property[] {FACING, AGE}; - } - - public Model getModel(ModelProvider provider, String name, State state) { - Model model; - switch(state.getValue(AGE)) { - case 0: - model = provider.getModel("cocoa_0") - .add(6, 7, 11, 10, 12, 15) - .d().uv(0, 0, 4, 4).noCull() - .u().uv(0, 0, 4, 4).noCull() - .n().uv(11, 4, 15, 9).noCull() - .s().uv(11, 4, 15, 9).noCull() - .w().uv(11, 4, 15, 9).noCull() - .e().uv(11, 4, 15, 9).noCull() - .add(8, 12, 12, 8, 16, 16) - .w().uv(12, 0, 16, 4).noCull() - .e().uv(16, 0, 12, 4).noCull(); - break; - case 1: - model = provider.getModel("cocoa_1") - .add(5, 5, 9, 11, 12, 15) - .d().uv(0, 0, 6, 6).noCull() - .u().uv(0, 0, 6, 6).noCull() - .n().uv(9, 4, 15, 11).noCull() - .s().uv(9, 4, 15, 11).noCull() - .w().uv(9, 4, 15, 11).noCull() - .e().uv(9, 4, 15, 11).noCull() - .add(8, 12, 12, 8, 16, 16) - .w().uv(12, 0, 16, 4).noCull() - .e().uv(16, 0, 12, 4).noCull(); - break; - case 2: - default: - model = provider.getModel("cocoa_2") - .add(4, 3, 7, 12, 12, 15) - .d().uv(0, 0, 7, 7).noCull() - .u().uv(0, 0, 7, 7).noCull() - .n().uv(7, 4, 15, 13).noCull() - .s().uv(7, 4, 15, 13).noCull() - .w().uv(7, 4, 15, 13).noCull() - .e().uv(7, 4, 15, 13).noCull() - .add(8, 12, 12, 8, 16, 16) - .w().uv(12, 0, 16, 4).noCull() - .e().uv(16, 0, 12, 4).noCull(); - break; - } - return model.rotate(ModelRotation.getNorthRot(state.getValue(FACING).getOpposite())); - } - - public Transform getTransform() { - return Transform.PANE_SIDE; - } - - protected Item getItemToRegister() { - return new ItemDye(DyeColor.BROWN, this); - } -} diff --git a/common/src/main/java/common/block/foliage/BlockLeaves.java b/common/src/main/java/common/block/foliage/BlockLeaves.java index 79e0f0a4..c147260b 100755 --- a/common/src/main/java/common/block/foliage/BlockLeaves.java +++ b/common/src/main/java/common/block/foliage/BlockLeaves.java @@ -262,7 +262,7 @@ public class BlockLeaves extends BlockLeavesBase spawnAsEntity(worldIn, pos, new ItemStack(item)); } - i = 200; + i = this.type.getDropChance(); if (fortune > 0) { diff --git a/common/src/main/java/common/block/foliage/BlockStem.java b/common/src/main/java/common/block/foliage/BlockStem.java index d69279c2..316460cb 100755 --- a/common/src/main/java/common/block/foliage/BlockStem.java +++ b/common/src/main/java/common/block/foliage/BlockStem.java @@ -1,7 +1,7 @@ package common.block.foliage; import common.block.Block; -import common.block.DirectionalUp; +import common.block.Directional; import common.init.Blocks; import common.init.Items; import common.item.CheatTab; @@ -23,7 +23,7 @@ import common.world.State; import common.world.World; import common.world.AWorldServer; -public class BlockStem extends BlockBush implements DirectionalUp, IGrowable +public class BlockStem extends BlockBush implements Directional, IGrowable { public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 7); @@ -206,7 +206,7 @@ public class BlockStem extends BlockBush implements DirectionalUp, IGrowable public Model getModel(ModelProvider provider, String name, State state) { String stem = name; String upperstem = name + "_connected"; - if(state.getValue(FACING) == Facing.UP) { + if(state.getValue(FACING).getAxis().isVertical()) { switch(state.getValue(AGE)) { case 0: return provider.getModel(stem) diff --git a/common/src/main/java/common/block/tech/BlockDaylightDetector.java b/common/src/main/java/common/block/tech/BlockDaylightDetector.java deleted file mode 100755 index b34cb878..00000000 --- a/common/src/main/java/common/block/tech/BlockDaylightDetector.java +++ /dev/null @@ -1,161 +0,0 @@ -package common.block.tech; - -import common.block.Block; -import common.block.ITileEntityProvider; -import common.block.Material; -import common.block.SoundType; -import common.entity.npc.EntityNPC; -import common.init.Blocks; -import common.init.Items; -import common.item.CheatTab; -import common.item.Item; -import common.model.Model; -import common.model.ModelProvider; -import common.model.Transform; -import common.properties.Property; -import common.properties.PropertyInteger; -import common.tileentity.TileEntity; -import common.tileentity.TileEntityDaylightDetector; -import common.util.BlockPos; -import common.util.ExtMath; -import common.util.Facing; -import common.world.IWorldAccess; -import common.world.LightType; -import common.world.State; -import common.world.World; -import common.world.AWorldServer; - -public class BlockDaylightDetector extends Block implements ITileEntityProvider -{ - public static final PropertyInteger POWER = PropertyInteger.create("power", 0, 15); - private final boolean inverted; - - public BlockDaylightDetector(boolean inverted) - { - super(Material.WOOD); - this.inverted = inverted; - this.setDefaultState(this.getBaseState().withProperty(POWER, Integer.valueOf(0))); - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F); - this.setTab(CheatTab.TECHNOLOGY); - this.setHardness(0.2F); - this.setStepSound(SoundType.WOOD); -// this.setDisplay("daylightDetector"); - } - - public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos) - { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F); - } - - public double getResistance(World worldIn, BlockPos pos, State state) { - return state.getValue(POWER) > 0 ? (double)(15 - state.getValue(POWER)) * 10000.0 : super.getResistance(worldIn, pos, state); - } - - public void updatePower(AWorldServer worldIn, BlockPos pos) - { - if (worldIn.dimension.hasSkyLight() && worldIn.dimension.hasDaylight()) - { - State iblockstate = worldIn.getState(pos); - int i = worldIn.getLightFor(LightType.SKY, pos) - worldIn.getSkylightSubtracted(); - float f = worldIn.getDayPhase(1.0F); - float f1 = f < (float)Math.PI ? 0.0F : ((float)Math.PI * 2F); - f = f + (f1 - f) * 0.2F; - i = Math.round((float)i * ExtMath.cos(f)); - i = ExtMath.clampi(i, 0, 15); - - if (this.inverted) - { - i = 15 - i; - } - - if (((Integer)iblockstate.getValue(POWER)).intValue() != i) - { - worldIn.setState(pos, iblockstate.withProperty(POWER, Integer.valueOf(i)), 3); - } - } - } - - public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ) - { -// if (playerIn.isAllowEdit()) -// { - if (worldIn.client) - { - return true; - } - else - { - if (this.inverted) - { - worldIn.setState(pos, Blocks.daylight_detector.getState().withProperty(POWER, state.getValue(POWER)), 4); - Blocks.daylight_detector.updatePower((AWorldServer)worldIn, pos); - } - else - { - worldIn.setState(pos, Blocks.daylight_detector_inverted.getState().withProperty(POWER, state.getValue(POWER)), 4); - Blocks.daylight_detector_inverted.updatePower((AWorldServer)worldIn, pos); - } - - return true; - } -// } -// else -// { -// return super.onBlockActivated(worldIn, pos, state, playerIn, side, hitX, hitY, hitZ); -// } - } - - public Item getItem() - { - return Items.daylight_detector; - } - - public boolean isFullCube() - { - return false; - } - - /** - * Used to determine ambient occlusion and culling when rebuilding chunks for render - */ - public boolean isOpaqueCube() - { - return false; - } - - /** - * Can this block provide power. Only wire currently seems to have this change based on its state. - */ - public boolean canConnectToWire(State state) - { - return true; - } - - /** - * Returns a new instance of a block's tile entity class. Called on placing the block. - */ - public TileEntity createNewTileEntity() - { - return new TileEntityDaylightDetector(); - } - - protected Property[] getProperties() - { - return new Property[] {POWER}; - } - - public Model getModel(ModelProvider provider, String name, State state) { - return provider.getModel(this.inverted ? "daylight_detector_inverted_top" : "daylight_detector_top") - .add(0, 0, 0, 16, 6, 16) - .d("daylight_detector_side").uv(0, 0, 16, 16) - .u().uv(0, 0, 16, 16).noCull() - .n("daylight_detector_side").uv(0, 10, 16, 16) - .s("daylight_detector_side").uv(0, 10, 16, 16) - .w("daylight_detector_side").uv(0, 10, 16, 16) - .e("daylight_detector_side").uv(0, 10, 16, 16); - } - - protected Item getItemToRegister() { - return this.inverted ? null : super.getItemToRegister(); - } -} diff --git a/common/src/main/java/common/block/tech/BlockHopper.java b/common/src/main/java/common/block/tech/BlockHopper.java index 127d943c..10535f27 100755 --- a/common/src/main/java/common/block/tech/BlockHopper.java +++ b/common/src/main/java/common/block/tech/BlockHopper.java @@ -3,7 +3,7 @@ package common.block.tech; import java.util.List; import common.block.Block; -import common.block.DirectionalDown; +import common.block.Directional; import common.block.ITileEntityProvider; import common.block.Material; import common.entity.Entity; @@ -11,8 +11,6 @@ import common.entity.npc.EntityNPC; import common.entity.types.EntityLiving; import common.inventory.InventoryHelper; import common.item.CheatTab; -import common.item.Item; -import common.item.block.ItemBlock; import common.model.BlockLayer; import common.model.Model; import common.model.ModelProvider; @@ -28,9 +26,10 @@ import common.world.State; import common.world.World; import common.world.AWorldServer; -public class BlockHopper extends Block implements ITileEntityProvider, DirectionalDown +public class BlockHopper extends Block implements ITileEntityProvider, Directional { - private static final Model hopper_down = ModelProvider.getModelProvider().getModel("hopper_outside") + private static Model getHopperModel(boolean up) { + return ModelProvider.getModelProvider().getModel("hopper_outside") .add(0, 10, 0, 16, 11, 16) .d().uv(0, 0, 16, 16).noCull() .u("hopper_inside").uv(0, 0, 16, 16).noCull() @@ -79,8 +78,8 @@ public class BlockHopper extends Block implements ITileEntityProvider, Direction .n().uv(6, 12, 10, 16).noCull() .s().uv(6, 12, 10, 16).noCull() .w().uv(6, 12, 10, 16).noCull() - .e().uv(6, 12, 10, 16).noCull() - ; + .e().uv(6, 12, 10, 16).noCull().rotate(up ? ModelRotation.X180_Y0 : ModelRotation.X0_Y0); + } public BlockHopper() { @@ -100,7 +99,8 @@ public class BlockHopper extends Block implements ITileEntityProvider, Direction */ public void addCollisionBoxesToList(World worldIn, BlockPos pos, State state, BoundingBox mask, List list, Entity collidingEntity) { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.625F, 1.0F); + boolean flip = state.getBlock() == this && state.getValue(FACING) == Facing.UP; + this.setBlockBounds(0.0F, flip ? 0.375f : 0.0F, 0.0F, 1.0F, flip ? 1.0f : 0.625F, 1.0F); super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); float f = 0.125F; this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); @@ -120,14 +120,7 @@ public class BlockHopper extends Block implements ITileEntityProvider, Direction */ public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer) { - Facing enumfacing = facing.getOpposite(); - - if (enumfacing == Facing.UP) - { - enumfacing = Facing.DOWN; - } - - return this.getState().withProperty(FACING, enumfacing); + return this.getState().withProperty(FACING, facing.getOpposite()); } /** @@ -151,7 +144,6 @@ public class BlockHopper extends Block implements ITileEntityProvider, Direction if (tileentity instanceof TileEntityHopper) { playerIn.connection.show((TileEntityHopper)tileentity); -// playerIn.triggerAchievement(StatRegistry.hopperStat); } return true; @@ -203,7 +195,7 @@ public class BlockHopper extends Block implements ITileEntityProvider, Direction } public Model getModel(ModelProvider provider, String name, State state) { - return state.getValue(FACING) == Facing.DOWN ? hopper_down : provider.getModel("hopper_outside") + return state.getValue(FACING).getAxis().isVertical() ? getHopperModel(state.getValue(FACING) == Facing.UP) : provider.getModel("hopper_outside") .add(0, 10, 0, 16, 11, 16) .d().uv(0, 0, 16, 16).noCull() .u("hopper_inside").uv(0, 0, 16, 16).noCull() diff --git a/common/src/main/java/common/block/tech/BlockTNT.java b/common/src/main/java/common/block/tech/BlockTNT.java index e83ad012..ab476614 100755 --- a/common/src/main/java/common/block/tech/BlockTNT.java +++ b/common/src/main/java/common/block/tech/BlockTNT.java @@ -88,12 +88,12 @@ public class BlockTNT extends Block { Item item = playerIn.getCurrentEquippedItem().getItem(); - if (item == Items.flint_and_steel || item == Items.fireball) + if (item == Items.lighter || item == Items.fireball) { this.explode(worldIn, pos, state.withProperty(EXPLODE, Boolean.valueOf(true)), playerIn); worldIn.setBlockToAir(pos); - if (item == Items.flint_and_steel) + if (item == Items.lighter) { playerIn.getCurrentEquippedItem().damage(1, playerIn); } diff --git a/common/src/main/java/common/block/tech/BlockToggleableLight.java b/common/src/main/java/common/block/tech/BlockToggleableLight.java index 08054ca6..18128cb2 100755 --- a/common/src/main/java/common/block/tech/BlockToggleableLight.java +++ b/common/src/main/java/common/block/tech/BlockToggleableLight.java @@ -32,9 +32,9 @@ public class BlockToggleableLight extends Block { if(player.getCurrentEquippedItem() == null) return super.onBlockActivated(worldIn, pos, state, player, side, hitX, hitY, hitZ); Item item = player.getCurrentEquippedItem().getItem(); - if(item != Items.flint_and_steel && item != Items.fireball) + if(item != Items.lighter && item != Items.fireball) return super.onBlockActivated(worldIn, pos, state, player, side, hitX, hitY, hitZ); - if(item == Items.flint_and_steel) + if(item == Items.lighter) player.getCurrentEquippedItem().damage(1, player); else player.getCurrentEquippedItem().decrSize(); diff --git a/common/src/main/java/common/block/tech/BlockTorch.java b/common/src/main/java/common/block/tech/BlockTorch.java index ca273152..baeed07f 100755 --- a/common/src/main/java/common/block/tech/BlockTorch.java +++ b/common/src/main/java/common/block/tech/BlockTorch.java @@ -1,7 +1,7 @@ package common.block.tech; import common.block.Block; -import common.block.DirectionalUp; +import common.block.Directional; import common.block.Material; import common.block.artificial.BlockFence; import common.block.artificial.BlockStainedGlass; @@ -24,7 +24,7 @@ import common.world.State; import common.world.World; import common.world.AWorldServer; -public abstract class BlockTorch extends Block implements DirectionalUp +public abstract class BlockTorch extends Block implements Directional { private static boolean isBlockNormalCube(World world, BlockPos pos, boolean def) { if(!World.isValid(pos) || (world.client && !world.isBlockLoaded(pos, false))) @@ -74,7 +74,7 @@ public abstract class BlockTorch extends Block implements DirectionalUp public boolean canPlaceBlockAt(World worldIn, BlockPos pos) { - for (Facing enumfacing : FACING.getStates()) + for (Facing enumfacing : Facing.values()) { if (this.canPlaceAt(worldIn, pos, enumfacing)) { @@ -89,7 +89,7 @@ public abstract class BlockTorch extends Block implements DirectionalUp { BlockPos blockpos = pos.offset(facing.getOpposite()); boolean flag = facing.getAxis().isHorizontal(); - return flag && isBlockNormalCube(worldIn, blockpos, true) || facing.equals(Facing.UP) && this.canPlaceOn(worldIn, blockpos); + return flag && isBlockNormalCube(worldIn, blockpos, true) || facing.getAxis().isVertical() && this.canPlaceOn(worldIn, blockpos); } /** @@ -137,7 +137,7 @@ public abstract class BlockTorch extends Block implements DirectionalUp } else { - Facing enumfacing = (Facing)state.getValue(FACING); + Facing enumfacing = state.getValue(FACING); Facing.Axis enumfacing$axis = enumfacing.getAxis(); Facing enumfacing1 = enumfacing.getOpposite(); boolean flag = false; @@ -166,7 +166,7 @@ public abstract class BlockTorch extends Block implements DirectionalUp protected boolean checkForDrop(World worldIn, BlockPos pos, State state) { - if (state.getBlock() == this && this.canPlaceAt(worldIn, pos, (Facing)state.getValue(FACING))) + if (state.getBlock() == this && this.canPlaceAt(worldIn, pos, state.getValue(FACING))) { return true; } @@ -206,6 +206,11 @@ public abstract class BlockTorch extends Block implements DirectionalUp { this.setBlockBounds(0.5F - f, 0.2F, 1.0F - f * 2.0F, 0.5F + f, 0.8F, 1.0F); } + else if (enumfacing == Facing.DOWN) + { + f = 0.25F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 1.0F, 0.5F + f); + } else { f = 0.1F; @@ -226,29 +231,34 @@ public abstract class BlockTorch extends Block implements DirectionalUp } public Model getModel(ModelProvider provider, String name, State state) { - if(state.getValue(FACING) == Facing.UP) - return provider.getModel(name) - .add(7, 0, 7, 9, 10, 9).noShade() - .d().uv(7, 13, 9, 15).noCull() - .u().uv(7, 6, 9, 8).noCull() - .add(7, 0, 0, 9, 16, 16).noShade() - .w().uv(0, 0, 16, 16).noCull() - .e().uv(0, 0, 16, 16).noCull() - .add(0, 0, 7, 16, 16, 9).noShade() - .n().uv(0, 0, 16, 16).noCull() - .s().uv(0, 0, 16, 16).noCull(); - else - return provider.getModel(name) - .add(-1, 3.5f, 7, 1, 13.5f, 9).noShade().rotate(0, 3.5f, 8, Facing.Axis.Z, -22.5f, false) - .d().uv(7, 13, 9, 15).noCull() - .u().uv(7, 6, 9, 8).noCull() - .add(-1, 3.5f, 0, 1, 19.5f, 16).noShade().rotate(0, 3.5f, 8, Facing.Axis.Z, -22.5f, false) - .w().uv(0, 0, 16, 16).noCull() - .e().uv(0, 0, 16, 16).noCull() - .add(-8, 3.5f, 7, 8, 19.5f, 9).noShade().rotate(0, 3.5f, 8, Facing.Axis.Z, -22.5f, false) - .n().uv(0, 0, 16, 16).noCull() - .s().uv(0, 0, 16, 16).noCull() - .rotate(ModelRotation.getEastRot(state.getValue(FACING), false)); + if(state.getValue(FACING).getAxis().isVertical()) { + Model model = provider.getModel(name) + .add(7, 0, 7, 9, 10, 9).noShade(); + if(state.getValue(FACING) == Facing.UP) + model = model.d().uv(7, 13, 9, 15).noCull(); + model = model.u().uv(7, 6, 9, 8).noCull() + .add(7, 0, 0, 9, 16, 16).noShade() + .w().uv(0, 0, 16, 16).noCull() + .e().uv(0, 0, 16, 16).noCull() + .add(0, 0, 7, 16, 16, 9).noShade() + .n().uv(0, 0, 16, 16).noCull() + .s().uv(0, 0, 16, 16).noCull(); + return state.getValue(FACING) == Facing.UP ? model : model + .add(7, 0, 4, 9, 0, 12).noShade().du("iron_bars").cull(Facing.DOWN) + .add(7, 0, 4, 9, 16, 4).noShade().ns("iron_bars").noCull() + .add(7, 0, 12, 9, 16, 12).noShade().ns("iron_bars").noCull(); + } + return provider.getModel(name) + .add(-1, 3.5f, 7, 1, 13.5f, 9).noShade().rotate(0, 3.5f, 8, Facing.Axis.Z, -22.5f, false) + .d().uv(7, 13, 9, 15).noCull() + .u().uv(7, 6, 9, 8).noCull() + .add(-1, 3.5f, 0, 1, 19.5f, 16).noShade().rotate(0, 3.5f, 8, Facing.Axis.Z, -22.5f, false) + .w().uv(0, 0, 16, 16).noCull() + .e().uv(0, 0, 16, 16).noCull() + .add(-8, 3.5f, 7, 8, 19.5f, 9).noShade().rotate(0, 3.5f, 8, Facing.Axis.Z, -22.5f, false) + .n().uv(0, 0, 16, 16).noCull() + .s().uv(0, 0, 16, 16).noCull() + .rotate(ModelRotation.getEastRot(state.getValue(FACING), false)); } public Transform getTransform() { diff --git a/common/src/main/java/common/block/tech/BlockUnlitTorch.java b/common/src/main/java/common/block/tech/BlockUnlitTorch.java index 951f1c49..5e0f70a7 100644 --- a/common/src/main/java/common/block/tech/BlockUnlitTorch.java +++ b/common/src/main/java/common/block/tech/BlockUnlitTorch.java @@ -31,11 +31,11 @@ public class BlockUnlitTorch extends BlockTorch { if(playerIn.getCurrentEquippedItem() != null) { Item item = playerIn.getCurrentEquippedItem().getItem(); - if(item == Items.flint_and_steel || item == Items.fireball) { + if(item == Items.lighter || item == Items.fireball) { worldIn.setState(pos, this.lit.getState().withProperty(FACING, state.getValue(FACING)).withProperty(BlockLitTorch.FUEL, 7), 3); worldIn.playAuxSFX(playerIn, 1007, pos, 0); - if(item == Items.flint_and_steel) { + if(item == Items.lighter) { playerIn.getCurrentEquippedItem().damage(1, playerIn); } else { diff --git a/common/src/main/java/common/color/DyeColor.java b/common/src/main/java/common/color/DyeColor.java index 817ed6ae..a2a9630b 100755 --- a/common/src/main/java/common/color/DyeColor.java +++ b/common/src/main/java/common/color/DyeColor.java @@ -19,7 +19,7 @@ public enum DyeColor implements Identifyable, Displayable { CYAN("cyan", "Türkis", "Türkises", "Türkiser", "Türkise", null, "Türkiser Farbstoff", 5013401, TextColor.CYAN), PURPLE("purple", "Violett", "Violettes", "Violetter", "Violette", null, "Violetter Farbstoff", 8339378, TextColor.DMAGENTA), BLUE("blue", "Blau", "Blaues", "Blauer", "Blaue", "lapis_lazuli", "Lapislazuli", 3361970, TextColor.MIDNIGHT), - BROWN("brown", "Braun", "Braunes", "Brauner", "Braune", "cocoa", "Kakaobohnen", 6704179, TextColor.BROWN), + BROWN("brown", "Braun", "Braunes", "Brauner", "Braune", "cocoa_powder", "Gemahlene Kakaobohnen", 6704179, TextColor.BROWN), GREEN("green", "Grün", "Grünes", "Grüner", "Grüne", "cactus_green", "Kaktusgrün", 6717235, TextColor.DGREEN), RED("red", "Rot", "Rotes", "Roter", "Rote", null, "Roter Farbstoff", 10040115, TextColor.DRED), BLACK("black", "Schwarz", "Schwarzes", "Schwarzer", "Schwarze", "ink_sack", "Tintenbeutel", 1644825, TextColor.BLACK); diff --git a/common/src/main/java/common/entity/npc/EntityHaunter.java b/common/src/main/java/common/entity/npc/EntityHaunter.java index 15242769..f3a50e0a 100755 --- a/common/src/main/java/common/entity/npc/EntityHaunter.java +++ b/common/src/main/java/common/entity/npc/EntityHaunter.java @@ -229,7 +229,7 @@ public class EntityHaunter extends EntityNPC { { ItemStack itemstack = player.inventory.getCurrentItem(); - if (itemstack != null && itemstack.getItem() == Items.flint_and_steel) + if (itemstack != null && itemstack.getItem() == Items.lighter) { this.worldObj.playSound(SoundEvent.IGNITE, this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, 1.0F); player.swingItem(); diff --git a/common/src/main/java/common/init/BlockRegistry.java b/common/src/main/java/common/init/BlockRegistry.java index b25e67fc..0ed12445 100755 --- a/common/src/main/java/common/init/BlockRegistry.java +++ b/common/src/main/java/common/init/BlockRegistry.java @@ -39,7 +39,6 @@ import common.block.foliage.BlockBlackenedSoil; import common.block.foliage.BlockBlueShroom; import common.block.foliage.BlockCactus; import common.block.foliage.BlockCarrot; -import common.block.foliage.BlockCocoa; import common.block.foliage.BlockCrops; import common.block.foliage.BlockDeadBush; import common.block.foliage.BlockDoublePlant; @@ -99,7 +98,6 @@ import common.block.tech.BlockButton; import common.block.tech.BlockCauldron; import common.block.tech.BlockChest; import common.block.tech.BlockCore; -import common.block.tech.BlockDaylightDetector; import common.block.tech.BlockDispenser; import common.block.tech.BlockDropper; import common.block.tech.BlockEnchantmentTable; @@ -362,7 +360,6 @@ public abstract class BlockRegistry { register("reeds", (new BlockReed()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Zuckerrohr").setTab(CheatTab.PLANTS)); register("vine", (new BlockVine()).setHardness(0.2F).setStepSound(SoundType.GRASS).setDisplay("Ranken").setShearsEfficiency(0)); register("waterlily", (new BlockLilyPad()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Seerosenblatt")); - register("cocoa", (new BlockCocoa()).setHardness(0.2F).setResistance(5.0F).setStepSound(SoundType.WOOD).setDisplay("Kakao")); @@ -666,8 +663,6 @@ public abstract class BlockRegistry { register("lamp", (new BlockToggleableLight(false)).setHardness(0.3F).setStepSound(SoundType.GLASS) .setDisplay("Lampe").setTab(CheatTab.TECHNOLOGY)); register("lit_lamp", (new BlockToggleableLight(true)).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("Lampe")); - register("daylight_detector", new BlockDaylightDetector(false).setDisplay("Tageslichtsensor")); - register("daylight_detector_inverted", new BlockDaylightDetector(true).setDisplay("Tageslichtsensor")); register("tripwire_hook", (new BlockTripWireHook()).setDisplay("Haken")); register("string", (new BlockTripWire()).setDisplay("Stolperdraht").setShearsEfficiency(0).setTab(CheatTab.TECHNOLOGY)); diff --git a/common/src/main/java/common/init/Blocks.java b/common/src/main/java/common/init/Blocks.java index ddb64ea7..6a56a125 100755 --- a/common/src/main/java/common/init/Blocks.java +++ b/common/src/main/java/common/init/Blocks.java @@ -164,7 +164,6 @@ public abstract class Blocks { public static final BlockSlab cobblestone_slab = get("cobblestone_slab"); public static final BlockStairs cobblestone_stairs = get("cobblestone_stairs"); public static final BlockWall cobblestone_wall = get("cobblestone_wall"); - public static final BlockCocoa cocoa = get("cocoa"); public static final BlockWorkbench construction_table = get("construction_table"); public static final Block copper_block = get("copper_block"); public static final BlockOre copper_ore = get("copper_ore"); @@ -190,8 +189,6 @@ public abstract class Blocks { public static final BlockSapling dark_oak_sapling = get("dark_oak_sapling"); public static final BlockSlab dark_oak_slab = get("dark_oak_slab"); public static final BlockStairs dark_oak_stairs = get("dark_oak_stairs"); - public static final BlockDaylightDetector daylight_detector = get("daylight_detector"); - public static final BlockDaylightDetector daylight_detector_inverted = get("daylight_detector_inverted"); public static final BlockTallGrass dead_bush = get("dead_bush"); public static final BlockDeadBush deadbush = get("deadbush"); public static final Block diamond_block = get("diamond_block"); diff --git a/common/src/main/java/common/init/CraftingRegistry.java b/common/src/main/java/common/init/CraftingRegistry.java index 5e816ae6..8661cee9 100755 --- a/common/src/main/java/common/init/CraftingRegistry.java +++ b/common/src/main/java/common/init/CraftingRegistry.java @@ -134,7 +134,7 @@ public abstract class CraftingRegistry add(new ItemStack(Items.gold_nugget, 9), "#", '#', Items.gold_ingot); addShapeless(new ItemStack(Items.mushroom_stew), Items.brown_mushroom, Items.red_mushroom, Items.bowl); - add(new ItemStack(Items.cookie, 8), "#X#", 'X', Items.cocoa, '#', Items.wheats); + add(new ItemStack(Items.cookie, 8), "#X#", 'X', Items.cocoa_powder, '#', Items.wheats); add(new ItemStack(Items.melon_block), "MMM", "MMM", "MMM", 'M', Items.melon); add(new ItemStack(Items.melon_stem), "M", 'M', Items.melon); add(new ItemStack(Items.pumpkin_stem, 4), "M", 'M', Items.pumpkin); @@ -218,7 +218,6 @@ public abstract class CraftingRegistry Item slab = ItemRegistry.byName(wood.getName() + "_slab"); add(new ItemStack(slab, 6), "###", '#', planks); add(new ItemStack(ItemRegistry.byName(wood.getName() + "_stairs"), 4), "# ", "## ", "###", '#', planks); - add(new ItemStack(Items.daylight_detector), "GGG", "QQQ", "WWW", 'G', Items.glass, 'Q', Items.quartz, 'W', slab); add(new ItemStack(Items.chest), "###", "# #", "###", '#', planks); add(new ItemStack(Items.workbench), "##", "##", '#', planks); @@ -281,7 +280,7 @@ public abstract class CraftingRegistry add(new ItemStack(Items.tnt_minecart, 1), "A", "B", 'A', Items.tnt, 'B', Items.minecart); add(new ItemStack(Items.bucket, 1), "# #", " # ", '#', Items.iron_ingot); add(new ItemStack(Items.flowerpot, 1), "# #", " # ", '#', Items.brick); - addShapeless(new ItemStack(Items.flint_and_steel, 1), new ItemStack(Items.iron_ingot, 1), new ItemStack(Items.flint, 1)); + addShapeless(new ItemStack(Items.lighter, 1), new ItemStack(Items.iron_ingot, 1), new ItemStack(Items.flint, 1)); add(new ItemStack(Items.bread, 1), "###", '#', Items.wheats); add(new ItemStack(Items.fishing_rod, 1), " #", " #X", "# X", '#', Items.stick, 'X', Items.string); diff --git a/common/src/main/java/common/init/ItemRegistry.java b/common/src/main/java/common/init/ItemRegistry.java index b22ae9a8..6b6f550c 100755 --- a/common/src/main/java/common/init/ItemRegistry.java +++ b/common/src/main/java/common/init/ItemRegistry.java @@ -61,7 +61,7 @@ import common.item.tool.ItemFireball; import common.item.tool.ItemRocketLauncher; import common.item.tool.ItemFishFood; import common.item.tool.ItemFishingRod; -import common.item.tool.ItemFlintAndSteel; +import common.item.tool.ItemFire; import common.item.tool.ItemFood; import common.item.tool.ItemGlassBottle; import common.item.tool.ItemHoe; @@ -222,9 +222,9 @@ public abstract class ItemRegistry { register("weather_token_" + weather.getName(), new ItemWeatherToken(weather).setTab(CheatTab.MAGIC)); } - register("flint_and_steel", (new ItemFlintAndSteel(Blocks.fire)).setDisplay("Feuerzeug")); - register("burning_soul", (new ItemFlintAndSteel(Blocks.soul_fire)).setDisplay("Brennende Seele")); - register("dark_lighter", (new ItemFlintAndSteel(Blocks.black_fire)).setDisplay("Verdunkelndes Feuerzeug")); + register("lighter", (new ItemFire(Blocks.fire)).setDisplay("Feuerzeug")); + register("burning_soul", (new ItemFire(Blocks.soul_fire)).setDisplay("Brennende Seele")); + register("dark_lighter", (new ItemFire(Blocks.black_fire)).setDisplay("Verdunkelndes Feuerzeug")); register("apple", (new ItemFood(4, false)).setDisplay("Apfel").setMaxAmount(StackSize.L)); register("bow", (new ItemBow()).setDisplay("Bogen")); register("boltgun", (new ItemBoltgun()).setDisplay("Bolter")); @@ -270,9 +270,7 @@ public abstract class ItemRegistry { } Item lapis = null; for(DyeColor color : DyeColor.values()) { - if(color == DyeColor.BROWN) - continue; - Item dye = new ItemDye(color, null); + Item dye = new ItemDye(color); if(color == DyeColor.BLUE) lapis = dye; register(color.getDye(), dye); @@ -288,7 +286,7 @@ public abstract class ItemRegistry { register("rotten_flesh", (new ItemFood(4, true)).setDisplay("Verrottetes Fleisch")); register("orb", (new ItemFragile()).setDisplay("Kugel").setTab(CheatTab.MAGIC)); register("demon_rod", (new Item()).setDisplay("Dämonenrute").setTab(CheatTab.MATERIALS).setMaxAmount(StackSize.XL)); - register("tear", (new Item()).setDisplay("Träne").setTab(CheatTab.MATERIALS).setMaxAmount(StackSize.XL)); + register("gold_coin", (new Item()).setDisplay("Goldmünze").setTab(CheatTab.MATERIALS).setMaxAmount(StackSize.XL)); register("gold_nugget", (new Item()).setDisplay("Goldnugget").setTab(CheatTab.METALS).setMaxAmount(StackSize.XL)); register("glass_bottle", (new ItemGlassBottle()).setDisplay("Glasflasche")); for(Pair pot : ItemPotion.getBasePotions()) { diff --git a/common/src/main/java/common/init/Items.java b/common/src/main/java/common/init/Items.java index d4a21a6e..b303c49b 100755 --- a/common/src/main/java/common/init/Items.java +++ b/common/src/main/java/common/init/Items.java @@ -59,7 +59,7 @@ import common.item.tool.ItemFireball; import common.item.tool.ItemRocketLauncher; import common.item.tool.ItemFishFood; import common.item.tool.ItemFishingRod; -import common.item.tool.ItemFlintAndSteel; +import common.item.tool.ItemFire; import common.item.tool.ItemFood; import common.item.tool.ItemGlassBottle; import common.item.tool.ItemHoe; @@ -223,7 +223,7 @@ public abstract class Items { public static final ItemBlock brown_mushroom_block = get("brown_mushroom_block"); public static final ItemBlock brown_wool = get("brown_wool"); public static final ItemBucket bucket = get("bucket"); - public static final ItemFlintAndSteel burning_soul = get("burning_soul"); + public static final ItemFire burning_soul = get("burning_soul"); public static final ItemBlock cactus = get("cactus"); public static final ItemDye cactus_green = get("cactus_green"); public static final ItemBlock cake = get("cake"); @@ -284,7 +284,7 @@ public abstract class Items { public static final ItemSlab cobblestone_slab = get("cobblestone_slab"); public static final ItemBlock cobblestone_stairs = get("cobblestone_stairs"); public static final ItemWall cobblestone_wall = get("cobblestone_wall"); - public static final ItemDye cocoa = get("cocoa"); + public static final ItemDye cocoa_powder = get("cocoa_powder"); public static final ItemBlock construction_table = get("construction_table"); public static final ItemFood cooked_beef = get("cooked_beef"); public static final ItemFood cooked_chicken = get("cooked_chicken"); @@ -303,7 +303,7 @@ public abstract class Items { public static final ItemBlock cyan_wool = get("cyan_wool"); public static final ItemBlock daisy = get("daisy"); public static final ItemBlock dandelion = get("dandelion"); - public static final ItemFlintAndSteel dark_lighter = get("dark_lighter"); + public static final ItemFire dark_lighter = get("dark_lighter"); public static final ItemDoor dark_oak_door = get("dark_oak_door"); public static final ItemFence dark_oak_fence = get("dark_oak_fence"); public static final ItemBlock dark_oak_fence_gate = get("dark_oak_fence_gate"); @@ -317,7 +317,6 @@ public abstract class Items { public static final ItemBlock dark_oak_sapling = get("dark_oak_sapling"); public static final ItemSlab dark_oak_slab = get("dark_oak_slab"); public static final ItemBlock dark_oak_stairs = get("dark_oak_stairs"); - public static final ItemBlock daylight_detector = get("daylight_detector"); public static final ItemBlock dead_bush = get("dead_bush"); public static final ItemBlock deadbush = get("deadbush"); public static final Item diamond = get("diamond"); @@ -367,14 +366,14 @@ public abstract class Items { public static final ItemFireball fireball = get("fireball"); public static final ItemFishingRod fishing_rod = get("fishing_rod"); public static final Item flint = get("flint"); - public static final ItemFlintAndSteel flint_and_steel = get("flint_and_steel"); + public static final ItemFire lighter = get("lighter"); public static final ItemBlock floor_tiles = get("floor_tiles"); public static final ItemBlock floor_tiles_black = get("floor_tiles_black"); public static final ItemBlock floor_tiles_red = get("floor_tiles_red"); public static final ItemBlock floor_tiles_white = get("floor_tiles_white"); public static final ItemBlock flowerpot = get("flowerpot"); public static final ItemBlock furnace = get("furnace"); - public static final Item tear = get("tear"); + public static final Item gold_coin = get("gold_coin"); public static final Item ghi_fragment = get("ghi_fragment"); public static final ItemBlock glass = get("glass"); public static final ItemGlassBottle glass_bottle = get("glass_bottle"); diff --git a/common/src/main/java/common/init/WoodType.java b/common/src/main/java/common/init/WoodType.java index aa76f8dc..a7b97b1f 100755 --- a/common/src/main/java/common/init/WoodType.java +++ b/common/src/main/java/common/init/WoodType.java @@ -3,10 +3,10 @@ package common.init; import common.color.Colorizer; public enum WoodType { - OAK("oak", "Eichen", null, 20, "apple"), + OAK("oak", "Eichen", null, 20, "apple", 200), SPRUCE("spruce", "Fichten", Colorizer.PINE, 20), BIRCH("birch", "Birken", Colorizer.BIRCH, 20), - JUNGLE("jungle", "Tropen", null, 40), + JUNGLE("jungle", "Tropen", null, 40, "cocoa_powder", 350), ACACIA("acacia", "Akazien", null, 20), DARK_OAK("dark_oak", "Schwarzeichen", null, 20), CHERRY("cherry", "Kirsch", Colorizer.NONE, 20), @@ -17,17 +17,19 @@ public enum WoodType { private final String name; private final Colorizer tintType; private final int sapChance; + private final int dropChance; private final String item; private final String display; private WoodType(String name, String display, Colorizer tint, int sapChance) { - this(name, display, tint, sapChance, null); + this(name, display, tint, sapChance, null, 0); } - private WoodType(String name, String display, Colorizer tint, int sapChance, String item) { + private WoodType(String name, String display, Colorizer tint, int sapChance, String item, int dropChance) { this.name = name; this.tintType = tint; this.sapChance = sapChance; + this.dropChance = dropChance; this.item = item; this.display = display; } @@ -40,6 +42,10 @@ public enum WoodType { return this.sapChance; } + public int getDropChance() { + return this.dropChance; + } + public String toString() { return this.name; } diff --git a/common/src/main/java/common/item/CheatTab.java b/common/src/main/java/common/item/CheatTab.java index 50d26d9a..f06cf77e 100755 --- a/common/src/main/java/common/item/CheatTab.java +++ b/common/src/main/java/common/item/CheatTab.java @@ -74,7 +74,7 @@ public enum CheatTab { }, TOOLS("Werkzeug", false) { protected Item getIconItem() { - return Items.flint_and_steel; + return Items.lighter; } }, LIQUIDS("Flüssigkeiten", false) { diff --git a/common/src/main/java/common/item/block/ItemBlock.java b/common/src/main/java/common/item/block/ItemBlock.java index 16d45eed..52762d75 100755 --- a/common/src/main/java/common/item/block/ItemBlock.java +++ b/common/src/main/java/common/item/block/ItemBlock.java @@ -111,7 +111,7 @@ public class ItemBlock extends Item } public Transform getTransform() { - return this.block.getRenderType() == 2 ? Transform.IDENTITY : (this.block.hasBlockFlatTexture() ? super.getTransform() : this.block.getTransform()); + return this.block.getRenderType() == 2 ? super.getTransform() : (this.block.hasBlockFlatTexture() ? super.getTransform() : this.block.getTransform()); } public Model getModel(ModelProvider provider, String name) { diff --git a/common/src/main/java/common/item/block/ItemSign.java b/common/src/main/java/common/item/block/ItemSign.java index 100f5522..18297ab4 100755 --- a/common/src/main/java/common/item/block/ItemSign.java +++ b/common/src/main/java/common/item/block/ItemSign.java @@ -8,6 +8,8 @@ import common.init.Blocks; import common.item.CheatTab; import common.item.Item; import common.item.ItemStack; +import common.model.Model; +import common.model.ModelProvider; import common.tileentity.TileEntity; import common.tileentity.TileEntitySign; import common.util.BlockPos; @@ -83,4 +85,8 @@ public class ItemSign extends Item } } } + + public Model getModel(ModelProvider provider, String name) { + return provider.getModel(provider.getEntityModel(), this.getTransform()); + } } diff --git a/common/src/main/java/common/item/material/ItemDye.java b/common/src/main/java/common/item/material/ItemDye.java index 1be53cad..dfc3acde 100755 --- a/common/src/main/java/common/item/material/ItemDye.java +++ b/common/src/main/java/common/item/material/ItemDye.java @@ -1,9 +1,7 @@ package common.item.material; import common.block.Block; -import common.block.Rotatable; import common.block.artificial.BlockBed; -import common.block.foliage.BlockCocoa; import common.block.foliage.IGrowable; import common.color.DyeColor; import common.entity.animal.EntitySheep; @@ -15,9 +13,6 @@ import common.item.CheatTab; import common.item.Item; import common.item.ItemStack; import common.item.StackSize; -import common.model.Model; -import common.model.ModelProvider; -import common.model.Transform; import common.tileentity.TileEntity; import common.util.BlockPos; import common.util.Facing; @@ -31,17 +26,15 @@ public class ItemDye extends Item { private static final ItemDye[] DIES = new ItemDye[DyeColor.values().length]; private final DyeColor color; - private final Block block; public static ItemDye getByColor(DyeColor color) { return DIES[color.ordinal()]; } - public ItemDye(DyeColor color, Block block) + public ItemDye(DyeColor color) { this.color = color; - this.block = block; - this.setTab(color == DyeColor.BROWN ? CheatTab.PLANTS : (color == DyeColor.BLUE ? CheatTab.METALS : CheatTab.MATERIALS)); + this.setTab(color == DyeColor.BLUE ? CheatTab.METALS : CheatTab.MATERIALS); this.setDisplay(color.getDyeName()); this.setMaxAmount(StackSize.XXL); DIES[this.color.ordinal()] = this; @@ -50,10 +43,6 @@ public class ItemDye extends Item { public DyeColor getColor() { return this.color; } - - public Block getBlock() { - return this.block; - } /** * Called when a Block is right-clicked with this Item @@ -78,39 +67,6 @@ public class ItemDye extends Item { return true; } } - else if (this.color == DyeColor.BROWN) - { - State iblockstate = worldIn.getState(pos); - Block block = iblockstate.getBlock(); - - if (block == Blocks.jungle_log) // && iblockstate.getValue(BlockPlanks.VARIANT) == BlockPlanks.EnumType.JUNGLE) - { - if (side == Facing.DOWN) - { - return false; - } - - if (side == Facing.UP) - { - return false; - } - - pos = pos.offset(side); - - if (worldIn.isAirBlock(pos)) - { - State iblockstate1 = this.block.onBlockPlaced(worldIn, pos, side, hitX, hitY, hitZ, playerIn); - worldIn.setState(pos, iblockstate1, 2); - -// if (!playerIn.creative) -// { - stack.decrSize(); -// } - } - - return true; - } - } State iblockstate = worldIn.getState(pos); if(iblockstate.getBlock() instanceof BlockBed) { Block bedBlock = BlockRegistry.byName(this.color.getName() + "_bed"); @@ -240,14 +196,4 @@ public class ItemDye extends Item { public int getDispenseSoundId() { return this.color == DyeColor.WHITE ? 0 : super.getDispenseSoundId(); } - - public Transform getTransform() { - return this.block == null ? super.getTransform() : this.block.getTransform(); - } - - public Model getModel(ModelProvider provider, String name) { - return this.block == null ? super.getModel(provider, name) : - provider.getModel(this.block.getModel(provider, - BlockRegistry.getName(this.block), this.block instanceof BlockCocoa ? this.block.getState().withProperty(BlockCocoa.FACING, Facing.SOUTH).withProperty(BlockCocoa.AGE, 2) : this.block.getState()), this.getTransform()); - } } diff --git a/common/src/main/java/common/item/tool/ItemArmor.java b/common/src/main/java/common/item/tool/ItemArmor.java index 957eba87..ca36c059 100755 --- a/common/src/main/java/common/item/tool/ItemArmor.java +++ b/common/src/main/java/common/item/tool/ItemArmor.java @@ -120,17 +120,10 @@ public class ItemArmor extends Item public boolean isMagnetic() { return this.material.isMagnetic(); } - - public Model getModel(ModelProvider provider, String name) { - if(this.material.canBeDyed()) - return provider.getModel(this.getTransform(), name, name + "_overlay"); - else - return super.getModel(provider, name); - } - -// public Set getValidTags() { -// return Sets.newHashSet("color"); -// } + + public Model getModel(ModelProvider provider, String name) { + return provider.getModel(provider.getEntityModel(), this.getTransform()); + } public static int getArmorPosition(ItemStack stack) { // if(stack.getItem() != Items.pumpkin && stack.getItem() != Items.skull) { diff --git a/common/src/main/java/common/item/tool/ItemFlintAndSteel.java b/common/src/main/java/common/item/tool/ItemFire.java similarity index 96% rename from common/src/main/java/common/item/tool/ItemFlintAndSteel.java rename to common/src/main/java/common/item/tool/ItemFire.java index f236c36b..a4daf348 100755 --- a/common/src/main/java/common/item/tool/ItemFlintAndSteel.java +++ b/common/src/main/java/common/item/tool/ItemFire.java @@ -14,11 +14,11 @@ import common.util.Facing; import common.util.Vec3; import common.world.World; -public class ItemFlintAndSteel extends Item +public class ItemFire extends Item { private final BlockFire fireBlock; - public ItemFlintAndSteel(BlockFire fireBlock) + public ItemFire(BlockFire fireBlock) { this.fireBlock = fireBlock; this.setMaxDamage(64); diff --git a/common/src/main/java/common/item/tool/ItemGlassBottle.java b/common/src/main/java/common/item/tool/ItemGlassBottle.java index fb673332..815b2ee3 100755 --- a/common/src/main/java/common/item/tool/ItemGlassBottle.java +++ b/common/src/main/java/common/item/tool/ItemGlassBottle.java @@ -67,6 +67,6 @@ public class ItemGlassBottle extends Item } public Model getModel(ModelProvider provider, String name) { - return provider.getModel(this.getTransform(), "potion_bottle_empty"); + return provider.getModel(this.getTransform(), "bottle"); } } diff --git a/common/src/main/java/common/item/tool/ItemPotion.java b/common/src/main/java/common/item/tool/ItemPotion.java index f872a5f8..b7d720cb 100755 --- a/common/src/main/java/common/item/tool/ItemPotion.java +++ b/common/src/main/java/common/item/tool/ItemPotion.java @@ -254,7 +254,7 @@ public class ItemPotion extends Item } public Model getModel(ModelProvider provider, String name) { - return provider.getModel(this.getTransform(), "potion_overlay", "potion_bottle_drinkable"); + return provider.getModel(this.getTransform(), "potion_overlay", "bottle"); } public ItemStack dispenseStack(World world, TileEntity source, Vec3 position, BlockPos blockpos, Facing facing, ItemStack stack) { diff --git a/common/src/main/java/common/tileentity/TileEntityComparator.java b/common/src/main/java/common/tileentity/TileEntityComparator.java deleted file mode 100755 index 67eeb4ff..00000000 --- a/common/src/main/java/common/tileentity/TileEntityComparator.java +++ /dev/null @@ -1,34 +0,0 @@ -package common.tileentity; - -import common.tags.TagObject; - -public class TileEntityComparator extends TileEntity -{ - private int outputSignal; - - public void writeTags(TagObject compound) - { - super.writeTags(compound); - compound.setInt("OutputSignal", this.outputSignal); - } - - public void readTags(TagObject compound) - { - super.readTags(compound); - this.outputSignal = compound.getInt("OutputSignal"); - } - - public int getOutputSignal() - { - return this.outputSignal; - } - - public void setOutputSignal(int p_145995_1_) - { - this.outputSignal = p_145995_1_; - } - - public int getColor() { - return 0xaf0000; - } -} diff --git a/common/src/main/java/common/tileentity/TileEntityDaylightDetector.java b/common/src/main/java/common/tileentity/TileEntityDaylightDetector.java deleted file mode 100755 index a2afb5db..00000000 --- a/common/src/main/java/common/tileentity/TileEntityDaylightDetector.java +++ /dev/null @@ -1,33 +0,0 @@ -package common.tileentity; - -import common.block.tech.BlockDaylightDetector; -import common.world.AWorldServer; - -public class TileEntityDaylightDetector extends TileEntity implements ITickable -{ - private int updateTimer; - - public void update() - { - if (this.worldObj != null && !this.worldObj.client) - { - if(this.updateTimer <= 0) { - this.blockType = this.getBlockType(); - - if (this.blockType instanceof BlockDaylightDetector) - { - ((BlockDaylightDetector)this.blockType).updatePower((AWorldServer)this.worldObj, this.pos); - } - - this.updateTimer = 20; - } - else { - --this.updateTimer; - } - } - } - - public int getColor() { - return 0xffffaf; - } -} diff --git a/common/src/main/java/common/tileentity/TileEntityHopper.java b/common/src/main/java/common/tileentity/TileEntityHopper.java index cb7864ff..be993f58 100755 --- a/common/src/main/java/common/tileentity/TileEntityHopper.java +++ b/common/src/main/java/common/tileentity/TileEntityHopper.java @@ -224,7 +224,7 @@ public class TileEntityHopper extends TileEntityInventory implements ITickable if (!this.isFull()) { - flag = captureDroppedItems(this) || flag; + flag = captureDroppedItems(this, state.getValue(BlockHopper.FACING) != Facing.UP) || flag; } if (flag) @@ -382,13 +382,13 @@ public class TileEntityHopper extends TileEntityInventory implements ITickable return true; } - public static boolean captureDroppedItems(TileEntityHopper p_145891_0_) + public static boolean captureDroppedItems(TileEntityHopper te, boolean down) { - IInventory iinventory = getHopperInventory(p_145891_0_); + IInventory iinventory = getHopperInventory(te, !down); if (iinventory != null) { - Facing enumfacing = Facing.DOWN; + Facing enumfacing = down ? Facing.UP : Facing.DOWN; if (isInventoryEmpty(iinventory, enumfacing)) { @@ -402,7 +402,7 @@ public class TileEntityHopper extends TileEntityInventory implements ITickable for (int i = 0; i < aint.length; ++i) { - if (pullItemFromSlot(p_145891_0_, iinventory, aint[i], enumfacing)) + if (pullItemFromSlot(te, iinventory, aint[i], enumfacing)) { return true; } @@ -414,18 +414,18 @@ public class TileEntityHopper extends TileEntityInventory implements ITickable for (int k = 0; k < j; ++k) { - if (pullItemFromSlot(p_145891_0_, iinventory, k, enumfacing)) + if (pullItemFromSlot(te, iinventory, k, enumfacing)) { return true; } } } } - else + else if(down) { - for (EntityItem entityitem : func_181556_a(p_145891_0_.getWorld(), p_145891_0_.getXPos(), p_145891_0_.getYPos() + 1.0D, p_145891_0_.getZPos())) + for (EntityItem entityitem : func_181556_a(te.getWorld(), te.getXPos(), te.getYPos() + 1.0D, te.getZPos())) { - if (putDropInInventoryAllSlots(p_145891_0_, entityitem)) + if (putDropInInventoryAllSlots(te, entityitem)) { return true; } @@ -600,9 +600,9 @@ public class TileEntityHopper extends TileEntityInventory implements ITickable /** * Returns the IInventory for the specified hopper */ - public static IInventory getHopperInventory(TileEntityHopper hopper) + public static IInventory getHopperInventory(TileEntityHopper hopper, boolean down) { - return getInventoryAtPosition(hopper.getWorld(), hopper.getXPos(), hopper.getYPos() + 1.0D, hopper.getZPos()); + return getInventoryAtPosition(hopper.getWorld(), hopper.getXPos(), hopper.getYPos() + (down ? -1.0 : 1.0), hopper.getZPos()); } public static List func_181556_a(World p_181556_0_, double p_181556_1_, double p_181556_3_, double p_181556_5_) diff --git a/server/src/main/java/server/clipboard/ReorderRegistry.java b/server/src/main/java/server/clipboard/ReorderRegistry.java index 763c6748..d9da2e2e 100755 --- a/server/src/main/java/server/clipboard/ReorderRegistry.java +++ b/server/src/main/java/server/clipboard/ReorderRegistry.java @@ -81,7 +81,6 @@ public abstract class ReorderRegistry { PLACE_LAST.add(Blocks.soul_wart); PLACE_LAST.add(Blocks.piston); PLACE_LAST.add(Blocks.sticky_piston); - PLACE_LAST.add(Blocks.cocoa); PLACE_LAST.add(Blocks.tripwire_hook); PLACE_LAST.add(Blocks.string); for(BlockFlowerPot block : BlockFlowerPot.POTS) { @@ -102,8 +101,6 @@ public abstract class ReorderRegistry { for(BlockDoublePlant block : BlockDoublePlant.PLANTS) { PLACE_LAST.add(block); } - PLACE_LAST.add(Blocks.daylight_detector_inverted); - // shouldPlaceLast.add(Blocks.daylight_detector); PLACE_LAST.add(Blocks.blue_mushroom); PLACE_LAST.add(Blocks.red_button); } diff --git a/server/src/main/java/server/world/Converter.java b/server/src/main/java/server/world/Converter.java index bd3ff584..8e1c5ae9 100644 --- a/server/src/main/java/server/world/Converter.java +++ b/server/src/main/java/server/world/Converter.java @@ -38,7 +38,6 @@ import common.block.artificial.BlockTrapDoor.DoorHalf; import common.block.artificial.BlockWool; import common.block.foliage.BlockCactus; import common.block.foliage.BlockCarrot; -import common.block.foliage.BlockCocoa; import common.block.foliage.BlockCrops; import common.block.foliage.BlockDoublePlant; import common.block.foliage.BlockFarmland; @@ -62,7 +61,6 @@ import common.block.tech.BlockBrewingStand; import common.block.tech.BlockButton; import common.block.tech.BlockCauldron; import common.block.tech.BlockChest; -import common.block.tech.BlockDaylightDetector; import common.block.tech.BlockDispenser; import common.block.tech.BlockDropper; import common.block.tech.BlockFurnace; @@ -104,10 +102,7 @@ import common.log.Log; import common.rng.Random; import common.tags.TagObject; import common.tileentity.TileEntity; -import common.tileentity.DeviceEffectGenerator; import common.tileentity.TileEntityChest; -import common.tileentity.TileEntityComparator; -import common.tileentity.TileEntityDaylightDetector; import common.tileentity.TileEntityDispenser; import common.tileentity.TileEntityDropper; import common.tileentity.TileEntityFurnace; @@ -364,10 +359,7 @@ public abstract class Converter { mapTile(TileEntityDispenser.class, "Trap", "dispenser"); mapTile(TileEntityDropper.class, "Dropper", "dropper"); mapTile(TileEntitySign.class, "Sign", "sign"); - mapTile(DeviceEffectGenerator.class, "Beacon", "beacon"); - mapTile(TileEntityDaylightDetector.class, "DLDetector", "daylight_detector"); mapTile(TileEntityHopper.class, "Hopper", "hopper"); - mapTile(TileEntityComparator.class, "Comparator", "comparator"); Arrays.fill(BLOCK_MAP, Blocks.air.getState()); @@ -1032,18 +1024,6 @@ public abstract class Converter { 126, 12); mapBlock(Blocks.dark_oak_slab.getState().withProperty(BlockSlab.FACING, Facing.UP), 126, 13); - mapBlock(Blocks.cocoa.getState().withProperty(BlockCocoa.AGE, 0).withProperty(BlockCocoa.FACING, Facing.SOUTH), 127, 0, 12); - mapBlock(Blocks.cocoa.getState().withProperty(BlockCocoa.AGE, 0).withProperty(BlockCocoa.FACING, Facing.WEST), 127, 1, 13); - mapBlock(Blocks.cocoa.getState().withProperty(BlockCocoa.AGE, 0).withProperty(BlockCocoa.FACING, Facing.NORTH), 127, 2, 14); - mapBlock(Blocks.cocoa.getState().withProperty(BlockCocoa.AGE, 0).withProperty(BlockCocoa.FACING, Facing.EAST), 127, 3, 15); - mapBlock(Blocks.cocoa.getState().withProperty(BlockCocoa.AGE, 1).withProperty(BlockCocoa.FACING, Facing.SOUTH), 127, 4); - mapBlock(Blocks.cocoa.getState().withProperty(BlockCocoa.AGE, 1).withProperty(BlockCocoa.FACING, Facing.WEST), 127, 5); - mapBlock(Blocks.cocoa.getState().withProperty(BlockCocoa.AGE, 1).withProperty(BlockCocoa.FACING, Facing.NORTH), 127, 6); - mapBlock(Blocks.cocoa.getState().withProperty(BlockCocoa.AGE, 1).withProperty(BlockCocoa.FACING, Facing.EAST), 127, 7); - mapBlock(Blocks.cocoa.getState().withProperty(BlockCocoa.AGE, 2).withProperty(BlockCocoa.FACING, Facing.SOUTH), 127, 8); - mapBlock(Blocks.cocoa.getState().withProperty(BlockCocoa.AGE, 2).withProperty(BlockCocoa.FACING, Facing.WEST), 127, 9); - mapBlock(Blocks.cocoa.getState().withProperty(BlockCocoa.AGE, 2).withProperty(BlockCocoa.FACING, Facing.NORTH), 127, 10); - mapBlock(Blocks.cocoa.getState().withProperty(BlockCocoa.AGE, 2).withProperty(BlockCocoa.FACING, Facing.EAST), 127, 11); mapBlock(Blocks.sandstone_stairs.getState().withProperty(BlockStairs.FACING, Facing.EAST).withProperty(BlockStairs.HALF, EnumHalf.BOTTOM), 128, 0, 8); mapBlock(Blocks.sandstone_stairs.getState().withProperty(BlockStairs.FACING, Facing.WEST).withProperty(BlockStairs.HALF, EnumHalf.BOTTOM), 128, 1, 9); mapBlock(Blocks.sandstone_stairs.getState().withProperty(BlockStairs.FACING, Facing.SOUTH).withProperty(BlockStairs.HALF, EnumHalf.BOTTOM), 128, 2, 10); @@ -1115,7 +1095,7 @@ public abstract class Converter { mapBlock(Blocks.spruce_stairs.getState().withProperty(BlockStairs.FACING, Facing.SOUTH).withProperty(BlockStairs.HALF, EnumHalf.TOP), 136, 6, 14); mapBlock(Blocks.spruce_stairs.getState().withProperty(BlockStairs.FACING, Facing.NORTH).withProperty(BlockStairs.HALF, EnumHalf.TOP), 136, 7, 15); mapBlock(Blocks.obsidian, 137); - mapBlock(Blocks.effect_generator, 138); + mapBlock(Blocks.glass, 138); mapBlock(Blocks.cobblestone_wall, 139); mapBlock(Blocks.mossy_cobblestone_wall, 139, 1); mapBlock(Blocks.flowerpot, 140); @@ -1191,23 +1171,7 @@ public abstract class Converter { mapBlock(Blocks.heavy_weighted_pressure_plate.getState().withProperty(BlockPressurePlateWeighted.POWER, 13), 148, 13); mapBlock(Blocks.heavy_weighted_pressure_plate.getState().withProperty(BlockPressurePlateWeighted.POWER, 14), 148, 14); mapBlock(Blocks.heavy_weighted_pressure_plate.getState().withProperty(BlockPressurePlateWeighted.POWER, 15), 148, 15); - mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 0), 151, 0); - mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 1), 151, 1); - mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 2), 151, 2); - mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 3), 151, 3); - mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 4), 151, 4); - mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 5), 151, 5); - mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 6), 151, 6); - mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 7), 151, 7); - mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 8), 151, 8); - mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 9), 151, 9); - mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 10), 151, 10); - mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 11), 151, 11); - mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 12), 151, 12); - mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 13), 151, 13); - mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 14), 151, 14); - mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 15), 151, 15); - mapBlock(Blocks.charged_block, 152); + mapBlock(Blocks.cobblestone, 152); mapBlock(Blocks.quartz_ore, 153); mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.FACING, Facing.DOWN), 154, 0, 1, 6, 7); mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.FACING, Facing.NORTH), 154, 2); @@ -1343,22 +1307,6 @@ public abstract class Converter { mapBlock(Blocks.large_fern, 175, 3); mapBlock(Blocks.rose_bush, 175, 4); mapBlock(Blocks.paeonia, 175, 5); - mapBlock(Blocks.daylight_detector_inverted.getState().withProperty(BlockDaylightDetector.POWER, 0), 178, 0); - mapBlock(Blocks.daylight_detector_inverted.getState().withProperty(BlockDaylightDetector.POWER, 1), 178, 1); - mapBlock(Blocks.daylight_detector_inverted.getState().withProperty(BlockDaylightDetector.POWER, 2), 178, 2); - mapBlock(Blocks.daylight_detector_inverted.getState().withProperty(BlockDaylightDetector.POWER, 3), 178, 3); - mapBlock(Blocks.daylight_detector_inverted.getState().withProperty(BlockDaylightDetector.POWER, 4), 178, 4); - mapBlock(Blocks.daylight_detector_inverted.getState().withProperty(BlockDaylightDetector.POWER, 5), 178, 5); - mapBlock(Blocks.daylight_detector_inverted.getState().withProperty(BlockDaylightDetector.POWER, 6), 178, 6); - mapBlock(Blocks.daylight_detector_inverted.getState().withProperty(BlockDaylightDetector.POWER, 7), 178, 7); - mapBlock(Blocks.daylight_detector_inverted.getState().withProperty(BlockDaylightDetector.POWER, 8), 178, 8); - mapBlock(Blocks.daylight_detector_inverted.getState().withProperty(BlockDaylightDetector.POWER, 9), 178, 9); - mapBlock(Blocks.daylight_detector_inverted.getState().withProperty(BlockDaylightDetector.POWER, 10), 178, 10); - mapBlock(Blocks.daylight_detector_inverted.getState().withProperty(BlockDaylightDetector.POWER, 11), 178, 11); - mapBlock(Blocks.daylight_detector_inverted.getState().withProperty(BlockDaylightDetector.POWER, 12), 178, 12); - mapBlock(Blocks.daylight_detector_inverted.getState().withProperty(BlockDaylightDetector.POWER, 13), 178, 13); - mapBlock(Blocks.daylight_detector_inverted.getState().withProperty(BlockDaylightDetector.POWER, 14), 178, 14); - mapBlock(Blocks.daylight_detector_inverted.getState().withProperty(BlockDaylightDetector.POWER, 15), 178, 15); mapBlock(Blocks.sandstone, 179); mapBlock(Blocks.carved_sandstone, 179, 1); mapBlock(Blocks.smooth_sandstone, 179, 2); @@ -1636,9 +1584,6 @@ public abstract class Converter { nent.setString("Text" + (i + 1), signText[i]); } } - else if(clazz == TileEntityComparator.class) { - nent.setInt("OutputSignal", ent.getInt("OutputSignal")); - } return nent; } diff --git a/server/src/main/java/server/worldgen/LootConstants.java b/server/src/main/java/server/worldgen/LootConstants.java index 03e96cdd..566c9858 100755 --- a/server/src/main/java/server/worldgen/LootConstants.java +++ b/server/src/main/java/server/worldgen/LootConstants.java @@ -44,7 +44,7 @@ public abstract class LootConstants { new RngLoot(Items.pumpkin_stem, 2, 4, 10), new RngLoot(Items.saddle, 1, 1, 3), new RngLoot(Items.iron_horse_armor, 1, 1, 1)); public static final WeightedList HELL_FORTRESS = new WeightedList(new RngLoot(Items.diamond, 1, 3, 5), new RngLoot(Items.iron_ingot, 1, 5, 5), new RngLoot(Items.gold_ingot, 1, 3, 15), new RngLoot(Items.gold_sword, 1, 1, 5), - new RngLoot(Items.gold_chestplate, 1, 1, 5), new RngLoot(Items.flint_and_steel, 1, 1, 5), + new RngLoot(Items.gold_chestplate, 1, 1, 5), new RngLoot(Items.lighter, 1, 1, 5), new RngLoot(Items.soul_wart, 3, 7, 5), new RngLoot(Items.saddle, 1, 1, 10), new RngLoot(Items.gold_horse_armor, 1, 1, 8), new RngLoot(Items.iron_horse_armor, 1, 1, 5), new RngLoot(Items.diamond_horse_armor, 1, 1, 3), new RngLoot(Items.obsidian, 2, 4, 2)); diff --git a/server/src/main/java/server/worldgen/tree/WorldGenBaseTree.java b/server/src/main/java/server/worldgen/tree/WorldGenBaseTree.java index cd5cf3ba..17f45fb1 100755 --- a/server/src/main/java/server/worldgen/tree/WorldGenBaseTree.java +++ b/server/src/main/java/server/worldgen/tree/WorldGenBaseTree.java @@ -2,7 +2,6 @@ package server.worldgen.tree; import common.block.Block; import common.block.Material; -import common.block.foliage.BlockCocoa; import common.block.foliage.BlockLeaves; import common.block.foliage.BlockVine; import common.init.Blocks; @@ -203,21 +202,6 @@ public class WorldGenBaseTree extends WorldGenTree } } } - - if (rand.zrange(5) == 0 && i > 5) - { - for (int l3 = 0; l3 < 2; ++l3) - { - for (Facing enumfacing : Facing.Plane.HORIZONTAL) - { - if (rand.zrange(4 - l3) == 0) - { - Facing enumfacing1 = enumfacing.getOpposite(); - this.func_181652_a(worldIn, rand.zrange(3), position.add(enumfacing1.getFrontOffsetX(), i - 5 + l3, enumfacing1.getFrontOffsetZ()), enumfacing); - } - } - } - } } return true; @@ -234,11 +218,6 @@ public class WorldGenBaseTree extends WorldGenTree } } - private void func_181652_a(WorldServer p_181652_1_, int p_181652_2_, BlockPos p_181652_3_, Facing p_181652_4_) - { - this.setBlockAndNotifyAdequately(p_181652_1_, p_181652_3_, Blocks.cocoa.getState().withProperty(BlockCocoa.AGE, p_181652_2_).withProperty(BlockCocoa.FACING, p_181652_4_)); - } - private void func_181651_a(WorldServer p_181651_1_, BlockPos p_181651_2_, PropertyBool p_181651_3_) { this.setBlockAndNotifyAdequately(p_181651_1_, p_181651_2_, Blocks.vine.getState().withProperty(p_181651_3_, Boolean.valueOf(true)));