diff --git a/client/src/main/java/client/renderer/tileentity/TileEntityBannerRenderer.java b/client/src/main/java/client/renderer/tileentity/TileEntityBannerRenderer.java deleted file mode 100755 index 9d35dca7..00000000 --- a/client/src/main/java/client/renderer/tileentity/TileEntityBannerRenderer.java +++ /dev/null @@ -1,142 +0,0 @@ -package client.renderer.tileentity; - -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.lwjgl.opengl.GL11; - -import client.Client; -import client.renderer.GlState; -import client.renderer.model.ModelBanner; -import client.renderer.texture.LayeredColorMaskTexture; -import common.block.tile.BlockBannerStanding; -import common.collect.Lists; -import common.collect.Maps; -import common.color.DyeColor; -import common.init.Blocks; -import common.tileentity.TileEntityBanner; -import common.util.BlockPos; -import common.util.ExtMath; -import common.world.State; - -public class TileEntityBannerRenderer extends TileEntitySpecialRenderer { - private static class TimedTexture { - public long time; - public String texture; - - private TimedTexture() { - } - } - - private static final Map DESIGNS = Maps.newHashMap(); - private static final String BANNERTEXTURES = "textures/blocks/banner.png"; - private ModelBanner bannerModel = new ModelBanner(); - - public void renderTileEntityAt(TileEntityBanner te, double x, double y, double z, float partialTicks, int destroyStage) { - boolean flag = te.getWorld() != null; - boolean flag1 = !flag || te.getBlockType() == Blocks.banner; - int i = 0; - if(flag) { - State state = te.getBlockState(); - if(state.getBlock() == Blocks.banner) - i = state.getValue(BlockBannerStanding.ROTATION); - } -// long j = flag ? te.getWorld().getTime() : 0L; - double j = flag ? (double)(System.nanoTime() / 1000L) / 50000.0 /* te.getWorld().getTime() */ : (double)partialTicks; - GL11.glPushMatrix(); - float f = 0.6666667F; - - if(flag1) { - GL11.glTranslatef((float)x + 0.5F, (float)y + 0.75F * f, (float)z + 0.5F); - float f1 = (float)(i * 360) / 16.0F; - GL11.glRotatef(-f1, 0.0F, 1.0F, 0.0F); - this.bannerModel.bannerStand.showModel = true; - } - else { - float f2 = 0.0F; - - if(i == 2) { - f2 = 180.0F; - } - - if(i == 4) { - f2 = 90.0F; - } - - if(i == 5) { - f2 = -90.0F; - } - - GL11.glTranslatef((float)x + 0.5F, (float)y - 0.25F * f, (float)z + 0.5F); - GL11.glRotatef(-f2, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(0.0F, -0.3125F, -0.4375F); - this.bannerModel.bannerStand.showModel = false; - } - - BlockPos blockpos = te.getPos(); - float f3 = (float)(blockpos.getX() * 7 + blockpos.getY() * 9 + blockpos.getZ() * 13) + (float)j; // + partialTicks; - this.bannerModel.bannerSlate.rotateAngleX = (-0.0125F + 0.01F * ExtMath.cos(f3 * (float)Math.PI * 0.02F)) * (float)Math.PI; - GlState.enableRescaleNormal(); - String resourcelocation = this.getTexture(te); - - if(resourcelocation != null) { - this.bindTexture(resourcelocation); - GL11.glPushMatrix(); - GL11.glScalef(f, -f, -f); - this.bannerModel.renderBanner(); - GL11.glPopMatrix(); - } - - GlState.color(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPopMatrix(); - } - - private String getTexture(TileEntityBanner te) { - String s = te.getPatternResourceLocation(); - - if(s.isEmpty()) { - return null; - } - else { - TimedTexture tex = (TimedTexture)DESIGNS.get(s); - - if(tex == null) { - if(DESIGNS.size() >= 256) { - long i = System.currentTimeMillis(); - Iterator iterator = DESIGNS.keySet().iterator(); - - while(iterator.hasNext()) { - String s1 = (String)iterator.next(); - TimedTexture tileentitybannerrenderer$timedbannertexture1 = (TimedTexture)DESIGNS.get(s1); - - if(i - tileentitybannerrenderer$timedbannertexture1.time > 60000L) { - Client.CLIENT.getTextureManager().deleteTexture(tileentitybannerrenderer$timedbannertexture1.texture); - iterator.remove(); - } - } - - if(DESIGNS.size() >= 256) { - return null; - } - } - - List list1 = te.getPatternList(); - List list = te.getColorList(); - List list2 = Lists.newArrayList(); - - for(TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern : list1) { - list2.add("textures/blocks/banner_" + tileentitybanner$enumbannerpattern.getPatternName() + ".png"); - } - - tex = new TimedTexture(); - tex.texture = s; - Client.CLIENT.getTextureManager().loadTexture(tex.texture, new LayeredColorMaskTexture(BANNERTEXTURES, list2, list)); - DESIGNS.put(s, tex); - } - - tex.time = System.currentTimeMillis(); - return tex.texture; - } - } -} diff --git a/client/src/main/java/client/renderer/tileentity/TileEntityItemStackRenderer.java b/client/src/main/java/client/renderer/tileentity/TileEntityItemStackRenderer.java index d470a793..be544bda 100755 --- a/client/src/main/java/client/renderer/tileentity/TileEntityItemStackRenderer.java +++ b/client/src/main/java/client/renderer/tileentity/TileEntityItemStackRenderer.java @@ -2,7 +2,6 @@ package client.renderer.tileentity; import common.init.Items; import common.item.ItemStack; -import common.tileentity.TileEntityBanner; import common.tileentity.TileEntityChest; public class TileEntityItemStackRenderer { @@ -10,14 +9,9 @@ public class TileEntityItemStackRenderer { private final TileEntityChest chest = new TileEntityChest(0); private final TileEntityChest trapChest = new TileEntityChest(1); - private final TileEntityBanner banner = new TileEntityBanner(); public void renderByItem(ItemStack stack) { - if(stack.getItem() == Items.banner) { - this.banner.setItemValues(stack); - TileEntityRendererDispatcher.instance.renderTileEntityAt(this.banner, 0.0D, 0.0D, 0.0D, 0.0F); - } - else if(stack.getItem() == Items.trapped_chest) { + if(stack.getItem() == Items.trapped_chest) { TileEntityRendererDispatcher.instance.renderTileEntityAt(this.trapChest, 0.0D, 0.0D, 0.0D, 0.0F); } else if(stack.getItem() == Items.chest) { diff --git a/client/src/main/java/client/renderer/tileentity/TileEntityRendererDispatcher.java b/client/src/main/java/client/renderer/tileentity/TileEntityRendererDispatcher.java index a3ecbcf4..b90ad35c 100755 --- a/client/src/main/java/client/renderer/tileentity/TileEntityRendererDispatcher.java +++ b/client/src/main/java/client/renderer/tileentity/TileEntityRendererDispatcher.java @@ -9,7 +9,6 @@ import client.renderer.texture.TextureManager; import common.collect.Maps; import common.entity.Entity; import common.tileentity.TileEntity; -import common.tileentity.TileEntityBanner; import common.tileentity.TileEntityChest; import common.tileentity.TileEntityDisplay; import common.tileentity.TileEntityPiston; @@ -50,7 +49,6 @@ public class TileEntityRendererDispatcher this.mapSpecialRenderers.put(TileEntityDisplay.class, new TileEntityDisplayRenderer()); this.mapSpecialRenderers.put(TileEntityPiston.class, new TileEntityPistonRenderer()); this.mapSpecialRenderers.put(TileEntityChest.class, new TileEntityChestRenderer()); - this.mapSpecialRenderers.put(TileEntityBanner.class, new TileEntityBannerRenderer()); for (TileEntitySpecialRenderer tileentityspecialrenderer : this.mapSpecialRenderers.values()) { diff --git a/client/src/main/resources/textures/blocks/banner.png b/client/src/main/resources/textures/blocks/banner.png deleted file mode 100755 index e38d28e2..00000000 Binary files a/client/src/main/resources/textures/blocks/banner.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_base.png b/client/src/main/resources/textures/blocks/banner_base.png deleted file mode 100755 index bc806033..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_base.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_border.png b/client/src/main/resources/textures/blocks/banner_border.png deleted file mode 100755 index 444aeea7..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_border.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_bricks.png b/client/src/main/resources/textures/blocks/banner_bricks.png deleted file mode 100755 index 544cff4f..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_bricks.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_circle.png b/client/src/main/resources/textures/blocks/banner_circle.png deleted file mode 100755 index c6d3774d..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_circle.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_cross.png b/client/src/main/resources/textures/blocks/banner_cross.png deleted file mode 100755 index c18bf825..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_cross.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_curly_border.png b/client/src/main/resources/textures/blocks/banner_curly_border.png deleted file mode 100755 index 5ea188e1..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_curly_border.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_diagonal_left.png b/client/src/main/resources/textures/blocks/banner_diagonal_left.png deleted file mode 100755 index c6f45ffa..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_diagonal_left.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_diagonal_right.png b/client/src/main/resources/textures/blocks/banner_diagonal_right.png deleted file mode 100755 index 23280c4c..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_diagonal_right.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_diagonal_up_left.png b/client/src/main/resources/textures/blocks/banner_diagonal_up_left.png deleted file mode 100755 index b0955f23..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_diagonal_up_left.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_diagonal_up_right.png b/client/src/main/resources/textures/blocks/banner_diagonal_up_right.png deleted file mode 100755 index e8cd6b18..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_diagonal_up_right.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_flower.png b/client/src/main/resources/textures/blocks/banner_flower.png deleted file mode 100755 index 67dc1ac9..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_flower.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_gradient.png b/client/src/main/resources/textures/blocks/banner_gradient.png deleted file mode 100755 index 8ce98320..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_gradient.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_gradient_up.png b/client/src/main/resources/textures/blocks/banner_gradient_up.png deleted file mode 100755 index 38cf516f..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_gradient_up.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_half_horizontal.png b/client/src/main/resources/textures/blocks/banner_half_horizontal.png deleted file mode 100755 index 0f6d8a7c..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_half_horizontal.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_half_horizontal_bottom.png b/client/src/main/resources/textures/blocks/banner_half_horizontal_bottom.png deleted file mode 100755 index 64fac368..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_half_horizontal_bottom.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_half_vertical.png b/client/src/main/resources/textures/blocks/banner_half_vertical.png deleted file mode 100755 index 8178ea7b..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_half_vertical.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_half_vertical_right.png b/client/src/main/resources/textures/blocks/banner_half_vertical_right.png deleted file mode 100755 index 74089b6c..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_half_vertical_right.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_rhombus.png b/client/src/main/resources/textures/blocks/banner_rhombus.png deleted file mode 100755 index abee9826..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_rhombus.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_rune.png b/client/src/main/resources/textures/blocks/banner_rune.png deleted file mode 100755 index 32e76206..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_rune.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_skull.png b/client/src/main/resources/textures/blocks/banner_skull.png deleted file mode 100755 index ddf86534..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_skull.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_small_stripes.png b/client/src/main/resources/textures/blocks/banner_small_stripes.png deleted file mode 100755 index 0abaef05..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_small_stripes.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_square_bottom_left.png b/client/src/main/resources/textures/blocks/banner_square_bottom_left.png deleted file mode 100755 index 5fdd2459..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_square_bottom_left.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_square_bottom_right.png b/client/src/main/resources/textures/blocks/banner_square_bottom_right.png deleted file mode 100755 index dd64ecaa..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_square_bottom_right.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_square_top_left.png b/client/src/main/resources/textures/blocks/banner_square_top_left.png deleted file mode 100755 index 76289989..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_square_top_left.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_square_top_right.png b/client/src/main/resources/textures/blocks/banner_square_top_right.png deleted file mode 100755 index 4197ecb5..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_square_top_right.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_straight_cross.png b/client/src/main/resources/textures/blocks/banner_straight_cross.png deleted file mode 100755 index 1b7fa7d0..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_straight_cross.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_stripe_bottom.png b/client/src/main/resources/textures/blocks/banner_stripe_bottom.png deleted file mode 100755 index 5473f901..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_stripe_bottom.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_stripe_center.png b/client/src/main/resources/textures/blocks/banner_stripe_center.png deleted file mode 100755 index eddba20e..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_stripe_center.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_stripe_downleft.png b/client/src/main/resources/textures/blocks/banner_stripe_downleft.png deleted file mode 100755 index d73f9b7c..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_stripe_downleft.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_stripe_downright.png b/client/src/main/resources/textures/blocks/banner_stripe_downright.png deleted file mode 100755 index 0b610d9b..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_stripe_downright.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_stripe_left.png b/client/src/main/resources/textures/blocks/banner_stripe_left.png deleted file mode 100755 index 0707d313..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_stripe_left.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_stripe_middle.png b/client/src/main/resources/textures/blocks/banner_stripe_middle.png deleted file mode 100755 index bde988b4..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_stripe_middle.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_stripe_right.png b/client/src/main/resources/textures/blocks/banner_stripe_right.png deleted file mode 100755 index f0a8a252..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_stripe_right.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_stripe_top.png b/client/src/main/resources/textures/blocks/banner_stripe_top.png deleted file mode 100755 index 1b8e3f2b..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_stripe_top.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_thing.png b/client/src/main/resources/textures/blocks/banner_thing.png deleted file mode 100755 index 7ae1cbcc..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_thing.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_triangle_bottom.png b/client/src/main/resources/textures/blocks/banner_triangle_bottom.png deleted file mode 100755 index bc379308..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_triangle_bottom.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_triangle_top.png b/client/src/main/resources/textures/blocks/banner_triangle_top.png deleted file mode 100755 index 77877c0f..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_triangle_top.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_triangles_bottom.png b/client/src/main/resources/textures/blocks/banner_triangles_bottom.png deleted file mode 100755 index fe25db74..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_triangles_bottom.png and /dev/null differ diff --git a/client/src/main/resources/textures/blocks/banner_triangles_top.png b/client/src/main/resources/textures/blocks/banner_triangles_top.png deleted file mode 100755 index f59a121c..00000000 Binary files a/client/src/main/resources/textures/blocks/banner_triangles_top.png and /dev/null differ diff --git a/common/src/main/java/common/block/tech/BlockCauldron.java b/common/src/main/java/common/block/tech/BlockCauldron.java index fcd2dfe9..d5ac1782 100755 --- a/common/src/main/java/common/block/tech/BlockCauldron.java +++ b/common/src/main/java/common/block/tech/BlockCauldron.java @@ -11,7 +11,6 @@ import common.init.Items; import common.item.CheatTab; import common.item.Item; import common.item.ItemStack; -import common.item.block.ItemBanner; import common.item.block.ItemSmallBlock; import common.item.tool.ItemArmor; import common.model.Model; @@ -19,7 +18,6 @@ import common.model.ModelProvider; import common.properties.Property; import common.properties.PropertyInteger; import common.rng.Random; -import common.tileentity.TileEntityBanner; import common.util.BlockPos; import common.util.BoundingBox; import common.util.ExtMath; @@ -553,46 +551,7 @@ public class BlockCauldron extends Block } } - if (i > 0 && item instanceof ItemBanner && TileEntityBanner.getPatterns(itemstack) > 0) - { - ItemStack itemstack1 = itemstack.copy(); - itemstack1.size = 1; - TileEntityBanner.removeBannerData(itemstack1); - - if (itemstack.size <= 1) // && !playerIn.creative) - { - playerIn.inventory.setInventorySlotContents(playerIn.inventory.currentItem, itemstack1); - } - else - { - if (!playerIn.inventory.addItemStackToInventory(itemstack1)) - { - worldIn.spawnEntityInWorld(new EntityItem(worldIn, (double)pos.getX() + 0.5D, (double)pos.getY() + 1.5D, (double)pos.getZ() + 0.5D, itemstack1)); - } - else - { - playerIn.connection.sendContainerToPlayer(playerIn.inventoryContainer); - } - -// playerIn.triggerAchievement(StatRegistry.bannerCleanedStat); - -// if (!playerIn.creative) -// { - --itemstack.size; -// } - } - -// if (!playerIn.creative) -// { - this.setWaterLevel(worldIn, pos, state, i - 1); -// } - - return true; - } - else - { - return false; - } + return false; } } } diff --git a/common/src/main/java/common/block/tile/BlockBanner.java b/common/src/main/java/common/block/tile/BlockBanner.java deleted file mode 100755 index 0a9c3650..00000000 --- a/common/src/main/java/common/block/tile/BlockBanner.java +++ /dev/null @@ -1,144 +0,0 @@ -package common.block.tile; - -import common.block.BlockContainer; -import common.block.Rotatable; -import common.block.Material; -import common.entity.npc.EntityNPC; -import common.init.Items; -import common.item.Item; -import common.item.ItemStack; -import common.model.Transforms; -import common.rng.Random; -import common.tags.TagObject; -import common.tileentity.TileEntity; -import common.tileentity.TileEntityBanner; -import common.util.BlockPos; -import common.util.BoundingBox; -import common.world.IBlockAccess; -import common.world.State; -import common.world.World; - -public class BlockBanner extends BlockContainer implements Rotatable -{ - public BlockBanner() - { - super(Material.WOOD); - float f = 0.25F; - float f1 = 1.0F; - this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f); - } - - public boolean isPickStrict() - { - return true; - } - - public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state) - { - return null; - } - - public BoundingBox getSelectedBoundingBox(World worldIn, BlockPos pos) - { - this.setBlockBoundsBasedOnState(worldIn, pos); - return super.getSelectedBoundingBox(worldIn, pos); - } - - public boolean isFullCube() - { - return false; - } - - public boolean isPassable(IBlockAccess worldIn, BlockPos pos) - { - return true; - } - - /** - * Used to determine ambient occlusion and culling when rebuilding chunks for render - */ - public boolean isOpaqueCube() - { - return false; - } - - /** - * Return true if an entity can be spawned inside the block (used to get the player's bed spawn location) - */ - public boolean canSpawnInBlock() - { - return true; - } - - /** - * Returns a new instance of a block's tile entity class. Called on placing the block. - */ - public TileEntity createNewTileEntity() - { - return new TileEntityBanner(); - } - - /** - * Get the Item that this Block should drop when harvested. - */ - public Item getItemDropped(State state, Random rand, int fortune) - { - return Items.banner; - } - - public Item getItem(World worldIn, BlockPos pos) - { - return Items.banner; - } - - /** - * Spawns this Block's drops into the World as EntityItems. - */ - public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, State state, float chance, int fortune) - { - TileEntity tileentity = worldIn.getTileEntity(pos); - - if (tileentity instanceof TileEntityBanner) - { - ItemStack itemstack = new ItemStack(Items.banner); - TagObject tag = new TagObject(); - tileentity.writeTags(tag); - itemstack.setTagInfo("BlockEntityTag", tag); - spawnAsEntity(worldIn, pos, itemstack); - } - else - { - super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); - } - } - - public boolean canPlaceBlockAt(World worldIn, BlockPos pos) - { - return !this.hasInvalidNeighbor(worldIn, pos) && super.canPlaceBlockAt(worldIn, pos); - } - - public void harvestBlock(World worldIn, EntityNPC player, BlockPos pos, State state, TileEntity te) - { - if (te instanceof TileEntityBanner) - { - TileEntityBanner tileentitybanner = (TileEntityBanner)te; - ItemStack itemstack = new ItemStack(Items.banner); - TagObject tag = new TagObject(); - TileEntityBanner.setBaseColorAndPatterns(tag, tileentitybanner.getBaseColor(), tileentitybanner.getPatterns()); - itemstack.setTagInfo("BlockEntityTag", tag); - spawnAsEntity(worldIn, pos, itemstack); - } - else - { - super.harvestBlock(worldIn, player, pos, state, (TileEntity)null); - } - } - - public Transforms getTransform() { - return Transforms.BANNER; - } - - public String getFallbackTexture() { - return "oak_planks"; - } -} diff --git a/common/src/main/java/common/block/tile/BlockBannerHanging.java b/common/src/main/java/common/block/tile/BlockBannerHanging.java deleted file mode 100644 index 5e109966..00000000 --- a/common/src/main/java/common/block/tile/BlockBannerHanging.java +++ /dev/null @@ -1,70 +0,0 @@ -package common.block.tile; - -import common.block.Block; -import common.item.Item; -import common.properties.Property; -import common.util.BlockPos; -import common.util.Facing; -import common.world.IWorldAccess; -import common.world.State; -import common.world.World; - -public class BlockBannerHanging extends BlockBanner -{ - public BlockBannerHanging() - { - this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH)); - } - - public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos) - { - Facing enumfacing = (Facing)worldIn.getState(pos).getValue(FACING); - float f = 0.0F; - float f1 = 0.78125F; - float f2 = 0.0F; - float f3 = 1.0F; - float f4 = 0.125F; - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - - switch (enumfacing) - { - case NORTH: - default: - this.setBlockBounds(f2, f, 1.0F - f4, f3, f1, 1.0F); - break; - - case SOUTH: - this.setBlockBounds(f2, f, 0.0F, f3, f1, f4); - break; - - case WEST: - this.setBlockBounds(1.0F - f4, f, f2, 1.0F, f1, f3); - break; - - case EAST: - this.setBlockBounds(0.0F, f, f2, f4, f1, f3); - } - } - - public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock) - { - Facing enumfacing = (Facing)state.getValue(FACING); - - if (!worldIn.getState(pos.offset(enumfacing.getOpposite())).getBlock().getMaterial().isSolid()) - { - this.dropBlockAsItem(worldIn, pos, state, 0); - worldIn.setBlockToAir(pos); - } - - super.onNeighborBlockChange(worldIn, pos, state, neighborBlock); - } - - protected Property[] getProperties() - { - return new Property[] {FACING}; - } - - protected Item getItemToRegister() { - return null; - } -} \ No newline at end of file diff --git a/common/src/main/java/common/block/tile/BlockBannerStanding.java b/common/src/main/java/common/block/tile/BlockBannerStanding.java deleted file mode 100644 index b1002805..00000000 --- a/common/src/main/java/common/block/tile/BlockBannerStanding.java +++ /dev/null @@ -1,40 +0,0 @@ -package common.block.tile; - -import common.block.Block; -import common.item.Item; -import common.item.block.ItemBanner; -import common.properties.Property; -import common.properties.PropertyInteger; -import common.util.BlockPos; -import common.world.State; -import common.world.World; - -public class BlockBannerStanding extends BlockBanner -{ - public static final PropertyInteger ROTATION = PropertyInteger.create("rotation", 0, 15); - - public BlockBannerStanding() - { - this.setDefaultState(this.getBaseState().withProperty(ROTATION, Integer.valueOf(0))); - } - - public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock) - { - if (!worldIn.getState(pos.down()).getBlock().getMaterial().isSolid()) - { - this.dropBlockAsItem(worldIn, pos, state, 0); - worldIn.setBlockToAir(pos); - } - - super.onNeighborBlockChange(worldIn, pos, state, neighborBlock); - } - - protected Property[] getProperties() - { - return new Property[] {ROTATION}; - } - - protected Item getItemToRegister() { - return new ItemBanner(this).setDisplay("Banner"); - } -} \ No newline at end of file diff --git a/common/src/main/java/common/init/BlockRegistry.java b/common/src/main/java/common/init/BlockRegistry.java index 062d53b0..2898d08b 100755 --- a/common/src/main/java/common/init/BlockRegistry.java +++ b/common/src/main/java/common/init/BlockRegistry.java @@ -132,8 +132,6 @@ import common.block.tech.BlockTripWire; import common.block.tech.BlockTripWireHook; import common.block.tech.BlockWarpChest; import common.block.tech.BlockWorkbench; -import common.block.tile.BlockBannerHanging; -import common.block.tile.BlockBannerStanding; import common.block.tile.BlockStandingSign; import common.block.tile.BlockWallSign; import common.collect.BiMap; @@ -470,8 +468,6 @@ public abstract class BlockRegistry { register("display" + (density == 1 ? "" : density) + "_on", new BlockActiveDisplay(display).setHardness(1.0F).setStepSound(SoundType.STONE).setDisplay("Displaymodul (" + (density * 16) + "x" + (density * 16) + ")")); } - register("banner", (new BlockBannerStanding()).setHardness(1.0F).setStepSound(SoundType.WOOD).setDisplay("Banner")); - register("wall_banner", (new BlockBannerHanging()).setHardness(1.0F).setStepSound(SoundType.WOOD).setDisplay("Banner")); register("portal", (new BlockPortal()).setHardness(0.0F).setStepSound(SoundType.GLASS).setLightLevel(0.75F).setDisplay("Portal")); register("floor_portal", (new BlockFloorPortal(Material.PORTAL)).setHardness(0.0F).setDisplay("Portal")); diff --git a/common/src/main/java/common/init/Blocks.java b/common/src/main/java/common/init/Blocks.java index cf18d5a5..4d38c912 100755 --- a/common/src/main/java/common/init/Blocks.java +++ b/common/src/main/java/common/init/Blocks.java @@ -50,7 +50,6 @@ public abstract class Blocks { public static final BlockOre arsenic_ore = get("arsenic_ore"); public static final Block ash = get("ash"); public static final BlockWorkbench assembly_unit = get("assembly_unit"); - public static final BlockBannerStanding banner = get("banner"); public static final BlockBeacon beacon = get("beacon"); public static final BlockBedrock bedrock = get("bedrock"); public static final BlockDoor birch_door = get("birch_door"); @@ -554,7 +553,6 @@ public abstract class Blocks { public static final Block vanadium_block = get("vanadium_block"); public static final BlockOre vanadium_ore = get("vanadium_ore"); public static final BlockVine vine = get("vine"); - public static final BlockBannerHanging wall_banner = get("wall_banner"); public static final BlockWallSign wall_sign = get("wall_sign"); public static final BlockWarpChest warp_chest = get("warp_chest"); public static final BlockStaticLiquid water = get("water"); diff --git a/common/src/main/java/common/init/CraftingRegistry.java b/common/src/main/java/common/init/CraftingRegistry.java index 410462c0..eeea1b80 100755 --- a/common/src/main/java/common/init/CraftingRegistry.java +++ b/common/src/main/java/common/init/CraftingRegistry.java @@ -19,11 +19,9 @@ import common.entity.animal.EntitySheep; import common.inventory.InventoryCrafting; import common.item.Item; import common.item.ItemStack; -import common.item.block.ItemBanner; import common.item.material.ItemDye; import common.item.tool.ItemArmor; import common.tags.TagObject; -import common.tileentity.TileEntityBanner; public abstract class CraftingRegistry { @@ -212,15 +210,7 @@ public abstract class CraftingRegistry recipes.add(new RecipesArmorDyes()); recipes.add(new RecipeFireworks()); recipes.add(new RecipeRepairItem()); - - for (DyeColor color : DyeColor.values()) - { - add(ItemBanner.getColoredBanner(color), "###", "###", " | ", '#', BlockWool.getByColor(color).getItem(), '|', Items.stick); - } - recipes.add(new RecipeDuplicatePattern()); - recipes.add(new RecipeAddPattern()); - add(new ItemStack(Items.paper, 3), "###", '#', Items.reeds); addShapeless(new ItemStack(Items.book, 1), Items.paper, Items.paper, Items.paper, Items.leather); addShapeless(new ItemStack(Items.writable_book, 1), Items.book, Items.ink_sack, Items.feather); @@ -519,347 +509,6 @@ public abstract class CraftingRegistry ItemStack[] getRemainingItems(InventoryCrafting inv); } - private static class RecipeAddPattern implements IRecipe - { - public boolean matches(InventoryCrafting inv) - { - boolean flag = false; - - for (int i = 0; i < inv.getSizeInventory(); ++i) - { - ItemStack itemstack = inv.getStackInSlot(i); - - if (itemstack != null && itemstack.getItem() == Items.banner) - { - if (flag) - { - return false; - } - - if (TileEntityBanner.getPatterns(itemstack) >= 6) - { - return false; - } - - flag = true; - } - } - - if (!flag) - { - return false; - } - else - { - return this.getBannerPattern(inv) != null; - } - } - - public ItemStack getCraftingResult(InventoryCrafting inv) - { - ItemStack itemstack = null; - - for (int i = 0; i < inv.getSizeInventory(); ++i) - { - ItemStack itemstack1 = inv.getStackInSlot(i); - - if (itemstack1 != null && itemstack1.getItem() == Items.banner) - { - itemstack = itemstack1.copy(); - itemstack.size = 1; - break; - } - } - - TileEntityBanner.EnumBannerPattern type = this.getBannerPattern(inv); - - if (type != null) - { - String k = DyeColor.WHITE.getName(); - - for (int j = 0; j < inv.getSizeInventory(); ++j) - { - ItemStack itemstack2 = inv.getStackInSlot(j); - - if (itemstack2 != null && itemstack2.getItem() instanceof ItemDye dye) - { - k = dye.getColor().getName(); - break; - } - } - - TagObject tag = itemstack.getSubTag("BlockEntityTag", true); - List list = null; - - if (tag.hasList("Patterns")) - { - list = tag.getList("Patterns"); - } - else - { - list = Lists.newArrayList(); - tag.setList("Patterns", list); - } - - TagObject pattern = new TagObject(); - pattern.setString("Pattern", type.getPatternID()); - pattern.setString("Color", k); - list.add(pattern); - } - - return itemstack; - } - - public int getRecipeSize() - { - return 10; - } - - public ItemStack getRecipeOutput() - { - return null; - } - - public ItemStack[] getRemainingItems(InventoryCrafting inv) - { - ItemStack[] aitemstack = new ItemStack[inv.getSizeInventory()]; - - for (int i = 0; i < aitemstack.length; ++i) - { - ItemStack itemstack = inv.getStackInSlot(i); - - if (itemstack != null && itemstack.getItem().hasContainerItem()) - { - aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); - } - } - - return aitemstack; - } - - private TileEntityBanner.EnumBannerPattern getBannerPattern(InventoryCrafting p_179533_1_) - { - for (TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern : TileEntityBanner.EnumBannerPattern.values()) - { - if (tileentitybanner$enumbannerpattern.hasValidCrafting()) - { - boolean flag = true; - - if (tileentitybanner$enumbannerpattern.hasCraftingStack()) - { - boolean flag1 = false; - boolean flag2 = false; - - for (int i = 0; i < p_179533_1_.getSizeInventory() && flag; ++i) - { - ItemStack itemstack = p_179533_1_.getStackInSlot(i); - - if (itemstack != null && itemstack.getItem() != Items.banner) - { - if (itemstack.getItem() instanceof ItemDye) - { - if (flag2) - { - flag = false; - break; - } - - flag2 = true; - } - else - { - if (flag1 || !itemstack.isItemEqual(tileentitybanner$enumbannerpattern.getCraftingStack())) - { - flag = false; - break; - } - - flag1 = true; - } - } - } - - if (!flag1) - { - flag = false; - } - } - else if (p_179533_1_.getSizeInventory() == tileentitybanner$enumbannerpattern.getCraftingLayers().length * tileentitybanner$enumbannerpattern.getCraftingLayers()[0].length()) - { - DyeColor j = null; - - for (int k = 0; k < p_179533_1_.getSizeInventory() && flag; ++k) - { - int l = k / 3; - int i1 = k % 3; - ItemStack itemstack1 = p_179533_1_.getStackInSlot(k); - - if (itemstack1 != null && itemstack1.getItem() != Items.banner) - { - if (!(itemstack1.getItem() instanceof ItemDye dye)) - { - flag = false; - break; - } - - if (j != null && j != dye.getColor()) - { - flag = false; - break; - } - - if (tileentitybanner$enumbannerpattern.getCraftingLayers()[l].charAt(i1) == 32) - { - flag = false; - break; - } - - j = dye.getColor(); - } - else if (tileentitybanner$enumbannerpattern.getCraftingLayers()[l].charAt(i1) != 32) - { - flag = false; - break; - } - } - } - else - { - flag = false; - } - - if (flag) - { - return tileentitybanner$enumbannerpattern; - } - } - } - - return null; - } - } - - private static class RecipeDuplicatePattern implements IRecipe - { - public boolean matches(InventoryCrafting inv) - { - ItemStack itemstack = null; - ItemStack itemstack1 = null; - - for (int i = 0; i < inv.getSizeInventory(); ++i) - { - ItemStack itemstack2 = inv.getStackInSlot(i); - - if (itemstack2 != null) - { - if (itemstack2.getItem() != Items.banner) - { - return false; - } - - if (itemstack != null && itemstack1 != null) - { - return false; - } - - DyeColor j = TileEntityBanner.getBaseColor(itemstack2); - boolean flag = TileEntityBanner.getPatterns(itemstack2) > 0; - - if (itemstack != null) - { - if (flag) - { - return false; - } - - if (j != TileEntityBanner.getBaseColor(itemstack)) - { - return false; - } - - itemstack1 = itemstack2; - } - else if (itemstack1 != null) - { - if (!flag) - { - return false; - } - - if (j != TileEntityBanner.getBaseColor(itemstack1)) - { - return false; - } - - itemstack = itemstack2; - } - else if (flag) - { - itemstack = itemstack2; - } - else - { - itemstack1 = itemstack2; - } - } - } - - return itemstack != null && itemstack1 != null; - } - - public ItemStack getCraftingResult(InventoryCrafting inv) - { - for (int i = 0; i < inv.getSizeInventory(); ++i) - { - ItemStack itemstack = inv.getStackInSlot(i); - - if (itemstack != null && TileEntityBanner.getPatterns(itemstack) > 0) - { - ItemStack itemstack1 = itemstack.copy(); - itemstack1.size = 1; - return itemstack1; - } - } - - return null; - } - - public int getRecipeSize() - { - return 2; - } - - public ItemStack getRecipeOutput() - { - return null; - } - - public ItemStack[] getRemainingItems(InventoryCrafting inv) - { - ItemStack[] aitemstack = new ItemStack[inv.getSizeInventory()]; - - for (int i = 0; i < aitemstack.length; ++i) - { - ItemStack itemstack = inv.getStackInSlot(i); - - if (itemstack != null) - { - if (itemstack.getItem().hasContainerItem()) - { - aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); - } - else if (itemstack.hasTag() && TileEntityBanner.getPatterns(itemstack) > 0) - { - aitemstack[i] = itemstack.copy(); - aitemstack[i].size = 1; - } - } - } - - return aitemstack; - } - } - private static class RecipeFireworks implements IRecipe { private ItemStack field_92102_a; diff --git a/common/src/main/java/common/init/Items.java b/common/src/main/java/common/init/Items.java index de3b9007..0094f66e 100755 --- a/common/src/main/java/common/init/Items.java +++ b/common/src/main/java/common/init/Items.java @@ -11,7 +11,6 @@ import java.util.Set; import common.collect.Lists; import common.collect.Sets; import common.item.*; -import common.item.block.ItemBanner; import common.item.block.ItemBed; import common.item.block.ItemBlock; import common.item.block.ItemButton; @@ -134,7 +133,6 @@ public abstract class Items { public static final ItemBlock assembly_unit = get("assembly_unit"); public static final ItemFood baked_potato = get("baked_potato"); public static final ItemBanHammer banhammer = get("banhammer"); - public static final ItemBanner banner = get("banner"); public static final ItemBlock beacon = get("beacon"); public static final ItemBlock bedrock = get("bedrock"); public static final ItemFood beef = get("beef"); diff --git a/common/src/main/java/common/init/Registry.java b/common/src/main/java/common/init/Registry.java index 0af89057..d855fdee 100755 --- a/common/src/main/java/common/init/Registry.java +++ b/common/src/main/java/common/init/Registry.java @@ -7,7 +7,6 @@ public abstract class Registry { SpeciesRegistry.register(); EntityRegistry.registerEggs(); ItemRegistry.register(); - TileRegistry.register(); CraftingRegistry.register(); SmeltingRegistry.register(); EntityRegistry.register(); diff --git a/common/src/main/java/common/init/TileRegistry.java b/common/src/main/java/common/init/TileRegistry.java deleted file mode 100755 index 6d9921aa..00000000 --- a/common/src/main/java/common/init/TileRegistry.java +++ /dev/null @@ -1,57 +0,0 @@ -package common.init; - -import java.util.Map; - -import common.collect.Maps; -import common.tileentity.TileEntity; -import common.tileentity.TileEntityBanner; -import common.tileentity.TileEntityBeacon; -import common.tileentity.TileEntityBrewingStand; -import common.tileentity.TileEntityChest; -import common.tileentity.TileEntityComparator; -import common.tileentity.TileEntityDaylightDetector; -import common.tileentity.TileEntityDispenser; -import common.tileentity.TileEntityDisplay; -import common.tileentity.TileEntityDropper; -import common.tileentity.TileEntityEnchantmentTable; -import common.tileentity.TileEntityFurnace; -import common.tileentity.TileEntityHopper; -import common.tileentity.TileEntityMobSpawner; -import common.tileentity.TileEntityPiston; -import common.tileentity.TileEntitySign; -import common.tileentity.TileEntityTianReactor; - -public abstract class TileRegistry { - public static final Map> NAME_TO_CLASS = Maps.>newHashMap(); - public static final Map, String> CLASS_TO_NAME = Maps., String>newHashMap(); - public static final Map, Integer> CLASS_TO_ID = Maps., Integer>newHashMap(); - - private static int nextId; - - private static void addMapping(Class cl, String id) { - if(NAME_TO_CLASS.containsKey(id)) - throw new IllegalArgumentException("Duplicate id: " + id); - NAME_TO_CLASS.put(id, cl); - CLASS_TO_NAME.put(cl, id); - CLASS_TO_ID.put(cl, ++nextId); - } - - static void register() { - addMapping(TileEntityFurnace.class, "Furnace"); - addMapping(TileEntityChest.class, "Chest"); - addMapping(TileEntityDispenser.class, "Trap"); - addMapping(TileEntityDropper.class, "Dropper"); - addMapping(TileEntitySign.class, "Sign"); - addMapping(TileEntityDisplay.class, "Display"); - addMapping(TileEntityPiston.class, "Piston"); - addMapping(TileEntityBrewingStand.class, "Cauldron"); - addMapping(TileEntityEnchantmentTable.class, "EnchantTable"); - addMapping(TileEntityBeacon.class, "Beacon"); - addMapping(TileEntityDaylightDetector.class, "DLDetector"); - addMapping(TileEntityHopper.class, "Hopper"); - addMapping(TileEntityComparator.class, "Comparator"); - addMapping(TileEntityBanner.class, "Banner"); - addMapping(TileEntityTianReactor.class, "TianReactor"); - addMapping(TileEntityMobSpawner.class, "MobSpawner"); - } -} diff --git a/common/src/main/java/common/item/block/ItemBanner.java b/common/src/main/java/common/item/block/ItemBanner.java deleted file mode 100755 index 256d3398..00000000 --- a/common/src/main/java/common/item/block/ItemBanner.java +++ /dev/null @@ -1,200 +0,0 @@ -package common.item.block; - -import java.util.List; - -import common.block.Block; -import common.block.tile.BlockBannerStanding; -import common.block.tile.BlockStandingSign; -import common.block.tile.BlockWallSign; -import common.collect.Lists; -import common.color.DyeColor; -import common.entity.npc.EntityNPC; -import common.init.Blocks; -import common.init.Items; -import common.item.CheatTab; -import common.item.Item; -import common.item.ItemStack; -import common.model.Model; -import common.model.ModelProvider; -import common.model.Transforms; -import common.tags.TagObject; -import common.tileentity.TileEntity; -import common.tileentity.TileEntityBanner; -import common.util.BlockPos; -import common.util.ExtMath; -import common.util.Facing; -import common.world.World; - -public class ItemBanner extends Item -{ - private final BlockBannerStanding block; - - public ItemBanner(BlockBannerStanding block) - { - this.block = block; - this.setTab(CheatTab.DECORATION); - } - - public static ItemStack getColoredBanner(DyeColor color) { - return Items.banner.getColored(color); - } - - private ItemStack getColored(DyeColor color) { - TagObject tag = new TagObject(); - TileEntityBanner.setBaseColorAndPatterns(tag, color, null); - TagObject tile = new TagObject(); - tile.setObject("BlockEntityTag", tag); - ItemStack stack = new ItemStack(this); - stack.setTag(tile); - return stack; - } - - public Block getBlock() - { - return this.block; - } - - /** - * Called when a Block is right-clicked with this Item - */ - public boolean onItemUse(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ) - { - if (side == Facing.DOWN) - { - return false; - } - else if (!worldIn.getState(pos).getBlock().getMaterial().isSolid()) - { - return false; - } - else - { - pos = pos.offset(side); - - if (!playerIn.canPlayerEdit(pos, side, stack)) - { - return false; - } - else if (!this.block.canPlaceBlockAt(worldIn, pos)) - { - return false; - } - else if (worldIn.client) - { - return true; - } - else - { - if (side == Facing.UP) - { - int i = ExtMath.floord((double)((playerIn.rotYaw + 180.0F) * 16.0F / 360.0F) + 0.5D) & 15; - worldIn.setState(pos, Blocks.banner.getState().withProperty(BlockStandingSign.ROTATION, Integer.valueOf(i)), 3); - } - else - { - worldIn.setState(pos, Blocks.wall_banner.getState().withProperty(BlockWallSign.FACING, side), 3); - } - - --stack.size; - TileEntity tileentity = worldIn.getTileEntity(pos); - - if (tileentity instanceof TileEntityBanner) - { - ((TileEntityBanner)tileentity).setItemValues(stack); - } - - return true; - } - } - } - - public String getDisplay(ItemStack stack) - { -// String s = "item.banner."; - DyeColor enumdyecolor = this.getBaseColor(stack); -// s = s + + ".name"; - return enumdyecolor.getSubject(0) + " " + super.getDisplay(stack); - } - - /** - * allows items to add custom lines of information to the mouseover description - */ - public void addInformation(ItemStack stack, EntityNPC playerIn, List tooltip) - { - TagObject tag = stack.getSubTag("BlockEntityTag", false); - - if (tag != null && tag.hasList("Patterns")) - { - List list = tag.getList("Patterns"); - - for (int i = 0; i < list.size() && i < 6; ++i) - { - TagObject pat = list.get(i); - DyeColor color = DyeColor.byName(pat.getString("Color")); - TileEntityBanner.EnumBannerPattern pattern = TileEntityBanner.EnumBannerPattern.getPatternByID(pat.getString("Pattern")); - - if (pattern != null) - { - tooltip.add(String.format(pattern.getDisplay(), pattern.isColorLowercase() ? - color.getSubject(pattern.getDisplayType()).toLowerCase() : color.getSubject(pattern.getDisplayType()))); - } - } - } - } - - public int getColorFromItemStack(ItemStack stack, int renderPass) - { - if (renderPass == 0) - { - return 16777215; - } - else - { - DyeColor enumdyecolor = this.getBaseColor(stack); - return enumdyecolor.getColor(); - } - } - - public List getItemTags() - { - List tags = Lists.newArrayList(); - for (DyeColor color : DyeColor.values()) - { - tags.add(this.getColored(color).getTag()); - } - return tags; - } - - /** - * gets the tab this item is displayed on - */ - public CheatTab getTab() - { - return CheatTab.DECORATION; - } - - private DyeColor getBaseColor(ItemStack stack) - { - TagObject tag = stack.getSubTag("BlockEntityTag", false); - DyeColor color = null; - - if (tag != null && tag.hasString("Base")) - { - color = DyeColor.byName(tag.getString("Base")); - } - else - { - color = DyeColor.WHITE; - } - - return color; - } - - public Transforms getTransform() { - return Transforms.BANNER; - } - - public Model getModel(ModelProvider provider, String name) { - return provider.getModel(provider.getEntityModel(), this.getTransform()); - } -} diff --git a/common/src/main/java/common/tileentity/TileEntityBanner.java b/common/src/main/java/common/tileentity/TileEntityBanner.java deleted file mode 100755 index c472dd76..00000000 --- a/common/src/main/java/common/tileentity/TileEntityBanner.java +++ /dev/null @@ -1,347 +0,0 @@ -package common.tileentity; - -import java.util.List; - -import common.collect.Lists; -import common.color.DyeColor; -import common.init.Items; -import common.item.ItemStack; -import common.network.Packet; -import common.packet.SPacketUpdateTileEntity; -import common.tags.TagObject; - -public class TileEntityBanner extends TileEntity -{ - private DyeColor baseColor; - - /** A list of all the banner patterns. */ - private List patterns; - private boolean field_175119_g; - private List patternList; - private List colorList; - - /** - * This is a String representation of this banners pattern and color lists, used for texture caching. - */ - private String patternResourceLocation; - - public void setItemValues(ItemStack stack) - { - this.patterns = null; - - if (stack.hasTag() && stack.getTag().hasObject("BlockEntityTag")) - { - TagObject nbttagcompound = stack.getTag().getObject("BlockEntityTag"); - - if (nbttagcompound.hasList("Patterns")) - { - this.patterns = Lists.newArrayList(); - for(TagObject pattern : nbttagcompound.getList("Patterns")) { - this.patterns.add(pattern.copy()); - } - } - - if (nbttagcompound.hasString("Base")) - { - this.baseColor = DyeColor.byName(nbttagcompound.getString("Base")); - } - else - { - this.baseColor = DyeColor.WHITE; - } - } - else - { - this.baseColor = DyeColor.WHITE; - } - - this.patternList = null; - this.colorList = null; - this.patternResourceLocation = ""; - this.field_175119_g = true; - } - - public void writeTags(TagObject compound) - { - super.writeTags(compound); - setBaseColorAndPatterns(compound, this.baseColor, this.patterns); - } - - public static void setBaseColorAndPatterns(TagObject compound, DyeColor baseColorIn, List patternsIn) - { - compound.setString("Base", baseColorIn.getName()); - - if (patternsIn != null) - { - compound.setList("Patterns", patternsIn); - } - } - - public void readTags(TagObject compound) - { - super.readTags(compound); - this.baseColor = DyeColor.byName(compound.getString("Base")); - this.patterns = compound.getList("Patterns"); - this.patternList = null; - this.colorList = null; - this.patternResourceLocation = null; - this.field_175119_g = true; - } - - /** - * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the - * server to the client easily. For example this is used by signs to synchronise the text to be displayed. - */ - public Packet getDescriptionPacket() - { - return new SPacketUpdateTileEntity(this); - } - - public DyeColor getBaseColor() - { - return this.baseColor; - } - - public static DyeColor getBaseColor(ItemStack stack) - { - TagObject nbttagcompound = stack.getSubTag("BlockEntityTag", false); - return nbttagcompound != null && nbttagcompound.hasString("Base") ? DyeColor.byName(nbttagcompound.getString("Base")) : DyeColor.WHITE; - } - - /** - * Retrieves the amount of patterns stored on an ItemStack. If the tag does not exist this value will be 0. - */ - public static int getPatterns(ItemStack stack) - { - TagObject nbttagcompound = stack.getSubTag("BlockEntityTag", false); - return nbttagcompound != null && nbttagcompound.hasList("Patterns") ? nbttagcompound.getList("Patterns").size() : 0; - } - - public List getPatternList() - { - this.initializeBannerData(); - return this.patternList; - } - - public List getPatterns() - { - return this.patterns; - } - - public List getColorList() - { - this.initializeBannerData(); - return this.colorList; - } - - public String getPatternResourceLocation() - { - this.initializeBannerData(); - return this.patternResourceLocation; - } - - /** - * Establishes all of the basic properties for the banner. This will also apply the data from the tile entities nbt - * tag compounds. - */ - private void initializeBannerData() - { - if (this.patternList == null || this.colorList == null || this.patternResourceLocation == null) - { - if (!this.field_175119_g) - { - this.patternResourceLocation = ""; - } - else - { - this.patternList = Lists.newArrayList(); - this.colorList = Lists.newArrayList(); - this.patternList.add(TileEntityBanner.EnumBannerPattern.BASE); - this.colorList.add(this.baseColor); - this.patternResourceLocation = "b" + this.baseColor.ordinal(); - - if (this.patterns != null) - { - for (int i = 0; i < this.patterns.size(); ++i) - { - TagObject nbttagcompound = this.patterns.get(i); - TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern = TileEntityBanner.EnumBannerPattern.getPatternByID(nbttagcompound.getString("Pattern")); - - if (tileentitybanner$enumbannerpattern != null) - { - this.patternList.add(tileentitybanner$enumbannerpattern); - String j = nbttagcompound.getString("Color"); - DyeColor color = DyeColor.byName(j); - this.colorList.add(color); - this.patternResourceLocation = this.patternResourceLocation + tileentitybanner$enumbannerpattern.getPatternID() + color.ordinal(); - } - } - } - } - } - } - - public int getColor() { - return 0xffffff; - } - - /** - * Removes all the banner related data from a provided instance of ItemStack. - */ - public static void removeBannerData(ItemStack stack) - { - TagObject nbttagcompound = stack.getSubTag("BlockEntityTag", false); - - if (nbttagcompound != null && nbttagcompound.hasList("Patterns")) - { - List nbttaglist = nbttagcompound.getList("Patterns"); - - if (nbttaglist.size() > 0) - { - nbttaglist.remove(nbttaglist.size() - 1); - - if (nbttaglist.isEmpty()) - { - stack.getTag().remove("BlockEntityTag"); - - if (stack.getTag().isEmpty()) - { - stack.setTag((TagObject)null); - } - } - } - } - } - - public static enum EnumBannerPattern - { - BASE("base", "b", "%s Banner", 0, false), - SQUARE_BOTTOM_LEFT("square_bottom_left", "bl", "%s rechtes Untereck", 0, false, " ", " ", "# "), - SQUARE_BOTTOM_RIGHT("square_bottom_right", "br", "%s linkes Untereck", 0, false, " ", " ", " #"), - SQUARE_TOP_LEFT("square_top_left", "tl", "%s rechtes Obereck", 0, false, "# ", " ", " "), - SQUARE_TOP_RIGHT("square_top_right", "tr", "%s linkes Obereck", 0, false, " #", " ", " "), - STRIPE_BOTTOM("stripe_bottom", "bs", "%s Bannerfuß", 1, false, " ", " ", "###"), - STRIPE_TOP("stripe_top", "ts", "%s Bannerhaupt", 0, false, "###", " ", " "), - STRIPE_LEFT("stripe_left", "ls", "%s rechte Flanke", -1, false, "# ", "# ", "# "), - STRIPE_RIGHT("stripe_right", "rs", "%s linke Flanke", -1, false, " #", " #", " #"), - STRIPE_CENTER("stripe_center", "cs", "%s Pfahl", 1, false, " # ", " # ", " # "), - STRIPE_MIDDLE("stripe_middle", "ms", "%s Balken", 1, false, " ", "###", " "), - STRIPE_DOWNRIGHT("stripe_downright", "drs", "%s Schrägbalken", 1, false, "# ", " # ", " #"), - STRIPE_DOWNLEFT("stripe_downleft", "dls", "%s Schräglinksbalken", 1, false, " #", " # ", "# "), - STRIPE_SMALL("small_stripes", "ss", "Vier %s Pfähle", 1, true, "# #", "# #", " "), - CROSS("cross", "cr", "%s Andreaskreuz", 0, false, "# #", " # ", "# #"), - STRAIGHT_CROSS("straight_cross", "sc", "%s Kreuz", 0, false, " # ", "###", " # "), - TRIANGLE_BOTTOM("triangle_bottom", "bt", "%s halbe Spitze", -1, false, " ", " # ", "# #"), - TRIANGLE_TOP("triangle_top", "tt", "%s gestürzte halbe Spitze", -1, false, "# #", " # ", " "), - TRIANGLES_BOTTOM("triangles_bottom", "bts", "%s gespickelter Bannerfuß", 1, false, " ", "# #", " # "), - TRIANGLES_TOP("triangles_top", "tts", "%s gespickeltes Bannerhaupt", 0, false, " # ", "# #", " "), - DIAGONAL_LEFT("diagonal_left", "ld", "%s schräglinks geteilt", null, false, "## ", "# ", " "), - DIAGONAL_RIGHT("diagonal_up_right", "rd", "%s schräglinks geteilt (Invertiert)", null, false, " ", " #", " ##"), - DIAGONAL_LEFT_MIRROR("diagonal_up_left", "lud", "%s schrägrechts geteilt (Invertiert)", null, false, " ", "# ", "## "), - DIAGONAL_RIGHT_MIRROR("diagonal_right", "rud", "%s schrägrechts geteilt", null, false, " ##", " #", " "), - CIRCLE_MIDDLE("circle", "mc", "%s Kugel", -1, false, " ", " # ", " "), - RHOMBUS_MIDDLE("rhombus", "mr", "%s Raute", -1, false, " # ", "# #", " # "), - HALF_VERTICAL("half_vertical", "vh", "Rechts %s gespalten", null, true, "## ", "## ", "## "), - HALF_HORIZONTAL("half_horizontal", "hh", "Oben %s geteilt", null, true, "###", "###", " "), - HALF_VERTICAL_MIRROR("half_vertical_right", "vhr", "Links %s gespalten", null, true, " ##", " ##", " ##"), - HALF_HORIZONTAL_MIRROR("half_horizontal_bottom", "hhb", "Unten %s geteilt", null, true, " ", "###", "###"), - BORDER("border", "bo", "%s Bord", 1, false, "###", "# #", "###"), - CURLY_BORDER("curly_border", "cbo", "%s Spickelbord", 1, false, new ItemStack(Items.vine)), - RUNE("rune", "run", "%s Rune", -1, false, new ItemStack(Items.golden_apple)), - GRADIENT("gradient", "gra", "%s Farbverlauf", 1, false, "# #", " # ", " # "), - GRADIENT_UP("gradient_up", "gru", "%s Farbverlauf (Invertiert)", 1, false, " # ", " # ", "# #"), - BRICKS("bricks", "bri", "Feld %s gemauert", null, true, new ItemStack(Items.brick_block)), - SKULL("skull", "sku", "%s Schädel", 1, false, new ItemStack(Items.skull)), - FLOWER("flower", "flo", "%s Blume", -1, false, new ItemStack(Items.daisy)), - THING("thing", "thi", "%s ", 0, false, new ItemStack(Items.charged_apple)); - - private String patternName; - private String patternID; - private String display; - private Integer displayType; - private boolean displayLower; - private String[] craftingLayers; - private ItemStack patternCraftingStack; - - private EnumBannerPattern(String name, String id, String display, Integer displayType, boolean displayLower) - { - this.craftingLayers = new String[3]; - this.patternName = name; - this.patternID = id; - this.display = display; - this.displayType = displayType; - } - - private EnumBannerPattern(String name, String id, String display, Integer displayType, boolean displayLower, ItemStack craftingItem) - { - this(name, id, display, displayType, displayLower); - this.patternCraftingStack = craftingItem; - } - - private EnumBannerPattern(String name, String id, String display, Integer displayType, boolean displayLower, String craftingTop, String craftingMid, String craftingBot) - { - this(name, id, display, displayType, displayLower); - this.craftingLayers[0] = craftingTop; - this.craftingLayers[1] = craftingMid; - this.craftingLayers[2] = craftingBot; - } - - public String getPatternName() - { - return this.patternName; - } - - public String getPatternID() - { - return this.patternID; - } - - public String getDisplay() - { - return this.display; - } - - public Integer getDisplayType() - { - return this.displayType; - } - - public boolean isColorLowercase() - { - return this.displayLower; - } - - public String[] getCraftingLayers() - { - return this.craftingLayers; - } - - public boolean hasValidCrafting() - { - return this.patternCraftingStack != null || this.craftingLayers[0] != null; - } - - public boolean hasCraftingStack() - { - return this.patternCraftingStack != null; - } - - public ItemStack getCraftingStack() - { - return this.patternCraftingStack; - } - - public static TileEntityBanner.EnumBannerPattern getPatternByID(String id) - { - for (TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern : values()) - { - if (tileentitybanner$enumbannerpattern.patternID.equals(id)) - { - return tileentitybanner$enumbannerpattern; - } - } - - return null; - } - } -} diff --git a/server/src/main/java/server/clipboard/ReorderRegistry.java b/server/src/main/java/server/clipboard/ReorderRegistry.java index 1d9fe9bd..b503fd72 100755 --- a/server/src/main/java/server/clipboard/ReorderRegistry.java +++ b/server/src/main/java/server/clipboard/ReorderRegistry.java @@ -124,8 +124,6 @@ public abstract class ReorderRegistry { PLACE_FINAL.add(Blocks.cake); PLACE_FINAL.add(Blocks.piston_head); PLACE_FINAL.add(Blocks.piston_extension); - PLACE_FINAL.add(Blocks.banner); - PLACE_FINAL.add(Blocks.wall_banner); } /* diff --git a/server/src/main/java/server/world/Converter.java b/server/src/main/java/server/world/Converter.java index 546b5354..920205fc 100644 --- a/server/src/main/java/server/world/Converter.java +++ b/server/src/main/java/server/world/Converter.java @@ -10,6 +10,7 @@ import java.io.FilenameFilter; import java.io.IOException; import java.io.RandomAccessFile; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.function.Consumer; @@ -87,8 +88,6 @@ import common.block.tech.BlockTorch; import common.block.tech.BlockTripWire; import common.block.tech.BlockTripWireHook; import common.block.tech.BlockWarpChest; -import common.block.tile.BlockBannerHanging; -import common.block.tile.BlockBannerStanding; import common.block.tile.BlockStandingSign; import common.block.tile.BlockWallSign; import common.collect.Lists; @@ -115,7 +114,6 @@ import common.log.Log; import common.rng.Random; import common.tags.TagObject; import common.tileentity.TileEntity; -import common.tileentity.TileEntityBanner; import common.tileentity.TileEntityBeacon; import common.tileentity.TileEntityChest; import common.tileentity.TileEntityComparator; @@ -385,7 +383,8 @@ public abstract class Converter { mapTile(TileEntityDaylightDetector.class, "DLDetector", "daylight_detector"); mapTile(TileEntityHopper.class, "Hopper", "hopper"); mapTile(TileEntityComparator.class, "Comparator", "comparator"); - mapTile(TileEntityBanner.class, "Banner", "banner"); + + Arrays.fill(BLOCK_MAP, Blocks.air.getState()); mapBlock(Blocks.stone, 1); mapBlock(Blocks.rock, 1, 1); @@ -1439,26 +1438,6 @@ public abstract class Converter { mapBlock(Blocks.large_fern, 175, 3); mapBlock(Blocks.rose_bush, 175, 4); mapBlock(Blocks.paeonia, 175, 5); - mapBlock(Blocks.banner.getState().withProperty(BlockBannerStanding.ROTATION, 0), 176, 0); - mapBlock(Blocks.banner.getState().withProperty(BlockBannerStanding.ROTATION, 1), 176, 1); - mapBlock(Blocks.banner.getState().withProperty(BlockBannerStanding.ROTATION, 2), 176, 2); - mapBlock(Blocks.banner.getState().withProperty(BlockBannerStanding.ROTATION, 3), 176, 3); - mapBlock(Blocks.banner.getState().withProperty(BlockBannerStanding.ROTATION, 4), 176, 4); - mapBlock(Blocks.banner.getState().withProperty(BlockBannerStanding.ROTATION, 5), 176, 5); - mapBlock(Blocks.banner.getState().withProperty(BlockBannerStanding.ROTATION, 6), 176, 6); - mapBlock(Blocks.banner.getState().withProperty(BlockBannerStanding.ROTATION, 7), 176, 7); - mapBlock(Blocks.banner.getState().withProperty(BlockBannerStanding.ROTATION, 8), 176, 8); - mapBlock(Blocks.banner.getState().withProperty(BlockBannerStanding.ROTATION, 9), 176, 9); - mapBlock(Blocks.banner.getState().withProperty(BlockBannerStanding.ROTATION, 10), 176, 10); - mapBlock(Blocks.banner.getState().withProperty(BlockBannerStanding.ROTATION, 11), 176, 11); - mapBlock(Blocks.banner.getState().withProperty(BlockBannerStanding.ROTATION, 12), 176, 12); - mapBlock(Blocks.banner.getState().withProperty(BlockBannerStanding.ROTATION, 13), 176, 13); - mapBlock(Blocks.banner.getState().withProperty(BlockBannerStanding.ROTATION, 14), 176, 14); - mapBlock(Blocks.banner.getState().withProperty(BlockBannerStanding.ROTATION, 15), 176, 15); - mapBlock(Blocks.wall_banner.getState().withProperty(BlockBannerHanging.FACING, Facing.NORTH), 177); - mapBlock(Blocks.wall_banner.getState().withProperty(BlockBannerHanging.FACING, Facing.SOUTH), 177, 3, 9, 15); - mapBlock(Blocks.wall_banner.getState().withProperty(BlockBannerHanging.FACING, Facing.WEST), 177, 4, 10); - mapBlock(Blocks.wall_banner.getState().withProperty(BlockBannerHanging.FACING, Facing.EAST), 177, 5, 11); 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); diff --git a/server/src/main/java/server/world/Region.java b/server/src/main/java/server/world/Region.java index a360fa26..2b9b1ca1 100755 --- a/server/src/main/java/server/world/Region.java +++ b/server/src/main/java/server/world/Region.java @@ -83,7 +83,7 @@ public class Region { mapping.put(bid, id); highest = bid > highest ? bid : highest; missing.remove(id); - Log.IO.debug("Geänderte Block-ID %d = %s -> %s", (int)bid, oid, id); + Log.IO.debug((id.equals(oid) ? "Mehrfache" : "Geänderte") + " Block-ID %d = %s -> %s", (int)bid, oid, id); } else { Log.IO.debug("Entfernte Block-ID %d = %s", (int)bid, oid);