From c18a9ab656e30a434666f8713286cb32955d8e79 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Sat, 19 Mar 2016 08:56:04 -0700 Subject: [PATCH 01/47] Minecraft 1.9 port. --- build.gradle | 4 +- gradle.properties | 4 +- .../java/com/fireball1725/graves/Graves.java | 28 +- .../fireball1725/graves/block/BlockBase.java | 24 +- .../graves/block/BlockGraveSlave.java | 159 +++----- .../graves/block/BlockGraveStone.java | 101 ++--- .../graves/block/BlockHeadStone.java | 157 +++++--- .../com/fireball1725/graves/block/Blocks.java | 6 +- .../graves/client/events/RenderEvents.java | 11 +- .../client/render/entity/LayerHumanCape.java | 2 +- .../render/entity/RenderPlayerZombie.java | 18 +- .../graves/creativetab/ModCreativeTabs.java | 6 +- .../graves/entity/EntityFlying.java | 4 +- .../graves/entity/EntityPlayerZombie.java | 377 +++++++++--------- .../graves/event/EventBlockBreak.java | 8 +- .../graves/event/EventDeathHandler.java | 38 +- .../graves/helpers/SafeBlockReplacer.java | 6 +- .../graves/helpers/SoundHelper.java | 21 + .../graves/item/ItemHeadStone.java | 8 +- .../messages/MessageSetHeadstoneName.java | 2 +- .../graves/proxy/ClientProxy.java | 2 +- .../graves/tileentity/TileEntityBase.java | 19 +- .../tileentity/TileEntityGraveSlave.java | 2 +- .../tileentity/TileEntityGraveStone.java | 14 +- .../inventory/InternalDynamicInventory.java | 10 +- .../inventory/InternalInventory.java | 11 +- .../fireball1725/graves/util/GuiHandler.java | 2 +- .../fireball1725/graves/util/TileTools.java | 2 +- 28 files changed, 525 insertions(+), 521 deletions(-) create mode 100644 src/main/java/com/fireball1725/graves/helpers/SoundHelper.java diff --git a/build.gradle b/build.gradle index 40de087..05b82e6 100644 --- a/build.gradle +++ b/build.gradle @@ -51,7 +51,7 @@ if (hasProperty("teamcity")) { } minecraft { - version = minecraft_version + "-" + forge_version + version = minecraft_version + "-" + forge_version + "-" + minecraft_version replaceIn "ModInfo.java" @@ -59,7 +59,7 @@ minecraft { replace "@MCVERSION@", minecraft_version runDir = "run" - mappings = "stable_20" + mappings = "snapshot_20160312" } processResources diff --git a/gradle.properties b/gradle.properties index 6781e4d..98bcca3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -minecraft_version=1.8.9 -forge_version=11.15.1.1722 +minecraft_version=1.9 +forge_version=12.16.0.1770 cibuild=0 cibasename=graves \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/Graves.java b/src/main/java/com/fireball1725/graves/Graves.java index 608a44b..f83bb81 100644 --- a/src/main/java/com/fireball1725/graves/Graves.java +++ b/src/main/java/com/fireball1725/graves/Graves.java @@ -34,26 +34,26 @@ public void preInit(FMLPreInitializationEvent event) { // Setup Configuration proxy.registerConfiguration(event.getSuggestedConfigurationFile()); - // Register Blocks - proxy.registerBlocks(); + // Register Blocks + proxy.registerBlocks(); - // Register Items - proxy.registerItems(); + // Register Items + proxy.registerItems(); - // Register Entities - proxy.registerEntities(); + // Register Entities + proxy.registerEntities(); - // Register Events - proxy.registerEvents(); + // Register Events + proxy.registerEvents(); - // Register Crafting Recipes - proxy.registerRecipes(); + // Register Crafting Recipes + proxy.registerRecipes(); - // Register Whitelist - proxy.registerWhiteList(); + // Register Whitelist + proxy.registerWhiteList(); - LogHelper.info("Pre Initalization ( ended after " + stopWatch.elapsed(TimeUnit.MILLISECONDS) + "ms )"); - } + LogHelper.info("Pre Initalization ( ended after " + stopWatch.elapsed(TimeUnit.MILLISECONDS) + "ms )"); + } @Mod.EventHandler public void init(FMLInitializationEvent event) { diff --git a/src/main/java/com/fireball1725/graves/block/BlockBase.java b/src/main/java/com/fireball1725/graves/block/BlockBase.java index 4028330..11b334a 100644 --- a/src/main/java/com/fireball1725/graves/block/BlockBase.java +++ b/src/main/java/com/fireball1725/graves/block/BlockBase.java @@ -13,7 +13,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.relauncher.ReflectionHelper; @@ -28,8 +29,8 @@ public class BlockBase extends BlockContainer { protected BlockBase(Material material) { super(material); - setStepSound(Block.soundTypeStone); - setHardness(2.2F); + // setStepSound(SoundType.STONE); + setHardness(2.2F); setResistance(5.0F); //setHarvestLevel("pickaxe", 0); @@ -40,8 +41,8 @@ protected BlockBase(Material material) { public TileEntity createNewTileEntity(World var1, int var2) { if (hasBlockTileEntity()) { try { - return (TileEntity) this.tileEntityType.newInstance(); - } catch (Throwable e) { + return this.tileEntityType.newInstance(); + } catch (Throwable e) { throw new RuntimeException(e); } } @@ -61,8 +62,8 @@ protected void setTileEntity(Class c) { } private void setTileProvider(boolean b) { - ReflectionHelper.setPrivateValue(Block.class, this, Boolean.valueOf(b), new String[]{"isTileProvider"}); - } + ReflectionHelper.setPrivateValue(Block.class, this, Boolean.valueOf(b), "isTileProvider"); + } public Class getTileEntityClass() { return this.tileEntityType; @@ -132,8 +133,9 @@ public void onBlockPlacedBy(World world, BlockPos blockPos, IBlockState state, E } } - @Override - public int getRenderType() { - return 3; - } + @Override + public EnumBlockRenderType getRenderType(IBlockState state) + { + return EnumBlockRenderType.MODEL; + } } diff --git a/src/main/java/com/fireball1725/graves/block/BlockGraveSlave.java b/src/main/java/com/fireball1725/graves/block/BlockGraveSlave.java index f2e12a1..096f5b0 100644 --- a/src/main/java/com/fireball1725/graves/block/BlockGraveSlave.java +++ b/src/main/java/com/fireball1725/graves/block/BlockGraveSlave.java @@ -3,43 +3,47 @@ import com.fireball1725.graves.tileentity.TileEntityGraveSlave; import com.fireball1725.graves.tileentity.TileEntityGraveStone; import com.fireball1725.graves.util.TileTools; -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyEnum; -import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.particle.EffectRenderer; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.*; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IStringSerializable; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraft.world.WorldServer; import java.util.List; import java.util.Random; public class BlockGraveSlave extends BlockBase { - public static final PropertyBool isFoot = PropertyBool.create("isFoot"); - public static final PropertyEnum slaveType = PropertyEnum.create("slaveType", SlaveType.class); - public BlockGraveSlave() { - super(Material.cloth); + public static final PropertyBool isFoot = PropertyBool.create("isfoot"); + public static final PropertyEnum slaveType = PropertyEnum.create("slavetype", SlaveType.class); + + public BlockGraveSlave() + { + super(Material.cloth); setDefaultState(blockState.getBaseState().withProperty(slaveType, SlaveType.LID).withProperty(isFoot, true).withProperty(BlockGraveStone.FACING, EnumFacing.NORTH)); - setStepSound(Block.soundTypeStone); - setHardness(1.0F); - setResistance(10000.0F); + setStepSound(SoundType.STONE); + setHardness(1.0F); + setResistance(10000.0F); setTileEntity(TileEntityGraveSlave.class); } @Override - protected BlockState createBlockState() + protected BlockStateContainer createBlockState() { - return new BlockState(this, slaveType, isFoot, BlockGraveStone.FACING); + return new BlockStateContainer(this, slaveType, isFoot, BlockGraveStone.FACING); } @Override @@ -55,50 +59,41 @@ public IBlockState getStateFromMeta(int meta) } @Override - public int getRenderType() { - return 3; + public EnumBlockRenderType getRenderType(IBlockState state) + { + return EnumBlockRenderType.MODEL; } @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, BlockPos pos, EntityPlayer player) + public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) { TileEntityGraveSlave slave = TileTools.getTileEntity(world, pos, TileEntityGraveSlave.class); if(slave == null) { return null; } - return world.getBlockState(slave.getMasterBlock()).getBlock().getPickBlock(target, world, slave.getMasterBlock(), player); + return world.getBlockState(slave.getMasterBlock()).getBlock().getPickBlock(state, target, world, slave.getMasterBlock(), player); } - @Override - public AxisAlignedBB getSelectedBoundingBox(World worldIn, BlockPos pos) + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { - AxisAlignedBB selectionBox; - if(worldIn.getBlockState(pos.up()).getBlock() instanceof BlockGraveSlave || worldIn.getBlockState(pos.up()).getBlock() instanceof BlockGraveStone) - { - selectionBox = AxisAlignedBB.fromBounds(0f, 0f, 0f, 1f, 1f, 1f); - } - else + AxisAlignedBB selectionBox = new AxisAlignedBB(0f, 0f, 0f, 1f, 1f, 1f); + TileEntityGraveSlave graveSlave = TileTools.getTileEntity(source, pos, TileEntityGraveSlave.class); + if(graveSlave != null && graveSlave.getMasterBlock() != null) { - selectionBox = AxisAlignedBB.fromBounds(0, 0, 0, 1, .1425f, 1); + EnumFacing facing = getActualState(state, source, pos).getValue(BlockGraveStone.FACING); + if(graveSlave.getMasterBlock().offset(facing).equals(pos)) + { + selectionBox = new AxisAlignedBB(0, 0, 0, 1, .1425f, 1); + } } - return selectionBox.offset(pos.getX(), pos.getY(), pos.getZ()); + return selectionBox;//.offset(pos.getX(), pos.getY(), pos.getZ()); } - @Override - public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + @Override + public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB mask, List list, Entity p_185477_6_) { - TileEntityGraveSlave graveSlave = TileTools.getTileEntity(worldIn, pos, TileEntityGraveSlave.class); - if(graveSlave != null && graveSlave.getMasterBlock() != null && graveSlave.getMasterBlock().up().getY() == pos.getY()) - { - setBlockBounds(0f, 0f, 0f, 1f, 1f, 1f); - } else { - setBlockBounds(0, 0, 0, 1, .1425f, 1); - } - } - - @Override - public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) { TileEntityGraveSlave graveSlave = TileTools.getTileEntity(worldIn, pos, TileEntityGraveSlave.class); if (graveSlave != null && graveSlave.getMasterBlock() != null) { IBlockState masterState = worldIn.getBlockState(graveSlave.getMasterBlock()); @@ -109,72 +104,55 @@ public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState sta if (masterState.getBlock() instanceof BlockGraveStone) { boolean hasLid = actualState.getValue(BlockGraveStone.HASLID); if (worldIn.getBlockState(pos.up()).getBlock() instanceof BlockGraveSlave || worldIn.getBlockState(pos.up()).getBlock() instanceof BlockGraveStone) { - setBlockBounds(0f, 0f, 0f, 1f, 0.01f, 1f); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, 1f, 0.01f, 1f)); switch (facing) { case NORTH: - setBlockBounds(0f, 0f, 0f, pixel, 1f, 1f); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); - setBlockBounds(1f - pixel, 0f, 0f, 1f, 1f, 1f); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, pixel, 1f, 1f)); + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(1f - pixel, 0f, 0f, 1f, 1f, 1f)); if(isFoot) { - setBlockBounds(0f, 0f, 0f, 1f, 1f, pixel); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, 1f, 1f, pixel)); } else { - setBlockBounds(0f, 0f, 1f - pixel, 1f, 1f, 1f); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 1f - pixel, 1f, 1f, 1f)); } break; case SOUTH: - setBlockBounds(0f, 0f, 0f, pixel, 1f, 1f); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); - setBlockBounds(1f - pixel, 0f, 0f, 1f, 1f, 1f); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, pixel, 1f, 1f)); + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(1f - pixel, 0f, 0f, 1f, 1f, 1f)); if(!isFoot) { - setBlockBounds(0f, 0f, 0f, 1f, 1f, pixel); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, 1f, 1f, pixel)); } else { - setBlockBounds(0f, 0f, 1f - pixel, 1f, 1f, 1f); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 1f - pixel, 1f, 1f, 1f)); } break; case WEST: - setBlockBounds(0f, 0f, 0f, 1f, 1f, pixel); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); - setBlockBounds(0f, 0f, 1f - pixel, 1f, 1f, 1f); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, 1f, 1f, pixel)); + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 1f - pixel, 1f, 1f, 1f)); if(isFoot) { - setBlockBounds(0f, 0f, 0f, pixel, 1f, 1f); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, pixel, 1f, 1f)); } else { - setBlockBounds(1f - pixel, 0f, 0f, 1f, 1f, 1f); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(1f - pixel, 0f, 0f, 1f, 1f, 1f)); } break; case EAST: - setBlockBounds(0f, 0f, 0f, 1f, 1f, pixel); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); - setBlockBounds(0f, 0f, 1f - pixel, 1f, 1f, 1f); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, 1f, 1f, pixel)); + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 1f - pixel, 1f, 1f, 1f)); if(!isFoot) { - setBlockBounds(0f, 0f, 0f, pixel, 1f, 1f); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, pixel, 1f, 1f)); } else { - setBlockBounds(1f - pixel, 0f, 0f, 1f, 1f, 1f); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(1f - pixel, 0f, 0f, 1f, 1f, 1f)); } break; } @@ -183,13 +161,11 @@ public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState sta { if(hasLid) { - setBlockBounds(0, 0, 0, 1, .1425f, 1); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0, 0, 0, 1, .1425f, 1)); } else { - setBlockBounds(0, 0, 0, .000001f, .000001f, .000001f); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0, 0, 0, .000001f, .000001f, .000001f)); } } } @@ -223,7 +199,7 @@ else if(pos.equals(master.getPos().down())) { st = SlaveType.BOX; } - else if(pos.equals(master.getPos().down().offset(masterFacing))) + else if(pos.equals(master.getPos().offset(masterFacing).down())) { st = SlaveType.BOXFOOT; } @@ -238,37 +214,22 @@ else if(pos.equals(master.getPos().down().offset(masterFacing))) return super.getActualState(state, worldIn, pos); } - @Override - public boolean addLandingEffects(WorldServer worldObj, BlockPos blockPosition, IBlockState iblockstate, EntityLivingBase entity, int numberOfParticles) { - return super.addLandingEffects(worldObj, blockPosition, iblockstate, entity, numberOfParticles); - } - - @Override - public boolean addHitEffects(World worldObj, MovingObjectPosition target, EffectRenderer effectRenderer) - { - return super.addHitEffects(worldObj, target, effectRenderer); - } - @Override - public boolean addDestroyEffects(World world, BlockPos pos, EffectRenderer effectRenderer) - { - return super.addDestroyEffects(world, pos, effectRenderer); - } @Override - public boolean isOpaqueCube() + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean isFullBlock() + public boolean isFullBlock(IBlockState state) { return false; } @Override - public boolean isFullCube() + public boolean isFullCube(IBlockState state) { return false; } diff --git a/src/main/java/com/fireball1725/graves/block/BlockGraveStone.java b/src/main/java/com/fireball1725/graves/block/BlockGraveStone.java index 377dad1..94cb0dc 100644 --- a/src/main/java/com/fireball1725/graves/block/BlockGraveStone.java +++ b/src/main/java/com/fireball1725/graves/block/BlockGraveStone.java @@ -1,12 +1,11 @@ package com.fireball1725.graves.block; -import com.fireball1725.graves.helpers.LogHelper; import com.fireball1725.graves.tileentity.TileEntityGraveStone; import com.fireball1725.graves.util.TileTools; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyDirection; -import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -14,9 +13,10 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -26,30 +26,32 @@ public class BlockGraveStone extends BlockBase { public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); - public static final PropertyBool HASLID = PropertyBool.create("hasLid"); + public static final PropertyBool HASLID = PropertyBool.create("haslid"); public BlockGraveStone() { super(Material.cloth); - setDefaultState(blockState.getBaseState().withProperty(HASLID, true).withProperty(FACING, EnumFacing.NORTH)); - setHardness(1F); - this.setResistance(10000F); + setDefaultState(this.blockState.getBaseState().withProperty(HASLID, true).withProperty(FACING, EnumFacing.NORTH)); + setHardness(1F); + this.setResistance(10000F); this.setTileEntity(TileEntityGraveStone.class); } - @Override - public boolean canEntityDestroy(IBlockAccess world, BlockPos pos, Entity entity) { - return false; - } + @Override + public boolean canEntityDestroy(IBlockState state, IBlockAccess world, BlockPos pos, Entity entity) + { + return false; + } @Override public Item getItemDropped(IBlockState state, Random rand, int fortune) { return null; } - @Override - public int getRenderType() { - return 3; - } + @Override + public EnumBlockRenderType getRenderType(IBlockState state) + { + return EnumBlockRenderType.MODEL; + } @Override public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player) { @@ -57,9 +59,10 @@ public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, Enti } @Override - protected BlockState createBlockState() { - return new BlockState(this, HASLID, FACING); - } + protected BlockStateContainer createBlockState() + { + return new BlockStateContainer(this, HASLID, FACING); + } @Override public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) { @@ -80,28 +83,25 @@ public int getMetaFromState(IBlockState state) { return state.getValue(FACING).getIndex(); } - @Override - public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) { - setBlockBounds(0, 0, 0, 1, .1425f, 1); - } - - @Override - public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) { - IBlockState actualState = getActualState(state, worldIn, pos); - boolean hasLid = actualState.getValue(BlockGraveStone.HASLID); - if (hasLid) { - setBlockBounds(0, 0, 0, 1, .1425f, 1); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); - } else { - setBlockBounds(0, 0, 0, 0, 0, 0); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); - } - } + @Override + public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB mask, List list, Entity p_185477_6_) + { + IBlockState actualState = getActualState(state, worldIn, pos); + boolean hasLid = actualState.getValue(BlockGraveStone.HASLID); + if (hasLid) { + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0, 0, 0, 1, .1425f, 1)); + } + else + { + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0, 0, 0, 0, 0, 0)); + } + } - @Override - public AxisAlignedBB getSelectedBoundingBox(World worldIn, BlockPos pos) { - return AxisAlignedBB.fromBounds(0, 0, 0, 1, .1425f, 1).offset(pos.getX(), pos.getY(), pos.getZ()); - } + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) + { + return new AxisAlignedBB(0, 0, 0, 1, .1425f, 1); + } @Override public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { @@ -118,19 +118,22 @@ public void onBlockPlacedBy(World world, BlockPos blockPos, IBlockState state, E } @Override - public boolean isOpaqueCube() { - return false; - } + public boolean isOpaqueCube(IBlockState state) + { + return false; + } @Override - public boolean isFullBlock() { - return false; - } + public boolean isFullBlock(IBlockState state) + { + return false; + } @Override - public boolean isFullCube() { - return false; - } + public boolean isFullCube(IBlockState state) + { + return false; + } @Override public void onBlockExploded(World world, BlockPos pos, Explosion explosion) { diff --git a/src/main/java/com/fireball1725/graves/block/BlockHeadStone.java b/src/main/java/com/fireball1725/graves/block/BlockHeadStone.java index 6e87547..c079649 100644 --- a/src/main/java/com/fireball1725/graves/block/BlockHeadStone.java +++ b/src/main/java/com/fireball1725/graves/block/BlockHeadStone.java @@ -5,16 +5,18 @@ import com.fireball1725.graves.util.TileTools; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyDirection; -import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -35,21 +37,24 @@ protected BlockHeadStone() { } @Override - public int getRenderType() { - return 3; - } + public EnumBlockRenderType getRenderType(IBlockState state) + { + return EnumBlockRenderType.MODEL; + } - @Override - public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, boolean willHarvest) { - return willHarvest || super.removedByPlayer(world, pos, player, false); - } + @Override + public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) + { + return willHarvest || super.removedByPlayer(state, world, pos, player, false); + } @Override public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { TileEntityHeadStone headStone = TileTools.getTileEntity(world, pos, TileEntityHeadStone.class); - if (headStone != null && headStone.getCustomName() != "") { - final ItemStack itemStack = new ItemStack(this); - itemStack.setStackDisplayName(headStone.getCustomName()); + if(headStone != null && !headStone.getCustomName().isEmpty()) + { + final ItemStack itemStack = new ItemStack(this); + itemStack.setStackDisplayName(headStone.getCustomName()); ArrayList drops = new ArrayList(); drops.add(itemStack); @@ -59,73 +64,95 @@ public List getDrops(IBlockAccess world, BlockPos pos, IBlockState st return super.getDrops(world, pos, state, fortune); } - @Override - public void harvestBlock(World world, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) { - super.harvestBlock(world, player, pos, state, te); - world.setBlockToAir(pos); - } + @Override + public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te, ItemStack stack) + { + super.harvestBlock(worldIn, player, pos, state, te, stack); + worldIn.setBlockToAir(pos); + } - @Override - public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { - if (playerIn.capabilities.isCreativeMode) { - playerIn.openGui(Graves.instance, 0, worldIn, pos.getX(), pos.getY(), pos.getZ()); - } - return super.onBlockActivated(worldIn, pos, state, playerIn, side, hitX, hitY, hitZ); - } + @Override + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) + { + if(playerIn.capabilities.isCreativeMode) + { + playerIn.openGui(Graves.instance, 0, worldIn, pos.getX(), pos.getY(), pos.getZ()); + } + return super.onBlockActivated(worldIn, pos, state, playerIn, hand, heldItem, side, hitX, hitY, hitZ); + } @Override - protected BlockState createBlockState() { - return new BlockState(this, FACING); - } + protected BlockStateContainer createBlockState() + { + return new BlockStateContainer(this, FACING); + } @Override - public boolean isOpaqueCube() { - return false; - } + public boolean isOpaqueCube(IBlockState state) + { + return false; + } @Override - public boolean isFullBlock() { - return false; - } + public boolean isFullBlock(IBlockState state) + { + return false; + } @Override - public boolean isFullCube() { - return false; - } + public boolean isFullCube(IBlockState state) + { + return false; + } @Override public IBlockState getStateFromMeta(int meta) { return getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)); } - @Override - public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) { - IBlockState state = worldIn.getBlockState(pos); - switch (state.getValue(FACING)) { - case NORTH: - setBlockBounds(.1f, 0f, 0f, .9f, .95f, .3f); - break; - case SOUTH: - setBlockBounds(.1f, 0f, .7f, .9f, .95f, 1f); - break; - case WEST: - setBlockBounds(0f, 0f, .1f, .3f, .95f, .9f); - break; - case EAST: - setBlockBounds(.7f, 0f, .1f, 1f, .95f, .9f); - break; - } - } - - @Override - public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) { - setBlockBoundsBasedOnState(worldIn, pos); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); - } - - @Override - public int getMetaFromState(IBlockState state) { - return state.getValue(FACING).getHorizontalIndex(); + @Override + public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB mask, List list, Entity p_185477_6_) + { + IBlockState astate = worldIn.getBlockState(pos); + switch(astate.getValue(FACING)) + { + case NORTH: + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(.1f, 0f, 0f, .9f, .95f, .3f)); + break; + case SOUTH: + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(.1f, 0f, .7f, .9f, .95f, 1f)); + break; + case WEST: + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, .1f, .3f, .95f, .9f)); + break; + case EAST: + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(.7f, 0f, .1f, 1f, .95f, .9f)); + break; + } + } + + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) + { + IBlockState astate = source.getBlockState(pos); + switch(astate.getValue(FACING)) + { + case NORTH: + return new AxisAlignedBB(.1f, 0f, 0f, .9f, .95f, .3f); + case SOUTH: + return new AxisAlignedBB(.1f, 0f, .7f, .9f, .95f, 1f); + case WEST: + return new AxisAlignedBB(0f, 0f, .1f, .3f, .95f, .9f); + case EAST: + return new AxisAlignedBB(.7f, 0f, .1f, 1f, .95f, .9f); + } + return null; + } + + @Override + public int getMetaFromState(IBlockState state) + { + return state.getValue(FACING).getHorizontalIndex(); } diff --git a/src/main/java/com/fireball1725/graves/block/Blocks.java b/src/main/java/com/fireball1725/graves/block/Blocks.java index 6850889..ddcc59d 100644 --- a/src/main/java/com/fireball1725/graves/block/Blocks.java +++ b/src/main/java/com/fireball1725/graves/block/Blocks.java @@ -6,7 +6,7 @@ import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemBlock; -import net.minecraft.util.StatCollector; +import net.minecraft.util.text.translation.I18n; import net.minecraftforge.fml.common.registry.GameRegistry; public enum Blocks { @@ -52,8 +52,8 @@ public String getInternalName() { } public String getStatName() { - return StatCollector.translateToLocal(block.getUnlocalizedName().replace("tileentity.", "block.")); - } + return I18n.translateToLocal(block.getUnlocalizedName().replace("tileentity.", "block.")); + } private void register() { GameRegistry.registerBlock(block.setCreativeTab(creativeTabs).setUnlocalizedName(internalName), itemBlockClass, internalName); diff --git a/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java b/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java index 038f912..8c3b7df 100644 --- a/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java +++ b/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java @@ -2,7 +2,6 @@ import com.fireball1725.graves.block.BlockGraveSlave; import com.fireball1725.graves.block.BlockGraveStone; -import com.fireball1725.graves.helpers.LogHelper; import com.fireball1725.graves.tileentity.TileEntityGraveSlave; import com.fireball1725.graves.tileentity.TileEntityGraveStone; import com.fireball1725.graves.util.TileTools; @@ -14,7 +13,7 @@ import net.minecraft.client.renderer.BlockRendererDispatcher; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.VertexBuffer; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.renderer.texture.TextureMap; @@ -24,7 +23,7 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -71,7 +70,7 @@ public void renderExtraBlockBreak(RenderWorldLastEvent event) { blocks.add(pos.down().offset(master.getBlockState().getValue(BlockGraveStone.FACING))); drawBlockDamageTexture(Tessellator.getInstance(), - Tessellator.getInstance().getWorldRenderer(), + Tessellator.getInstance().getBuffer(), player, event.partialTicks, world, @@ -82,7 +81,7 @@ public void renderExtraBlockBreak(RenderWorldLastEvent event) { } // RenderGlobal.drawBlockDamageTexture - public void drawBlockDamageTexture(Tessellator tessellatorIn, WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, World world, List blocks) + public void drawBlockDamageTexture(Tessellator tessellatorIn, VertexBuffer worldRendererIn, Entity entityIn, float partialTicks, World world, List blocks) { double d0 = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * (double)partialTicks; double d1 = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double)partialTicks; @@ -121,7 +120,7 @@ public void drawBlockDamageTexture(Tessellator tessellatorIn, WorldRenderer worl { IBlockState iblockstate = world.getBlockState(blockpos); - if (iblockstate.getBlock().getMaterial() != Material.air) + if(iblockstate.getBlock().getMaterial(iblockstate) != Material.air) { TextureAtlasSprite textureatlassprite = this.destroyBlockIcons[progress]; BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher(); diff --git a/src/main/java/com/fireball1725/graves/client/render/entity/LayerHumanCape.java b/src/main/java/com/fireball1725/graves/client/render/entity/LayerHumanCape.java index 878ebfe..72afae0 100644 --- a/src/main/java/com/fireball1725/graves/client/render/entity/LayerHumanCape.java +++ b/src/main/java/com/fireball1725/graves/client/render/entity/LayerHumanCape.java @@ -4,8 +4,8 @@ import com.fireball1725.graves.util.TextureUtils; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.layers.LayerRenderer; -import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.MathHelper; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; diff --git a/src/main/java/com/fireball1725/graves/client/render/entity/RenderPlayerZombie.java b/src/main/java/com/fireball1725/graves/client/render/entity/RenderPlayerZombie.java index 2e55013..20d5952 100644 --- a/src/main/java/com/fireball1725/graves/client/render/entity/RenderPlayerZombie.java +++ b/src/main/java/com/fireball1725/graves/client/render/entity/RenderPlayerZombie.java @@ -2,8 +2,8 @@ import com.fireball1725.graves.configuration.ConfigZombie; import com.fireball1725.graves.entity.EntityPlayerZombie; -import com.fireball1725.graves.helpers.IDeadPlayerEntity; import com.fireball1725.graves.util.TextureUtils; +import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelPlayer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.RenderBiped; @@ -12,8 +12,8 @@ import net.minecraft.client.renderer.entity.layers.LayerBipedArmor; import net.minecraft.client.renderer.entity.layers.LayerCustomHead; import net.minecraft.client.renderer.entity.layers.LayerHeldItem; -import net.minecraft.entity.boss.BossStatus; import net.minecraft.item.ItemBow; +import net.minecraft.util.EnumHand; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; @@ -45,20 +45,20 @@ public void transformHeldFull3DItemLayer() { public void doRender(EntityPlayerZombie entity, double x, double y, double z, float f0, float partialTickTime) { setModel(entity); if (ConfigZombie.configZombieShowBossBar) - BossStatus.setBossStatus(entity, true); + { + // TODO: Do what was done here... + } - if (entity.getHeldItem() != null && entity.getHeldItem().getItem() instanceof ItemBow) - modelBipedMain.aimedBow = true; - else - modelBipedMain.aimedBow = false; + if(entity.getHeldItem(EnumHand.MAIN_HAND) != null && entity.getHeldItem(EnumHand.MAIN_HAND).getItem() instanceof ItemBow) + { modelBipedMain.rightArmPose = ModelBiped.ArmPose.BOW_AND_ARROW; } super.doRender(entity, x, y, z, f0, partialTickTime); } @Override protected ResourceLocation getEntityTexture(EntityPlayerZombie entity) { - return TextureUtils.getPlayerSkin(((IDeadPlayerEntity) entity).getProfile()); - } + return TextureUtils.getPlayerSkin((entity).getProfile()); + } @Override protected void preRenderCallback(EntityPlayerZombie entity, float float0) { diff --git a/src/main/java/com/fireball1725/graves/creativetab/ModCreativeTabs.java b/src/main/java/com/fireball1725/graves/creativetab/ModCreativeTabs.java index 3ecbf1a..7fa7876 100644 --- a/src/main/java/com/fireball1725/graves/creativetab/ModCreativeTabs.java +++ b/src/main/java/com/fireball1725/graves/creativetab/ModCreativeTabs.java @@ -9,7 +9,7 @@ public class ModCreativeTabs { public static final CreativeTabs tabGraves = new CreativeTabs(ModInfo.MOD_ID) { @Override public Item getTabIconItem() { - return Blocks.BLOCK_GRAVE_HEADSTONE.block.getItem(null, null); - } - }; + return Item.getItemFromBlock(Blocks.BLOCK_GRAVE_HEADSTONE.block); + } + }; } diff --git a/src/main/java/com/fireball1725/graves/entity/EntityFlying.java b/src/main/java/com/fireball1725/graves/entity/EntityFlying.java index a319940..c6bef41 100644 --- a/src/main/java/com/fireball1725/graves/entity/EntityFlying.java +++ b/src/main/java/com/fireball1725/graves/entity/EntityFlying.java @@ -2,8 +2,8 @@ import net.minecraft.block.Block; import net.minecraft.entity.monster.EntityMob; -import net.minecraft.util.BlockPos; -import net.minecraft.util.MathHelper; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; public abstract class EntityFlying extends EntityMob diff --git a/src/main/java/com/fireball1725/graves/entity/EntityPlayerZombie.java b/src/main/java/com/fireball1725/graves/entity/EntityPlayerZombie.java index e2cb214..09b01c8 100644 --- a/src/main/java/com/fireball1725/graves/entity/EntityPlayerZombie.java +++ b/src/main/java/com/fireball1725/graves/entity/EntityPlayerZombie.java @@ -5,36 +5,45 @@ import com.fireball1725.graves.helpers.LogHelper; import com.google.common.base.Predicate; import com.mojang.authlib.GameProfile; -import net.minecraft.client.Minecraft; -import net.minecraft.enchantment.Enchantment; -import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.*; import net.minecraft.entity.ai.*; import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.boss.IBossDisplayData; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.Items; -import net.minecraft.item.ItemBow; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.datasync.DataParameter; +import net.minecraft.network.datasync.DataSerializers; +import net.minecraft.network.datasync.EntityDataManager; import net.minecraft.tileentity.TileEntitySkull; -import net.minecraft.util.*; -import net.minecraft.world.*; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.Style; +import net.minecraft.util.text.TextComponentString; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import org.apache.commons.lang3.StringUtils; import java.util.*; -public class EntityPlayerZombie extends EntityFlying implements IRangedAttackMob, IDeadPlayerEntity, IBossDisplayData { - private static final int NAME = 13; - private static final int CHILD = 14; - private static final int WIDTH = 16; - private static final int HEIGHT = 17; - private final EntityAIBreakDoor breakDoorAI = new EntityAIBreakDoor(this); - private final EntityAIArrowAttack arrowAI = new EntityAIArrowAttack(this, 1.0D, 20, 60, 15.0F); - private double prevCapeX, prevCapeY, prevCapeZ; +public class EntityPlayerZombie extends EntityFlying implements IDeadPlayerEntity +{ + private static final DataParameter NAME = EntityDataManager.createKey(EntityPlayerZombie.class, DataSerializers.STRING); + private static final DataParameter CHILD = EntityDataManager.createKey(EntityPlayerZombie.class, DataSerializers.BYTE); + private static final DataParameter WIDTH = EntityDataManager.createKey(EntityPlayerZombie.class, DataSerializers.FLOAT); + private static final DataParameter HEIGHT = EntityDataManager.createKey(EntityPlayerZombie.class, DataSerializers.FLOAT); + private final EntityAIBreakDoor breakDoorAI = new EntityAIBreakDoor(this); + private double prevCapeX, prevCapeY, prevCapeZ; private double capeX, capeY, capeZ; private GameProfile profile; private EntityPlayer player; @@ -52,8 +61,8 @@ public EntityPlayerZombie(World world) { tasks.addTask(4, new AIPlayerZombieAttackTarget()); tasks.addTask(1, new EntityAIOpenDoor(this, true)); - tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false)); - tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D)); + tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false)); + tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D)); tasks.addTask(7, new EntityAIWander(this, 1.0D)); tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); @@ -73,11 +82,12 @@ public void setPlayer(EntityPlayer player) { this.player = player; } - @Override - public boolean writeMountToNBT(NBTTagCompound tagCompund) { - tagCompund.setBoolean("[GoldenLassoPrevent]", true); // Make it so ExU2 cursed lassos are disabled - return super.writeMountToNBT(tagCompund); - } + @Override + public void writeToNBT(NBTTagCompound tagCompund) + { + tagCompund.setBoolean("[GoldenLassoPrevent]", true); // Make it so ExU2 cursed lassos are disabled + super.writeToNBT(tagCompund); + } @Override public boolean canPickUpLoot() { @@ -126,12 +136,12 @@ public void onUpdate() { capeY += y * 0.25; if (worldObj.isRemote) { - float w = dataWatcher.getWatchableObjectFloat(WIDTH); - if (w != width) - width = w; - float h = dataWatcher.getWatchableObjectFloat(HEIGHT); - if (h != height) - height = h; + float w = dataWatcher.get(WIDTH); + if(w != width) + width = w; + float h = dataWatcher.get(HEIGHT); + if(h != height) + height = h; } if (this.player != null) { @@ -147,45 +157,49 @@ public void onUpdate() { @Override protected void applyEntityAttributes() { super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(ConfigZombie.configZombieDefaultFollowRange); - getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(ConfigZombie.configZombieDefaultSpeed); - getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(ConfigZombie.configZombieDefaultBaseDamage); - } + getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(ConfigZombie.configZombieDefaultFollowRange); + getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(ConfigZombie.configZombieDefaultSpeed); + getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(ConfigZombie.configZombieDefaultBaseDamage); + } @Override protected void entityInit() { super.entityInit(); - getDataWatcher().addObject(NAME, ""); - getDataWatcher().addObject(CHILD, (byte) 0); - getDataWatcher().addObject(WIDTH, width); - getDataWatcher().addObject(HEIGHT, height); - } - - @Override - protected String getLivingSound() { - return "graves:graveZombieIdle"; - } - - @Override - protected String getHurtSound() { - return "graves:graveZombieAttack"; - } + dataWatcher.register(NAME, ""); + dataWatcher.register(CHILD, (byte) 0); + dataWatcher.register(WIDTH, width); + dataWatcher.register(HEIGHT, height); + } - @Override - protected String getDeathSound() { - return "graves:graveZombieDeath"; - } + //TODO: Add Sounds when not completely broken. + // @Override + // protected SoundEvent getAmbientSound() + // { + // return SoundHelper.getRegisteredSoundEvent("graves:graveZombieIdle"); + // } + // + // @Override + // protected SoundEvent getHurtSound() + // { + // return SoundHelper.getRegisteredSoundEvent("graves:graveZombieAttack"); + // } + // + // @Override + // public SoundCategory getSoundCategory() + // { + // return SoundCategory.HOSTILE; + // } + // + // @Override + // protected String getDeathSound() { + // return "graves:graveZombieDeath"; + // } @Override protected void dropFewItems(boolean recentHit, int looting) { } - @Override - protected void addRandomDrop() { - - } - @Override protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty) { super.setEquipmentBasedOnDifficulty(difficulty); @@ -193,23 +207,24 @@ protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty) { if (rand.nextFloat() < (worldObj.getDifficulty() == EnumDifficulty.HARD ? 0.1F : 0.05F)) { int i = rand.nextInt(3); - if (i == 0) - setCurrentItemOrArmor(0, new ItemStack(Items.stone_sword)); - else if (i == 1) - setCurrentItemOrArmor(0, new ItemStack(Items.bow)); - } - } + if(i == 0) + { setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.stone_sword)); } + else if(i == 1) + { setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.bow)); } + } + } - @Override - public void setCurrentItemOrArmor(int slot, ItemStack stack) { - super.setCurrentItemOrArmor(slot, stack); - setCombatAI(); - } + @Override + public void setItemStackToSlot(EntityEquipmentSlot slotIn, ItemStack stack) + { + super.setItemStackToSlot(slotIn, stack); + } @Override - public ItemStack getPickedResult(MovingObjectPosition target) { - ItemStack stack = new ItemStack(Items.spawn_egg); - NBTTagCompound nbt = new NBTTagCompound(); + public ItemStack getPickedResult(RayTraceResult target) + { + ItemStack stack = new ItemStack(Items.spawn_egg); + NBTTagCompound nbt = new NBTTagCompound(); nbt.setString("entity_name", EntityList.classToStringMapping.get(getClass())); stack.setTagCompound(nbt); return stack; @@ -222,23 +237,22 @@ public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLi setEquipmentBasedOnDifficulty(difficulty); setEnchantmentBasedOnDifficulty(difficulty); - setCombatAI(); - float additionalDifficulty = difficulty.getClampedAdditionalDifficulty(); - getEntityAttribute(SharedMonsterAttributes.knockbackResistance).applyModifier(new AttributeModifier("Knockback Resistance Bonus", rand.nextDouble() * 50, 0)); + float additionalDifficulty = difficulty.getClampedAdditionalDifficulty(); + getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(new AttributeModifier("Knockback Resistance Bonus", rand.nextDouble() * 50, 0)); double rangeBonus = rand.nextDouble() * 1.5 * additionalDifficulty; - if (rangeBonus > 1.0) - getEntityAttribute(SharedMonsterAttributes.followRange).applyModifier(new AttributeModifier("Range Bonus", rangeBonus, 2)); + if(rangeBonus > 1.0) + { getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).applyModifier(new AttributeModifier("Range Bonus", rangeBonus, 2)); } - if (rand.nextFloat() < additionalDifficulty * 0.05F) - getEntityAttribute(SharedMonsterAttributes.maxHealth).applyModifier(new AttributeModifier("Health Bonus", rand.nextDouble() * 3.0 + 1.0, 2)); + if(rand.nextFloat() < additionalDifficulty * 0.05F) + { getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(new AttributeModifier("Health Bonus", rand.nextDouble() * 3.0 + 1.0, 2)); } - if (rand.nextFloat() < additionalDifficulty * 0.15F) - getEntityAttribute(SharedMonsterAttributes.attackDamage).applyModifier(new AttributeModifier("Damage Bonus", rand.nextDouble() + 0.5, 2)); + if(rand.nextFloat() < additionalDifficulty * 0.15F) + { getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).applyModifier(new AttributeModifier("Damage Bonus", rand.nextDouble() + 0.5, 2)); } - if (rand.nextFloat() < additionalDifficulty * 0.2F) - getEntityAttribute(SharedMonsterAttributes.movementSpeed).applyModifier(new AttributeModifier("Speed Bonus", rand.nextDouble() * 2.0 * 0.24 + 0.01, 2)); + if(rand.nextFloat() < additionalDifficulty * 0.2F) + { getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).applyModifier(new AttributeModifier("Speed Bonus", rand.nextDouble() * 2.0 * 0.24 + 0.01, 2)); } if (rand.nextFloat() < additionalDifficulty * 0.1F) tasks.addTask(1, breakDoorAI); @@ -336,21 +350,21 @@ public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLi } if (ConfigZombie.configZombieArmorEnabled) { - if (slot0 != null) - this.setCurrentItemOrArmor(0, slot0); + if(slot0 != null) + { this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, slot0); } - if (slot1 != null) - this.setCurrentItemOrArmor(1, slot1); + if(slot1 != null) + { this.setItemStackToSlot(EntityEquipmentSlot.FEET, slot1); } - if (slot2 != null) - this.setCurrentItemOrArmor(2, slot2); + if(slot2 != null) + { this.setItemStackToSlot(EntityEquipmentSlot.LEGS, slot2); } - if (slot3 != null) - this.setCurrentItemOrArmor(3, slot3); + if(slot3 != null) + { this.setItemStackToSlot(EntityEquipmentSlot.CHEST, slot3); } - if (slot4 != null) - this.setCurrentItemOrArmor(4, slot4); - } + if(slot4 != null) + { this.setItemStackToSlot(EntityEquipmentSlot.HEAD, slot4); } + } this.setHealth(ConfigZombie.configZombieDefaultHealth); @@ -360,9 +374,9 @@ public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLi @Override protected void despawnEntity() { super.despawnEntity(); - if (isDead && ridingEntity != null) - ridingEntity.setDead(); - } + if(isDead && this.getRidingEntity() != null) + { getRidingEntity().setDead(); } + } @Override public double getYOffset() { @@ -391,51 +405,15 @@ public void readEntityFromNBT(NBTTagCompound nbt) { setUsername(username); graveMaster = BlockPos.fromLong(nbt.getLong("graveMaster")); - - setCombatAI(); } @Override public boolean attackEntityAsMob(Entity target) { boolean result = super.attackEntityAsMob(target); - if (result) - swingItem(); - return result; - } - - @Override - public void attackEntityWithRangedAttack(EntityLivingBase target, float damage) { - if (!hasBow()) - return; - - EntityArrow arrow = new EntityArrow(worldObj, this, target, 1.6F, 14 - worldObj.getDifficulty().getDifficultyId() * 4); - int power = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, getHeldItem()); - int punch = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, getHeldItem()); - arrow.setDamage(damage * 2.0F + rand.nextGaussian() * 0.25D + worldObj.getDifficulty().getDifficultyId() * 0.11F); - - if (power > 0) - arrow.setDamage(arrow.getDamage() + power * 0.5D + 0.5D); - - if (punch > 0) - arrow.setKnockbackStrength(punch); - - if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, getHeldItem()) > 0) - arrow.setFire(100); - - playSound("random.bow", 1.0F, 1.0F / (rand.nextFloat() * 0.4F + 0.8F)); - worldObj.spawnEntityInWorld(arrow); - } - - private boolean hasBow() { - return getHeldItem() != null && getHeldItem().getItem() instanceof ItemBow; - } - - private void setCombatAI() { - if (hasBow()) - tasks.addTask(1, arrowAI); - else - tasks.removeTask(arrowAI); - } + if(result) + { swingArm(EnumHand.MAIN_HAND); } + return result; + } @Override public String getName() { @@ -457,15 +435,20 @@ public boolean hasCustomName() { } @Override - public IChatComponent getDisplayName() { - return new ChatComponentText(getName()) { + public ITextComponent getDisplayName() + { + return new TextComponentString(getName()) + { - private ChatStyle style; + private Style style; @Override - public ChatStyle getChatStyle() { - if (style == null) { - style = new ChatStyle() { + public Style getChatStyle() + { + if(style == null) + { + style = new Style() + { @Override @SideOnly(Side.CLIENT) @@ -477,10 +460,10 @@ public String getFormattingCode() { Iterator iterator = siblings.iterator(); while (iterator.hasNext()) { - IChatComponent ichatcomponent = (IChatComponent) iterator.next(); - ichatcomponent.getChatStyle().setParentStyle(style); - } - } + ITextComponent ITextComponent = (ITextComponent) iterator.next(); + ITextComponent.getChatStyle().setParentStyle(style); + } + } return style; } @@ -500,11 +483,11 @@ public void setProfile(GameProfile profile) { @Override public String getUsername() { - String username = getDataWatcher().getWatchableObjectString(NAME); - if (StringUtils.isBlank(username)) - getDataWatcher().updateObject(NAME, "FireBall1725"); - if (username.equals("Soaryn")) - return "direwolf20"; + String username = dataWatcher.get(NAME); + if(StringUtils.isBlank(username)) + { dataWatcher.set(NAME, "FireBall1725"); } + if(username.equals("Soaryn")) + return "direwolf20"; if (username.equals("direwolf20")) return "Soaryn"; return username; @@ -512,13 +495,12 @@ public String getUsername() { @Override public void setUsername(String name) { - getDataWatcher().updateObject(NAME, name); String newName = ""; if ("Herobrine".equals(name)) { - getEntityAttribute(SharedMonsterAttributes.attackDamage).applyModifier(new AttributeModifier("Herobrine Damage Bonus", 1, 2)); - getEntityAttribute(SharedMonsterAttributes.movementSpeed).applyModifier(new AttributeModifier("Herobrine Speed Bonus", 0.5, 2)); - } + getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).applyModifier(new AttributeModifier("Herobrine Damage Bonus", 1, 2)); + getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).applyModifier(new AttributeModifier("Herobrine Speed Bonus", 0.5, 2)); + } if ("direwolf20".equals(name)) { newName = "Soaryn"; @@ -528,10 +510,12 @@ public void setUsername(String name) { newName = "direwolf20"; } - if (newName != "") { - name = newName; - } - } + if(!newName.isEmpty()) + { + name = newName; + } + dataWatcher.set(NAME, name); + } @Override public double getInterpolatedCapeX(float partialTickTime) { @@ -550,31 +534,38 @@ public double getInterpolatedCapeZ(float partialTickTime) { @Override public boolean isChild() { - return getDataWatcher().getWatchableObjectByte(CHILD) == 1; - } + return dataWatcher.get(CHILD) == 1; + } @Override protected void setSize(float width, float height) { super.setSize(width, height); - dataWatcher.updateObject(WIDTH, this.width); - dataWatcher.updateObject(HEIGHT, this.height); - } + dataWatcher.set(WIDTH, this.width); + dataWatcher.set(HEIGHT, this.height); + } + + public BlockPos getGraveMaster() + { + return graveMaster; + } public void setGraveMaster(BlockPos graveMaster) { this.graveMaster = graveMaster; } - public BlockPos getGraveMaster() + /** + * Returns false if this Entity is a boss, true otherwise. + */ + public boolean isNonBoss() { - return graveMaster; + return false; } - class PlayerZombieMoveTargetPos { - private EntityPlayerZombie playerZombie = EntityPlayerZombie.this; - - public double posX; - public double posY; + class PlayerZombieMoveTargetPos + { + public double posX; + public double posY; public double posZ; public double distX; public double distY; @@ -583,6 +574,7 @@ class PlayerZombieMoveTargetPos { public double aimX; public double aimY; public double aimZ; + private EntityPlayerZombie playerZombie = EntityPlayerZombie.this; public PlayerZombieMoveTargetPos() { this(0, 0, 0); @@ -631,25 +623,26 @@ public boolean isPathClear(double howFar) { // check there's nothing in the way if (this.isBoxBlocked(box.offset(this.aimX * i, this.aimY * i, this.aimZ * i))) { return false; - } - } - if (this.isBoxBlocked(box.offset(this.aimX * howFar, this.aimY * howFar, this.aimZ * howFar))) { - return false; - } - return true; - } + } + } + return !this.isBoxBlocked(box.offset(this.aimX * howFar, this.aimY * howFar, this.aimZ * howFar)); + } + + } + - } class PlayerZombieMoveHelper extends EntityMoveHelper { private EntityPlayerZombie playerZombie = EntityPlayerZombie.this; private int courseChangeCooldown = 0; private double closeEnough = 0.3D; private PlayerZombieMoveTargetPos targetPos = new PlayerZombieMoveTargetPos(); + private boolean update; - public PlayerZombieMoveHelper() { - super(EntityPlayerZombie.this); - } + public PlayerZombieMoveHelper() + { + super(EntityPlayerZombie.this); + } @Override public void setMoveTo(double x, double y, double z, double speedIn) { @@ -691,17 +684,20 @@ public void onUpdateMoveHelper() { // abandon this movement if we have reached the target or there is no longer a clear path to the target if (!this.targetPos.isPathClear(5.0D)) { //LogHelper.info(">>> Abandoning move target - way is blocked"); + this.update = true; } else if (this.targetPos.dist < this.closeEnough) { //LogHelper.info(">>> Arrived (close enough) dist:" + this.targetPos.dist); this.update = true; } - } + } + + } + - } - // AI class for implementing the random flying behaviour - class AIPlayerZombieRandomFly extends EntityAIBase { + // AI class for implementing the random flying behaviour + class AIPlayerZombieRandomFly extends EntityAIBase { private EntityPlayerZombie playerZombie = EntityPlayerZombie.this; private PlayerZombieMoveTargetPos targetPos = new PlayerZombieMoveTargetPos(); @@ -782,11 +778,12 @@ public boolean tryGoing(double dirX, double dirY, double dirZ) { } return result; } - } + } + - // AI class for implementing the behaviour to target and attack players - class AIPlayerZombieAttackTarget extends EntityAIBase { + // AI class for implementing the behaviour to target and attack players + class AIPlayerZombieAttackTarget extends EntityAIBase { private EntityPlayerZombie playerZombie = EntityPlayerZombie.this; private int attackTick = 0; private PlayerZombieMoveTargetPos targetPos = new PlayerZombieMoveTargetPos(); @@ -842,6 +839,4 @@ public boolean continueExecuting() { return true; } } - - } diff --git a/src/main/java/com/fireball1725/graves/event/EventBlockBreak.java b/src/main/java/com/fireball1725/graves/event/EventBlockBreak.java index eb017c2..17056ac 100644 --- a/src/main/java/com/fireball1725/graves/event/EventBlockBreak.java +++ b/src/main/java/com/fireball1725/graves/event/EventBlockBreak.java @@ -7,9 +7,7 @@ import com.fireball1725.graves.tileentity.TileEntityGraveSlave; import com.fireball1725.graves.tileentity.TileEntityGraveStone; import com.fireball1725.graves.util.TileTools; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.EnumDifficulty; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.world.BlockEvent; @@ -85,8 +83,8 @@ public void onBreakBlock(BlockEvent.BreakEvent event) { // nbtTagCompound.setIntArray("MasterGrave", new int[]{graveStone.getPos().getX(), graveStone.getPos().getY(), graveStone.getPos().getZ()}); event.world.spawnEntityInWorld(playerZombie); - event.world.playSoundEffect(event.pos.getX(), event.pos.getY(), event.pos.getZ(), "graves:graveZombieSpawn", 1, 1); - } + // event.world.playSound(event.pos.getX(), event.pos.getY(), event.pos.getZ(), SoundHelper.getRegisteredSoundEvent("graves:graveZombieSpawn"), SoundCategory.HOSTILE, 1, 1, true); + } event.setCanceled(true); return; diff --git a/src/main/java/com/fireball1725/graves/event/EventDeathHandler.java b/src/main/java/com/fireball1725/graves/event/EventDeathHandler.java index 10d0eea..afd1831 100644 --- a/src/main/java/com/fireball1725/graves/event/EventDeathHandler.java +++ b/src/main/java/com/fireball1725/graves/event/EventDeathHandler.java @@ -10,16 +10,14 @@ import com.fireball1725.graves.tileentity.TileEntityGraveStone; import com.fireball1725.graves.tileentity.TileEntityHeadStone; import com.fireball1725.graves.util.TileTools; -import jdk.nashorn.internal.ir.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.GameRules; import net.minecraft.world.World; -import net.minecraftforge.event.entity.living.LivingDeathEvent; import net.minecraftforge.event.entity.player.PlayerDropsEvent; import net.minecraftforge.fml.common.event.FMLInterModComms; import net.minecraftforge.fml.common.eventhandler.EventPriority; @@ -28,6 +26,23 @@ import java.util.List; public class EventDeathHandler { + /** + * @param mod Your @Mod.instance object. + * @param player The player we are setting the gps for. + * @param pos The destination position. + * @param text The short description of the destination + */ + + public static void sendTomTomPos(Object mod, EntityPlayer player, BlockPos pos, String text) + { + NBTTagCompound tag = new NBTTagCompound(); + tag.setLong("location", pos.toLong()); + tag.setLong("uuid-most", player.getUniqueID().getMostSignificantBits()); + tag.setLong("uuid-least", player.getUniqueID().getLeastSignificantBits()); + tag.setString("text", text); + FMLInterModComms.sendRuntimeMessage(mod, "tomtom", "setPointer", tag); + } + @SubscribeEvent(priority = EventPriority.LOW, receiveCanceled = true) public void onPlayerDrops(PlayerDropsEvent event) { @@ -101,21 +116,4 @@ public void onPlayerDrops(PlayerDropsEvent event) { event.drops.clear(); } - - /** - * @param mod Your @Mod.instance object. - * @param player The player we are setting the gps for. - * @param pos The destination position. - * @param text The short description of the destination - */ - - public static void sendTomTomPos(Object mod, EntityPlayer player, BlockPos pos, String text) - { - NBTTagCompound tag = new NBTTagCompound(); - tag.setLong("location", pos.toLong()); - tag.setLong("uuid-most", player.getUniqueID().getMostSignificantBits()); - tag.setLong("uuid-least", player.getUniqueID().getLeastSignificantBits()); - tag.setString("text", text); - FMLInterModComms.sendRuntimeMessage(mod, "tomtom", "setPointer", tag); - } } diff --git a/src/main/java/com/fireball1725/graves/helpers/SafeBlockReplacer.java b/src/main/java/com/fireball1725/graves/helpers/SafeBlockReplacer.java index f3beebc..81e5f67 100644 --- a/src/main/java/com/fireball1725/graves/helpers/SafeBlockReplacer.java +++ b/src/main/java/com/fireball1725/graves/helpers/SafeBlockReplacer.java @@ -2,8 +2,8 @@ import net.minecraft.block.BlockAir; import net.minecraft.block.state.IBlockState; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class SafeBlockReplacer { @@ -26,8 +26,8 @@ else if (forceAir) return false; // Make sure the block isn't unbreakable - if (blockState.getBlock().getBlockHardness(world, blockPos) == -1.0F) - return false; + if(blockState.getBlock().getBlockHardness(world.getBlockState(blockPos), world, blockPos) == -1.0F) + { return false; } // Make sure the block is on the whitelist return BreakableWhiteListHelper.checkBlock(blockState); diff --git a/src/main/java/com/fireball1725/graves/helpers/SoundHelper.java b/src/main/java/com/fireball1725/graves/helpers/SoundHelper.java new file mode 100644 index 0000000..ed6c603 --- /dev/null +++ b/src/main/java/com/fireball1725/graves/helpers/SoundHelper.java @@ -0,0 +1,21 @@ +package com.fireball1725.graves.helpers; + +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundEvent; + +public class SoundHelper +{ + public static SoundEvent getRegisteredSoundEvent(String id) + { + SoundEvent soundevent = SoundEvent.soundEventRegistry.getObject(new ResourceLocation(id)); + + if(soundevent == null) + { + throw new IllegalStateException("Invalid Sound requested: " + id); + } + else + { + return soundevent; + } + } +} diff --git a/src/main/java/com/fireball1725/graves/item/ItemHeadStone.java b/src/main/java/com/fireball1725/graves/item/ItemHeadStone.java index 9154de5..ca9024b 100644 --- a/src/main/java/com/fireball1725/graves/item/ItemHeadStone.java +++ b/src/main/java/com/fireball1725/graves/item/ItemHeadStone.java @@ -1,10 +1,10 @@ package com.fireball1725.graves.item; +import com.mojang.realmsclient.gui.ChatFormatting; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; import java.util.List; @@ -16,7 +16,7 @@ public ItemHeadStone(Block block) { @Override public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced) { if (!stack.hasDisplayName()) { - tooltip.add(EnumChatFormatting.GREEN + "Rename in anvil to name Head Stone"); - } - } + tooltip.add(ChatFormatting.GREEN + "Rename in anvil to name Head Stone"); + } + } } diff --git a/src/main/java/com/fireball1725/graves/network/messages/MessageSetHeadstoneName.java b/src/main/java/com/fireball1725/graves/network/messages/MessageSetHeadstoneName.java index 080b882..1d75de5 100644 --- a/src/main/java/com/fireball1725/graves/network/messages/MessageSetHeadstoneName.java +++ b/src/main/java/com/fireball1725/graves/network/messages/MessageSetHeadstoneName.java @@ -3,7 +3,7 @@ import com.fireball1725.graves.tileentity.TileEntityHeadStone; import com.fireball1725.graves.util.TileTools; import io.netty.buffer.ByteBuf; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraftforge.fml.common.network.ByteBufUtils; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; diff --git a/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java b/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java index f742867..fbf76ee 100644 --- a/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java +++ b/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java @@ -10,8 +10,8 @@ import com.fireball1725.graves.reference.ModInfo; import com.fireball1725.graves.tileentity.TileEntityHeadStone; import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.resources.IReloadableResourceManager; -import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.client.model.obj.OBJLoader; diff --git a/src/main/java/com/fireball1725/graves/tileentity/TileEntityBase.java b/src/main/java/com/fireball1725/graves/tileentity/TileEntityBase.java index 40f5444..36776e6 100644 --- a/src/main/java/com/fireball1725/graves/tileentity/TileEntityBase.java +++ b/src/main/java/com/fireball1725/graves/tileentity/TileEntityBase.java @@ -9,9 +9,9 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import java.util.ArrayList; @@ -30,21 +30,22 @@ public static void registerTileItem(Class c, ItemStackSrc wat) { public Packet getDescriptionPacket() { NBTTagCompound data = new NBTTagCompound(); writeToNBT(data); - return new S35PacketUpdateTileEntity(this.pos, 1, data); - } + return new SPacketUpdateTileEntity(this.pos, 1, data); + } @Override - public void onDataPacket(NetworkManager networkManager, S35PacketUpdateTileEntity s35PacketUpdateTileEntity) { - readFromNBT(s35PacketUpdateTileEntity.getNbtCompound()); - worldObj.markBlockRangeForRenderUpdate(this.pos, this.pos); - markForUpdate(); + public void onDataPacket(NetworkManager networkManager, SPacketUpdateTileEntity sPacketUpdateTileEntity) + { + readFromNBT(sPacketUpdateTileEntity.getNbtCompound()); + worldObj.markBlockRangeForRenderUpdate(this.pos, this.pos); + markForUpdate(); } public void markForUpdate() { if (this.renderedFragment > 0) { this.renderedFragment |= 0x1; } else if (this.worldObj != null) { - this.worldObj.markBlockForUpdate(this.pos); + this.worldObj.notifyBlockUpdate(this.pos, this.getBlockState(), this.getBlockState(), 0); Block block = worldObj.getBlockState(this.pos).getBlock(); diff --git a/src/main/java/com/fireball1725/graves/tileentity/TileEntityGraveSlave.java b/src/main/java/com/fireball1725/graves/tileentity/TileEntityGraveSlave.java index f5f69b8..3b66b0e 100644 --- a/src/main/java/com/fireball1725/graves/tileentity/TileEntityGraveSlave.java +++ b/src/main/java/com/fireball1725/graves/tileentity/TileEntityGraveSlave.java @@ -1,7 +1,7 @@ package com.fireball1725.graves.tileentity; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; public class TileEntityGraveSlave extends TileEntityBase { protected BlockPos masterBlock; diff --git a/src/main/java/com/fireball1725/graves/tileentity/TileEntityGraveStone.java b/src/main/java/com/fireball1725/graves/tileentity/TileEntityGraveStone.java index 10914d6..edb9959 100644 --- a/src/main/java/com/fireball1725/graves/tileentity/TileEntityGraveStone.java +++ b/src/main/java/com/fireball1725/graves/tileentity/TileEntityGraveStone.java @@ -4,7 +4,6 @@ import com.fireball1725.graves.block.Blocks; import com.fireball1725.graves.helpers.LogHelper; import com.fireball1725.graves.tileentity.inventory.InternalDynamicInventory; -import com.fireball1725.graves.tileentity.inventory.InternalInventory; import com.fireball1725.graves.tileentity.inventory.InventoryOperation; import com.fireball1725.graves.util.TileTools; import com.mojang.authlib.GameProfile; @@ -17,7 +16,7 @@ import net.minecraft.nbt.NBTUtil; import net.minecraft.network.Packet; import net.minecraft.util.EnumFacing; -import net.minecraft.util.IChatComponent; +import net.minecraft.util.text.ITextComponent; import java.util.List; import java.util.Random; @@ -47,8 +46,8 @@ public boolean getHasLid() { public void setHasLid(boolean hasLid) { this.hasLid = hasLid; worldObj.setBlockState(pos, worldObj.getBlockState(pos).withProperty(BlockGraveStone.HASLID, false)); - worldObj.markBlockForUpdate(pos); - } + worldObj.notifyBlockUpdate(pos, getBlockState(), getBlockState(), 0); + } public GameProfile getPlayerProfile() { return playerProfile; @@ -168,7 +167,8 @@ public void clear() { } @Override - public IChatComponent getDisplayName() { - return null; - } + public ITextComponent getDisplayName() + { + return null; + } } diff --git a/src/main/java/com/fireball1725/graves/tileentity/inventory/InternalDynamicInventory.java b/src/main/java/com/fireball1725/graves/tileentity/inventory/InternalDynamicInventory.java index 13a3662..ec017d9 100644 --- a/src/main/java/com/fireball1725/graves/tileentity/inventory/InternalDynamicInventory.java +++ b/src/main/java/com/fireball1725/graves/tileentity/inventory/InternalDynamicInventory.java @@ -1,13 +1,12 @@ package com.fireball1725.graves.tileentity.inventory; -import com.fireball1725.graves.helpers.LogHelper; import com.fireball1725.graves.util.Platform; import com.fireball1725.graves.util.iterators.InventoryIterator; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.IChatComponent; +import net.minecraft.util.text.ITextComponent; import java.util.ArrayList; import java.util.Iterator; @@ -202,7 +201,8 @@ public boolean hasCustomName() { } @Override - public IChatComponent getDisplayName() { - return null; - } + public ITextComponent getDisplayName() + { + return null; + } } \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/tileentity/inventory/InternalInventory.java b/src/main/java/com/fireball1725/graves/tileentity/inventory/InternalInventory.java index 2ac8b98..a8200c8 100644 --- a/src/main/java/com/fireball1725/graves/tileentity/inventory/InternalInventory.java +++ b/src/main/java/com/fireball1725/graves/tileentity/inventory/InternalInventory.java @@ -1,13 +1,11 @@ package com.fireball1725.graves.tileentity.inventory; -import com.fireball1725.graves.helpers.LogHelper; import com.fireball1725.graves.util.Platform; import com.fireball1725.graves.util.iterators.InventoryIterator; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.IChatComponent; +import net.minecraft.util.text.ITextComponent; import java.util.Iterator; @@ -183,7 +181,8 @@ public boolean hasCustomName() { } @Override - public IChatComponent getDisplayName() { - return null; - } + public ITextComponent getDisplayName() + { + return null; + } } \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/util/GuiHandler.java b/src/main/java/com/fireball1725/graves/util/GuiHandler.java index 087123e..53cffdd 100644 --- a/src/main/java/com/fireball1725/graves/util/GuiHandler.java +++ b/src/main/java/com/fireball1725/graves/util/GuiHandler.java @@ -3,7 +3,7 @@ import com.fireball1725.graves.client.gui.GuiScreenHeadstone; import com.fireball1725.graves.tileentity.TileEntityHeadStone; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.common.network.IGuiHandler; diff --git a/src/main/java/com/fireball1725/graves/util/TileTools.java b/src/main/java/com/fireball1725/graves/util/TileTools.java index a1d8893..a5bd09e 100644 --- a/src/main/java/com/fireball1725/graves/util/TileTools.java +++ b/src/main/java/com/fireball1725/graves/util/TileTools.java @@ -1,7 +1,7 @@ package com.fireball1725.graves.util; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; public class TileTools { From 91d0ddee4941dec799435f6785f63ad55b63ad86 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Sat, 19 Mar 2016 19:50:16 -0700 Subject: [PATCH 02/47] Minecraft 1.9 port. --- build.gradle | 2 +- gradle.properties | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 05b82e6..84ae5fb 100644 --- a/build.gradle +++ b/build.gradle @@ -59,7 +59,7 @@ minecraft { replace "@MCVERSION@", minecraft_version runDir = "run" - mappings = "snapshot_20160312" + mappings = mcp_mappings } processResources diff --git a/gradle.properties b/gradle.properties index 98bcca3..d9a2258 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,5 @@ minecraft_version=1.9 forge_version=12.16.0.1770 +mcp_mappings=snapshot_20160312 cibuild=0 cibasename=graves \ No newline at end of file From 02264aa28cc7d07d50cff58f18304a5c9d389c37 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Sun, 20 Mar 2016 16:00:20 -0700 Subject: [PATCH 03/47] Fixes a crash where the client is trying to get the bounding box of the headstone before it is placed in the world. Fixes #36 --- .../graves/block/BlockHeadStone.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/fireball1725/graves/block/BlockHeadStone.java b/src/main/java/com/fireball1725/graves/block/BlockHeadStone.java index c079649..868fe2d 100644 --- a/src/main/java/com/fireball1725/graves/block/BlockHeadStone.java +++ b/src/main/java/com/fireball1725/graves/block/BlockHeadStone.java @@ -135,16 +135,19 @@ public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { IBlockState astate = source.getBlockState(pos); - switch(astate.getValue(FACING)) + if(astate.getBlock() instanceof BlockHeadStone) { - case NORTH: - return new AxisAlignedBB(.1f, 0f, 0f, .9f, .95f, .3f); - case SOUTH: - return new AxisAlignedBB(.1f, 0f, .7f, .9f, .95f, 1f); - case WEST: - return new AxisAlignedBB(0f, 0f, .1f, .3f, .95f, .9f); - case EAST: - return new AxisAlignedBB(.7f, 0f, .1f, 1f, .95f, .9f); + switch(astate.getValue(FACING)) + { + case NORTH: + return new AxisAlignedBB(.1f, 0f, 0f, .9f, .95f, .3f); + case SOUTH: + return new AxisAlignedBB(.1f, 0f, .7f, .9f, .95f, 1f); + case WEST: + return new AxisAlignedBB(0f, 0f, .1f, .3f, .95f, .9f); + case EAST: + return new AxisAlignedBB(.7f, 0f, .1f, 1f, .95f, .9f); + } } return null; } From cbc007459a2bb343ee653e23830905c8536a49a4 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Sun, 20 Mar 2016 22:02:36 -0700 Subject: [PATCH 04/47] Updated the rendering of the hud arrow to be less jittery; Added and in-world bobbing arrow; Added a foot arrow; Made moving the hud arrow easier, by enabling mouse control; --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index d9a2258..1a594c9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ minecraft_version=1.9 -forge_version=12.16.0.1770 +forge_version=12.16.0.1776 mcp_mappings=snapshot_20160312 cibuild=0 cibasename=graves \ No newline at end of file From d53678f19cbe5e7844b17ff477338bbb2be0d4fb Mon Sep 17 00:00:00 2001 From: FusionLord Date: Wed, 23 Mar 2016 13:30:09 -0700 Subject: [PATCH 05/47] Updated forge; Refactored a ton of code; Fixed #37: 1.9 loading crash (Blame goes to @Shadekiller666) Fixed a bug where Graves don't drop contents Fixed a block state issue that would cause grave slaves to render incorrectly --- gradle.properties | 2 +- .../fireball1725/graves/block/BlockBase.java | 106 +++++----- .../graves/block/BlockGraveSlave.java | 194 ++++++++++-------- .../graves/block/BlockGraveStone.java | 21 +- .../graves/client/events/RenderEvents.java | 4 +- .../graves/client/gui/GuiScreenHeadstone.java | 2 - .../graves/entity/EntityPlayerZombie.java | 26 +-- .../graves/event/EventBlockBreak.java | 132 ++++-------- .../graves/event/EventDeathHandler.java | 3 +- .../graves/proxy/ClientProxy.java | 6 +- .../graves/tileentity/TileEntityBase.java | 4 +- .../tileentity/TileEntityGraveStone.java | 128 +++++++++++- .../inventory/InternalDynamicInventory.java | 43 ++-- .../fireball1725/graves/util/TileTools.java | 16 +- .../util/iterators/InventoryIterator.java | 16 +- 15 files changed, 389 insertions(+), 314 deletions(-) diff --git a/gradle.properties b/gradle.properties index 1a594c9..7c2cbb7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ minecraft_version=1.9 -forge_version=12.16.0.1776 +forge_version=12.16.0.1797 mcp_mappings=snapshot_20160312 cibuild=0 cibasename=graves \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/block/BlockBase.java b/src/main/java/com/fireball1725/graves/block/BlockBase.java index 11b334a..179652c 100644 --- a/src/main/java/com/fireball1725/graves/block/BlockBase.java +++ b/src/main/java/com/fireball1725/graves/block/BlockBase.java @@ -2,24 +2,25 @@ import com.fireball1725.graves.reference.ModInfo; import com.fireball1725.graves.tileentity.TileEntityBase; +import com.fireball1725.graves.tileentity.TileEntityInventoryBase; import com.fireball1725.graves.util.TileTools; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.relauncher.ReflectionHelper; -import java.util.Random; +import java.util.ArrayList; +import java.util.List; public class BlockBase extends BlockContainer { protected boolean isInventory = false; @@ -69,50 +70,56 @@ public Class getTileEntityClass() { return this.tileEntityType; } - @Override - public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) { - dropInventory(world, blockPos); - - super.breakBlock(world, blockPos, blockState); - } - - protected void dropInventory(World world, BlockPos blockPos) { - TileEntity tileEntity = world.getTileEntity(blockPos); - - if (!(tileEntity instanceof IInventory)) { - return; - } - - IInventory inventory = (IInventory) tileEntity; - - for (int i = 0; i < inventory.getSizeInventory(); i++) { - ItemStack itemStack = inventory.getStackInSlot(i); - - if (itemStack != null && itemStack.stackSize > 0) { - Random rand = new Random(); - - float dX = rand.nextFloat() * 0.8F + 0.1F; - float dY = rand.nextFloat() * 0.8F + 0.1F; - float dZ = rand.nextFloat() * 0.8F + 0.1F; - - EntityItem entityItem = new EntityItem(world, blockPos.getX() + dX, blockPos.getY() + dY, blockPos.getZ() + dZ, itemStack.copy()); - - if (itemStack.hasTagCompound()) { - entityItem.getEntityItem().setTagCompound((NBTTagCompound) itemStack.getTagCompound().copy()); - } + // @Override + // public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) { + // dropInventory(world, blockPos); + // + // super.breakBlock(world, blockPos, blockState); + // } + // + // protected void dropInventory(World world, BlockPos blockPos) { + // for (ItemStack itemStack : getDrops(world, blockPos, null, 0)) { + // + // if (itemStack != null && itemStack.stackSize > 0) { + // Random rand = new Random(); + // + // float dX = rand.nextFloat() * 0.8F + 0.1F; + // float dY = rand.nextFloat() * 0.8F + 0.1F; + // float dZ = rand.nextFloat() * 0.8F + 0.1F; + // + // EntityItem entityItem = new EntityItem(world, blockPos.getX() + dX, blockPos.getY() + dY, blockPos.getZ() + dZ, itemStack.copy()); + // + // if (itemStack.hasTagCompound()) { + // entityItem.getEntityItem().setTagCompound((NBTTagCompound) itemStack.getTagCompound().copy()); + // } + // + // float factor = 0.05F; + // entityItem.motionX = rand.nextGaussian() * factor; + // entityItem.motionY = rand.nextGaussian() * factor + 0.2F; + // entityItem.motionZ = rand.nextGaussian() * factor; + // world.spawnEntityInWorld(entityItem); + // itemStack.stackSize = 0; + // } + // } + // } - float factor = 0.05F; - entityItem.motionX = rand.nextGaussian() * factor; - entityItem.motionY = rand.nextGaussian() * factor + 0.2F; - entityItem.motionZ = rand.nextGaussian() * factor; - world.spawnEntityInWorld(entityItem); - itemStack.stackSize = 0; - } - } - } + @Override + public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { + TileEntityInventoryBase base = TileTools.getTileEntity(world, pos, TileEntityInventoryBase.class); + if(base != null) + { + List drops = new ArrayList(); + IInventory iInventory = base.getInternalInventory(); + for(int i = 0; i < iInventory.getSizeInventory(); i++) + drops.add(iInventory.getStackInSlot(i)); + return drops; + } + return super.getDrops(world, pos, state, fortune); + } - @Override - public String getUnlocalizedName() { + @Override + public String getUnlocalizedName() { String blockName = getUnwrappedUnlocalizedName(super.getUnlocalizedName()); String test = String.format("tile.%s", blockName); @@ -129,9 +136,12 @@ public void onBlockPlacedBy(World world, BlockPos blockPos, IBlockState state, E if (itemStack.hasDisplayName()) { TileEntityBase tileEntityBase = TileTools.getTileEntity(world, blockPos, TileEntityBase.class); - tileEntityBase.setCustomName(itemStack.getDisplayName()); - } - } + if(tileEntityBase != null) + { + tileEntityBase.setCustomName(itemStack.getDisplayName()); + } + } + } @Override public EnumBlockRenderType getRenderType(IBlockState state) diff --git a/src/main/java/com/fireball1725/graves/block/BlockGraveSlave.java b/src/main/java/com/fireball1725/graves/block/BlockGraveSlave.java index 096f5b0..4a69715 100644 --- a/src/main/java/com/fireball1725/graves/block/BlockGraveSlave.java +++ b/src/main/java/com/fireball1725/graves/block/BlockGraveSlave.java @@ -40,6 +40,40 @@ public BlockGraveSlave() setTileEntity(TileEntityGraveSlave.class); } + @SuppressWarnings("Duplicates") + public static IBlockState getActualStatePre(IBlockState state, IBlockAccess worldIn, BlockPos pos, BlockPos masterPos) + { + if(masterPos != null) + { + TileEntityGraveStone master = TileTools.getTileEntity(worldIn, masterPos, TileEntityGraveStone.class); + if(master != null) + { + IBlockState masterState = master.getBlockState(); + EnumFacing masterFacing = masterState.getValue(BlockGraveStone.FACING); + + SlaveType st = SlaveType.NORENDER; + if(pos.offset(masterFacing.getOpposite()).up().equals(master.getPos())) + { + st = SlaveType.BOXFOOT; + } + if(pos.up().equals(master.getPos())) + { + st = SlaveType.BOX; + } + if(master.getPos().offset(masterFacing).equals(pos) && master.getHasLid()) + { + st = SlaveType.LID; + } + + return state + .withProperty(slaveType, st) + .withProperty(isFoot, !pos.up().equals(master.getPos())) + .withProperty(BlockGraveStone.FACING, master.getFacing()); + } + } + return null; + } + @Override protected BlockStateContainer createBlockState() { @@ -80,10 +114,10 @@ public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, Bloc { AxisAlignedBB selectionBox = new AxisAlignedBB(0f, 0f, 0f, 1f, 1f, 1f); TileEntityGraveSlave graveSlave = TileTools.getTileEntity(source, pos, TileEntityGraveSlave.class); - if(graveSlave != null && graveSlave.getMasterBlock() != null) + if(graveSlave != null) { - EnumFacing facing = getActualState(state, source, pos).getValue(BlockGraveStone.FACING); - if(graveSlave.getMasterBlock().offset(facing).equals(pos)) + SlaveType st = getActualState(state, source, pos).getValue(slaveType); + if(st == SlaveType.LID || st == SlaveType.NORENDER) { selectionBox = new AxisAlignedBB(0, 0, 0, 1, .1425f, 1); } @@ -95,83 +129,81 @@ public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, Bloc public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB mask, List list, Entity p_185477_6_) { TileEntityGraveSlave graveSlave = TileTools.getTileEntity(worldIn, pos, TileEntityGraveSlave.class); - if (graveSlave != null && graveSlave.getMasterBlock() != null) { - IBlockState masterState = worldIn.getBlockState(graveSlave.getMasterBlock()); - IBlockState actualState = masterState.getBlock().getActualState(masterState, worldIn, graveSlave.getMasterBlock()); - EnumFacing facing = getActualState(state, worldIn, pos).getValue(BlockGraveStone.FACING); - float pixel = 0.0625f; + if(graveSlave != null) + { + IBlockState actualState = getActualState(state, worldIn, pos); + EnumFacing facing = actualState.getValue(BlockGraveStone.FACING); + + float pixel = 0.0625f; boolean isFoot = worldIn.getBlockState(pos.up()).getBlock() instanceof BlockGraveSlave; - if (masterState.getBlock() instanceof BlockGraveStone) { - boolean hasLid = actualState.getValue(BlockGraveStone.HASLID); - if (worldIn.getBlockState(pos.up()).getBlock() instanceof BlockGraveSlave || worldIn.getBlockState(pos.up()).getBlock() instanceof BlockGraveStone) { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, 1f, 0.01f, 1f)); - switch (facing) - { - case NORTH: - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, pixel, 1f, 1f)); - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(1f - pixel, 0f, 0f, 1f, 1f, 1f)); - if(isFoot) - { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, 1f, 1f, pixel)); - } - else - { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 1f - pixel, 1f, 1f, 1f)); - } - break; - case SOUTH: - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, pixel, 1f, 1f)); - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(1f - pixel, 0f, 0f, 1f, 1f, 1f)); - if(!isFoot) - { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, 1f, 1f, pixel)); - } - else - { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 1f - pixel, 1f, 1f, 1f)); - } - break; - case WEST: + SlaveType type = actualState.getValue(slaveType); + if(type == SlaveType.BOX || type == SlaveType.BOXFOOT) + { + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, 1f, 0.01f, 1f)); + switch(facing) + { + case NORTH: + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, pixel, 1f, 1f)); + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(1f - pixel, 0f, 0f, 1f, 1f, 1f)); + if(isFoot) + { addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, 1f, 1f, pixel)); + } + else + { addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 1f - pixel, 1f, 1f, 1f)); - if(isFoot) - { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, pixel, 1f, 1f)); - } - else - { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(1f - pixel, 0f, 0f, 1f, 1f, 1f)); - } - break; - case EAST: + } + break; + case SOUTH: + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, pixel, 1f, 1f)); + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(1f - pixel, 0f, 0f, 1f, 1f, 1f)); + if(!isFoot) + { addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, 1f, 1f, pixel)); + } + else + { addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 1f - pixel, 1f, 1f, 1f)); - if(!isFoot) - { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, pixel, 1f, 1f)); - } - else - { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(1f - pixel, 0f, 0f, 1f, 1f, 1f)); - } - break; - } - } - else - { - if(hasLid) - { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0, 0, 0, 1, .1425f, 1)); - } - else - { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0, 0, 0, .000001f, .000001f, .000001f)); - } + } + break; + case WEST: + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, 1f, 1f, pixel)); + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 1f - pixel, 1f, 1f, 1f)); + if(isFoot) + { + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, pixel, 1f, 1f)); + } + else + { + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(1f - pixel, 0f, 0f, 1f, 1f, 1f)); + } + break; + case EAST: + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, 1f, 1f, pixel)); + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 1f - pixel, 1f, 1f, 1f)); + if(!isFoot) + { + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, pixel, 1f, 1f)); + } + else + { + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(1f - pixel, 0f, 0f, 1f, 1f, 1f)); + } + break; } } + if(type == SlaveType.NORENDER) + { + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0, 0, 0, 0, 0, 0)); + } + if(type == SlaveType.LID) + { + addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0, 0, 0, 1, .1425f, 1)); + } } } + @SuppressWarnings("Duplicates") @Override public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) { @@ -183,31 +215,27 @@ public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, Block TileEntityGraveStone master = TileTools.getTileEntity(worldIn, slave.getMasterBlock(), TileEntityGraveStone.class); if(master != null) { - IBlockState masterState = worldIn.getBlockState(slave.getMasterBlock()); - IBlockState masterActualState = masterState.getBlock().getActualState(masterState, worldIn, slave.getMasterBlock()); - EnumFacing masterFacing = masterActualState.getValue(BlockGraveStone.FACING); + IBlockState masterState = master.getBlockState(); + EnumFacing masterFacing = masterState.getValue(BlockGraveStone.FACING); SlaveType st = SlaveType.NORENDER; - if(pos.equals(master.getPos().offset(masterFacing))) + if(pos.offset(masterFacing.getOpposite()).up().equals(master.getPos())) { - if(masterActualState.getValue(BlockGraveStone.HASLID)) - { - st = SlaveType.LID; - } + st = SlaveType.BOXFOOT; } - else if(pos.equals(master.getPos().down())) + if(pos.up().equals(master.getPos())) { st = SlaveType.BOX; } - else if(pos.equals(master.getPos().offset(masterFacing).down())) + if(master.getPos().offset(masterFacing).equals(pos) && master.getHasLid()) { - st = SlaveType.BOXFOOT; + st = SlaveType.LID; } return getDefaultState() .withProperty(slaveType, st) - .withProperty(isFoot, !pos.equals(slave.getMasterBlock().down())) - .withProperty(BlockGraveStone.FACING, masterFacing); + .withProperty(isFoot, !pos.up().equals(master.getPos())) + .withProperty(BlockGraveStone.FACING, master.getFacing()); } } } diff --git a/src/main/java/com/fireball1725/graves/block/BlockGraveStone.java b/src/main/java/com/fireball1725/graves/block/BlockGraveStone.java index 94cb0dc..aab64aa 100644 --- a/src/main/java/com/fireball1725/graves/block/BlockGraveStone.java +++ b/src/main/java/com/fireball1725/graves/block/BlockGraveStone.java @@ -103,8 +103,8 @@ public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, Bloc return new AxisAlignedBB(0, 0, 0, 1, .1425f, 1); } - @Override - public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { + @Override + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { return getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()); } @@ -113,11 +113,14 @@ public void onBlockPlacedBy(World world, BlockPos blockPos, IBlockState state, E super.onBlockPlacedBy(world, blockPos, state, placer, itemStack); TileEntityGraveStone graveStoneTileEntity = TileTools.getTileEntity(world, blockPos, TileEntityGraveStone.class); - graveStoneTileEntity.breakBlocks(); - graveStoneTileEntity.setPlayerProfile(((EntityPlayer) placer).getGameProfile()); - } + if(graveStoneTileEntity != null) + { + graveStoneTileEntity.breakBlocks(); + graveStoneTileEntity.setPlayerProfile(((EntityPlayer) placer).getGameProfile()); + } + } - @Override + @Override public boolean isOpaqueCube(IBlockState state) { return false; @@ -136,7 +139,7 @@ public boolean isFullCube(IBlockState state) } @Override - public void onBlockExploded(World world, BlockPos pos, Explosion explosion) { - - } + public void onBlockExploded(World world, BlockPos pos, Explosion explosion) + { + } } diff --git a/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java b/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java index 8c3b7df..997b6b1 100644 --- a/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java +++ b/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java @@ -95,6 +95,7 @@ public void drawBlockDamageTexture(Tessellator tessellatorIn, VertexBuffer world renderEngine.bindTexture(TextureMap.locationBlocksTexture); //preRenderDamagedBlocks BEGIN + GlStateManager.pushMatrix(); GlStateManager.tryBlendFuncSeparate(774, 768, 1, 0); GlStateManager.enableBlend(); GlStateManager.color(1.0F, 1.0F, 1.0F, 0.5F); @@ -102,7 +103,6 @@ public void drawBlockDamageTexture(Tessellator tessellatorIn, VertexBuffer world GlStateManager.enablePolygonOffset(); GlStateManager.alphaFunc(516, 0.1F); GlStateManager.enableAlpha(); - GlStateManager.pushMatrix(); //preRenderDamagedBlocks END worldRendererIn.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK); @@ -135,7 +135,7 @@ public void drawBlockDamageTexture(Tessellator tessellatorIn, VertexBuffer world GlStateManager.disableAlpha(); GlStateManager.doPolygonOffset(0.0F, 0.0F); GlStateManager.disablePolygonOffset(); - GlStateManager.enableAlpha(); + GlStateManager.disableBlend(); GlStateManager.depthMask(true); GlStateManager.popMatrix(); // postRenderDamagedBlocks END diff --git a/src/main/java/com/fireball1725/graves/client/gui/GuiScreenHeadstone.java b/src/main/java/com/fireball1725/graves/client/gui/GuiScreenHeadstone.java index d1a916f..e490f1e 100644 --- a/src/main/java/com/fireball1725/graves/client/gui/GuiScreenHeadstone.java +++ b/src/main/java/com/fireball1725/graves/client/gui/GuiScreenHeadstone.java @@ -1,6 +1,5 @@ package com.fireball1725.graves.client.gui; -import com.fireball1725.graves.helpers.LogHelper; import com.fireball1725.graves.network.PacketHandler; import com.fireball1725.graves.network.messages.MessageSetHeadstoneName; import com.fireball1725.graves.tileentity.TileEntityHeadStone; @@ -56,7 +55,6 @@ protected void keyTyped(char typedChar, int keyCode) throws IOException { case 28: case 156: name = name + "\\n"; - LogHelper.info(">>> new Line, " + name); break; default: diff --git a/src/main/java/com/fireball1725/graves/entity/EntityPlayerZombie.java b/src/main/java/com/fireball1725/graves/entity/EntityPlayerZombie.java index 09b01c8..28fa9ee 100644 --- a/src/main/java/com/fireball1725/graves/entity/EntityPlayerZombie.java +++ b/src/main/java/com/fireball1725/graves/entity/EntityPlayerZombie.java @@ -478,8 +478,14 @@ public GameProfile getProfile() { } public void setProfile(GameProfile profile) { - this.profile = profile; - } + if(profile != null) + { + this.profile = profile; + this.setUsername(profile.getName()); + return; + } + this.setUsername("FireBall1725"); + } @Override public String getUsername() { @@ -637,7 +643,6 @@ class PlayerZombieMoveHelper extends EntityMoveHelper { private int courseChangeCooldown = 0; private double closeEnough = 0.3D; private PlayerZombieMoveTargetPos targetPos = new PlayerZombieMoveTargetPos(); - private boolean update; public PlayerZombieMoveHelper() { @@ -652,8 +657,9 @@ public void setMoveTo(double x, double y, double z, double speedIn) { @Override public void onUpdateMoveHelper() { - if (!this.update) { - return; + if(!this.isUpdating()) + { + return; } if (this.courseChangeCooldown-- > 0) { @@ -680,16 +686,6 @@ public void onUpdateMoveHelper() { this.playerZombie.motionX += (double) (strafeAmount * MathHelper.cos(this.playerZombie.rotationYaw * (float) Math.PI / 180.0F)); this.playerZombie.motionZ += (double) (strafeAmount * MathHelper.sin(this.playerZombie.rotationYaw * (float) Math.PI / 180.0F)); } - - // abandon this movement if we have reached the target or there is no longer a clear path to the target - if (!this.targetPos.isPathClear(5.0D)) { - //LogHelper.info(">>> Abandoning move target - way is blocked"); - - this.update = true; - } else if (this.targetPos.dist < this.closeEnough) { - //LogHelper.info(">>> Arrived (close enough) dist:" + this.targetPos.dist); - this.update = true; - } } } diff --git a/src/main/java/com/fireball1725/graves/event/EventBlockBreak.java b/src/main/java/com/fireball1725/graves/event/EventBlockBreak.java index 17056ac..39745c6 100644 --- a/src/main/java/com/fireball1725/graves/event/EventBlockBreak.java +++ b/src/main/java/com/fireball1725/graves/event/EventBlockBreak.java @@ -2,109 +2,47 @@ import com.fireball1725.graves.block.BlockGraveSlave; import com.fireball1725.graves.block.BlockGraveStone; -import com.fireball1725.graves.configuration.ConfigZombie; -import com.fireball1725.graves.entity.EntityPlayerZombie; import com.fireball1725.graves.tileentity.TileEntityGraveSlave; import com.fireball1725.graves.tileentity.TileEntityGraveStone; import com.fireball1725.graves.util.TileTools; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.EnumDifficulty; -import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import java.util.Random; - public class EventBlockBreak { @SubscribeEvent - public void onBreakBlock(BlockEvent.BreakEvent event) { - if (!(event.state.getBlock() instanceof BlockGraveStone || event.state.getBlock() instanceof BlockGraveSlave)) return; - - boolean hardcoreEnabled = event.getPlayer().worldObj.getWorldInfo().isHardcoreModeEnabled(); - EnumDifficulty gameDifficulty = event.getPlayer().worldObj.getDifficulty(); - - TileEntityGraveStone graveStone = TileTools.getTileEntity(event.world, event.pos, TileEntityGraveStone.class); - if (graveStone != null) { - if (graveStone.getHasLid() && !event.getPlayer().capabilities.isCreativeMode) { - graveStone.setHasLid(false); - graveStone.markDirty(); - graveStone.markForUpdate(); - - boolean spawnPlayerZombie = false; - - //todo: make if player has items, make the chance less - int spawnChance = 40; - - switch (gameDifficulty) { - case EASY: - spawnChance = ConfigZombie.configZombieSpawnChanceEasy; - break; - - case NORMAL: - spawnChance = ConfigZombie.configZombieSpawnChanceNormal; - break; - - case HARD: - spawnChance = ConfigZombie.configZombieSpawnChanceHard; - break; - } - - if (hardcoreEnabled) { - spawnChance = ConfigZombie.configZombieSpawnChanceHardCore; - } - - /* Notes : - - Artifacts: - > 4x Artifacts, each one lowers the zombie spawning chance - - */ - - if (spawnChance > 0) { - Random random = new Random(); - int rng = random.nextInt(100); - - if (rng <= spawnChance) - spawnPlayerZombie = true; - } - - if (spawnPlayerZombie && ConfigZombie.configZombieEnabled) { - EntityPlayerZombie playerZombie = new EntityPlayerZombie(event.world); - - playerZombie.setUsername(graveStone.getPlayerProfile().getName()); - playerZombie.setProfile(graveStone.getPlayerProfile()); - - playerZombie.setLocationAndAngles(event.pos.getX(), event.pos.down().getY(), event.pos.getZ(), graveStone.getBlockState().getValue(BlockGraveStone.FACING).getHorizontalIndex() * 90f, 0f); - playerZombie.onInitialSpawn(event.world.getDifficultyForLocation(new BlockPos(playerZombie)), null); - - playerZombie.setPlayer(event.getPlayer()); - - playerZombie.setGraveMaster(graveStone.getPos()); -// nbtTagCompound.setIntArray("MasterGrave", new int[]{graveStone.getPos().getX(), graveStone.getPos().getY(), graveStone.getPos().getZ()}); - - event.world.spawnEntityInWorld(playerZombie); - // event.world.playSound(event.pos.getX(), event.pos.getY(), event.pos.getZ(), SoundHelper.getRegisteredSoundEvent("graves:graveZombieSpawn"), SoundCategory.HOSTILE, 1, 1, true); - } - - event.setCanceled(true); - return; - } else { - event.world.setBlockToAir(graveStone.getPos().down()); - event.world.setBlockToAir(graveStone.getPos().down().offset(graveStone.getBlockState().getValue(BlockGraveStone.FACING))); - event.world.setBlockToAir(graveStone.getPos().offset(graveStone.getBlockState().getValue(BlockGraveStone.FACING))); - event.world.setBlockToAir(graveStone.getPos()); - } - } - TileEntityGraveSlave graveSlave = TileTools.getTileEntity(event.world, event.pos, TileEntityGraveSlave.class); - if (graveSlave != null) { - BlockPos masterBlock = graveSlave.getMasterBlock(); - if (event.world.getTileEntity(masterBlock) == null) { - return; - } - MinecraftForge.EVENT_BUS.post(new BlockEvent.BreakEvent(event.world, masterBlock, event.world.getBlockState(masterBlock), event.getPlayer())); - graveSlave.markDirty(); - graveSlave.markForUpdate(); - event.setCanceled(true); - } - } + public void onBreakBlock(BlockEvent.BreakEvent event) + { + if(!(event.state.getBlock() instanceof BlockGraveStone || event.state.getBlock() instanceof BlockGraveSlave)) + { return; } + + TileEntityGraveStone graveStone = null; + + if(event.state.getBlock() instanceof BlockGraveSlave) + { + TileEntityGraveSlave slave = TileTools.getTileEntity(event.world, event.pos, TileEntityGraveSlave.class); + if(slave != null) + { graveStone = TileTools.getTileEntity(event.world, slave.getMasterBlock(), TileEntityGraveStone.class); } + } + else + { + graveStone = TileTools.getTileEntity(event.world, event.pos, TileEntityGraveStone.class); + } + + if(graveStone == null) + { return; } + + if(graveStone.getBlockState().getValue(BlockGraveStone.HASLID)) + { + graveStone.breakLid(event.getPlayer()); + event.setCanceled(true); + } + else + { + event.world.destroyBlock(graveStone.getPos().down(), false); + event.world.destroyBlock(graveStone.getPos().down().offset(graveStone.getBlockState().getValue(BlockGraveStone.FACING)), false); + event.world.destroyBlock(graveStone.getPos().offset(graveStone.getBlockState().getValue(BlockGraveStone.FACING)), false); + event.world.destroyBlock(graveStone.getPos(), true); + event.setCanceled(true); + } + } } diff --git a/src/main/java/com/fireball1725/graves/event/EventDeathHandler.java b/src/main/java/com/fireball1725/graves/event/EventDeathHandler.java index afd1831..7d2a842 100644 --- a/src/main/java/com/fireball1725/graves/event/EventDeathHandler.java +++ b/src/main/java/com/fireball1725/graves/event/EventDeathHandler.java @@ -81,10 +81,9 @@ public void onPlayerDrops(PlayerDropsEvent event) { if (graveStone != null) { graveStone.addGraveItems(event.drops); -// event.drops.clear(); graveStone.setHasLid(true); spawnGrave = false; - LogHelper.info(">>> : Killed by zombie added drops to grave"); + // LogHelper.info(">>> : Killed by zombie added drops to grave"); } } } diff --git a/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java b/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java index fbf76ee..d28edfc 100644 --- a/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java +++ b/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java @@ -6,7 +6,6 @@ import com.fireball1725.graves.client.render.entity.EntityRenderers; import com.fireball1725.graves.client.render.entity.RenderPlayerZombie; import com.fireball1725.graves.entity.EntityPlayerZombie; -import com.fireball1725.graves.helpers.LogHelper; import com.fireball1725.graves.reference.ModInfo; import com.fireball1725.graves.tileentity.TileEntityHeadStone; import net.minecraft.client.Minecraft; @@ -24,9 +23,8 @@ public class ClientProxy extends CommonProxy { @Override public void registerBlocks() { super.registerBlocks(); - LogHelper.info(">>>: registering blockstate jsons"); - OBJLoader.instance.addDomain(ModInfo.MOD_ID); - Item graveItem = Item.getItemFromBlock(Blocks.BLOCK_GRAVESTONE.block); + OBJLoader.INSTANCE.addDomain(ModInfo.MOD_ID); + Item graveItem = Item.getItemFromBlock(Blocks.BLOCK_GRAVESTONE.block); ModelLoader.setCustomModelResourceLocation(graveItem, 0, new ModelResourceLocation(ModInfo.MOD_ID + ":gravestone", "inventory")); graveItem = Item.getItemFromBlock(Blocks.BLOCK_GRAVESTONE_SLAVE.block); ModelLoader.setCustomModelResourceLocation(graveItem, 0, new ModelResourceLocation(ModInfo.MOD_ID + ":graveslave", "inventory")); diff --git a/src/main/java/com/fireball1725/graves/tileentity/TileEntityBase.java b/src/main/java/com/fireball1725/graves/tileentity/TileEntityBase.java index 36776e6..4a8d4a5 100644 --- a/src/main/java/com/fireball1725/graves/tileentity/TileEntityBase.java +++ b/src/main/java/com/fireball1725/graves/tileentity/TileEntityBase.java @@ -143,6 +143,6 @@ public void readFromNBT(NBTTagCompound nbtTagCompound) { } public IBlockState getBlockState() { - return worldObj.getBlockState(pos); - } + return worldObj.getBlockState(pos).getActualState(worldObj, pos); + } } diff --git a/src/main/java/com/fireball1725/graves/tileentity/TileEntityGraveStone.java b/src/main/java/com/fireball1725/graves/tileentity/TileEntityGraveStone.java index edb9959..2f3a0b3 100644 --- a/src/main/java/com/fireball1725/graves/tileentity/TileEntityGraveStone.java +++ b/src/main/java/com/fireball1725/graves/tileentity/TileEntityGraveStone.java @@ -1,7 +1,10 @@ package com.fireball1725.graves.tileentity; +import com.fireball1725.graves.block.BlockGraveSlave; import com.fireball1725.graves.block.BlockGraveStone; import com.fireball1725.graves.block.Blocks; +import com.fireball1725.graves.configuration.ConfigZombie; +import com.fireball1725.graves.entity.EntityPlayerZombie; import com.fireball1725.graves.helpers.LogHelper; import com.fireball1725.graves.tileentity.inventory.InternalDynamicInventory; import com.fireball1725.graves.tileentity.inventory.InventoryOperation; @@ -10,19 +13,23 @@ import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTUtil; import net.minecraft.network.Packet; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.ITextComponent; +import net.minecraft.world.EnumDifficulty; import java.util.List; import java.util.Random; -public class TileEntityGraveStone extends TileEntityInventoryBase { - protected boolean hasLid = true; +public class TileEntityGraveStone extends TileEntityInventoryBase +{ + protected boolean hasLid = true; private InternalDynamicInventory internalInventory = new InternalDynamicInventory(this); private GameProfile playerProfile; @@ -45,8 +52,7 @@ public boolean getHasLid() { public void setHasLid(boolean hasLid) { this.hasLid = hasLid; - worldObj.setBlockState(pos, worldObj.getBlockState(pos).withProperty(BlockGraveStone.HASLID, false)); - worldObj.notifyBlockUpdate(pos, getBlockState(), getBlockState(), 0); + worldObj.notifyBlockUpdate(pos, getBlockState(), getBlockState().withProperty(BlockGraveStone.HASLID, false), 3); } public GameProfile getPlayerProfile() { @@ -93,9 +99,9 @@ public void breakBlocks() { ItemStack item2 = new ItemStack(block2.getItemDropped(state2, new Random(1), 0), 1, block2.damageDropped(state2)); worldObj.setBlockToAir(pos.down()); worldObj.setBlockToAir(pos.down().offset(masterState.getValue(BlockGraveStone.FACING))); - internalInventory.setInventorySlotContents(80, item1); - internalInventory.setInventorySlotContents(81, item2); - } + internalInventory.addInventorySlotContents(item1); + internalInventory.addInventorySlotContents(item2); + } // Adding slaves EnumFacing facing = worldObj.getBlockState(pos).getValue(BlockGraveStone.FACING); @@ -103,17 +109,17 @@ public void breakBlocks() { TileEntityGraveSlave tileEntityGraveSlave; state = Blocks.BLOCK_GRAVESTONE_SLAVE.block.getDefaultState(); - worldObj.setBlockState(pos.down(), state); + worldObj.setBlockState(pos.down(), BlockGraveSlave.getActualStatePre(state, worldObj, pos.down(), pos)); tileEntityGraveSlave = TileTools.getTileEntity(worldObj, pos.down(), TileEntityGraveSlave.class); tileEntityGraveSlave.setMasterBlock(pos); - worldObj.setBlockState(pos.down().offset(facing), state); + worldObj.setBlockState(pos.down().offset(facing), BlockGraveSlave.getActualStatePre(state, worldObj, pos.down().offset(facing), pos)); tileEntityGraveSlave = TileTools.getTileEntity(worldObj, pos.down().offset(facing), TileEntityGraveSlave.class); tileEntityGraveSlave.setMasterBlock(pos); - worldObj.setBlockState(pos.offset(facing), state); + worldObj.setBlockState(pos.offset(facing), BlockGraveSlave.getActualStatePre(state, worldObj, pos.offset(facing), pos)); tileEntityGraveSlave = TileTools.getTileEntity(worldObj, pos.offset(facing), TileEntityGraveSlave.class); tileEntityGraveSlave.setMasterBlock(pos); @@ -121,7 +127,7 @@ public void breakBlocks() { } - @Override + @Override public IInventory getInternalInventory() { return this.internalInventory; } @@ -171,4 +177,104 @@ public ITextComponent getDisplayName() { return null; } + + public void breakLid(EntityPlayer player) + { + IBlockState state = getBlockState(); + if(state.getValue(BlockGraveStone.HASLID)) + { + LogHelper.info("breaking lid"); + hasLid = false; + worldObj.notifyBlockUpdate(pos, state, state.withProperty(BlockGraveStone.HASLID, false), 3); + updateSlaves(); + markForUpdate(); + markDirty(); + + spawnPlayerZombie(player); + } + } + + private void updateSlaves() + { + for(BlockPos sPos : getSlaves()) + { + IBlockState state = worldObj.getBlockState(sPos); + worldObj.markAndNotifyBlock(sPos, worldObj.getChunkFromBlockCoords(pos), state, state.getActualState(worldObj, sPos), 3); + } + } + + private void spawnPlayerZombie(EntityPlayer player) + { + boolean spawnPlayerZombie = false; + + //todo: make if player has items, make the chance less + int spawnChance = 40; + + boolean hardcoreEnabled = worldObj.getWorldInfo().isHardcoreModeEnabled(); + EnumDifficulty gameDifficulty = worldObj.getDifficulty(); + + switch(gameDifficulty) + { + case EASY: + spawnChance = ConfigZombie.configZombieSpawnChanceEasy; + break; + + case NORMAL: + spawnChance = ConfigZombie.configZombieSpawnChanceNormal; + break; + + case HARD: + spawnChance = ConfigZombie.configZombieSpawnChanceHard; + break; + } + + if(hardcoreEnabled) + { + spawnChance = ConfigZombie.configZombieSpawnChanceHardCore; + } + + /* Notes : + + Artifacts: + > 4x Artifacts, each one lowers the zombie spawning chance + + */ + + if(spawnChance > 0) + { + Random random = new Random(); + int rng = random.nextInt(100); + + if(rng <= spawnChance) + { spawnPlayerZombie = true; } + } + + if(spawnPlayerZombie && ConfigZombie.configZombieEnabled) + { + EntityPlayerZombie playerZombie = new EntityPlayerZombie(worldObj); + + playerZombie.setProfile(getPlayerProfile()); + + playerZombie.setLocationAndAngles(pos.getX(), pos.down().getY(), pos.getZ(), getBlockState().getValue(BlockGraveStone.FACING).getHorizontalIndex() * 90f, 0f); + playerZombie.onInitialSpawn(worldObj.getDifficultyForLocation(new BlockPos(playerZombie)), null); + playerZombie.setPlayer(player); + playerZombie.setGraveMaster(pos); + // nbtTagCompound.setIntArray("MasterGrave", new int[]{graveStone.getPos().getX(), graveStone.getPos().getY(), graveStone.getPos().getZ()}); + + worldObj.spawnEntityInWorld(playerZombie); + // world.playSound(pos.getX(), pos.getY(), pos.getZ(), SoundHelper.getRegisteredSoundEvent("graves:graveZombieSpawn"), SoundCategory.HOSTILE, 1, 1, true); + } + + } + + public EnumFacing getFacing() + { + return getBlockState().getValue(BlockGraveStone.FACING); + } + + public BlockPos[] getSlaves() + { + EnumFacing facing = getFacing(); + return new BlockPos[] {pos.down(), pos.offset(facing).down(), pos.offset(facing)}; + } } diff --git a/src/main/java/com/fireball1725/graves/tileentity/inventory/InternalDynamicInventory.java b/src/main/java/com/fireball1725/graves/tileentity/inventory/InternalDynamicInventory.java index ec017d9..57ad1a3 100644 --- a/src/main/java/com/fireball1725/graves/tileentity/inventory/InternalDynamicInventory.java +++ b/src/main/java/com/fireball1725/graves/tileentity/inventory/InternalDynamicInventory.java @@ -1,7 +1,6 @@ package com.fireball1725.graves.tileentity.inventory; import com.fireball1725.graves.util.Platform; -import com.fireball1725.graves.util.iterators.InventoryIterator; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -10,10 +9,11 @@ import java.util.ArrayList; import java.util.Iterator; +import java.util.List; public class InternalDynamicInventory implements IInventory, Iterable, IInventoryCustom { - protected final ArrayList inventory; - public boolean enableClientEvents = false; + protected final List inventory; + public boolean enableClientEvents = false; protected IInventoryHandler inventoryHandler; protected int maxSize; @@ -63,8 +63,8 @@ public ItemStack decrStackSize(int slot, int qty) { this.inventoryHandler.onChangeInventory(this, slot, InventoryOperation.decreaseStackSize, newStack, null); } - this.markDirty(); - return newStack; + // this.markDirty(); + return newStack; } return null; @@ -77,24 +77,25 @@ public ItemStack removeStackFromSlot(int index) { @Override public void setInventorySlotContents(int slot, ItemStack itemStack) { - if (inventory.size() != 0 && inventory.size() >= slot) { - this.inventory.set(slot, itemStack); + ItemStack removed = this.inventory.get(slot); + if(inventory.size() >= slot) + { + this.inventory.set(slot, itemStack); } else { this.inventory.add(itemStack); } - //this.inventoryHandler.onChangeInventory(this, slot, InventoryOperation.setInventorySlotContents, removed, added); + this.inventoryHandler.onChangeInventory(this, slot, InventoryOperation.setInventorySlotContents, removed, itemStack); - this.markDirty(); - } + // this.markDirty(); + } public void addInventorySlotContents(ItemStack itemStack) { - this.inventory.add(itemStack); - - //this.inventoryHandler.onChangeInventory(this, slot, InventoryOperation.setInventorySlotContents, removed, added); - - this.markDirty(); - } + int slot = this.inventory.size(); + this.inventory.add(itemStack); + this.inventoryHandler.onChangeInventory(this, slot, InventoryOperation.setInventorySlotContents, null, itemStack); + // this.markDirty(); + } @Override public int getInventoryStackLimit() { @@ -150,14 +151,14 @@ public int getFieldCount() { } @Override - public void clear() { - - } + public void clear() + { + } @Override public Iterator iterator() { - return new InventoryIterator(this); - } + return inventory.iterator(); + } public void setMaxStackSize(int s) { this.maxSize = s; diff --git a/src/main/java/com/fireball1725/graves/util/TileTools.java b/src/main/java/com/fireball1725/graves/util/TileTools.java index a5bd09e..227b879 100644 --- a/src/main/java/com/fireball1725/graves/util/TileTools.java +++ b/src/main/java/com/fireball1725/graves/util/TileTools.java @@ -8,14 +8,14 @@ public class TileTools { /** * Gets tile entity at @BlockPos location * - * @param world World - * @param blockPos Block Position - * @param tClass Class of Tile Entity - * @param - * @return Null is not the Tile Entity or the instance of the Tile Entity - */ + * @param world The World + * @param blockPos Block Position + * @param tClass Class of TileEntity + * @param Generic Class Type + * @return The TileEntity or Null if not the TileEntity + */ public static T getTileEntity(IBlockAccess world, BlockPos blockPos, Class tClass) { TileEntity tileEntity = world.getTileEntity(blockPos); - return !tClass.isInstance(tileEntity) ? null : (T) tileEntity; - } + return !tClass.isInstance(tileEntity) ? null : tClass.cast(tileEntity); + } } diff --git a/src/main/java/com/fireball1725/graves/util/iterators/InventoryIterator.java b/src/main/java/com/fireball1725/graves/util/iterators/InventoryIterator.java index e80eb18..b6f1498 100644 --- a/src/main/java/com/fireball1725/graves/util/iterators/InventoryIterator.java +++ b/src/main/java/com/fireball1725/graves/util/iterators/InventoryIterator.java @@ -6,10 +6,10 @@ import java.util.Iterator; public class InventoryIterator implements Iterator { - final IInventory inventory; - final int size; + private final IInventory inventory; + private final int size; - int i = 0; + private int i = -1; public InventoryIterator(IInventory inventory) { this.inventory = inventory; @@ -18,15 +18,13 @@ public InventoryIterator(IInventory inventory) { @Override public boolean hasNext() { - return this.i < this.size; - } + return this.i + 1 < this.size; + } @Override public ItemStack next() { - ItemStack result = this.inventory.getStackInSlot(this.i); - this.i++; - return result; - } + return inventory.getStackInSlot(this.i++); + } @Override public void remove() { From 4d0bc846f1791c55d865f79f101e1151b1d3fe78 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Fri, 25 Mar 2016 08:31:49 -0700 Subject: [PATCH 06/47] Updated to forge 1809. --- gradle.properties | 2 +- .../com/fireball1725/graves/block/Blocks.java | 4 +- .../graves/client/events/RenderEvents.java | 2 +- .../graves/event/EventBlockBreak.java | 18 +- .../graves/event/EventDeathHandler.java | 35 +- .../graves/helpers/ConfigurationHelper.java | 28 +- .../assets/graves/blockstates/gravestone.json | 21 +- .../assets/graves/blockstates/headstone.json | 11 +- .../resources/assets/graves/lang/en_US.lang | 7 + .../assets/graves/models/block/gravestone.mtl | 34 +- .../assets/graves/models/block/gravestone.obj | 352 ++++++++++-------- .../graves/models/block/gravestone_lid.mtl | 13 - .../graves/models/block/gravestone_lid.obj | 92 ----- 13 files changed, 282 insertions(+), 337 deletions(-) create mode 100644 src/main/resources/assets/graves/lang/en_US.lang delete mode 100644 src/main/resources/assets/graves/models/block/gravestone_lid.mtl delete mode 100644 src/main/resources/assets/graves/models/block/gravestone_lid.obj diff --git a/gradle.properties b/gradle.properties index 7c2cbb7..0a641b1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ minecraft_version=1.9 -forge_version=12.16.0.1797 +forge_version=12.16.0.1809 mcp_mappings=snapshot_20160312 cibuild=0 cibasename=graves \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/block/Blocks.java b/src/main/java/com/fireball1725/graves/block/Blocks.java index ddcc59d..deb7d67 100644 --- a/src/main/java/com/fireball1725/graves/block/Blocks.java +++ b/src/main/java/com/fireball1725/graves/block/Blocks.java @@ -10,8 +10,8 @@ import net.minecraftforge.fml.common.registry.GameRegistry; public enum Blocks { - BLOCK_GRAVESTONE("gravestone", new BlockGraveStone()), - BLOCK_GRAVESTONE_SLAVE("graveslave", new BlockGraveSlave()), + BLOCK_GRAVESTONE("gravestone", new BlockGraveStone(), ModCreativeTabs.tabGraves), + BLOCK_GRAVESTONE_SLAVE("graveslave", new BlockGraveSlave()), BLOCK_GRAVE_HEADSTONE("headstone", new BlockHeadStone(), ItemHeadStone.class, ModCreativeTabs.tabGraves); private static boolean registered = false; diff --git a/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java b/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java index 997b6b1..0715ddb 100644 --- a/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java +++ b/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java @@ -72,7 +72,7 @@ public void renderExtraBlockBreak(RenderWorldLastEvent event) { drawBlockDamageTexture(Tessellator.getInstance(), Tessellator.getInstance().getBuffer(), player, - event.partialTicks, + event.getPartialTicks(), world, blocks); } diff --git a/src/main/java/com/fireball1725/graves/event/EventBlockBreak.java b/src/main/java/com/fireball1725/graves/event/EventBlockBreak.java index 39745c6..94292d1 100644 --- a/src/main/java/com/fireball1725/graves/event/EventBlockBreak.java +++ b/src/main/java/com/fireball1725/graves/event/EventBlockBreak.java @@ -12,20 +12,20 @@ public class EventBlockBreak { @SubscribeEvent public void onBreakBlock(BlockEvent.BreakEvent event) { - if(!(event.state.getBlock() instanceof BlockGraveStone || event.state.getBlock() instanceof BlockGraveSlave)) + if(!(event.getState().getBlock() instanceof BlockGraveStone || event.getState().getBlock() instanceof BlockGraveSlave)) { return; } TileEntityGraveStone graveStone = null; - if(event.state.getBlock() instanceof BlockGraveSlave) + if(event.getState().getBlock() instanceof BlockGraveSlave) { - TileEntityGraveSlave slave = TileTools.getTileEntity(event.world, event.pos, TileEntityGraveSlave.class); + TileEntityGraveSlave slave = TileTools.getTileEntity(event.getWorld(), event.getPos(), TileEntityGraveSlave.class); if(slave != null) - { graveStone = TileTools.getTileEntity(event.world, slave.getMasterBlock(), TileEntityGraveStone.class); } + { graveStone = TileTools.getTileEntity(event.getWorld(), slave.getMasterBlock(), TileEntityGraveStone.class); } } else { - graveStone = TileTools.getTileEntity(event.world, event.pos, TileEntityGraveStone.class); + graveStone = TileTools.getTileEntity(event.getWorld(), event.getPos(), TileEntityGraveStone.class); } if(graveStone == null) @@ -38,10 +38,10 @@ public void onBreakBlock(BlockEvent.BreakEvent event) } else { - event.world.destroyBlock(graveStone.getPos().down(), false); - event.world.destroyBlock(graveStone.getPos().down().offset(graveStone.getBlockState().getValue(BlockGraveStone.FACING)), false); - event.world.destroyBlock(graveStone.getPos().offset(graveStone.getBlockState().getValue(BlockGraveStone.FACING)), false); - event.world.destroyBlock(graveStone.getPos(), true); + event.getWorld().destroyBlock(graveStone.getPos().down(), false); + event.getWorld().destroyBlock(graveStone.getPos().down().offset(graveStone.getBlockState().getValue(BlockGraveStone.FACING)), false); + event.getWorld().destroyBlock(graveStone.getPos().offset(graveStone.getBlockState().getValue(BlockGraveStone.FACING)), false); + event.getWorld().destroyBlock(graveStone.getPos(), true); event.setCanceled(true); } } diff --git a/src/main/java/com/fireball1725/graves/event/EventDeathHandler.java b/src/main/java/com/fireball1725/graves/event/EventDeathHandler.java index 7d2a842..e06dda0 100644 --- a/src/main/java/com/fireball1725/graves/event/EventDeathHandler.java +++ b/src/main/java/com/fireball1725/graves/event/EventDeathHandler.java @@ -46,8 +46,8 @@ public static void sendTomTomPos(Object mod, EntityPlayer player, BlockPos pos, @SubscribeEvent(priority = EventPriority.LOW, receiveCanceled = true) public void onPlayerDrops(PlayerDropsEvent event) { - World world = event.entityPlayer.worldObj; - if (world.isRemote) + World world = event.getEntityPlayer().worldObj; + if (world.isRemote) return; if (event.isCanceled()) { @@ -62,7 +62,7 @@ public void onPlayerDrops(PlayerDropsEvent event) { return; } - final List itemsList = event.drops; + final List itemsList = event.getDrops(); // If there are no items, then cancel spawning a grave if (itemsList.isEmpty()) @@ -70,17 +70,16 @@ public void onPlayerDrops(PlayerDropsEvent event) { boolean spawnGrave = true; - - if (event.entityLiving instanceof EntityPlayer) + if(event.getEntityLiving() instanceof EntityPlayer) { - if (event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayerZombie) + if(event.getSource().getEntity() != null && event.getSource().getEntity() instanceof EntityPlayerZombie) { - EntityPlayerZombie zombie = (EntityPlayerZombie) event.source.getEntity(); + EntityPlayerZombie zombie = (EntityPlayerZombie) event.getSource().getEntity(); BlockPos gravePos = zombie.getGraveMaster(); - TileEntityGraveStone graveStone = TileTools.getTileEntity(event.entityLiving.worldObj, gravePos, TileEntityGraveStone.class); + TileEntityGraveStone graveStone = TileTools.getTileEntity(event.getEntityLiving().worldObj, gravePos, TileEntityGraveStone.class); if (graveStone != null) { - graveStone.addGraveItems(event.drops); + graveStone.addGraveItems(itemsList); graveStone.setHasLid(true); spawnGrave = false; // LogHelper.info(">>> : Killed by zombie added drops to grave"); @@ -89,30 +88,30 @@ public void onPlayerDrops(PlayerDropsEvent event) { } if (spawnGrave) { - EnumFacing facing = event.entityPlayer.getHorizontalFacing(); - IBlockState state = Blocks.BLOCK_GRAVESTONE.block.getDefaultState().withProperty(BlockGraveStone.FACING, facing); + EnumFacing facing = event.getEntityPlayer().getHorizontalFacing(); + IBlockState state = Blocks.BLOCK_GRAVESTONE.block.getDefaultState().withProperty(BlockGraveStone.FACING, facing); - BlockPos safePos = SafeBlockReplacer.GetSafeGraveSite(world, event.entityPlayer.getPosition(), facing); + BlockPos safePos = SafeBlockReplacer.GetSafeGraveSite(world, event.getEntityPlayer().getPosition(), facing); - sendTomTomPos(Graves.instance, event.entityPlayer, safePos, "Grave this way!"); + sendTomTomPos(Graves.instance, event.getEntityPlayer(), safePos, "Grave this way!"); world.setBlockState(safePos, state); TileEntityGraveStone graveStoneTileEntity = TileTools.getTileEntity(world, safePos, TileEntityGraveStone.class); graveStoneTileEntity.addGraveItems(itemsList); graveStoneTileEntity.breakBlocks(); - graveStoneTileEntity.setPlayerProfile(event.entityPlayer.getGameProfile()); + graveStoneTileEntity.setPlayerProfile(event.getEntityPlayer().getGameProfile()); // Adding Headstone world.setBlockState(safePos.offset(facing.getOpposite()), Blocks.BLOCK_GRAVE_HEADSTONE.block.getDefaultState().withProperty(BlockHeadStone.FACING, facing)); TileEntityHeadStone tileEntityHeadStone = TileTools.getTileEntity(world, safePos.offset(facing.getOpposite()), TileEntityHeadStone.class); if (tileEntityHeadStone != null) { - tileEntityHeadStone.setCustomName(event.entityPlayer.getDisplayName().getFormattedText()); - //tileEntityHeadStone.setEulogy(event.source.getDeathMessage(event.entityPlayer).getFormattedText()); + tileEntityHeadStone.setCustomName(event.getEntityPlayer().getDisplayName().getFormattedText()); + //tileEntityHeadStone.setEulogy(event.source.getDeathMessage(event.entityPlayer).getFormattedText()); } // End of adding headstone } - event.drops.clear(); - } + event.getDrops().clear(); + } } diff --git a/src/main/java/com/fireball1725/graves/helpers/ConfigurationHelper.java b/src/main/java/com/fireball1725/graves/helpers/ConfigurationHelper.java index df78f52..f0331d6 100644 --- a/src/main/java/com/fireball1725/graves/helpers/ConfigurationHelper.java +++ b/src/main/java/com/fireball1725/graves/helpers/ConfigurationHelper.java @@ -7,8 +7,8 @@ public class ConfigurationHelper { public static String getString(Configuration configuration, String name, String category, String defaultValue, String comment, String[] validValues) { Property property = configuration.get(category, name, defaultValue); property.setValidValues(validValues); - property.comment = comment + " [default: " + defaultValue + "]"; - String value = property.getString(); + property.setComment(comment + " [default: " + defaultValue + "]"); + String value = property.getString(); for (int i = 0; i < validValues.length; i++) { if (value.equalsIgnoreCase(validValues[i])) { @@ -21,39 +21,39 @@ public static String getString(Configuration configuration, String name, String public static String getString(Configuration configuration, String name, String category, String defaultValue, String comment, boolean show) { Property property = configuration.get(category, name, defaultValue); - property.comment = comment + " [default: " + defaultValue + "]"; - property.setShowInGui(show); + property.setComment(comment + " [default: " + defaultValue + "]"); + property.setShowInGui(show); return property.getString(); } public static String[] getString(Configuration configuration, String name, String category, String[] defaultValue, String comment, boolean show) { Property property = configuration.get(category, name, defaultValue); - property.comment = comment; - property.setShowInGui(show); + property.setComment(comment); + property.setShowInGui(show); return property.getStringList(); } public static boolean getBoolean(Configuration configuration, String name, String category, boolean defaultValue, String comment) { Property property = configuration.get(category, name, defaultValue); - property.comment = comment + " [default: " + defaultValue + "]"; - return property.getBoolean(defaultValue); + property.setComment(comment + " [default: " + defaultValue + "]"); + return property.getBoolean(defaultValue); } public static int getInt(Configuration configuration, String name, String category, int defaultValue, String comment) { Property property = configuration.get(category, name, defaultValue); - property.comment = comment + " [default: " + defaultValue + "]"; - return property.getInt(defaultValue); + property.setComment(comment + " [default: " + defaultValue + "]"); + return property.getInt(defaultValue); } public static int[] getInt(Configuration configuration, String name, String category, int[] defaultValue, String comment) { Property property = configuration.get(category, name, defaultValue); - property.comment = comment; - return property.getIntList(); + property.setComment(comment); + return property.getIntList(); } public static double getDouble(Configuration configuration, String name, String category, double defaultValue, String comment) { Property property = configuration.get(category, name, defaultValue); - property.comment = comment + " [default: " + defaultValue + "]"; - return property.getDouble(defaultValue); + property.setComment(comment + " [default: " + defaultValue + "]"); + return property.getDouble(defaultValue); } } diff --git a/src/main/resources/assets/graves/blockstates/gravestone.json b/src/main/resources/assets/graves/blockstates/gravestone.json index 9eef2d6..c1d9545 100644 --- a/src/main/resources/assets/graves/blockstates/gravestone.json +++ b/src/main/resources/assets/graves/blockstates/gravestone.json @@ -2,9 +2,7 @@ "forge_marker": 1, "defaults": { "textures": { - "#inside": "minecraft:blocks/wool_colored_red", - "#box": "minecraft:blocks/stone_andesite_smooth", - "#headstone": "minecraft:blocks/stone_diorite_smooth" + "#box": "minecraft:blocks/stone_andesite_smooth" } }, "variants": { @@ -14,8 +12,21 @@ "inventory": [ { "model": "graves:gravestone.obj", - "submodel": "graves:gravestone_lid.obj", - "transform": "forge:default-block" + "transform": { + "rotation": { + "y": 90 + }, + "translation": [ + 0.125, + 0.25, + -0.125 + ], + "scale": [ + 0.25, + 0.25, + 0.25 + ] + } } ], "haslid": { diff --git a/src/main/resources/assets/graves/blockstates/headstone.json b/src/main/resources/assets/graves/blockstates/headstone.json index c070dd9..18e81bf 100644 --- a/src/main/resources/assets/graves/blockstates/headstone.json +++ b/src/main/resources/assets/graves/blockstates/headstone.json @@ -13,7 +13,16 @@ ], "inventory": [ { - "transform": "forge:default-block" + "transform": { + "rotation": { + "y": 225 + }, + "translation": [ + -0.25, + 0, + 0 + ] + } } ], "facing": { diff --git a/src/main/resources/assets/graves/lang/en_US.lang b/src/main/resources/assets/graves/lang/en_US.lang new file mode 100644 index 0000000..a5bfb0b --- /dev/null +++ b/src/main/resources/assets/graves/lang/en_US.lang @@ -0,0 +1,7 @@ +#Graves mod localization file for en_US +#Blocks +tile.headstone.name=Headstone +tile.gravestone.name=Coffin + +#Creative tabs +itemGroup.graves=Graves mod \ No newline at end of file diff --git a/src/main/resources/assets/graves/models/block/gravestone.mtl b/src/main/resources/assets/graves/models/block/gravestone.mtl index bc4af72..9825523 100644 --- a/src/main/resources/assets/graves/models/block/gravestone.mtl +++ b/src/main/resources/assets/graves/models/block/gravestone.mtl @@ -1,24 +1,14 @@ -# Blender MTL File: 'grave.blend' -# Material Count: 2 +# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware +# File Created: 23.03.2016 14:46:27 newmtl box -Ns 96.078431 -Ka 1.000000 1.000000 1.000000 -Kd 0.800000 0.800000 0.800000 -Ks 0.164706 0.164706 0.164706 -Ke 0.000000 0.000000 0.000000 -Ni 1.000000 -d 1.000000 -illum 2 -map_Kd minecraft:blocks/stone_andesite_smooth - -newmtl inside -Ns 96.078431 -Ka 1.000000 1.000000 1.000000 -Kd 0.800000 0.800000 0.800000 -Ks 0.164706 0.164706 0.164706 -Ke 0.000000 0.000000 0.000000 -Ni 1.000000 -d 1.000000 -illum 2 -map_Kd minecraft:blocks/wool_colored_red + Ns 96.0784 + Ni 1.5000 + d 1.0000 + Tr 0.0000 + Tf 1.0000 1.0000 1.0000 + illum 2 + Ka 1.0000 1.0000 1.0000 + Kd 0.8000 0.8000 0.8000 + Ks 0.1647 0.1647 0.1647 + Ke 0.0000 0.0000 0.0000 diff --git a/src/main/resources/assets/graves/models/block/gravestone.obj b/src/main/resources/assets/graves/models/block/gravestone.obj index 5bff163..e10e986 100644 --- a/src/main/resources/assets/graves/models/block/gravestone.obj +++ b/src/main/resources/assets/graves/models/block/gravestone.obj @@ -1,162 +1,196 @@ -# Blender v2.76 (sub 0) OBJ File: 'grave.blend' -# www.blender.org +# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware +# File Created: 23.03.2016 14:46:27 + mtllib gravestone.mtl -o box -v 1.000000 0.000000 1.000000 -v 0.951723 0.000000 0.951723 -v 0.000000 0.000000 1.000000 -v 1.000000 0.000000 -1.000000 -v 1.000000 -1.010000 1.000000 -v 1.000000 0.000000 -1.000000 -v 1.000000 0.000000 1.000000 -v 1.000000 -1.010000 -1.000000 -v 0.000000 -1.010000 -1.000000 -v 1.000000 -1.010000 -1.000000 -v 0.000000 -1.010000 1.000000 -v 0.000000 0.000000 1.000000 -v 0.000000 -1.010000 1.000000 -v 0.000000 0.000000 1.000000 -v 0.000000 -1.010000 -1.000000 -v 0.000000 -1.010000 1.000000 -v 0.000000 0.000000 -1.000000 -v 0.048277 0.000000 0.951723 -v 0.000000 0.000000 -1.000000 -v 0.951723 0.000000 0.951723 -v 0.048277 0.080000 0.951723 -v 0.048277 0.000000 0.951723 -v 0.951723 0.080000 0.951723 -v 0.951723 0.000000 0.951723 -v 0.951723 0.080000 -0.951723 -v 0.951723 0.080000 0.951723 -v 0.951723 0.000000 -0.951723 -v 0.951723 0.000000 -0.951723 -v 0.048277 0.000000 -0.951723 -v 0.048277 0.080000 0.951723 -v 0.048277 0.000000 -0.951723 -v 0.048277 0.000000 0.951723 -v 0.048277 0.080000 -0.951723 -v 0.048277 0.080000 0.951723 -v 0.087595 0.080000 0.912405 -v 0.048277 0.080000 -0.951723 -v 0.912405 0.080000 0.912405 -v 0.951723 0.080000 0.951723 -v 0.951723 0.080000 -0.951723 -v 0.912405 0.080000 -0.912405 -v 0.087595 0.080000 -0.912405 -v 0.087595 -0.979815 0.912405 -v 0.087595 0.080000 -0.912405 -v 0.087595 0.080000 0.912405 -v 0.087595 -0.979815 -0.912405 -v 0.087595 -0.979815 0.912405 -v 0.912405 -0.979815 -0.912405 -v 0.087595 -0.979815 -0.912405 -v 0.912405 -0.979815 0.912405 -v 0.087595 -0.979815 0.912405 -v 0.912405 0.080000 0.912405 -v 0.912405 -0.979815 0.912405 -v 0.087595 0.080000 0.912405 -v 0.912405 0.080000 0.912405 -v 0.912405 -0.979815 -0.912405 -v 0.912405 -0.979815 0.912405 -v 0.912405 0.080000 -0.912405 -v 0.087595 0.080000 -0.912405 -v 0.912405 -0.979815 -0.912405 -v 0.912405 0.080000 -0.912405 -v 0.087595 -0.979815 -0.912405 -v 0.951723 0.080000 -0.951723 -v 0.048277 0.000000 -0.951723 -v 0.048277 0.080000 -0.951723 -v 0.951723 0.000000 -0.951723 -v 1.000000 0.000000 -1.000000 -v 0.000000 -1.010000 -1.000000 -v 0.000000 0.000000 -1.000000 -v 1.000000 -1.010000 -1.000000 -v 0.000000 -1.010000 -0.000000 -v 0.000000 0.000000 -0.000000 -v 0.000000 -1.010000 -0.000000 -v 1.000000 -1.010000 0.000000 -v 1.000000 0.000000 0.000000 -v 1.000000 -1.010000 0.000000 -v 0.912405 0.080000 0.000000 -v 0.048277 0.080000 0.000000 -v 0.912405 -0.979815 0.000000 -v 0.912405 0.080000 0.000000 -v 0.951723 0.080000 0.000000 -v 0.048277 0.000000 -0.000000 -v 0.951723 0.000000 0.000000 -v 0.048277 0.080000 0.000000 -v 0.087595 0.080000 -0.000000 -v 0.087595 -0.979815 -0.000000 -v 0.951723 0.080000 0.000000 -v 0.087595 0.080000 -0.000000 -v 0.087595 -0.979815 -0.000000 -v 0.912405 -0.979815 0.000000 -vt 0.937500 0.937500 -vt 0.875000 1.000000 -vt 0.125000 1.000000 -vt 0.062500 0.937500 -vt 0.000000 0.875000 -vt 1.000000 0.875000 -vt 0.062500 1.000000 -vt 0.937500 1.000000 -vt 1.000000 0.000000 -vt 1.000000 0.937500 -vt 0.000000 0.937500 -vt 0.000000 0.000000 -vt 0.000000 1.000000 -vt 0.937500 0.000000 -vt 0.500000 0.956480 -vt 0.979344 0.956480 -vt 1.000000 1.000000 -vt 0.500000 1.000000 -vt 0.937500 0.875000 -vt 0.062500 0.000000 -vt 0.951723 0.937482 -vt 0.951723 1.000000 -vt 0.048277 1.000000 -vt 0.048277 0.937482 -vt 0.062500 0.875000 -vt 0.020656 0.956480 -vn 0.000000 1.000000 0.000000 -vn 0.000000 0.000000 -1.000000 -vn -0.000000 0.000000 1.000000 -vn 0.000000 -1.000000 0.000000 -vn 1.000000 0.000000 0.000000 -vn -1.000000 0.000000 -0.000000 + +v 0.3840 0.0800 0.8457 +v -0.4408 0.0800 0.8457 +v -0.4801 0.0800 0.8850 +v 0.4233 0.0800 0.8850 +v -0.5284 0.0000 0.9333 +v 0.4716 0.0000 0.9333 +v 0.4233 0.0000 0.8850 +v -0.4801 0.0000 0.8850 +v 0.4233 0.0000 -1.0184 +v -0.4801 0.0000 -1.0184 +v -0.4801 0.0800 -1.0184 +v 0.4233 0.0800 -1.0184 +v 0.4716 0.0000 -1.0667 +v -0.5284 0.0000 -1.0667 +v -0.5284 -1.0100 0.9333 +v 0.4716 -1.0100 0.9333 +v -0.5284 -1.0100 -0.0667 +v 0.4716 -1.0100 -0.0667 +v 0.4233 0.0800 -0.0667 +v 0.3840 0.0800 -0.0667 +v -0.4408 0.0800 -0.9791 +v -0.4801 0.0800 -0.0667 +v -0.4408 0.0800 -0.0667 +v 0.4716 0.0000 -0.0667 +v 0.4233 0.0000 -0.0667 +v 0.4716 -1.0100 -1.0667 +v -0.5284 -1.0100 -1.0667 +v -0.4801 0.0000 -0.0667 +v -0.5284 0.0000 -0.0667 +v 0.3840 0.0800 -0.9791 +v 0.3840 -0.9798 0.8457 +v 0.3840 -0.9798 -0.0667 +v -0.4408 -0.9798 -0.0667 +v -0.4408 -0.9798 0.8457 +v -0.4408 -0.9798 -0.9791 +v 0.3840 -0.9798 -0.9791 +# 36 vertices + +vn 0.0000 1.0000 -0.0000 +vn 0.0000 0.0000 -1.0000 +vn 0.0000 0.0000 1.0000 +vn 0.0000 -1.0000 -0.0000 +vn 1.0000 0.0000 -0.0000 +vn -1.0000 0.0000 -0.0000 +# 6 vertex normals + +vt 0.8750 1.0000 0.0000 +vt 0.1250 1.0000 0.0000 +vt 0.0625 0.9375 0.0000 +vt 0.9375 0.9375 0.0000 +vt 0.0000 0.8750 0.0000 +vt 1.0000 0.8750 0.0000 +vt 0.9375 1.0000 0.0000 +vt 0.0625 1.0000 0.0000 +vt 1.0000 0.9375 0.0000 +vt 0.0000 0.9375 0.0000 +vt 0.0000 0.0000 0.0000 +vt 1.0000 0.0000 0.0000 +vt 0.9375 0.0000 0.0000 +vt 0.0000 1.0000 0.0000 +vt 0.9793 0.9565 0.0000 +vt 1.0000 1.0000 0.0000 +vt 0.5000 1.0000 0.0000 +vt 0.5000 0.9565 0.0000 +vt 0.9375 0.8750 0.0000 +vt 0.0625 0.0000 0.0000 +vt 0.9517 1.0000 0.0000 +vt 0.0483 1.0000 0.0000 +vt 0.0483 0.9375 0.0000 +vt 0.9517 0.9375 0.0000 +vt 0.0625 0.8750 0.0000 +vt 0.0207 0.9565 0.0000 +# 26 texture coords + +g default usemtl box s off -f 38/1/1 37/2/1 35/3/1 34/4/1 -f 18/4/1 3/5/1 1/6/1 2/1/1 -f 62/7/2 65/4/2 63/1/2 64/8/2 -f 19/6/1 29/1/1 28/4/1 4/5/1 -f 5/9/3 7/10/3 12/11/3 13/12/3 -f 5/13/4 11/12/4 72/14/4 73/8/4 -f 80/1/1 76/8/1 37/3/1 38/4/1 -f 87/15/1 41/16/1 36/17/1 77/18/1 -f 24/4/1 7/5/1 74/19/1 82/1/1 -f 75/20/5 8/9/5 6/10/5 74/4/5 -f 20/21/3 23/22/3 21/23/3 22/24/3 -f 24/4/5 82/1/5 86/8/5 26/7/5 -f 73/7/4 72/20/4 9/9/4 10/17/4 -f 66/11/2 69/12/2 67/9/2 68/10/2 -f 30/8/6 83/7/6 81/4/6 32/1/6 -f 71/1/6 17/11/6 15/12/6 70/14/6 -f 14/10/6 71/4/6 70/20/6 16/9/6 -f 71/1/1 81/19/1 63/25/1 68/11/1 -f 36/1/1 41/2/1 40/3/1 39/4/1 -f 5/12/5 75/14/5 74/1/5 7/11/5 -f 39/1/1 40/2/1 76/7/1 80/4/1 -f 35/26/1 87/15/1 77/18/1 34/13/1 -f 83/8/6 33/7/6 31/4/6 81/1/6 -f 82/4/5 27/1/5 25/8/5 86/7/5 -f 81/4/1 71/25/1 14/6/1 32/1/1 -f 82/4/1 74/25/1 66/6/1 65/1/1 -usemtl inside -f 46/13/1 49/12/1 89/14/1 88/8/1 -f 85/20/5 45/9/5 43/17/5 84/7/5 -f 54/17/6 79/7/6 78/20/6 56/9/6 -f 58/13/3 61/12/3 59/9/3 60/17/3 -f 50/9/2 53/17/2 51/13/2 52/12/2 -f 79/8/6 57/13/6 55/12/6 78/14/6 -f 88/7/1 89/20/1 47/9/1 48/17/1 -f 42/12/5 85/14/5 84/8/5 44/13/5 +f 1/1/1 2/2/1 3/3/1 4/4/1 +f 5/5/1 6/6/1 7/4/1 8/3/1 +f 9/3/2 10/4/2 11/7/2 12/8/2 +f 10/4/1 9/3/1 13/5/1 14/6/1 +f 6/9/3 5/10/3 15/11/3 16/12/3 +f 15/11/4 17/13/4 18/7/4 16/14/4 +f 19/4/1 20/7/1 1/2/1 4/3/1 +f 21/15/1 11/16/1 22/17/1 23/18/1 +f 7/3/1 6/5/1 24/19/1 25/4/1 +f 26/12/5 13/9/5 24/3/5 18/20/5 +f 4/21/3 3/22/3 8/23/3 7/24/3 +f 25/4/5 19/7/5 4/8/5 7/3/5 +f 17/20/4 27/12/4 26/16/4 18/8/4 +f 26/11/2 27/12/2 14/9/2 13/10/2 +f 22/8/6 28/3/6 8/4/6 3/7/6 +f 14/10/6 27/11/6 17/13/6 29/4/6 +f 29/3/6 17/20/6 15/12/6 5/9/6 +f 29/4/1 28/19/1 10/25/1 14/10/1 +f 21/1/1 30/2/1 12/3/1 11/4/1 +f 18/13/5 24/4/5 6/10/5 16/11/5 +f 30/1/1 20/8/1 19/3/1 12/4/1 +f 2/26/1 23/18/1 22/17/1 3/14/1 +f 11/8/6 10/3/6 28/4/6 22/7/6 +f 9/4/5 12/7/5 19/8/5 25/3/5 +f 29/25/1 5/6/1 8/4/1 28/3/1 +f 24/25/1 13/6/1 9/4/1 25/3/1 +usemtl box +f 31/11/1 32/13/1 33/7/1 34/14/1 +f 35/12/5 21/16/5 23/8/5 33/20/5 +f 20/8/6 32/20/6 31/12/6 1/16/6 +f 35/11/3 36/12/3 30/16/3 21/14/3 +f 2/16/2 1/14/2 31/11/2 34/12/2 +f 30/14/6 36/11/6 32/13/6 20/7/6 +f 32/20/1 36/12/1 35/16/1 33/8/1 +f 33/13/5 23/7/5 2/14/5 34/11/5 +# 34 polygons + +# +# object default001 +# + +v 0.4200 0.1423 -0.0650 +v 0.4700 0.0823 -0.0650 +v 0.4700 0.0823 -1.0150 +v 0.4200 0.1423 -1.0150 +v -0.5300 0.0823 0.8850 +v -0.5300 0.0823 -0.0650 +v 0.4700 0.0823 0.8850 +v 0.4700 0.0823 -1.0650 +v 0.4200 0.0823 -1.0650 +v -0.4800 0.1423 -0.0650 +v -0.4800 0.1423 0.8850 +v 0.4200 0.1423 0.8850 +v -0.4800 0.1423 -1.0150 +v -0.5300 0.0823 -1.0650 +v -0.5300 0.0823 -1.0150 +v -0.4800 0.0823 -1.0650 +v -0.4800 0.0823 0.9350 +v 0.4200 0.0823 0.9350 +v 0.4700 0.0823 0.9350 +v -0.5300 0.0823 0.9350 +# 20 vertices + +vn 0.7682 0.6402 -0.0000 +vn 0.0000 -1.0000 -0.0000 +vn 0.0000 0.6402 -0.7682 +vn 0.0000 1.0000 -0.0000 +vn -0.7682 0.6402 -0.0000 +vn 0.0000 0.6402 0.7682 +# 6 vertex normals + +vt 0.0625 0.0625 0.0000 +vt 0.0625 0.0000 0.0000 +vt 1.0000 0.0000 0.0000 +vt 1.0000 0.0625 0.0000 +vt 0.9375 1.0000 0.0000 +vt 0.0625 1.0000 0.0000 +vt 0.9375 0.0000 0.0000 +vt 0.9375 0.0625 0.0000 +vt -0.0000 1.0000 0.0000 +vt 0.0000 -0.0000 0.0000 +vt 0.0000 0.9375 0.0000 +vt 0.9375 0.9375 0.0000 +vt 1.0000 1.0000 0.0000 +vt 1.0000 0.9375 0.0000 +vt 0.0000 0.0625 0.0000 +vt 0.0625 0.9375 0.0000 +# 16 texture coords + +g default001 +usemtl box +s off +f 37/27/7 38/28/7 39/29/7 40/30/7 +f 41/31/8 42/32/8 38/28/8 43/33/8 +f 40/34/9 44/29/9 45/30/9 +f 40/34/7 39/33/7 44/29/7 +f 46/31/10 47/35/10 48/36/10 37/33/10 +f 41/37/11 47/35/11 46/31/11 42/38/11 +f 49/38/11 50/39/11 51/31/11 +f 50/39/9 49/38/9 52/40/9 +f 38/33/7 37/34/7 48/41/7 43/36/7 +f 47/35/12 53/32/12 54/28/12 48/36/12 +f 48/27/7 55/36/7 43/28/7 +f 48/27/12 54/41/12 55/36/12 +f 51/32/8 50/35/8 44/36/8 39/28/8 +f 49/39/11 51/40/11 42/42/11 46/32/11 +f 42/31/8 51/32/8 39/28/8 38/33/8 +f 47/42/11 41/35/11 56/32/11 +f 56/35/12 53/37/12 47/42/12 +f 49/39/10 46/32/10 37/28/10 40/29/10 +f 45/29/9 52/39/9 49/31/9 40/33/9 +f 41/41/8 43/30/8 55/29/8 56/36/8 +# 12 polygons - 8 triangles + diff --git a/src/main/resources/assets/graves/models/block/gravestone_lid.mtl b/src/main/resources/assets/graves/models/block/gravestone_lid.mtl deleted file mode 100644 index a7e3f36..0000000 --- a/src/main/resources/assets/graves/models/block/gravestone_lid.mtl +++ /dev/null @@ -1,13 +0,0 @@ -# Blender MTL File: 'None' -# Material Count: 1 - -newmtl lid -Ns 96.078431 -Ka 1.000000 1.000000 1.000000 -Kd 0.800000 0.800000 0.800000 -Ks 0.164706 0.164706 0.164706 -Ke 0.000000 0.000000 0.000000 -Ni 1.000000 -d 1.000000 -illum 2 -map_Kd minecraft:blocks/stone_andesite_smooth diff --git a/src/main/resources/assets/graves/models/block/gravestone_lid.obj b/src/main/resources/assets/graves/models/block/gravestone_lid.obj deleted file mode 100644 index 1ab39d7..0000000 --- a/src/main/resources/assets/graves/models/block/gravestone_lid.obj +++ /dev/null @@ -1,92 +0,0 @@ -# Blender v2.76 (sub 0) OBJ File: '' -# www.blender.org -mtllib gravestone_lid.mtl -o lid -v 0.950000 0.142264 -0.950000 -v 0.050000 0.142264 -0.000000 -v 0.950000 0.142264 0.000000 -v 0.050000 0.142264 -0.950000 -v 0.950000 0.142264 -0.950000 -v 0.050000 0.082264 -1.000000 -v 0.050000 0.142264 -0.950000 -v 0.950000 0.082264 -1.000000 -v 1.000000 0.082264 -1.000000 -v 0.950000 0.142264 -0.950000 -v 1.000000 0.082264 -0.950000 -v 1.000000 0.082264 -1.000000 -v 1.000000 0.082264 0.000000 -v 0.950000 0.142264 0.000000 -v 0.050000 0.142264 -0.000000 -v 0.000000 0.082264 -0.950000 -v 0.000000 0.082264 -0.000000 -v 0.050000 0.142264 -0.950000 -v 0.000000 0.082264 -1.000000 -v 0.000000 0.082264 -1.000000 -v 1.000000 0.082264 -1.000000 -v 0.000000 0.082264 -1.000000 -v 1.000000 0.082264 -0.950000 -v 0.000000 0.082264 -0.950000 -v 1.000000 0.082264 0.000000 -v 0.000000 0.082264 -0.000000 -v 1.000000 0.082264 0.950000 -v 0.000000 0.082264 0.950000 -v 1.000000 0.082264 1.000000 -v 0.950000 0.142264 0.950000 -v 1.000000 0.082264 0.950000 -v 0.950000 0.142264 0.950000 -v 0.950000 0.082264 1.000000 -v 0.050000 0.082264 1.000000 -v 0.950000 0.082264 1.000000 -v 0.050000 0.142264 0.950000 -v 0.050000 0.142264 0.950000 -v 0.950000 0.142264 0.950000 -v 0.050000 0.142264 0.950000 -v 0.000000 0.082264 0.950000 -v 0.000000 0.082264 1.000000 -v 0.000000 0.082264 1.000000 -v 1.000000 0.082264 0.950000 -v 1.000000 0.082264 0.000000 -vt 1.000000 0.062500 -vt 0.062500 0.062500 -vt 0.062500 0.000000 -vt 1.000000 0.000000 -vt 0.937500 0.000000 -vt 0.937500 1.000000 -vt 0.062500 1.000000 -vt 0.937500 0.062500 -vt -0.000000 1.000000 -vt 0.000000 -0.000000 -vt 0.937500 0.937500 -vt 0.000000 0.937500 -vt 1.000000 1.000000 -vt 1.000000 0.937500 -vt 0.000000 0.062500 -vt 0.062500 0.937500 -vn 0.768200 0.640200 0.000000 -vn 0.000000 -1.000000 0.000000 -vn 0.000000 0.640200 -0.768200 -vn 0.000000 1.000000 0.000000 -vn -0.768200 0.640200 -0.000000 -vn -0.000000 0.640200 0.768200 -usemtl lid -s off -f 10/1/1 14/2/1 13/3/1 11/4/1 -f 27/5/2 28/6/2 26/7/2 25/3/2 -f 5/8/3 9/4/3 8/1/3 -f 10/8/1 11/5/1 12/4/1 -f 3/5/4 2/6/4 37/9/4 38/10/4 -f 17/11/5 40/12/5 39/9/5 15/6/5 -f 18/11/5 19/13/5 16/6/5 -f 20/13/3 7/11/3 6/14/3 -f 43/10/1 44/5/1 14/8/1 30/15/1 -f 32/10/6 36/9/6 34/7/6 35/3/6 -f 30/2/1 29/10/1 31/3/1 -f 32/2/6 33/15/6 29/10/6 -f 23/3/2 24/7/2 22/9/2 21/10/2 -f 15/7/5 18/13/5 16/14/5 17/16/5 -f 25/5/2 26/6/2 24/7/2 23/3/2 -f 39/16/5 40/9/5 41/7/5 -f 42/9/6 34/12/6 36/16/6 -f 1/4/4 4/13/4 2/7/4 3/3/4 -f 5/5/3 8/4/3 6/13/3 7/6/3 -f 41/10/2 28/15/2 27/1/2 29/4/2 From 8ff860239d26c24f372fd6bbe09f69ce8a8b6722 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Sat, 16 Apr 2016 16:19:41 -0700 Subject: [PATCH 07/47] Fixed a crash when EntityPlayerZombie masterGrave field is null; --- gradle.properties | 2 +- .../graves/block/BlockGraveSlave.java | 9 ++++----- .../graves/block/BlockGraveStone.java | 3 ++- .../graves/entity/EntityPlayerZombie.java | 20 ++++++++++--------- .../tileentity/TileEntityGraveStone.java | 3 +-- .../fireball1725/graves/util/TileTools.java | 4 +++- 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/gradle.properties b/gradle.properties index 0a641b1..827d8a1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ minecraft_version=1.9 -forge_version=12.16.0.1809 +forge_version=12.16.0.1813 mcp_mappings=snapshot_20160312 cibuild=0 cibasename=graves \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/block/BlockGraveSlave.java b/src/main/java/com/fireball1725/graves/block/BlockGraveSlave.java index 4a69715..462b3ee 100644 --- a/src/main/java/com/fireball1725/graves/block/BlockGraveSlave.java +++ b/src/main/java/com/fireball1725/graves/block/BlockGraveSlave.java @@ -27,10 +27,10 @@ import java.util.Random; public class BlockGraveSlave extends BlockBase { - public static final PropertyBool isFoot = PropertyBool.create("isfoot"); - public static final PropertyEnum slaveType = PropertyEnum.create("slavetype", SlaveType.class); + private static final PropertyBool isFoot = PropertyBool.create("isfoot"); + private static final PropertyEnum slaveType = PropertyEnum.create("slavetype", SlaveType.class); - public BlockGraveSlave() + BlockGraveSlave() { super(Material.cloth); setDefaultState(blockState.getBaseState().withProperty(slaveType, SlaveType.LID).withProperty(isFoot, true).withProperty(BlockGraveStone.FACING, EnumFacing.NORTH)); @@ -40,7 +40,6 @@ public BlockGraveSlave() setTileEntity(TileEntityGraveSlave.class); } - @SuppressWarnings("Duplicates") public static IBlockState getActualStatePre(IBlockState state, IBlockAccess worldIn, BlockPos pos, BlockPos masterPos) { if(masterPos != null) @@ -273,7 +272,7 @@ public void onBlockExploded(World world, BlockPos pos, Explosion explosion) { } - public enum SlaveType implements IStringSerializable + private enum SlaveType implements IStringSerializable { LID, BOX, diff --git a/src/main/java/com/fireball1725/graves/block/BlockGraveStone.java b/src/main/java/com/fireball1725/graves/block/BlockGraveStone.java index aab64aa..0c8869b 100644 --- a/src/main/java/com/fireball1725/graves/block/BlockGraveStone.java +++ b/src/main/java/com/fireball1725/graves/block/BlockGraveStone.java @@ -2,6 +2,7 @@ import com.fireball1725.graves.tileentity.TileEntityGraveStone; import com.fireball1725.graves.util.TileTools; +import net.minecraft.block.BlockHorizontal; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyDirection; @@ -25,7 +26,7 @@ import java.util.Random; public class BlockGraveStone extends BlockBase { - public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + public static final PropertyDirection FACING = BlockHorizontal.FACING; public static final PropertyBool HASLID = PropertyBool.create("haslid"); public BlockGraveStone() { diff --git a/src/main/java/com/fireball1725/graves/entity/EntityPlayerZombie.java b/src/main/java/com/fireball1725/graves/entity/EntityPlayerZombie.java index 28fa9ee..62e4e2b 100644 --- a/src/main/java/com/fireball1725/graves/entity/EntityPlayerZombie.java +++ b/src/main/java/com/fireball1725/graves/entity/EntityPlayerZombie.java @@ -78,6 +78,12 @@ public boolean apply(EntityPlayer input) { setSize(0.6F, 1.8F); } + public EntityPlayerZombie(World world, BlockPos pos) + { + this(world); + graveMaster = pos; + } + public void setPlayer(EntityPlayer player) { this.player = player; } @@ -386,7 +392,8 @@ public double getYOffset() { @Override public void writeEntityToNBT(NBTTagCompound nbt) { super.writeEntityToNBT(nbt); - nbt.setLong("graveMaster", graveMaster.toLong()); + if(graveMaster != null) + { nbt.setLong("graveMaster", graveMaster.toLong()); } String username = getUsername(); if (!StringUtils.isBlank(username)) @@ -403,9 +410,9 @@ public void readEntityFromNBT(NBTTagCompound nbt) { } else username = "FireBall1725"; setUsername(username); - - graveMaster = BlockPos.fromLong(nbt.getLong("graveMaster")); - } + if(nbt.hasKey("graveMaster")) + { graveMaster = BlockPos.fromLong(nbt.getLong("graveMaster")); } + } @Override public boolean attackEntityAsMob(Entity target) { @@ -555,11 +562,6 @@ public BlockPos getGraveMaster() return graveMaster; } - public void setGraveMaster(BlockPos graveMaster) - { - this.graveMaster = graveMaster; - } - /** * Returns false if this Entity is a boss, true otherwise. */ diff --git a/src/main/java/com/fireball1725/graves/tileentity/TileEntityGraveStone.java b/src/main/java/com/fireball1725/graves/tileentity/TileEntityGraveStone.java index 2f3a0b3..3a0f85e 100644 --- a/src/main/java/com/fireball1725/graves/tileentity/TileEntityGraveStone.java +++ b/src/main/java/com/fireball1725/graves/tileentity/TileEntityGraveStone.java @@ -251,14 +251,13 @@ private void spawnPlayerZombie(EntityPlayer player) if(spawnPlayerZombie && ConfigZombie.configZombieEnabled) { - EntityPlayerZombie playerZombie = new EntityPlayerZombie(worldObj); + EntityPlayerZombie playerZombie = new EntityPlayerZombie(worldObj, pos); playerZombie.setProfile(getPlayerProfile()); playerZombie.setLocationAndAngles(pos.getX(), pos.down().getY(), pos.getZ(), getBlockState().getValue(BlockGraveStone.FACING).getHorizontalIndex() * 90f, 0f); playerZombie.onInitialSpawn(worldObj.getDifficultyForLocation(new BlockPos(playerZombie)), null); playerZombie.setPlayer(player); - playerZombie.setGraveMaster(pos); // nbtTagCompound.setIntArray("MasterGrave", new int[]{graveStone.getPos().getX(), graveStone.getPos().getY(), graveStone.getPos().getZ()}); worldObj.spawnEntityInWorld(playerZombie); diff --git a/src/main/java/com/fireball1725/graves/util/TileTools.java b/src/main/java/com/fireball1725/graves/util/TileTools.java index 227b879..c45bc58 100644 --- a/src/main/java/com/fireball1725/graves/util/TileTools.java +++ b/src/main/java/com/fireball1725/graves/util/TileTools.java @@ -15,7 +15,9 @@ public class TileTools { * @return The TileEntity or Null if not the TileEntity */ public static T getTileEntity(IBlockAccess world, BlockPos blockPos, Class tClass) { - TileEntity tileEntity = world.getTileEntity(blockPos); + if(world == null || blockPos == null) + { return null; } + TileEntity tileEntity = world.getTileEntity(blockPos); return !tClass.isInstance(tileEntity) ? null : tClass.cast(tileEntity); } } From 674a9c3d7e6790bda47e0f4977e6214801baca6d Mon Sep 17 00:00:00 2001 From: FusionLord Date: Wed, 20 Apr 2016 12:11:25 -0700 Subject: [PATCH 08/47] 1.9 now with sounds. --- gradle.properties | 2 +- .../graves/entity/EntityPlayerZombie.java | 68 +++++++++++------- .../graves/helpers/SoundHelper.java | 18 ++--- .../graves/proxy/ClientProxy.java | 1 + src/main/resources/assets/graves/sounds.json | 40 +++++++++-- .../attack.ogg} | Bin .../death.ogg} | Bin .../idle.ogg} | Bin .../spawn.ogg} | Bin 9 files changed, 87 insertions(+), 42 deletions(-) rename src/main/resources/assets/graves/sounds/{Grave_Zombie_Attack.ogg => playerzombie/attack.ogg} (100%) rename src/main/resources/assets/graves/sounds/{Grave_Zombie_Death.ogg => playerzombie/death.ogg} (100%) rename src/main/resources/assets/graves/sounds/{Grave_Zombie_Idle.ogg => playerzombie/idle.ogg} (100%) rename src/main/resources/assets/graves/sounds/{Grave_Zombie_Spawn.ogg => playerzombie/spawn.ogg} (100%) diff --git a/gradle.properties b/gradle.properties index 827d8a1..4f9bc18 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ minecraft_version=1.9 -forge_version=12.16.0.1813 +forge_version=12.16.0.1865 mcp_mappings=snapshot_20160312 cibuild=0 cibasename=graves \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/entity/EntityPlayerZombie.java b/src/main/java/com/fireball1725/graves/entity/EntityPlayerZombie.java index 62e4e2b..ac7e5c0 100644 --- a/src/main/java/com/fireball1725/graves/entity/EntityPlayerZombie.java +++ b/src/main/java/com/fireball1725/graves/entity/EntityPlayerZombie.java @@ -3,6 +3,7 @@ import com.fireball1725.graves.configuration.ConfigZombie; import com.fireball1725.graves.helpers.IDeadPlayerEntity; import com.fireball1725.graves.helpers.LogHelper; +import com.fireball1725.graves.helpers.SoundHelper; import com.google.common.base.Predicate; import com.mojang.authlib.GameProfile; import net.minecraft.entity.*; @@ -17,9 +18,7 @@ import net.minecraft.network.datasync.DataSerializers; import net.minecraft.network.datasync.EntityDataManager; import net.minecraft.tileentity.TileEntitySkull; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumHand; +import net.minecraft.util.*; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; @@ -42,12 +41,12 @@ public class EntityPlayerZombie extends EntityFlying implements IDeadPlayerEntit private static final DataParameter CHILD = EntityDataManager.createKey(EntityPlayerZombie.class, DataSerializers.BYTE); private static final DataParameter WIDTH = EntityDataManager.createKey(EntityPlayerZombie.class, DataSerializers.FLOAT); private static final DataParameter HEIGHT = EntityDataManager.createKey(EntityPlayerZombie.class, DataSerializers.FLOAT); + private static Map sounds = new HashMap(); private final EntityAIBreakDoor breakDoorAI = new EntityAIBreakDoor(this); private double prevCapeX, prevCapeY, prevCapeZ; private double capeX, capeY, capeZ; private GameProfile profile; private EntityPlayer player; - private BlockPos graveMaster; public EntityPlayerZombie(World world) { @@ -84,6 +83,14 @@ public EntityPlayerZombie(World world, BlockPos pos) graveMaster = pos; } + public static void registerSounds() + { + SoundHelper.registerSound("playerzombie.spawn", sounds); + SoundHelper.registerSound("playerzombie.idle", sounds); + SoundHelper.registerSound("playerzombie.attack", sounds); + SoundHelper.registerSound("playerzombie.death", sounds); + } + public void setPlayer(EntityPlayer player) { this.player = player; } @@ -175,31 +182,33 @@ protected void entityInit() { dataWatcher.register(CHILD, (byte) 0); dataWatcher.register(WIDTH, width); dataWatcher.register(HEIGHT, height); + playSound(getSound("spawn"), getSoundVolume(), getSoundPitch()); } //TODO: Add Sounds when not completely broken. - // @Override - // protected SoundEvent getAmbientSound() - // { - // return SoundHelper.getRegisteredSoundEvent("graves:graveZombieIdle"); - // } - // - // @Override - // protected SoundEvent getHurtSound() - // { - // return SoundHelper.getRegisteredSoundEvent("graves:graveZombieAttack"); - // } - // - // @Override - // public SoundCategory getSoundCategory() - // { - // return SoundCategory.HOSTILE; - // } - // - // @Override - // protected String getDeathSound() { - // return "graves:graveZombieDeath"; - // } + @Override + public SoundCategory getSoundCategory() + { + return SoundCategory.HOSTILE; + } + + @Override + protected SoundEvent getAmbientSound() + { + return getSound("idle"); + } + + @Override + protected SoundEvent getHurtSound() + { + return getSound("attack"); + } + + @Override + protected SoundEvent getDeathSound() + { + return getSound("death"); + } @Override protected void dropFewItems(boolean recentHit, int looting) { @@ -570,6 +579,13 @@ public boolean isNonBoss() return false; } + public SoundEvent getSound(String name) + { + return sounds.get("playerzombie." + name); + } + + + class PlayerZombieMoveTargetPos { public double posX; diff --git a/src/main/java/com/fireball1725/graves/helpers/SoundHelper.java b/src/main/java/com/fireball1725/graves/helpers/SoundHelper.java index ed6c603..cbc5bae 100644 --- a/src/main/java/com/fireball1725/graves/helpers/SoundHelper.java +++ b/src/main/java/com/fireball1725/graves/helpers/SoundHelper.java @@ -1,21 +1,17 @@ package com.fireball1725.graves.helpers; +import com.fireball1725.graves.reference.ModInfo; import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundEvent; +import net.minecraftforge.fml.common.registry.GameRegistry; + +import java.util.Map; public class SoundHelper { - public static SoundEvent getRegisteredSoundEvent(String id) + public static void registerSound(String soundName, Map map) { - SoundEvent soundevent = SoundEvent.soundEventRegistry.getObject(new ResourceLocation(id)); - - if(soundevent == null) - { - throw new IllegalStateException("Invalid Sound requested: " + id); - } - else - { - return soundevent; - } + final ResourceLocation soundID = new ResourceLocation(ModInfo.MOD_ID, soundName); + map.put(soundName, GameRegistry.register(new SoundEvent(soundID).setRegistryName(soundID))); } } diff --git a/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java b/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java index d28edfc..b11b609 100644 --- a/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java +++ b/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java @@ -37,6 +37,7 @@ public void registerEntities() { super.registerEntities(); EntityRenderers.registerEntityRenderer(EntityPlayerZombie.class, RenderPlayerZombie.class); + EntityPlayerZombie.registerSounds(); } @Override diff --git a/src/main/resources/assets/graves/sounds.json b/src/main/resources/assets/graves/sounds.json index 21c30c9..c32d16e 100644 --- a/src/main/resources/assets/graves/sounds.json +++ b/src/main/resources/assets/graves/sounds.json @@ -1,6 +1,38 @@ { - "graveZombieSpawn": {"category": "master","sounds": [{"name": "Grave_Zombie_Spawn","stream":false}]}, - "graveZombieIdle": {"category": "master","sounds": [{"name": "Grave_Zombie_Idle","stream":false}]}, - "graveZombieAttack": {"category": "master","sounds": [{"name": "Grave_Zombie_Attack","stream":false}]}, - "graveZombieDeath": {"category": "master","sounds": [{"name": "Grave_Zombie_Death","stream":false}]} + "playerzombie.spawn": { + "category": "master", + "sounds": [ + { + "name": "graves:playerzombie/spawn", + "stream": false + } + ] + }, + "playerzombie.idle": { + "category": "master", + "sounds": [ + { + "name": "graves:playerzombie/idle", + "stream": false + } + ] + }, + "playerzombie.attack": { + "category": "master", + "sounds": [ + { + "name": "graves:playerzombie/attack", + "stream": false + } + ] + }, + "playerzombie.death": { + "category": "master", + "sounds": [ + { + "name": "graves:playerzombie/death", + "stream": false + } + ] + } } \ No newline at end of file diff --git a/src/main/resources/assets/graves/sounds/Grave_Zombie_Attack.ogg b/src/main/resources/assets/graves/sounds/playerzombie/attack.ogg similarity index 100% rename from src/main/resources/assets/graves/sounds/Grave_Zombie_Attack.ogg rename to src/main/resources/assets/graves/sounds/playerzombie/attack.ogg diff --git a/src/main/resources/assets/graves/sounds/Grave_Zombie_Death.ogg b/src/main/resources/assets/graves/sounds/playerzombie/death.ogg similarity index 100% rename from src/main/resources/assets/graves/sounds/Grave_Zombie_Death.ogg rename to src/main/resources/assets/graves/sounds/playerzombie/death.ogg diff --git a/src/main/resources/assets/graves/sounds/Grave_Zombie_Idle.ogg b/src/main/resources/assets/graves/sounds/playerzombie/idle.ogg similarity index 100% rename from src/main/resources/assets/graves/sounds/Grave_Zombie_Idle.ogg rename to src/main/resources/assets/graves/sounds/playerzombie/idle.ogg diff --git a/src/main/resources/assets/graves/sounds/Grave_Zombie_Spawn.ogg b/src/main/resources/assets/graves/sounds/playerzombie/spawn.ogg similarity index 100% rename from src/main/resources/assets/graves/sounds/Grave_Zombie_Spawn.ogg rename to src/main/resources/assets/graves/sounds/playerzombie/spawn.ogg From e30f02ddae50fdbb6306b7009cc4734c7c535503 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Mon, 16 May 2016 21:07:03 -0700 Subject: [PATCH 09/47] Refactored packages; Graves will always spawn where players died, and will replace destroyed TileEntities when destroyed. --- .../java/com/fireball1725/graves/Graves.java | 8 +- .../graves/client/events/RenderEvents.java | 10 +- .../graves/client/gui/GuiScreenHeadstone.java | 6 +- .../render/TileEntityHeadStoneRenderer.java | 6 +- .../client/render/entity/LayerHumanCape.java | 4 +- .../render/entity/RenderPlayerZombie.java | 6 +- .../graves/{ => common}/block/BlockBase.java | 10 +- .../{ => common}/block/BlockGraveSlave.java | 8 +- .../{ => common}/block/BlockGraveStone.java | 6 +- .../{ => common}/block/BlockHeadStone.java | 6 +- .../graves/{ => common}/block/Blocks.java | 8 +- .../configuration/ConfigZombie.java | 2 +- .../configuration/ConfigurationFile.java | 4 +- .../configuration/GravesConfig.java | 4 +- .../configuration/GravesConfigGuiFactory.java | 2 +- .../creativetab/ModCreativeTabs.java | 6 +- .../graves/{ => common}/entity/Entities.java | 5 +- .../{ => common}/entity/EntityFlying.java | 2 +- .../entity/EntityPlayerZombie.java | 10 +- .../{ => common}/event/EventBlockBreak.java | 22 +++-- .../{ => common}/event/EventDeathHandler.java | 53 ++++++---- .../helpers/BreakableWhiteListHelper.java | 2 +- .../helpers/ConfigurationHelper.java | 2 +- .../helpers/IDeadPlayerEntity.java | 2 +- .../{ => common}/helpers/LogHelper.java | 4 +- .../{ => common}/helpers/OpenGLHelper.java | 2 +- .../helpers/SafeBlockReplacer.java | 2 +- .../{ => common}/helpers/SoundHelper.java | 4 +- .../{ => common}/integrations/JourneyMap.java | 2 +- .../{ => common}/item/ItemHeadStone.java | 2 +- .../{ => common}/network/PacketHandler.java | 6 +- .../messages/MessageSetHeadstoneName.java | 6 +- .../{ => common}/reference/ModInfo.java | 2 +- .../common/structure/ReplaceableBlock.java | 68 +++++++++++++ .../tileentity/TileEntityBase.java | 4 +- .../tileentity/TileEntityGraveSlave.java | 2 +- .../tileentity/TileEntityGraveStone.java | 96 ++++++++++++------- .../tileentity/TileEntityHeadStone.java | 2 +- .../tileentity/TileEntityInventoryBase.java | 8 +- .../inventory/IInventoryCustom.java | 2 +- .../inventory/IInventoryHandler.java | 2 +- .../inventory/InternalDynamicInventory.java | 4 +- .../inventory/InternalInventory.java | 6 +- .../inventory/InventoryOperation.java | 2 +- .../graves/{ => common}/util/GuiHandler.java | 4 +- .../{ => common}/util/ItemStackSrc.java | 2 +- .../graves/{ => common}/util/Platform.java | 2 +- .../{ => common}/util/TextureUtils.java | 2 +- .../graves/{ => common}/util/TileTools.java | 2 +- .../util/iterators/InventoryIterator.java | 2 +- .../graves/proxy/ClientProxy.java | 8 +- .../graves/proxy/CommonProxy.java | 14 ++- 52 files changed, 285 insertions(+), 171 deletions(-) rename src/main/java/com/fireball1725/graves/{ => common}/block/BlockBase.java (94%) rename src/main/java/com/fireball1725/graves/{ => common}/block/BlockGraveSlave.java (97%) rename src/main/java/com/fireball1725/graves/{ => common}/block/BlockGraveStone.java (96%) rename src/main/java/com/fireball1725/graves/{ => common}/block/BlockHeadStone.java (96%) rename src/main/java/com/fireball1725/graves/{ => common}/block/Blocks.java (89%) rename src/main/java/com/fireball1725/graves/{ => common}/configuration/ConfigZombie.java (98%) rename src/main/java/com/fireball1725/graves/{ => common}/configuration/ConfigurationFile.java (98%) rename src/main/java/com/fireball1725/graves/{ => common}/configuration/GravesConfig.java (88%) rename src/main/java/com/fireball1725/graves/{ => common}/configuration/GravesConfigGuiFactory.java (92%) rename src/main/java/com/fireball1725/graves/{ => common}/creativetab/ModCreativeTabs.java (67%) rename src/main/java/com/fireball1725/graves/{ => common}/entity/Entities.java (95%) rename src/main/java/com/fireball1725/graves/{ => common}/entity/EntityFlying.java (98%) rename src/main/java/com/fireball1725/graves/{ => common}/entity/EntityPlayerZombie.java (99%) rename src/main/java/com/fireball1725/graves/{ => common}/event/EventBlockBreak.java (70%) rename src/main/java/com/fireball1725/graves/{ => common}/event/EventDeathHandler.java (63%) rename src/main/java/com/fireball1725/graves/{ => common}/helpers/BreakableWhiteListHelper.java (90%) rename src/main/java/com/fireball1725/graves/{ => common}/helpers/ConfigurationHelper.java (98%) rename src/main/java/com/fireball1725/graves/{ => common}/helpers/IDeadPlayerEntity.java (87%) rename src/main/java/com/fireball1725/graves/{ => common}/helpers/LogHelper.java (89%) rename src/main/java/com/fireball1725/graves/{ => common}/helpers/OpenGLHelper.java (97%) rename src/main/java/com/fireball1725/graves/{ => common}/helpers/SafeBlockReplacer.java (99%) rename src/main/java/com/fireball1725/graves/{ => common}/helpers/SoundHelper.java (81%) rename src/main/java/com/fireball1725/graves/{ => common}/integrations/JourneyMap.java (90%) rename src/main/java/com/fireball1725/graves/{ => common}/item/ItemHeadStone.java (93%) rename src/main/java/com/fireball1725/graves/{ => common}/network/PacketHandler.java (73%) rename src/main/java/com/fireball1725/graves/{ => common}/network/messages/MessageSetHeadstoneName.java (89%) rename src/main/java/com/fireball1725/graves/{ => common}/reference/ModInfo.java (93%) create mode 100644 src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java rename src/main/java/com/fireball1725/graves/{ => common}/tileentity/TileEntityBase.java (97%) rename src/main/java/com/fireball1725/graves/{ => common}/tileentity/TileEntityGraveSlave.java (94%) rename src/main/java/com/fireball1725/graves/{ => common}/tileentity/TileEntityGraveStone.java (74%) rename src/main/java/com/fireball1725/graves/{ => common}/tileentity/TileEntityHeadStone.java (81%) rename src/main/java/com/fireball1725/graves/{ => common}/tileentity/TileEntityInventoryBase.java (93%) rename src/main/java/com/fireball1725/graves/{ => common}/tileentity/inventory/IInventoryCustom.java (75%) rename src/main/java/com/fireball1725/graves/{ => common}/tileentity/inventory/IInventoryHandler.java (82%) rename src/main/java/com/fireball1725/graves/{ => common}/tileentity/inventory/InternalDynamicInventory.java (97%) rename src/main/java/com/fireball1725/graves/{ => common}/tileentity/inventory/InternalInventory.java (96%) rename src/main/java/com/fireball1725/graves/{ => common}/tileentity/inventory/InventoryOperation.java (60%) rename src/main/java/com/fireball1725/graves/{ => common}/util/GuiHandler.java (88%) rename src/main/java/com/fireball1725/graves/{ => common}/util/ItemStackSrc.java (93%) rename src/main/java/com/fireball1725/graves/{ => common}/util/Platform.java (95%) rename src/main/java/com/fireball1725/graves/{ => common}/util/TextureUtils.java (98%) rename src/main/java/com/fireball1725/graves/{ => common}/util/TileTools.java (94%) rename src/main/java/com/fireball1725/graves/{ => common}/util/iterators/InventoryIterator.java (93%) diff --git a/src/main/java/com/fireball1725/graves/Graves.java b/src/main/java/com/fireball1725/graves/Graves.java index f83bb81..04b3bd2 100644 --- a/src/main/java/com/fireball1725/graves/Graves.java +++ b/src/main/java/com/fireball1725/graves/Graves.java @@ -1,10 +1,10 @@ package com.fireball1725.graves; -import com.fireball1725.graves.helpers.LogHelper; -import com.fireball1725.graves.network.PacketHandler; +import com.fireball1725.graves.common.helpers.LogHelper; +import com.fireball1725.graves.common.network.PacketHandler; import com.fireball1725.graves.proxy.IProxy; -import com.fireball1725.graves.reference.ModInfo; -import com.fireball1725.graves.util.GuiHandler; +import com.fireball1725.graves.common.reference.ModInfo; +import com.fireball1725.graves.common.util.GuiHandler; import com.google.common.base.Stopwatch; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.fml.common.Mod; diff --git a/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java b/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java index 0715ddb..542e9c6 100644 --- a/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java +++ b/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java @@ -1,10 +1,10 @@ package com.fireball1725.graves.client.events; -import com.fireball1725.graves.block.BlockGraveSlave; -import com.fireball1725.graves.block.BlockGraveStone; -import com.fireball1725.graves.tileentity.TileEntityGraveSlave; -import com.fireball1725.graves.tileentity.TileEntityGraveStone; -import com.fireball1725.graves.util.TileTools; +import com.fireball1725.graves.common.block.BlockGraveSlave; +import com.fireball1725.graves.common.block.BlockGraveStone; +import com.fireball1725.graves.common.tileentity.TileEntityGraveSlave; +import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; +import com.fireball1725.graves.common.util.TileTools; import net.minecraft.block.*; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; diff --git a/src/main/java/com/fireball1725/graves/client/gui/GuiScreenHeadstone.java b/src/main/java/com/fireball1725/graves/client/gui/GuiScreenHeadstone.java index e490f1e..408a61b 100644 --- a/src/main/java/com/fireball1725/graves/client/gui/GuiScreenHeadstone.java +++ b/src/main/java/com/fireball1725/graves/client/gui/GuiScreenHeadstone.java @@ -1,8 +1,8 @@ package com.fireball1725.graves.client.gui; -import com.fireball1725.graves.network.PacketHandler; -import com.fireball1725.graves.network.messages.MessageSetHeadstoneName; -import com.fireball1725.graves.tileentity.TileEntityHeadStone; +import com.fireball1725.graves.common.network.PacketHandler; +import com.fireball1725.graves.common.network.messages.MessageSetHeadstoneName; +import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; import net.minecraft.client.gui.GuiScreen; import net.minecraft.util.ChatAllowedCharacters; diff --git a/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java b/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java index e5f34f0..949abab 100644 --- a/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java +++ b/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java @@ -1,8 +1,8 @@ package com.fireball1725.graves.client.render; -import com.fireball1725.graves.block.BlockHeadStone; -import com.fireball1725.graves.helpers.OpenGLHelper; -import com.fireball1725.graves.tileentity.TileEntityHeadStone; +import com.fireball1725.graves.common.block.BlockHeadStone; +import com.fireball1725.graves.common.helpers.OpenGLHelper; +import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; diff --git a/src/main/java/com/fireball1725/graves/client/render/entity/LayerHumanCape.java b/src/main/java/com/fireball1725/graves/client/render/entity/LayerHumanCape.java index 72afae0..b50008a 100644 --- a/src/main/java/com/fireball1725/graves/client/render/entity/LayerHumanCape.java +++ b/src/main/java/com/fireball1725/graves/client/render/entity/LayerHumanCape.java @@ -1,7 +1,7 @@ package com.fireball1725.graves.client.render.entity; -import com.fireball1725.graves.entity.EntityPlayerZombie; -import com.fireball1725.graves.util.TextureUtils; +import com.fireball1725.graves.common.entity.EntityPlayerZombie; +import com.fireball1725.graves.common.util.TextureUtils; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.layers.LayerRenderer; import net.minecraft.util.ResourceLocation; diff --git a/src/main/java/com/fireball1725/graves/client/render/entity/RenderPlayerZombie.java b/src/main/java/com/fireball1725/graves/client/render/entity/RenderPlayerZombie.java index 20d5952..68e5220 100644 --- a/src/main/java/com/fireball1725/graves/client/render/entity/RenderPlayerZombie.java +++ b/src/main/java/com/fireball1725/graves/client/render/entity/RenderPlayerZombie.java @@ -1,8 +1,8 @@ package com.fireball1725.graves.client.render.entity; -import com.fireball1725.graves.configuration.ConfigZombie; -import com.fireball1725.graves.entity.EntityPlayerZombie; -import com.fireball1725.graves.util.TextureUtils; +import com.fireball1725.graves.common.configuration.ConfigZombie; +import com.fireball1725.graves.common.entity.EntityPlayerZombie; +import com.fireball1725.graves.common.util.TextureUtils; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelPlayer; import net.minecraft.client.renderer.GlStateManager; diff --git a/src/main/java/com/fireball1725/graves/block/BlockBase.java b/src/main/java/com/fireball1725/graves/common/block/BlockBase.java similarity index 94% rename from src/main/java/com/fireball1725/graves/block/BlockBase.java rename to src/main/java/com/fireball1725/graves/common/block/BlockBase.java index 179652c..01b2d04 100644 --- a/src/main/java/com/fireball1725/graves/block/BlockBase.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockBase.java @@ -1,9 +1,9 @@ -package com.fireball1725.graves.block; +package com.fireball1725.graves.common.block; -import com.fireball1725.graves.reference.ModInfo; -import com.fireball1725.graves.tileentity.TileEntityBase; -import com.fireball1725.graves.tileentity.TileEntityInventoryBase; -import com.fireball1725.graves.util.TileTools; +import com.fireball1725.graves.common.reference.ModInfo; +import com.fireball1725.graves.common.tileentity.TileEntityBase; +import com.fireball1725.graves.common.tileentity.TileEntityInventoryBase; +import com.fireball1725.graves.common.util.TileTools; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; diff --git a/src/main/java/com/fireball1725/graves/block/BlockGraveSlave.java b/src/main/java/com/fireball1725/graves/common/block/BlockGraveSlave.java similarity index 97% rename from src/main/java/com/fireball1725/graves/block/BlockGraveSlave.java rename to src/main/java/com/fireball1725/graves/common/block/BlockGraveSlave.java index 462b3ee..8b9830a 100644 --- a/src/main/java/com/fireball1725/graves/block/BlockGraveSlave.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockGraveSlave.java @@ -1,8 +1,8 @@ -package com.fireball1725.graves.block; +package com.fireball1725.graves.common.block; -import com.fireball1725.graves.tileentity.TileEntityGraveSlave; -import com.fireball1725.graves.tileentity.TileEntityGraveStone; -import com.fireball1725.graves.util.TileTools; +import com.fireball1725.graves.common.tileentity.TileEntityGraveSlave; +import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; +import com.fireball1725.graves.common.util.TileTools; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyBool; diff --git a/src/main/java/com/fireball1725/graves/block/BlockGraveStone.java b/src/main/java/com/fireball1725/graves/common/block/BlockGraveStone.java similarity index 96% rename from src/main/java/com/fireball1725/graves/block/BlockGraveStone.java rename to src/main/java/com/fireball1725/graves/common/block/BlockGraveStone.java index 0c8869b..8b20466 100644 --- a/src/main/java/com/fireball1725/graves/block/BlockGraveStone.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockGraveStone.java @@ -1,7 +1,7 @@ -package com.fireball1725.graves.block; +package com.fireball1725.graves.common.block; -import com.fireball1725.graves.tileentity.TileEntityGraveStone; -import com.fireball1725.graves.util.TileTools; +import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; +import com.fireball1725.graves.common.util.TileTools; import net.minecraft.block.BlockHorizontal; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyBool; diff --git a/src/main/java/com/fireball1725/graves/block/BlockHeadStone.java b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java similarity index 96% rename from src/main/java/com/fireball1725/graves/block/BlockHeadStone.java rename to src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java index 868fe2d..527e73a 100644 --- a/src/main/java/com/fireball1725/graves/block/BlockHeadStone.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java @@ -1,8 +1,8 @@ -package com.fireball1725.graves.block; +package com.fireball1725.graves.common.block; import com.fireball1725.graves.Graves; -import com.fireball1725.graves.tileentity.TileEntityHeadStone; -import com.fireball1725.graves.util.TileTools; +import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; +import com.fireball1725.graves.common.util.TileTools; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockStateContainer; diff --git a/src/main/java/com/fireball1725/graves/block/Blocks.java b/src/main/java/com/fireball1725/graves/common/block/Blocks.java similarity index 89% rename from src/main/java/com/fireball1725/graves/block/Blocks.java rename to src/main/java/com/fireball1725/graves/common/block/Blocks.java index deb7d67..64f0e68 100644 --- a/src/main/java/com/fireball1725/graves/block/Blocks.java +++ b/src/main/java/com/fireball1725/graves/common/block/Blocks.java @@ -1,8 +1,8 @@ -package com.fireball1725.graves.block; +package com.fireball1725.graves.common.block; -import com.fireball1725.graves.creativetab.ModCreativeTabs; -import com.fireball1725.graves.helpers.LogHelper; -import com.fireball1725.graves.item.ItemHeadStone; +import com.fireball1725.graves.common.creativetab.ModCreativeTabs; +import com.fireball1725.graves.common.helpers.LogHelper; +import com.fireball1725.graves.common.item.ItemHeadStone; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemBlock; diff --git a/src/main/java/com/fireball1725/graves/configuration/ConfigZombie.java b/src/main/java/com/fireball1725/graves/common/configuration/ConfigZombie.java similarity index 98% rename from src/main/java/com/fireball1725/graves/configuration/ConfigZombie.java rename to src/main/java/com/fireball1725/graves/common/configuration/ConfigZombie.java index d24eefb..b08eceb 100644 --- a/src/main/java/com/fireball1725/graves/configuration/ConfigZombie.java +++ b/src/main/java/com/fireball1725/graves/common/configuration/ConfigZombie.java @@ -1,4 +1,4 @@ -package com.fireball1725.graves.configuration; +package com.fireball1725.graves.common.configuration; public class ConfigZombie { // Is zombie enabled (Default = true) diff --git a/src/main/java/com/fireball1725/graves/configuration/ConfigurationFile.java b/src/main/java/com/fireball1725/graves/common/configuration/ConfigurationFile.java similarity index 98% rename from src/main/java/com/fireball1725/graves/configuration/ConfigurationFile.java rename to src/main/java/com/fireball1725/graves/common/configuration/ConfigurationFile.java index aaa11d0..ab7de46 100644 --- a/src/main/java/com/fireball1725/graves/configuration/ConfigurationFile.java +++ b/src/main/java/com/fireball1725/graves/common/configuration/ConfigurationFile.java @@ -1,6 +1,6 @@ -package com.fireball1725.graves.configuration; +package com.fireball1725.graves.common.configuration; -import com.fireball1725.graves.helpers.ConfigurationHelper; +import com.fireball1725.graves.common.helpers.ConfigurationHelper; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.fml.client.event.ConfigChangedEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; diff --git a/src/main/java/com/fireball1725/graves/configuration/GravesConfig.java b/src/main/java/com/fireball1725/graves/common/configuration/GravesConfig.java similarity index 88% rename from src/main/java/com/fireball1725/graves/configuration/GravesConfig.java rename to src/main/java/com/fireball1725/graves/common/configuration/GravesConfig.java index 25e78e5..8589a6b 100644 --- a/src/main/java/com/fireball1725/graves/configuration/GravesConfig.java +++ b/src/main/java/com/fireball1725/graves/common/configuration/GravesConfig.java @@ -1,7 +1,7 @@ -package com.fireball1725.graves.configuration; +package com.fireball1725.graves.common.configuration; import com.fireball1725.graves.Graves; -import com.fireball1725.graves.reference.ModInfo; +import com.fireball1725.graves.common.reference.ModInfo; import net.minecraft.client.gui.GuiScreen; import net.minecraftforge.common.config.ConfigElement; import net.minecraftforge.fml.client.config.GuiConfig; diff --git a/src/main/java/com/fireball1725/graves/configuration/GravesConfigGuiFactory.java b/src/main/java/com/fireball1725/graves/common/configuration/GravesConfigGuiFactory.java similarity index 92% rename from src/main/java/com/fireball1725/graves/configuration/GravesConfigGuiFactory.java rename to src/main/java/com/fireball1725/graves/common/configuration/GravesConfigGuiFactory.java index 80f8b80..9735ea6 100644 --- a/src/main/java/com/fireball1725/graves/configuration/GravesConfigGuiFactory.java +++ b/src/main/java/com/fireball1725/graves/common/configuration/GravesConfigGuiFactory.java @@ -1,4 +1,4 @@ -package com.fireball1725.graves.configuration; +package com.fireball1725.graves.common.configuration; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; diff --git a/src/main/java/com/fireball1725/graves/creativetab/ModCreativeTabs.java b/src/main/java/com/fireball1725/graves/common/creativetab/ModCreativeTabs.java similarity index 67% rename from src/main/java/com/fireball1725/graves/creativetab/ModCreativeTabs.java rename to src/main/java/com/fireball1725/graves/common/creativetab/ModCreativeTabs.java index 7fa7876..739d6a5 100644 --- a/src/main/java/com/fireball1725/graves/creativetab/ModCreativeTabs.java +++ b/src/main/java/com/fireball1725/graves/common/creativetab/ModCreativeTabs.java @@ -1,7 +1,7 @@ -package com.fireball1725.graves.creativetab; +package com.fireball1725.graves.common.creativetab; -import com.fireball1725.graves.block.Blocks; -import com.fireball1725.graves.reference.ModInfo; +import com.fireball1725.graves.common.block.Blocks; +import com.fireball1725.graves.common.reference.ModInfo; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; diff --git a/src/main/java/com/fireball1725/graves/entity/Entities.java b/src/main/java/com/fireball1725/graves/common/entity/Entities.java similarity index 95% rename from src/main/java/com/fireball1725/graves/entity/Entities.java rename to src/main/java/com/fireball1725/graves/common/entity/Entities.java index 8b6ec36..6892a79 100644 --- a/src/main/java/com/fireball1725/graves/entity/Entities.java +++ b/src/main/java/com/fireball1725/graves/common/entity/Entities.java @@ -1,4 +1,4 @@ -package com.fireball1725.graves.entity; +package com.fireball1725.graves.common.entity; import com.fireball1725.graves.Graves; import net.minecraft.entity.Entity; @@ -6,7 +6,8 @@ public enum Entities { - PLAYERZOMBIE(EntityPlayerZombie.class, "playerzombie", 64, 1, true); + PLAYERZOMBIE(EntityPlayerZombie.class, "playerzombie", 64, 1, true), + ; private final Class entityClass; private String entityStringID; diff --git a/src/main/java/com/fireball1725/graves/entity/EntityFlying.java b/src/main/java/com/fireball1725/graves/common/entity/EntityFlying.java similarity index 98% rename from src/main/java/com/fireball1725/graves/entity/EntityFlying.java rename to src/main/java/com/fireball1725/graves/common/entity/EntityFlying.java index c6bef41..ef7f1f8 100644 --- a/src/main/java/com/fireball1725/graves/entity/EntityFlying.java +++ b/src/main/java/com/fireball1725/graves/common/entity/EntityFlying.java @@ -1,4 +1,4 @@ -package com.fireball1725.graves.entity; +package com.fireball1725.graves.common.entity; import net.minecraft.block.Block; import net.minecraft.entity.monster.EntityMob; diff --git a/src/main/java/com/fireball1725/graves/entity/EntityPlayerZombie.java b/src/main/java/com/fireball1725/graves/common/entity/EntityPlayerZombie.java similarity index 99% rename from src/main/java/com/fireball1725/graves/entity/EntityPlayerZombie.java rename to src/main/java/com/fireball1725/graves/common/entity/EntityPlayerZombie.java index ac7e5c0..17cb45a 100644 --- a/src/main/java/com/fireball1725/graves/entity/EntityPlayerZombie.java +++ b/src/main/java/com/fireball1725/graves/common/entity/EntityPlayerZombie.java @@ -1,9 +1,9 @@ -package com.fireball1725.graves.entity; +package com.fireball1725.graves.common.entity; -import com.fireball1725.graves.configuration.ConfigZombie; -import com.fireball1725.graves.helpers.IDeadPlayerEntity; -import com.fireball1725.graves.helpers.LogHelper; -import com.fireball1725.graves.helpers.SoundHelper; +import com.fireball1725.graves.common.configuration.ConfigZombie; +import com.fireball1725.graves.common.helpers.IDeadPlayerEntity; +import com.fireball1725.graves.common.helpers.LogHelper; +import com.fireball1725.graves.common.helpers.SoundHelper; import com.google.common.base.Predicate; import com.mojang.authlib.GameProfile; import net.minecraft.entity.*; diff --git a/src/main/java/com/fireball1725/graves/event/EventBlockBreak.java b/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java similarity index 70% rename from src/main/java/com/fireball1725/graves/event/EventBlockBreak.java rename to src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java index 94292d1..e9a223e 100644 --- a/src/main/java/com/fireball1725/graves/event/EventBlockBreak.java +++ b/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java @@ -1,13 +1,16 @@ -package com.fireball1725.graves.event; +package com.fireball1725.graves.common.event; -import com.fireball1725.graves.block.BlockGraveSlave; -import com.fireball1725.graves.block.BlockGraveStone; -import com.fireball1725.graves.tileentity.TileEntityGraveSlave; -import com.fireball1725.graves.tileentity.TileEntityGraveStone; -import com.fireball1725.graves.util.TileTools; +import com.fireball1725.graves.common.block.BlockGraveSlave; +import com.fireball1725.graves.common.block.BlockGraveStone; +import com.fireball1725.graves.common.structure.ReplaceableBlock; +import com.fireball1725.graves.common.tileentity.TileEntityGraveSlave; +import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; +import com.fireball1725.graves.common.util.TileTools; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import java.util.List; + public class EventBlockBreak { @SubscribeEvent public void onBreakBlock(BlockEvent.BreakEvent event) @@ -38,10 +41,17 @@ public void onBreakBlock(BlockEvent.BreakEvent event) } else { + List blocks = graveStone.getReplaceableBlocks(); event.getWorld().destroyBlock(graveStone.getPos().down(), false); event.getWorld().destroyBlock(graveStone.getPos().down().offset(graveStone.getBlockState().getValue(BlockGraveStone.FACING)), false); event.getWorld().destroyBlock(graveStone.getPos().offset(graveStone.getBlockState().getValue(BlockGraveStone.FACING)), false); event.getWorld().destroyBlock(graveStone.getPos(), true); + + for (ReplaceableBlock block : blocks) + { + block.placeBlock(event.getWorld()); + } + event.setCanceled(true); } } diff --git a/src/main/java/com/fireball1725/graves/event/EventDeathHandler.java b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java similarity index 63% rename from src/main/java/com/fireball1725/graves/event/EventDeathHandler.java rename to src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java index e06dda0..91e7150 100644 --- a/src/main/java/com/fireball1725/graves/event/EventDeathHandler.java +++ b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java @@ -1,15 +1,17 @@ -package com.fireball1725.graves.event; +package com.fireball1725.graves.common.event; import com.fireball1725.graves.Graves; -import com.fireball1725.graves.block.BlockGraveStone; -import com.fireball1725.graves.block.BlockHeadStone; -import com.fireball1725.graves.block.Blocks; -import com.fireball1725.graves.entity.EntityPlayerZombie; -import com.fireball1725.graves.helpers.LogHelper; -import com.fireball1725.graves.helpers.SafeBlockReplacer; -import com.fireball1725.graves.tileentity.TileEntityGraveStone; -import com.fireball1725.graves.tileentity.TileEntityHeadStone; -import com.fireball1725.graves.util.TileTools; +import com.fireball1725.graves.common.block.BlockGraveStone; +import com.fireball1725.graves.common.block.BlockHeadStone; +import com.fireball1725.graves.common.block.Blocks; +import com.fireball1725.graves.common.entity.EntityPlayerZombie; +import com.fireball1725.graves.common.helpers.LogHelper; +import com.fireball1725.graves.common.helpers.SafeBlockReplacer; +import com.fireball1725.graves.common.structure.ReplaceableBlock; +import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; +import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; +import com.fireball1725.graves.common.util.TileTools; +import com.google.common.collect.Lists; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; @@ -88,28 +90,39 @@ public void onPlayerDrops(PlayerDropsEvent event) { } if (spawnGrave) { - EnumFacing facing = event.getEntityPlayer().getHorizontalFacing(); - IBlockState state = Blocks.BLOCK_GRAVESTONE.block.getDefaultState().withProperty(BlockGraveStone.FACING, facing); - BlockPos safePos = SafeBlockReplacer.GetSafeGraveSite(world, event.getEntityPlayer().getPosition(), facing); + EnumFacing playerFacing = event.getEntityPlayer().getHorizontalFacing(); + LogHelper.info(String.format(">>>>>>>>>> %s, %s, %s, %s", event.getEntityPlayer().getPosition(), event.getEntityPlayer().posX, event.getEntityPlayer().posY, event.getEntityPlayer().posZ)); + BlockPos playerPos = event.getEntityPlayer().getPosition(); + IBlockState state = Blocks.BLOCK_GRAVESTONE.block.getDefaultState().withProperty(BlockGraveStone.FACING, playerFacing); - sendTomTomPos(Graves.instance, event.getEntityPlayer(), safePos, "Grave this way!"); + List blocks = Lists.newArrayList(); + for (BlockPos pos : TileEntityGraveStone.getPositions(playerPos, playerFacing)) + { + NBTTagCompound tag = null; + if (world.getTileEntity(pos) != null) + { + tag = new NBTTagCompound(); + world.getTileEntity(pos).writeToNBT(tag); + } + blocks.add(new ReplaceableBlock(world.getBlockState(pos), pos, tag)); + } - world.setBlockState(safePos, state); + world.setBlockState(playerPos, state); - TileEntityGraveStone graveStoneTileEntity = TileTools.getTileEntity(world, safePos, TileEntityGraveStone.class); + TileEntityGraveStone graveStoneTileEntity = TileTools.getTileEntity(world, playerPos, TileEntityGraveStone.class); graveStoneTileEntity.addGraveItems(itemsList); + graveStoneTileEntity.setReplaceableBlocks(blocks); graveStoneTileEntity.breakBlocks(); graveStoneTileEntity.setPlayerProfile(event.getEntityPlayer().getGameProfile()); // Adding Headstone - world.setBlockState(safePos.offset(facing.getOpposite()), Blocks.BLOCK_GRAVE_HEADSTONE.block.getDefaultState().withProperty(BlockHeadStone.FACING, facing)); - TileEntityHeadStone tileEntityHeadStone = TileTools.getTileEntity(world, safePos.offset(facing.getOpposite()), TileEntityHeadStone.class); + world.setBlockState(playerPos.offset(playerFacing.getOpposite()), Blocks.BLOCK_GRAVE_HEADSTONE.block.getDefaultState().withProperty(BlockHeadStone.FACING, playerFacing)); + TileEntityHeadStone tileEntityHeadStone = TileTools.getTileEntity(world, playerPos.offset(playerFacing.getOpposite()), TileEntityHeadStone.class); if (tileEntityHeadStone != null) { tileEntityHeadStone.setCustomName(event.getEntityPlayer().getDisplayName().getFormattedText()); - //tileEntityHeadStone.setEulogy(event.source.getDeathMessage(event.entityPlayer).getFormattedText()); } - // End of adding headstone + sendTomTomPos(Graves.instance, event.getEntityPlayer(), playerPos, "Grave this way!"); } event.getDrops().clear(); diff --git a/src/main/java/com/fireball1725/graves/helpers/BreakableWhiteListHelper.java b/src/main/java/com/fireball1725/graves/common/helpers/BreakableWhiteListHelper.java similarity index 90% rename from src/main/java/com/fireball1725/graves/helpers/BreakableWhiteListHelper.java rename to src/main/java/com/fireball1725/graves/common/helpers/BreakableWhiteListHelper.java index c4a387b..1cd3bc1 100644 --- a/src/main/java/com/fireball1725/graves/helpers/BreakableWhiteListHelper.java +++ b/src/main/java/com/fireball1725/graves/common/helpers/BreakableWhiteListHelper.java @@ -1,4 +1,4 @@ -package com.fireball1725.graves.helpers; +package com.fireball1725.graves.common.helpers; import net.minecraft.block.state.IBlockState; diff --git a/src/main/java/com/fireball1725/graves/helpers/ConfigurationHelper.java b/src/main/java/com/fireball1725/graves/common/helpers/ConfigurationHelper.java similarity index 98% rename from src/main/java/com/fireball1725/graves/helpers/ConfigurationHelper.java rename to src/main/java/com/fireball1725/graves/common/helpers/ConfigurationHelper.java index f0331d6..e18fb96 100644 --- a/src/main/java/com/fireball1725/graves/helpers/ConfigurationHelper.java +++ b/src/main/java/com/fireball1725/graves/common/helpers/ConfigurationHelper.java @@ -1,4 +1,4 @@ -package com.fireball1725.graves.helpers; +package com.fireball1725.graves.common.helpers; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; diff --git a/src/main/java/com/fireball1725/graves/helpers/IDeadPlayerEntity.java b/src/main/java/com/fireball1725/graves/common/helpers/IDeadPlayerEntity.java similarity index 87% rename from src/main/java/com/fireball1725/graves/helpers/IDeadPlayerEntity.java rename to src/main/java/com/fireball1725/graves/common/helpers/IDeadPlayerEntity.java index b26bd37..abb8472 100644 --- a/src/main/java/com/fireball1725/graves/helpers/IDeadPlayerEntity.java +++ b/src/main/java/com/fireball1725/graves/common/helpers/IDeadPlayerEntity.java @@ -1,4 +1,4 @@ -package com.fireball1725.graves.helpers; +package com.fireball1725.graves.common.helpers; import com.mojang.authlib.GameProfile; diff --git a/src/main/java/com/fireball1725/graves/helpers/LogHelper.java b/src/main/java/com/fireball1725/graves/common/helpers/LogHelper.java similarity index 89% rename from src/main/java/com/fireball1725/graves/helpers/LogHelper.java rename to src/main/java/com/fireball1725/graves/common/helpers/LogHelper.java index 08cdbd3..1bad3fe 100644 --- a/src/main/java/com/fireball1725/graves/helpers/LogHelper.java +++ b/src/main/java/com/fireball1725/graves/common/helpers/LogHelper.java @@ -1,6 +1,6 @@ -package com.fireball1725.graves.helpers; +package com.fireball1725.graves.common.helpers; -import com.fireball1725.graves.reference.ModInfo; +import com.fireball1725.graves.common.reference.ModInfo; import net.minecraftforge.fml.common.FMLLog; import org.apache.logging.log4j.Level; diff --git a/src/main/java/com/fireball1725/graves/helpers/OpenGLHelper.java b/src/main/java/com/fireball1725/graves/common/helpers/OpenGLHelper.java similarity index 97% rename from src/main/java/com/fireball1725/graves/helpers/OpenGLHelper.java rename to src/main/java/com/fireball1725/graves/common/helpers/OpenGLHelper.java index dc5bd30..2d78313 100644 --- a/src/main/java/com/fireball1725/graves/helpers/OpenGLHelper.java +++ b/src/main/java/com/fireball1725/graves/common/helpers/OpenGLHelper.java @@ -1,4 +1,4 @@ -package com.fireball1725.graves.helpers; +package com.fireball1725.graves.common.helpers; import org.lwjgl.opengl.GL11; diff --git a/src/main/java/com/fireball1725/graves/helpers/SafeBlockReplacer.java b/src/main/java/com/fireball1725/graves/common/helpers/SafeBlockReplacer.java similarity index 99% rename from src/main/java/com/fireball1725/graves/helpers/SafeBlockReplacer.java rename to src/main/java/com/fireball1725/graves/common/helpers/SafeBlockReplacer.java index 81e5f67..2ba4ce6 100644 --- a/src/main/java/com/fireball1725/graves/helpers/SafeBlockReplacer.java +++ b/src/main/java/com/fireball1725/graves/common/helpers/SafeBlockReplacer.java @@ -1,4 +1,4 @@ -package com.fireball1725.graves.helpers; +package com.fireball1725.graves.common.helpers; import net.minecraft.block.BlockAir; import net.minecraft.block.state.IBlockState; diff --git a/src/main/java/com/fireball1725/graves/helpers/SoundHelper.java b/src/main/java/com/fireball1725/graves/common/helpers/SoundHelper.java similarity index 81% rename from src/main/java/com/fireball1725/graves/helpers/SoundHelper.java rename to src/main/java/com/fireball1725/graves/common/helpers/SoundHelper.java index cbc5bae..cfda313 100644 --- a/src/main/java/com/fireball1725/graves/helpers/SoundHelper.java +++ b/src/main/java/com/fireball1725/graves/common/helpers/SoundHelper.java @@ -1,6 +1,6 @@ -package com.fireball1725.graves.helpers; +package com.fireball1725.graves.common.helpers; -import com.fireball1725.graves.reference.ModInfo; +import com.fireball1725.graves.common.reference.ModInfo; import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundEvent; import net.minecraftforge.fml.common.registry.GameRegistry; diff --git a/src/main/java/com/fireball1725/graves/integrations/JourneyMap.java b/src/main/java/com/fireball1725/graves/common/integrations/JourneyMap.java similarity index 90% rename from src/main/java/com/fireball1725/graves/integrations/JourneyMap.java rename to src/main/java/com/fireball1725/graves/common/integrations/JourneyMap.java index e71422b..6fd0186 100644 --- a/src/main/java/com/fireball1725/graves/integrations/JourneyMap.java +++ b/src/main/java/com/fireball1725/graves/common/integrations/JourneyMap.java @@ -1,4 +1,4 @@ -package com.fireball1725.graves.integrations; +package com.fireball1725.graves.common.integrations; //import journeymap.client.api.ClientPlugin; //import journeymap.client.api.IClientAPI; diff --git a/src/main/java/com/fireball1725/graves/item/ItemHeadStone.java b/src/main/java/com/fireball1725/graves/common/item/ItemHeadStone.java similarity index 93% rename from src/main/java/com/fireball1725/graves/item/ItemHeadStone.java rename to src/main/java/com/fireball1725/graves/common/item/ItemHeadStone.java index ca9024b..2b17c62 100644 --- a/src/main/java/com/fireball1725/graves/item/ItemHeadStone.java +++ b/src/main/java/com/fireball1725/graves/common/item/ItemHeadStone.java @@ -1,4 +1,4 @@ -package com.fireball1725.graves.item; +package com.fireball1725.graves.common.item; import com.mojang.realmsclient.gui.ChatFormatting; import net.minecraft.block.Block; diff --git a/src/main/java/com/fireball1725/graves/network/PacketHandler.java b/src/main/java/com/fireball1725/graves/common/network/PacketHandler.java similarity index 73% rename from src/main/java/com/fireball1725/graves/network/PacketHandler.java rename to src/main/java/com/fireball1725/graves/common/network/PacketHandler.java index 69d3b63..eab5359 100644 --- a/src/main/java/com/fireball1725/graves/network/PacketHandler.java +++ b/src/main/java/com/fireball1725/graves/common/network/PacketHandler.java @@ -1,7 +1,7 @@ -package com.fireball1725.graves.network; +package com.fireball1725.graves.common.network; -import com.fireball1725.graves.network.messages.MessageSetHeadstoneName; -import com.fireball1725.graves.reference.ModInfo; +import com.fireball1725.graves.common.network.messages.MessageSetHeadstoneName; +import com.fireball1725.graves.common.reference.ModInfo; import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; import net.minecraftforge.fml.relauncher.Side; diff --git a/src/main/java/com/fireball1725/graves/network/messages/MessageSetHeadstoneName.java b/src/main/java/com/fireball1725/graves/common/network/messages/MessageSetHeadstoneName.java similarity index 89% rename from src/main/java/com/fireball1725/graves/network/messages/MessageSetHeadstoneName.java rename to src/main/java/com/fireball1725/graves/common/network/messages/MessageSetHeadstoneName.java index 1d75de5..425f142 100644 --- a/src/main/java/com/fireball1725/graves/network/messages/MessageSetHeadstoneName.java +++ b/src/main/java/com/fireball1725/graves/common/network/messages/MessageSetHeadstoneName.java @@ -1,7 +1,7 @@ -package com.fireball1725.graves.network.messages; +package com.fireball1725.graves.common.network.messages; -import com.fireball1725.graves.tileentity.TileEntityHeadStone; -import com.fireball1725.graves.util.TileTools; +import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; +import com.fireball1725.graves.common.util.TileTools; import io.netty.buffer.ByteBuf; import net.minecraft.util.math.BlockPos; import net.minecraftforge.fml.common.network.ByteBufUtils; diff --git a/src/main/java/com/fireball1725/graves/reference/ModInfo.java b/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java similarity index 93% rename from src/main/java/com/fireball1725/graves/reference/ModInfo.java rename to src/main/java/com/fireball1725/graves/common/reference/ModInfo.java index 13e78e2..d4c3266 100644 --- a/src/main/java/com/fireball1725/graves/reference/ModInfo.java +++ b/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java @@ -1,4 +1,4 @@ -package com.fireball1725.graves.reference; +package com.fireball1725.graves.common.reference; public class ModInfo { public static final String MOD_ID = "graves"; diff --git a/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java b/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java new file mode 100644 index 0000000..b70a3a4 --- /dev/null +++ b/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java @@ -0,0 +1,68 @@ +package com.fireball1725.graves.common.structure; + +import net.minecraft.block.Block; +import net.minecraft.block.ITileEntityProvider; +import net.minecraft.block.state.IBlockState; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +public class ReplaceableBlock +{ + private BlockPos pos; + private IBlockState state; + private NBTTagCompound tagCompound; + + public ReplaceableBlock(IBlockState state, BlockPos pos, NBTTagCompound tagCompound) + { + this.state = state; + this.pos = pos; + this.tagCompound = tagCompound; + } + + public boolean placeBlock(World world) + { + if (state == null) return false; + world.setBlockState(pos, state, 3); + Block block = state.getBlock(); + if (block instanceof ITileEntityProvider && tagCompound != null) + { + world.getTileEntity(pos).readFromNBT(tagCompound); + } + return true; + } + + public NBTTagCompound writeNBT() + { + NBTTagCompound tag = new NBTTagCompound(); + if (state != null) + { + tag.setInteger("blockID", Block.blockRegistry.getIDForObject(state.getBlock())); + tag.setInteger("blockMeta", state.getBlock().getMetaFromState(state)); + tag.setLong("blockPos", pos.toLong()); + } + if (tagCompound != null) + { + tag.setTag("tileData", tagCompound); + } + return tag; + } + + public static ReplaceableBlock readNBT(NBTTagCompound tag) + { + if (!tag.hasKey("blockID") || !tag.hasKey("blockMeta")) return null; + IBlockState state; + NBTTagCompound tileTag = null; + + Block block = Block.getBlockById(tag.getInteger("blockID")); + state = block.getStateFromMeta(tag.getInteger("blockMeta")); + BlockPos pos = BlockPos.fromLong(tag.getLong("blockPos")); + + if (tag.hasKey("tileData")) + { + tileTag = tag.getCompoundTag("tileData"); + } + + return new ReplaceableBlock(state, pos, tileTag); + } +} diff --git a/src/main/java/com/fireball1725/graves/tileentity/TileEntityBase.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityBase.java similarity index 97% rename from src/main/java/com/fireball1725/graves/tileentity/TileEntityBase.java rename to src/main/java/com/fireball1725/graves/common/tileentity/TileEntityBase.java index 4a8d4a5..91d0ee1 100644 --- a/src/main/java/com/fireball1725/graves/tileentity/TileEntityBase.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityBase.java @@ -1,6 +1,6 @@ -package com.fireball1725.graves.tileentity; +package com.fireball1725.graves.common.tileentity; -import com.fireball1725.graves.util.ItemStackSrc; +import com.fireball1725.graves.common.util.ItemStackSrc; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.inventory.IInventory; diff --git a/src/main/java/com/fireball1725/graves/tileentity/TileEntityGraveSlave.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveSlave.java similarity index 94% rename from src/main/java/com/fireball1725/graves/tileentity/TileEntityGraveSlave.java rename to src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveSlave.java index 3b66b0e..5920260 100644 --- a/src/main/java/com/fireball1725/graves/tileentity/TileEntityGraveSlave.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveSlave.java @@ -1,4 +1,4 @@ -package com.fireball1725.graves.tileentity; +package com.fireball1725.graves.common.tileentity; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.math.BlockPos; diff --git a/src/main/java/com/fireball1725/graves/tileentity/TileEntityGraveStone.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java similarity index 74% rename from src/main/java/com/fireball1725/graves/tileentity/TileEntityGraveStone.java rename to src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java index 3a0f85e..7a29ecb 100644 --- a/src/main/java/com/fireball1725/graves/tileentity/TileEntityGraveStone.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java @@ -1,16 +1,17 @@ -package com.fireball1725.graves.tileentity; - -import com.fireball1725.graves.block.BlockGraveSlave; -import com.fireball1725.graves.block.BlockGraveStone; -import com.fireball1725.graves.block.Blocks; -import com.fireball1725.graves.configuration.ConfigZombie; -import com.fireball1725.graves.entity.EntityPlayerZombie; -import com.fireball1725.graves.helpers.LogHelper; -import com.fireball1725.graves.tileentity.inventory.InternalDynamicInventory; -import com.fireball1725.graves.tileentity.inventory.InventoryOperation; -import com.fireball1725.graves.util.TileTools; +package com.fireball1725.graves.common.tileentity; + +import com.fireball1725.graves.common.block.BlockGraveSlave; +import com.fireball1725.graves.common.block.BlockGraveStone; +import com.fireball1725.graves.common.block.Blocks; +import com.fireball1725.graves.common.configuration.ConfigZombie; +import com.fireball1725.graves.common.entity.EntityPlayerZombie; +import com.fireball1725.graves.common.helpers.LogHelper; +import com.fireball1725.graves.common.structure.ReplaceableBlock; +import com.fireball1725.graves.common.tileentity.inventory.InternalDynamicInventory; +import com.fireball1725.graves.common.tileentity.inventory.InventoryOperation; +import com.fireball1725.graves.common.util.TileTools; +import com.google.common.collect.Lists; import com.mojang.authlib.GameProfile; -import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; @@ -29,9 +30,10 @@ public class TileEntityGraveStone extends TileEntityInventoryBase { - protected boolean hasLid = true; + private boolean hasLid = true; private InternalDynamicInventory internalInventory = new InternalDynamicInventory(this); private GameProfile playerProfile; + private List replaceableBlocks = Lists.newArrayList(); @Override public Packet getDescriptionPacket() { @@ -55,7 +57,7 @@ public void setHasLid(boolean hasLid) { worldObj.notifyBlockUpdate(pos, getBlockState(), getBlockState().withProperty(BlockGraveStone.HASLID, false), 3); } - public GameProfile getPlayerProfile() { + private GameProfile getPlayerProfile() { return playerProfile; } @@ -69,6 +71,14 @@ public void readFromNBT(NBTTagCompound nbtTagCompound) { this.hasLid = nbtTagCompound.getBoolean("hasLid"); this.playerProfile = NBTUtil.readGameProfileFromNBT(nbtTagCompound.getCompoundTag("playerProfile")); + + NBTTagCompound replaceableTag = nbtTagCompound.getCompoundTag("replaceableTag"); + int size = replaceableTag.getInteger("size"); + replaceableBlocks = Lists.newArrayList(); + for (int i = 0; i < size; i++) + { + replaceableBlocks.add(ReplaceableBlock.readNBT((NBTTagCompound) replaceableTag.getTag("block:" + i))); + } } @Override @@ -82,43 +92,36 @@ public void writeToNBT(NBTTagCompound nbtTagCompound) { NBTUtil.writeGameProfile(profileTag, playerProfile); nbtTagCompound.setTag("playerProfile", profileTag); } - } - public void breakBlocks() { - IBlockState masterState = worldObj.getBlockState(pos); - Block block1, block2; - block1 = worldObj.getBlockState(pos.down()).getBlock(); - block2 = worldObj.getBlockState(pos.down().offset(masterState.getValue(BlockGraveStone.FACING))).getBlock(); - - if (block1 != null && block2 != null) { - IBlockState state1, state2; - state1 = worldObj.getBlockState(pos.down()); - state2 = worldObj.getBlockState(pos.down().offset(masterState.getValue(BlockGraveStone.FACING))); - - ItemStack item1 = new ItemStack(block1.getItemDropped(state1, new Random(1), 0), 1, block1.damageDropped(state1)); - ItemStack item2 = new ItemStack(block2.getItemDropped(state2, new Random(1), 0), 1, block2.damageDropped(state2)); - worldObj.setBlockToAir(pos.down()); - worldObj.setBlockToAir(pos.down().offset(masterState.getValue(BlockGraveStone.FACING))); - internalInventory.addInventorySlotContents(item1); - internalInventory.addInventorySlotContents(item2); + NBTTagCompound replaceableTag = new NBTTagCompound(); + replaceableTag.setInteger("size", replaceableBlocks.size()); + for (int i = 0; i < replaceableBlocks.size(); i++) + { + replaceableTag.setTag("block:" + i, replaceableBlocks.get(i).writeNBT()); } + nbtTagCompound.setTag("replaceableTag", replaceableTag); + } + public void breakBlocks() { // Adding slaves EnumFacing facing = worldObj.getBlockState(pos).getValue(BlockGraveStone.FACING); IBlockState state; TileEntityGraveSlave tileEntityGraveSlave; state = Blocks.BLOCK_GRAVESTONE_SLAVE.block.getDefaultState(); + worldObj.removeTileEntity(pos.down()); worldObj.setBlockState(pos.down(), BlockGraveSlave.getActualStatePre(state, worldObj, pos.down(), pos)); tileEntityGraveSlave = TileTools.getTileEntity(worldObj, pos.down(), TileEntityGraveSlave.class); tileEntityGraveSlave.setMasterBlock(pos); + worldObj.removeTileEntity(pos.down().offset(facing)); worldObj.setBlockState(pos.down().offset(facing), BlockGraveSlave.getActualStatePre(state, worldObj, pos.down().offset(facing), pos)); tileEntityGraveSlave = TileTools.getTileEntity(worldObj, pos.down().offset(facing), TileEntityGraveSlave.class); tileEntityGraveSlave.setMasterBlock(pos); + worldObj.removeTileEntity(pos.offset(facing)); worldObj.setBlockState(pos.offset(facing), BlockGraveSlave.getActualStatePre(state, worldObj, pos.offset(facing), pos)); tileEntityGraveSlave = TileTools.getTileEntity(worldObj, pos.offset(facing), TileEntityGraveSlave.class); @@ -196,7 +199,7 @@ public void breakLid(EntityPlayer player) private void updateSlaves() { - for(BlockPos sPos : getSlaves()) + for(BlockPos sPos : getSlaves(pos, getFacing())) { IBlockState state = worldObj.getBlockState(sPos); worldObj.markAndNotifyBlock(sPos, worldObj.getChunkFromBlockCoords(pos), state, state.getActualState(worldObj, sPos), 3); @@ -271,9 +274,30 @@ public EnumFacing getFacing() return getBlockState().getValue(BlockGraveStone.FACING); } - public BlockPos[] getSlaves() + private static List getSlaves(BlockPos pos, EnumFacing facing) + { + List poses = Lists.newArrayList(); + poses.add(pos.down()); + poses.add(pos.down().offset(facing)); + poses.add(pos.offset(facing)); + return poses; + } + + public static List getPositions(BlockPos pos, EnumFacing facing) + { + List poses = getSlaves(pos, facing); + poses.add(pos); + poses.add(pos.offset(facing.getOpposite())); + return poses; + } + + public List getReplaceableBlocks() + { + return replaceableBlocks; + } + + public void setReplaceableBlocks(List replaceableBlocks) { - EnumFacing facing = getFacing(); - return new BlockPos[] {pos.down(), pos.offset(facing).down(), pos.offset(facing)}; + this.replaceableBlocks = replaceableBlocks; } } diff --git a/src/main/java/com/fireball1725/graves/tileentity/TileEntityHeadStone.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityHeadStone.java similarity index 81% rename from src/main/java/com/fireball1725/graves/tileentity/TileEntityHeadStone.java rename to src/main/java/com/fireball1725/graves/common/tileentity/TileEntityHeadStone.java index f002adb..a083a27 100644 --- a/src/main/java/com/fireball1725/graves/tileentity/TileEntityHeadStone.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityHeadStone.java @@ -1,4 +1,4 @@ -package com.fireball1725.graves.tileentity; +package com.fireball1725.graves.common.tileentity; public class TileEntityHeadStone extends TileEntityBase { public TileEntityHeadStone() { diff --git a/src/main/java/com/fireball1725/graves/tileentity/TileEntityInventoryBase.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityInventoryBase.java similarity index 93% rename from src/main/java/com/fireball1725/graves/tileentity/TileEntityInventoryBase.java rename to src/main/java/com/fireball1725/graves/common/tileentity/TileEntityInventoryBase.java index 6609e0e..b83ac8d 100644 --- a/src/main/java/com/fireball1725/graves/tileentity/TileEntityInventoryBase.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityInventoryBase.java @@ -1,8 +1,8 @@ -package com.fireball1725.graves.tileentity; +package com.fireball1725.graves.common.tileentity; -import com.fireball1725.graves.tileentity.inventory.IInventoryCustom; -import com.fireball1725.graves.tileentity.inventory.IInventoryHandler; -import com.fireball1725.graves.tileentity.inventory.InventoryOperation; +import com.fireball1725.graves.common.tileentity.inventory.IInventoryCustom; +import com.fireball1725.graves.common.tileentity.inventory.IInventoryHandler; +import com.fireball1725.graves.common.tileentity.inventory.InventoryOperation; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; diff --git a/src/main/java/com/fireball1725/graves/tileentity/inventory/IInventoryCustom.java b/src/main/java/com/fireball1725/graves/common/tileentity/inventory/IInventoryCustom.java similarity index 75% rename from src/main/java/com/fireball1725/graves/tileentity/inventory/IInventoryCustom.java rename to src/main/java/com/fireball1725/graves/common/tileentity/inventory/IInventoryCustom.java index 145b334..fda6fd5 100644 --- a/src/main/java/com/fireball1725/graves/tileentity/inventory/IInventoryCustom.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/inventory/IInventoryCustom.java @@ -1,4 +1,4 @@ -package com.fireball1725.graves.tileentity.inventory; +package com.fireball1725.graves.common.tileentity.inventory; import net.minecraft.nbt.NBTTagCompound; diff --git a/src/main/java/com/fireball1725/graves/tileentity/inventory/IInventoryHandler.java b/src/main/java/com/fireball1725/graves/common/tileentity/inventory/IInventoryHandler.java similarity index 82% rename from src/main/java/com/fireball1725/graves/tileentity/inventory/IInventoryHandler.java rename to src/main/java/com/fireball1725/graves/common/tileentity/inventory/IInventoryHandler.java index 69c3d64..eedbb30 100644 --- a/src/main/java/com/fireball1725/graves/tileentity/inventory/IInventoryHandler.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/inventory/IInventoryHandler.java @@ -1,4 +1,4 @@ -package com.fireball1725.graves.tileentity.inventory; +package com.fireball1725.graves.common.tileentity.inventory; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; diff --git a/src/main/java/com/fireball1725/graves/tileentity/inventory/InternalDynamicInventory.java b/src/main/java/com/fireball1725/graves/common/tileentity/inventory/InternalDynamicInventory.java similarity index 97% rename from src/main/java/com/fireball1725/graves/tileentity/inventory/InternalDynamicInventory.java rename to src/main/java/com/fireball1725/graves/common/tileentity/inventory/InternalDynamicInventory.java index 57ad1a3..fc6ca90 100644 --- a/src/main/java/com/fireball1725/graves/tileentity/inventory/InternalDynamicInventory.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/inventory/InternalDynamicInventory.java @@ -1,6 +1,6 @@ -package com.fireball1725.graves.tileentity.inventory; +package com.fireball1725.graves.common.tileentity.inventory; -import com.fireball1725.graves.util.Platform; +import com.fireball1725.graves.common.util.Platform; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; diff --git a/src/main/java/com/fireball1725/graves/tileentity/inventory/InternalInventory.java b/src/main/java/com/fireball1725/graves/common/tileentity/inventory/InternalInventory.java similarity index 96% rename from src/main/java/com/fireball1725/graves/tileentity/inventory/InternalInventory.java rename to src/main/java/com/fireball1725/graves/common/tileentity/inventory/InternalInventory.java index a8200c8..0e0a1df 100644 --- a/src/main/java/com/fireball1725/graves/tileentity/inventory/InternalInventory.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/inventory/InternalInventory.java @@ -1,7 +1,7 @@ -package com.fireball1725.graves.tileentity.inventory; +package com.fireball1725.graves.common.tileentity.inventory; -import com.fireball1725.graves.util.Platform; -import com.fireball1725.graves.util.iterators.InventoryIterator; +import com.fireball1725.graves.common.util.Platform; +import com.fireball1725.graves.common.util.iterators.InventoryIterator; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; diff --git a/src/main/java/com/fireball1725/graves/tileentity/inventory/InventoryOperation.java b/src/main/java/com/fireball1725/graves/common/tileentity/inventory/InventoryOperation.java similarity index 60% rename from src/main/java/com/fireball1725/graves/tileentity/inventory/InventoryOperation.java rename to src/main/java/com/fireball1725/graves/common/tileentity/inventory/InventoryOperation.java index 428729b..4003501 100644 --- a/src/main/java/com/fireball1725/graves/tileentity/inventory/InventoryOperation.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/inventory/InventoryOperation.java @@ -1,4 +1,4 @@ -package com.fireball1725.graves.tileentity.inventory; +package com.fireball1725.graves.common.tileentity.inventory; public enum InventoryOperation { decreaseStackSize, setInventorySlotContents, markDirty diff --git a/src/main/java/com/fireball1725/graves/util/GuiHandler.java b/src/main/java/com/fireball1725/graves/common/util/GuiHandler.java similarity index 88% rename from src/main/java/com/fireball1725/graves/util/GuiHandler.java rename to src/main/java/com/fireball1725/graves/common/util/GuiHandler.java index 53cffdd..3daaaf7 100644 --- a/src/main/java/com/fireball1725/graves/util/GuiHandler.java +++ b/src/main/java/com/fireball1725/graves/common/util/GuiHandler.java @@ -1,7 +1,7 @@ -package com.fireball1725.graves.util; +package com.fireball1725.graves.common.util; import com.fireball1725.graves.client.gui.GuiScreenHeadstone; -import com.fireball1725.graves.tileentity.TileEntityHeadStone; +import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; diff --git a/src/main/java/com/fireball1725/graves/util/ItemStackSrc.java b/src/main/java/com/fireball1725/graves/common/util/ItemStackSrc.java similarity index 93% rename from src/main/java/com/fireball1725/graves/util/ItemStackSrc.java rename to src/main/java/com/fireball1725/graves/common/util/ItemStackSrc.java index f52283d..7ff5b0a 100644 --- a/src/main/java/com/fireball1725/graves/util/ItemStackSrc.java +++ b/src/main/java/com/fireball1725/graves/common/util/ItemStackSrc.java @@ -1,4 +1,4 @@ -package com.fireball1725.graves.util; +package com.fireball1725.graves.common.util; import net.minecraft.block.Block; import net.minecraft.item.Item; diff --git a/src/main/java/com/fireball1725/graves/util/Platform.java b/src/main/java/com/fireball1725/graves/common/util/Platform.java similarity index 95% rename from src/main/java/com/fireball1725/graves/util/Platform.java rename to src/main/java/com/fireball1725/graves/common/util/Platform.java index aec22ce..50250a6 100644 --- a/src/main/java/com/fireball1725/graves/util/Platform.java +++ b/src/main/java/com/fireball1725/graves/common/util/Platform.java @@ -1,4 +1,4 @@ -package com.fireball1725.graves.util; +package com.fireball1725.graves.common.util; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.common.FMLCommonHandler; diff --git a/src/main/java/com/fireball1725/graves/util/TextureUtils.java b/src/main/java/com/fireball1725/graves/common/util/TextureUtils.java similarity index 98% rename from src/main/java/com/fireball1725/graves/util/TextureUtils.java rename to src/main/java/com/fireball1725/graves/common/util/TextureUtils.java index 83c915f..147a557 100644 --- a/src/main/java/com/fireball1725/graves/util/TextureUtils.java +++ b/src/main/java/com/fireball1725/graves/common/util/TextureUtils.java @@ -1,4 +1,4 @@ -package com.fireball1725.graves.util; +package com.fireball1725.graves.common.util; import com.mojang.authlib.GameProfile; import com.mojang.authlib.minecraft.MinecraftProfileTexture; diff --git a/src/main/java/com/fireball1725/graves/util/TileTools.java b/src/main/java/com/fireball1725/graves/common/util/TileTools.java similarity index 94% rename from src/main/java/com/fireball1725/graves/util/TileTools.java rename to src/main/java/com/fireball1725/graves/common/util/TileTools.java index c45bc58..5fc676b 100644 --- a/src/main/java/com/fireball1725/graves/util/TileTools.java +++ b/src/main/java/com/fireball1725/graves/common/util/TileTools.java @@ -1,4 +1,4 @@ -package com.fireball1725.graves.util; +package com.fireball1725.graves.common.util; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; diff --git a/src/main/java/com/fireball1725/graves/util/iterators/InventoryIterator.java b/src/main/java/com/fireball1725/graves/common/util/iterators/InventoryIterator.java similarity index 93% rename from src/main/java/com/fireball1725/graves/util/iterators/InventoryIterator.java rename to src/main/java/com/fireball1725/graves/common/util/iterators/InventoryIterator.java index b6f1498..d87cc19 100644 --- a/src/main/java/com/fireball1725/graves/util/iterators/InventoryIterator.java +++ b/src/main/java/com/fireball1725/graves/common/util/iterators/InventoryIterator.java @@ -1,4 +1,4 @@ -package com.fireball1725.graves.util.iterators; +package com.fireball1725.graves.common.util.iterators; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; diff --git a/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java b/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java index b11b609..216d9e2 100644 --- a/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java +++ b/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java @@ -1,13 +1,13 @@ package com.fireball1725.graves.proxy; -import com.fireball1725.graves.block.Blocks; +import com.fireball1725.graves.common.block.Blocks; import com.fireball1725.graves.client.events.RenderEvents; import com.fireball1725.graves.client.render.TileEntityHeadStoneRenderer; import com.fireball1725.graves.client.render.entity.EntityRenderers; import com.fireball1725.graves.client.render.entity.RenderPlayerZombie; -import com.fireball1725.graves.entity.EntityPlayerZombie; -import com.fireball1725.graves.reference.ModInfo; -import com.fireball1725.graves.tileentity.TileEntityHeadStone; +import com.fireball1725.graves.common.entity.EntityPlayerZombie; +import com.fireball1725.graves.common.reference.ModInfo; +import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.resources.IReloadableResourceManager; diff --git a/src/main/java/com/fireball1725/graves/proxy/CommonProxy.java b/src/main/java/com/fireball1725/graves/proxy/CommonProxy.java index 53dcaa6..a45c609 100644 --- a/src/main/java/com/fireball1725/graves/proxy/CommonProxy.java +++ b/src/main/java/com/fireball1725/graves/proxy/CommonProxy.java @@ -1,16 +1,14 @@ package com.fireball1725.graves.proxy; import com.fireball1725.graves.Graves; -import com.fireball1725.graves.block.Blocks; -import com.fireball1725.graves.configuration.ConfigurationFile; -import com.fireball1725.graves.entity.Entities; -import com.fireball1725.graves.event.EventBlockBreak; -import com.fireball1725.graves.event.EventDeathHandler; -import com.fireball1725.graves.helpers.BreakableWhiteListHelper; -import net.minecraft.block.Block; +import com.fireball1725.graves.common.block.Blocks; +import com.fireball1725.graves.common.configuration.ConfigurationFile; +import com.fireball1725.graves.common.entity.Entities; +import com.fireball1725.graves.common.event.EventBlockBreak; +import com.fireball1725.graves.common.event.EventDeathHandler; +import com.fireball1725.graves.common.helpers.BreakableWhiteListHelper; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.registry.GameRegistry; import java.io.File; From 46eb46e8e79b7614221b22262244b2094ba65385 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Wed, 18 May 2016 12:49:23 -0700 Subject: [PATCH 10/47] Graves will now replace you hotbar, armor, and offhand items, into the correct slots. As per request from @doritobob269 --- gradle/scripts/dependencies.gradle | 3 +- .../graves/common/event/EventBlockBreak.java | 12 ++ .../common/event/EventDeathHandler.java | 66 +++++-- .../tileentity/TileEntityGraveStone.java | 182 ++++++++++++------ 4 files changed, 187 insertions(+), 76 deletions(-) diff --git a/gradle/scripts/dependencies.gradle b/gradle/scripts/dependencies.gradle index f575788..a8473bb 100644 --- a/gradle/scripts/dependencies.gradle +++ b/gradle/scripts/dependencies.gradle @@ -12,7 +12,7 @@ repositories { maven { name "FireBall API Depot" - url "http://dl.tsr.me/artifactory/libs-release-local" + url "http://dl.tsr.me/artifactory/libs-release" } maven { @@ -48,6 +48,7 @@ configurations { } dependencies { + mods "com.fireball1725.devworld:devworld:1.9-b10-universal" //mods(group: 'journeymap', name: 'journeymap', version: '1.8.8-5.1.3') //compile(group: 'journeymap-api', name: 'journeymap-api', version: '1.8.9-0.9') } \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java b/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java index e9a223e..bd06854 100644 --- a/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java +++ b/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java @@ -6,6 +6,8 @@ import com.fireball1725.graves.common.tileentity.TileEntityGraveSlave; import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; import com.fireball1725.graves.common.util.TileTools; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -17,6 +19,7 @@ public void onBreakBlock(BlockEvent.BreakEvent event) { if(!(event.getState().getBlock() instanceof BlockGraveStone || event.getState().getBlock() instanceof BlockGraveSlave)) { return; } + // if (event.getWorld().isRemote) return; TileEntityGraveStone graveStone = null; @@ -42,6 +45,15 @@ public void onBreakBlock(BlockEvent.BreakEvent event) else { List blocks = graveStone.getReplaceableBlocks(); + EntityPlayer player = event.getPlayer(); + InventoryPlayer inventoryPlayer = player.inventory; + for(int i = 0; i < inventoryPlayer.getSizeInventory(); i++) + { + player.dropItem(inventoryPlayer.getStackInSlot(i), true, true); + } + + graveStone.replaceItems(player.inventory); + event.getWorld().destroyBlock(graveStone.getPos().down(), false); event.getWorld().destroyBlock(graveStone.getPos().down().offset(graveStone.getBlockState().getValue(BlockGraveStone.FACING)), false); event.getWorld().destroyBlock(graveStone.getPos().offset(graveStone.getBlockState().getValue(BlockGraveStone.FACING)), false); diff --git a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java index 91e7150..af2b701 100644 --- a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java +++ b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java @@ -6,28 +6,35 @@ import com.fireball1725.graves.common.block.Blocks; import com.fireball1725.graves.common.entity.EntityPlayerZombie; import com.fireball1725.graves.common.helpers.LogHelper; -import com.fireball1725.graves.common.helpers.SafeBlockReplacer; import com.fireball1725.graves.common.structure.ReplaceableBlock; import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; import com.fireball1725.graves.common.util.TileTools; import com.google.common.collect.Lists; +import com.google.common.collect.Maps; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.GameRules; import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingDeathEvent; import net.minecraftforge.event.entity.player.PlayerDropsEvent; import net.minecraftforge.fml.common.event.FMLInterModComms; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import java.util.List; +import java.util.Map; +import java.util.UUID; public class EventDeathHandler { + private Map inventories = Maps.newHashMap(); + /** * @param mod Your @Mod.instance object. * @param player The player we are setting the gps for. @@ -35,7 +42,7 @@ public class EventDeathHandler { * @param text The short description of the destination */ - public static void sendTomTomPos(Object mod, EntityPlayer player, BlockPos pos, String text) + private static void sendTomTomPos(Object mod, EntityPlayer player, BlockPos pos, String text) { NBTTagCompound tag = new NBTTagCompound(); tag.setLong("location", pos.toLong()); @@ -45,6 +52,18 @@ public static void sendTomTomPos(Object mod, EntityPlayer player, BlockPos pos, FMLInterModComms.sendRuntimeMessage(mod, "tomtom", "setPointer", tag); } + @SubscribeEvent(priority = EventPriority.HIGHEST, receiveCanceled = true) + public void onLivingDeath(LivingDeathEvent event) + { + if(event.getEntityLiving() instanceof EntityPlayer) + { + EntityPlayer player = (EntityPlayer) event.getEntityLiving(); + InventoryPlayer inv = new InventoryPlayer(player); + inv.copyInventory(player.inventory); + inventories.put(player.getPersistentID(), inv); + } + } + @SubscribeEvent(priority = EventPriority.LOW, receiveCanceled = true) public void onPlayerDrops(PlayerDropsEvent event) { @@ -64,7 +83,12 @@ public void onPlayerDrops(PlayerDropsEvent event) { return; } - final List itemsList = event.getDrops(); + EntityPlayer player = event.getEntityPlayer(); + List itemsList = Lists.newArrayList(); + for(EntityItem entityItem : event.getDrops()) + { + itemsList.add(entityItem.getEntityItem()); + } // If there are no items, then cancel spawning a grave if (itemsList.isEmpty()) @@ -89,11 +113,10 @@ public void onPlayerDrops(PlayerDropsEvent event) { } } - if (spawnGrave) { - - EnumFacing playerFacing = event.getEntityPlayer().getHorizontalFacing(); - LogHelper.info(String.format(">>>>>>>>>> %s, %s, %s, %s", event.getEntityPlayer().getPosition(), event.getEntityPlayer().posX, event.getEntityPlayer().posY, event.getEntityPlayer().posZ)); - BlockPos playerPos = event.getEntityPlayer().getPosition(); + if(spawnGrave) + { + EnumFacing playerFacing = player.getHorizontalFacing(); + BlockPos playerPos = player.getPosition(); IBlockState state = Blocks.BLOCK_GRAVESTONE.block.getDefaultState().withProperty(BlockGraveStone.FACING, playerFacing); List blocks = Lists.newArrayList(); @@ -110,20 +133,21 @@ public void onPlayerDrops(PlayerDropsEvent event) { world.setBlockState(playerPos, state); - TileEntityGraveStone graveStoneTileEntity = TileTools.getTileEntity(world, playerPos, TileEntityGraveStone.class); - graveStoneTileEntity.addGraveItems(itemsList); + TileEntityGraveStone graveStoneTileEntity = TileTools.getTileEntity(world, playerPos, TileEntityGraveStone.class); + graveStoneTileEntity.addGraveItemsWithReplaceables(inventories.remove(player.getPersistentID()), itemsList); graveStoneTileEntity.setReplaceableBlocks(blocks); - graveStoneTileEntity.breakBlocks(); - graveStoneTileEntity.setPlayerProfile(event.getEntityPlayer().getGameProfile()); - - // Adding Headstone - world.setBlockState(playerPos.offset(playerFacing.getOpposite()), Blocks.BLOCK_GRAVE_HEADSTONE.block.getDefaultState().withProperty(BlockHeadStone.FACING, playerFacing)); - TileEntityHeadStone tileEntityHeadStone = TileTools.getTileEntity(world, playerPos.offset(playerFacing.getOpposite()), TileEntityHeadStone.class); - if (tileEntityHeadStone != null) { - tileEntityHeadStone.setCustomName(event.getEntityPlayer().getDisplayName().getFormattedText()); - } - sendTomTomPos(Graves.instance, event.getEntityPlayer(), playerPos, "Grave this way!"); - } + graveStoneTileEntity.breakBlocks(); + graveStoneTileEntity.setPlayerProfile(player.getGameProfile()); + + // Adding Headstone + world.setBlockState(playerPos.offset(playerFacing.getOpposite()), Blocks.BLOCK_GRAVE_HEADSTONE.block.getDefaultState().withProperty(BlockHeadStone.FACING, playerFacing)); + TileEntityHeadStone tileEntityHeadStone = TileTools.getTileEntity(world, playerPos.offset(playerFacing.getOpposite()), TileEntityHeadStone.class); + if(tileEntityHeadStone != null) + { + tileEntityHeadStone.setCustomName(player.getDisplayName().getFormattedText()); + } + sendTomTomPos(Graves.instance, player, playerPos, "Grave this way!"); + } event.getDrops().clear(); } diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java index 7a29ecb..cd5d963 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java @@ -13,8 +13,8 @@ import com.google.common.collect.Lists; import com.mojang.authlib.GameProfile; import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -25,6 +25,7 @@ import net.minecraft.util.text.ITextComponent; import net.minecraft.world.EnumDifficulty; +import java.util.Iterator; import java.util.List; import java.util.Random; @@ -34,19 +35,97 @@ public class TileEntityGraveStone extends TileEntityInventoryBase private InternalDynamicInventory internalInventory = new InternalDynamicInventory(this); private GameProfile playerProfile; private List replaceableBlocks = Lists.newArrayList(); + private ItemStack[] replaceableItems = new ItemStack[14]; - @Override - public Packet getDescriptionPacket() { - LogHelper.info(String.format("Gravestone (%s) at W=%s X=%s Y=%s Z=%s", this.playerProfile == null ? "null" : this.playerProfile.getName(), this.worldObj.getWorldInfo().getWorldName(), this.pos.getX(), this.pos.getY(), this.pos.getZ())); + private static List getSlaves(BlockPos pos, EnumFacing facing) + { + List poses = Lists.newArrayList(); + poses.add(pos.down()); + poses.add(pos.down().offset(facing)); + poses.add(pos.offset(facing)); + return poses; + } + + public static List getPositions(BlockPos pos, EnumFacing facing) + { + List poses = getSlaves(pos, facing); + poses.add(pos); + poses.add(pos.offset(facing.getOpposite())); + return poses; + } + + @Override + public Packet getDescriptionPacket() + { + LogHelper.info(String.format("Gravestone (%s) at W=%s X=%s Y=%s Z=%s", this.playerProfile == null ? "null" : this.playerProfile.getName(), this.worldObj.getWorldInfo().getWorldName(), this.pos.getX(), this.pos.getY(), this.pos.getZ())); return super.getDescriptionPacket(); } - public void addGraveItems(List itemsList) { - for (EntityItem item : itemsList) { - internalInventory.addInventorySlotContents(item.getEntityItem()); - } - } + public void addGraveItems(List itemsList) + { + for(ItemStack stack : itemsList) + { + internalInventory.addInventorySlotContents(stack); + } + } + + public void addGraveItemsWithReplaceables(InventoryPlayer inventory, List itemsList) + { + replaceableItems = new ItemStack[InventoryPlayer.getHotbarSize() + inventory.armorInventory.length + inventory.offHandInventory.length]; + ItemStack itemStack; + int placeAt; + for(int i = 0; i < InventoryPlayer.getHotbarSize(); i++) + { + placeAt = i; + itemStack = inventory.mainInventory[i]; + replaceableItems[placeAt] = itemStack; + } + for(int i = 0; i < inventory.armorInventory.length; i++) + { + placeAt = i + InventoryPlayer.getHotbarSize(); + itemStack = inventory.armorInventory[i]; + replaceableItems[placeAt] = itemStack; + } + for(int i = 0; i < inventory.offHandInventory.length; i++) + { + placeAt = i + InventoryPlayer.getHotbarSize() + inventory.armorInventory.length; + itemStack = inventory.offHandInventory[i]; + replaceableItems[placeAt] = itemStack; + } + Iterator listIterator = itemsList.listIterator(); + listIterator: + while(listIterator.hasNext()) + { + ItemStack stack1 = listIterator.next(); + if(stack1 != null) + { + for(ItemStack stack : replaceableItems) + { + if(stack != null) + { + if(stack1.isItemEqual(stack)) + { + if(stack1.hasTagCompound() && stack.hasTagCompound()) + { + if(stack1.getTagCompound().equals(stack.getTagCompound())) + { + listIterator.remove(); + continue listIterator; + } + } + else + { + listIterator.remove(); + continue listIterator; + } + } + } + } + } + } + addGraveItems(itemsList); + } public boolean getHasLid() { return hasLid; @@ -72,14 +151,21 @@ public void readFromNBT(NBTTagCompound nbtTagCompound) { this.hasLid = nbtTagCompound.getBoolean("hasLid"); this.playerProfile = NBTUtil.readGameProfileFromNBT(nbtTagCompound.getCompoundTag("playerProfile")); - NBTTagCompound replaceableTag = nbtTagCompound.getCompoundTag("replaceableTag"); + NBTTagCompound replaceableTag = nbtTagCompound.getCompoundTag("replaceableBlocks"); int size = replaceableTag.getInteger("size"); replaceableBlocks = Lists.newArrayList(); for (int i = 0; i < size; i++) { replaceableBlocks.add(ReplaceableBlock.readNBT((NBTTagCompound) replaceableTag.getTag("block:" + i))); } - } + NBTTagCompound tag = nbtTagCompound.getCompoundTag("replaceableItems"); + replaceableItems = new ItemStack[tag.getInteger("size")]; + for(int i = 0; i < replaceableItems.length; i++) + { + if(tag.hasKey("item:" + i)) + { replaceableItems[i] = ItemStack.loadItemStackFromNBT(tag.getCompoundTag("item:" + i)); } + } + } @Override public void writeToNBT(NBTTagCompound nbtTagCompound) { @@ -93,40 +179,38 @@ public void writeToNBT(NBTTagCompound nbtTagCompound) { nbtTagCompound.setTag("playerProfile", profileTag); } - NBTTagCompound replaceableTag = new NBTTagCompound(); - replaceableTag.setInteger("size", replaceableBlocks.size()); + NBTTagCompound replaceableBlocksTag = new NBTTagCompound(); + replaceableBlocksTag.setInteger("size", replaceableBlocks.size()); for (int i = 0; i < replaceableBlocks.size(); i++) { - replaceableTag.setTag("block:" + i, replaceableBlocks.get(i).writeNBT()); + replaceableBlocksTag.setTag("block:" + i, replaceableBlocks.get(i).writeNBT()); } - nbtTagCompound.setTag("replaceableTag", replaceableTag); - } + nbtTagCompound.setTag("replaceableBlocks", replaceableBlocksTag); + NBTTagCompound replaceableItemsTag = new NBTTagCompound(); + replaceableItemsTag.setInteger("size", replaceableItems.length); + for(int i = 0; i < replaceableItems.length; i++) + { + if(replaceableItems[i] != null) + { replaceableItemsTag.setTag("item:" + i, replaceableItems[i].writeToNBT(new NBTTagCompound())); } + } + nbtTagCompound.setTag("replaceableItems", replaceableItemsTag); + } public void breakBlocks() { // Adding slaves EnumFacing facing = worldObj.getBlockState(pos).getValue(BlockGraveStone.FACING); - IBlockState state; - TileEntityGraveSlave tileEntityGraveSlave; - state = Blocks.BLOCK_GRAVESTONE_SLAVE.block.getDefaultState(); + IBlockState state = Blocks.BLOCK_GRAVESTONE_SLAVE.block.getDefaultState(); + TileEntityGraveSlave tileEntityGraveSlave; - worldObj.removeTileEntity(pos.down()); - worldObj.setBlockState(pos.down(), BlockGraveSlave.getActualStatePre(state, worldObj, pos.down(), pos)); - - tileEntityGraveSlave = TileTools.getTileEntity(worldObj, pos.down(), TileEntityGraveSlave.class); - tileEntityGraveSlave.setMasterBlock(pos); - - worldObj.removeTileEntity(pos.down().offset(facing)); - worldObj.setBlockState(pos.down().offset(facing), BlockGraveSlave.getActualStatePre(state, worldObj, pos.down().offset(facing), pos)); - - tileEntityGraveSlave = TileTools.getTileEntity(worldObj, pos.down().offset(facing), TileEntityGraveSlave.class); - tileEntityGraveSlave.setMasterBlock(pos); - - worldObj.removeTileEntity(pos.offset(facing)); - worldObj.setBlockState(pos.offset(facing), BlockGraveSlave.getActualStatePre(state, worldObj, pos.offset(facing), pos)); + for(BlockPos slavePos : getSlaves(pos, facing)) + { + worldObj.removeTileEntity(slavePos); + worldObj.setBlockState(slavePos, BlockGraveSlave.getActualStatePre(state, worldObj, slavePos, pos)); - tileEntityGraveSlave = TileTools.getTileEntity(worldObj, pos.offset(facing), TileEntityGraveSlave.class); - tileEntityGraveSlave.setMasterBlock(pos); - // End of adding slaves + tileEntityGraveSlave = TileTools.getTileEntity(worldObj, slavePos, TileEntityGraveSlave.class); + tileEntityGraveSlave.setMasterBlock(pos); + } + // End of adding slaves } @@ -186,7 +270,6 @@ public void breakLid(EntityPlayer player) IBlockState state = getBlockState(); if(state.getValue(BlockGraveStone.HASLID)) { - LogHelper.info("breaking lid"); hasLid = false; worldObj.notifyBlockUpdate(pos, state, state.withProperty(BlockGraveStone.HASLID, false), 3); updateSlaves(); @@ -274,23 +357,6 @@ public EnumFacing getFacing() return getBlockState().getValue(BlockGraveStone.FACING); } - private static List getSlaves(BlockPos pos, EnumFacing facing) - { - List poses = Lists.newArrayList(); - poses.add(pos.down()); - poses.add(pos.down().offset(facing)); - poses.add(pos.offset(facing)); - return poses; - } - - public static List getPositions(BlockPos pos, EnumFacing facing) - { - List poses = getSlaves(pos, facing); - poses.add(pos); - poses.add(pos.offset(facing.getOpposite())); - return poses; - } - public List getReplaceableBlocks() { return replaceableBlocks; @@ -300,4 +366,12 @@ public void setReplaceableBlocks(List replaceableBlocks) { this.replaceableBlocks = replaceableBlocks; } + + public void replaceItems(InventoryPlayer inventory) + { + System.arraycopy(replaceableItems, 0, inventory.mainInventory, 0, InventoryPlayer.getHotbarSize()); + System.arraycopy(replaceableItems, InventoryPlayer.getHotbarSize(), inventory.armorInventory, 0, inventory.armorInventory.length); + System.arraycopy(replaceableItems, InventoryPlayer.getHotbarSize() + inventory.armorInventory.length, inventory.offHandInventory, 0, inventory.offHandInventory.length); + inventory.markDirty(); + } } From c3cd2ab950a3c3b9f34cf41c0e34795ecc49e615 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Sun, 19 Jun 2016 11:26:05 -0700 Subject: [PATCH 11/47] Updated to 1.9.4 --- build.gradle | 4 +- gradle.properties | 6 +- .../graves/client/events/RenderEvents.java | 4 +- .../graves/common/block/BlockGraveSlave.java | 4 +- .../graves/common/block/BlockGraveStone.java | 4 +- .../graves/common/block/BlockHeadStone.java | 8 +- .../graves/common/entity/EntityFlying.java | 12 +-- .../common/entity/EntityPlayerZombie.java | 96 +++++++++---------- .../graves/common/event/EventBlockBreak.java | 8 +- .../common/event/EventDeathHandler.java | 3 + .../graves/common/reference/ModInfo.java | 2 +- .../common/structure/ReplaceableBlock.java | 39 ++++---- .../common/tileentity/TileEntityBase.java | 26 ++--- .../tileentity/TileEntityGraveSlave.java | 9 +- .../tileentity/TileEntityGraveStone.java | 22 +++-- .../tileentity/TileEntityInventoryBase.java | 7 +- .../graves/proxy/CommonProxy.java | 52 +++++----- 17 files changed, 158 insertions(+), 148 deletions(-) diff --git a/build.gradle b/build.gradle index 84ae5fb..4a5b912 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ buildscript { } } dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT' + classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' classpath "gradle.plugin.com.matthewprenger:CurseGradle:1.0.7" } } @@ -51,7 +51,7 @@ if (hasProperty("teamcity")) { } minecraft { - version = minecraft_version + "-" + forge_version + "-" + minecraft_version + version = minecraft_version + "-" + forge_version replaceIn "ModInfo.java" diff --git a/gradle.properties b/gradle.properties index 4f9bc18..161225a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -minecraft_version=1.9 -forge_version=12.16.0.1865 -mcp_mappings=snapshot_20160312 +minecraft_version=1.9.4 +forge_version=12.17.0.1968 +mcp_mappings=snapshot_20160518 cibuild=0 cibasename=graves \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java b/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java index 542e9c6..132bb00 100644 --- a/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java +++ b/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java @@ -93,7 +93,7 @@ public void drawBlockDamageTexture(Tessellator tessellatorIn, VertexBuffer world if(progress < 0) return; - renderEngine.bindTexture(TextureMap.locationBlocksTexture); + renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); //preRenderDamagedBlocks BEGIN GlStateManager.pushMatrix(); GlStateManager.tryBlendFuncSeparate(774, 768, 1, 0); @@ -120,7 +120,7 @@ public void drawBlockDamageTexture(Tessellator tessellatorIn, VertexBuffer world { IBlockState iblockstate = world.getBlockState(blockpos); - if(iblockstate.getBlock().getMaterial(iblockstate) != Material.air) + if(iblockstate.getBlock().getMaterial(iblockstate) != Material.AIR) { TextureAtlasSprite textureatlassprite = this.destroyBlockIcons[progress]; BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher(); diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockGraveSlave.java b/src/main/java/com/fireball1725/graves/common/block/BlockGraveSlave.java index 8b9830a..29594e0 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockGraveSlave.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockGraveSlave.java @@ -32,9 +32,9 @@ public class BlockGraveSlave extends BlockBase { BlockGraveSlave() { - super(Material.cloth); + super(Material.CLOTH); setDefaultState(blockState.getBaseState().withProperty(slaveType, SlaveType.LID).withProperty(isFoot, true).withProperty(BlockGraveStone.FACING, EnumFacing.NORTH)); - setStepSound(SoundType.STONE); + setSoundType(SoundType.STONE); setHardness(1.0F); setResistance(10000.0F); setTileEntity(TileEntityGraveSlave.class); diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockGraveStone.java b/src/main/java/com/fireball1725/graves/common/block/BlockGraveStone.java index 8b20466..f1707bc 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockGraveStone.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockGraveStone.java @@ -3,6 +3,7 @@ import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; import com.fireball1725.graves.common.util.TileTools; import net.minecraft.block.BlockHorizontal; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyDirection; @@ -30,9 +31,10 @@ public class BlockGraveStone extends BlockBase { public static final PropertyBool HASLID = PropertyBool.create("haslid"); public BlockGraveStone() { - super(Material.cloth); + super(Material.CLOTH); setDefaultState(this.blockState.getBaseState().withProperty(HASLID, true).withProperty(FACING, EnumFacing.NORTH)); setHardness(1F); + setSoundType(SoundType.STONE); this.setResistance(10000F); this.setTileEntity(TileEntityGraveStone.class); } diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java index 527e73a..e6e59ee 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java @@ -3,6 +3,7 @@ import com.fireball1725.graves.Graves; import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; import com.fireball1725.graves.common.util.TileTools; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockStateContainer; @@ -28,9 +29,10 @@ public class BlockHeadStone extends BlockBase { public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); protected BlockHeadStone() { - super(Material.rock); - this.setDefaultState(blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); - this.setHardness(1.5F); + super(Material.ROCK); + this.setDefaultState(blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); + this.setSoundType(SoundType.STONE); + this.setHardness(1.5F); this.setResistance(10.0F); this.setHarvestLevel("pickaxe", 0); this.setTileEntity(TileEntityHeadStone.class); diff --git a/src/main/java/com/fireball1725/graves/common/entity/EntityFlying.java b/src/main/java/com/fireball1725/graves/common/entity/EntityFlying.java index ef7f1f8..71d5ffe 100644 --- a/src/main/java/com/fireball1725/graves/common/entity/EntityFlying.java +++ b/src/main/java/com/fireball1725/graves/common/entity/EntityFlying.java @@ -28,16 +28,16 @@ public void moveEntityWithHeading(float strafe, float forward) { if (this.isInWater()) { - this.moveFlying(strafe, forward, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.moveRelative(strafe, forward, 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); this.motionX *= 0.800000011920929D; this.motionY *= 0.800000011920929D; this.motionZ *= 0.800000011920929D; } else if (this.isInLava()) { - this.moveFlying(strafe, forward, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.moveRelative(strafe, forward, 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); this.motionX *= 0.5D; this.motionY *= 0.5D; this.motionZ *= 0.5D; @@ -52,8 +52,8 @@ else if (this.isInLava()) } float f1 = 0.16277136F / (f * f * f); - this.moveFlying(strafe, forward, this.onGround ? 0.1F * f1 : 0.02F); - f = 0.91F; + this.moveRelative(strafe, forward, this.onGround ? 0.1F * f1 : 0.02F); + f = 0.91F; if (this.onGround) { diff --git a/src/main/java/com/fireball1725/graves/common/entity/EntityPlayerZombie.java b/src/main/java/com/fireball1725/graves/common/entity/EntityPlayerZombie.java index 17cb45a..9fdd63f 100644 --- a/src/main/java/com/fireball1725/graves/common/entity/EntityPlayerZombie.java +++ b/src/main/java/com/fireball1725/graves/common/entity/EntityPlayerZombie.java @@ -96,10 +96,10 @@ public void setPlayer(EntityPlayer player) { } @Override - public void writeToNBT(NBTTagCompound tagCompund) + public NBTTagCompound writeToNBT(NBTTagCompound tagCompund) { tagCompund.setBoolean("[GoldenLassoPrevent]", true); // Make it so ExU2 cursed lassos are disabled - super.writeToNBT(tagCompund); + return super.writeToNBT(tagCompund); } @Override @@ -149,10 +149,10 @@ public void onUpdate() { capeY += y * 0.25; if (worldObj.isRemote) { - float w = dataWatcher.get(WIDTH); + float w = dataManager.get(WIDTH); if(w != width) width = w; - float h = dataWatcher.get(HEIGHT); + float h = dataManager.get(HEIGHT); if(h != height) height = h; } @@ -178,10 +178,10 @@ protected void applyEntityAttributes() { @Override protected void entityInit() { super.entityInit(); - dataWatcher.register(NAME, ""); - dataWatcher.register(CHILD, (byte) 0); - dataWatcher.register(WIDTH, width); - dataWatcher.register(HEIGHT, height); + dataManager.register(NAME, ""); + dataManager.register(CHILD, (byte) 0); + dataManager.register(WIDTH, width); + dataManager.register(HEIGHT, height); playSound(getSound("spawn"), getSoundVolume(), getSoundPitch()); } @@ -223,9 +223,9 @@ protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty) { int i = rand.nextInt(3); if(i == 0) - { setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.stone_sword)); } + { setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.STONE_SWORD)); } else if(i == 1) - { setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.bow)); } + { setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.BOW)); } } } @@ -238,10 +238,10 @@ public void setItemStackToSlot(EntityEquipmentSlot slotIn, ItemStack stack) @Override public ItemStack getPickedResult(RayTraceResult target) { - ItemStack stack = new ItemStack(Items.spawn_egg); + ItemStack stack = new ItemStack(Items.SPAWN_EGG); NBTTagCompound nbt = new NBTTagCompound(); - nbt.setString("entity_name", EntityList.classToStringMapping.get(getClass())); - stack.setTagCompound(nbt); + nbt.setString("entity_name", EntityList.CLASS_TO_NAME.get(getClass())); + stack.setTagCompound(nbt); return stack; } @@ -337,32 +337,32 @@ public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLi } if (rng > rngNothing + rngSword + rngLeatherKit + rngIronKit + rngGoldKit) { // Diamond Kit - slot0 = new ItemStack(Items.diamond_sword); - slot1 = new ItemStack(Items.diamond_boots); - slot2 = new ItemStack(Items.diamond_leggings); - slot3 = new ItemStack(Items.diamond_chestplate); - slot4 = new ItemStack(Items.diamond_helmet); - } else if (rng > rngNothing + rngSword + rngLeatherKit + rngIronKit) { // Gold Kit - slot0 = new ItemStack(Items.golden_sword); - slot1 = new ItemStack(Items.golden_boots); - slot2 = new ItemStack(Items.golden_leggings); - slot3 = new ItemStack(Items.golden_chestplate); - slot4 = new ItemStack(Items.golden_helmet); - } else if (rng > rngNothing + rngSword + rngLeatherKit) { // Iron Kit - slot0 = new ItemStack(Items.iron_sword); - slot1 = new ItemStack(Items.iron_boots); - slot2 = new ItemStack(Items.iron_leggings); - slot3 = new ItemStack(Items.iron_chestplate); - slot4 = new ItemStack(Items.iron_helmet); - } else if (rng > rngNothing + rngSword) { // Leather Kit - slot0 = new ItemStack(Items.wooden_sword); - slot1 = new ItemStack(Items.leather_boots); - slot2 = new ItemStack(Items.leather_leggings); - slot3 = new ItemStack(Items.leather_chestplate); - slot4 = new ItemStack(Items.leather_helmet); - } else if (rng > rngNothing) { // Wooden Sword - slot0 = new ItemStack(Items.wooden_sword); - } + slot0 = new ItemStack(Items.DIAMOND_SWORD); + slot1 = new ItemStack(Items.DIAMOND_BOOTS); + slot2 = new ItemStack(Items.DIAMOND_LEGGINGS); + slot3 = new ItemStack(Items.DIAMOND_CHESTPLATE); + slot4 = new ItemStack(Items.DIAMOND_HELMET); + } else if (rng > rngNothing + rngSword + rngLeatherKit + rngIronKit) { // Gold Kit + slot0 = new ItemStack(Items.GOLDEN_SWORD); + slot1 = new ItemStack(Items.GOLDEN_BOOTS); + slot2 = new ItemStack(Items.GOLDEN_LEGGINGS); + slot3 = new ItemStack(Items.GOLDEN_CHESTPLATE); + slot4 = new ItemStack(Items.GOLDEN_HELMET); + } else if (rng > rngNothing + rngSword + rngLeatherKit) { // Iron Kit + slot0 = new ItemStack(Items.IRON_SWORD); + slot1 = new ItemStack(Items.IRON_BOOTS); + slot2 = new ItemStack(Items.IRON_LEGGINGS); + slot3 = new ItemStack(Items.IRON_CHESTPLATE); + slot4 = new ItemStack(Items.IRON_HELMET); + } else if (rng > rngNothing + rngSword) { // Leather Kit + slot0 = new ItemStack(Items.WOODEN_SWORD); + slot1 = new ItemStack(Items.LEATHER_BOOTS); + slot2 = new ItemStack(Items.LEATHER_LEGGINGS); + slot3 = new ItemStack(Items.LEATHER_CHESTPLATE); + slot4 = new ItemStack(Items.LEATHER_HELMET); + } else if (rng > rngNothing) { // Wooden Sword + slot0 = new ItemStack(Items.WOODEN_SWORD); + } if (ConfigZombie.configZombieArmorEnabled) { if(slot0 != null) @@ -458,8 +458,8 @@ public ITextComponent getDisplayName() private Style style; - @Override - public Style getChatStyle() + @Override + public Style getStyle() { if(style == null) { @@ -477,7 +477,7 @@ public String getFormattingCode() { while (iterator.hasNext()) { ITextComponent ITextComponent = (ITextComponent) iterator.next(); - ITextComponent.getChatStyle().setParentStyle(style); + ITextComponent.getStyle().setParentStyle(style); } } @@ -505,9 +505,9 @@ public void setProfile(GameProfile profile) { @Override public String getUsername() { - String username = dataWatcher.get(NAME); + String username = dataManager.get(NAME); if(StringUtils.isBlank(username)) - { dataWatcher.set(NAME, "FireBall1725"); } + { dataManager.set(NAME, "FireBall1725"); } if(username.equals("Soaryn")) return "direwolf20"; if (username.equals("direwolf20")) @@ -536,7 +536,7 @@ public void setUsername(String name) { { name = newName; } - dataWatcher.set(NAME, name); + dataManager.set(NAME, name); } @Override @@ -556,14 +556,14 @@ public double getInterpolatedCapeZ(float partialTickTime) { @Override public boolean isChild() { - return dataWatcher.get(CHILD) == 1; + return dataManager.get(CHILD) == 1; } @Override protected void setSize(float width, float height) { super.setSize(width, height); - dataWatcher.set(WIDTH, this.width); - dataWatcher.set(HEIGHT, this.height); + dataManager.set(WIDTH, this.width); + dataManager.set(HEIGHT, this.height); } public BlockPos getGraveMaster() diff --git a/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java b/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java index bd06854..408339e 100644 --- a/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java +++ b/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java @@ -7,7 +7,6 @@ import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; import com.fireball1725.graves.common.util.TileTools; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -46,12 +45,7 @@ public void onBreakBlock(BlockEvent.BreakEvent event) { List blocks = graveStone.getReplaceableBlocks(); EntityPlayer player = event.getPlayer(); - InventoryPlayer inventoryPlayer = player.inventory; - for(int i = 0; i < inventoryPlayer.getSizeInventory(); i++) - { - player.dropItem(inventoryPlayer.getStackInSlot(i), true, true); - } - + player.inventory.dropAllItems(); graveStone.replaceItems(player.inventory); event.getWorld().destroyBlock(graveStone.getPos().down(), false); diff --git a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java index af2b701..ad7f024 100644 --- a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java +++ b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java @@ -119,6 +119,9 @@ public void onPlayerDrops(PlayerDropsEvent event) { BlockPos playerPos = player.getPosition(); IBlockState state = Blocks.BLOCK_GRAVESTONE.block.getDefaultState().withProperty(BlockGraveStone.FACING, playerFacing); + if(playerPos.getY() < 2) + { playerPos = new BlockPos(playerPos.getX(), 2, playerPos.getZ()); } + List blocks = Lists.newArrayList(); for (BlockPos pos : TileEntityGraveStone.getPositions(playerPos, playerFacing)) { diff --git a/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java b/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java index d4c3266..a6bf853 100644 --- a/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java +++ b/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java @@ -9,5 +9,5 @@ public class ModInfo { public static final String SERVER_PROXY_CLASS = "com.fireball1725." + MOD_ID + ".proxy.ServerProxy"; public static final String CLIENT_PROXY_CLASS = "com.fireball1725." + MOD_ID + ".proxy.ClientProxy"; public static final String FINGERPRINT = "@FINGERPRINT@"; - public static final String GUI_FACTORY = "com.fireball1725." + MOD_ID + ".configuration.GravesConfigGuiFactory"; + public static final String GUI_FACTORY = "com.fireball1725." + MOD_ID + ".common.configuration.GravesConfigGuiFactory"; } diff --git a/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java b/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java index b70a3a4..e645f37 100644 --- a/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java +++ b/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java @@ -20,6 +20,25 @@ public ReplaceableBlock(IBlockState state, BlockPos pos, NBTTagCompound tagCompo this.tagCompound = tagCompound; } + public static ReplaceableBlock readNBT(NBTTagCompound tag) + { + if(!tag.hasKey("blockID") || !tag.hasKey("blockMeta")) + { return null; } + IBlockState state; + NBTTagCompound tileTag = null; + + Block block = Block.getBlockById(tag.getInteger("blockID")); + state = block.getStateFromMeta(tag.getInteger("blockMeta")); + BlockPos pos = BlockPos.fromLong(tag.getLong("blockPos")); + + if(tag.hasKey("tileData")) + { + tileTag = tag.getCompoundTag("tileData"); + } + + return new ReplaceableBlock(state, pos, tileTag); + } + public boolean placeBlock(World world) { if (state == null) return false; @@ -37,7 +56,7 @@ public NBTTagCompound writeNBT() NBTTagCompound tag = new NBTTagCompound(); if (state != null) { - tag.setInteger("blockID", Block.blockRegistry.getIDForObject(state.getBlock())); + tag.setInteger("blockID", Block.REGISTRY.getIDForObject(state.getBlock())); tag.setInteger("blockMeta", state.getBlock().getMetaFromState(state)); tag.setLong("blockPos", pos.toLong()); } @@ -47,22 +66,4 @@ public NBTTagCompound writeNBT() } return tag; } - - public static ReplaceableBlock readNBT(NBTTagCompound tag) - { - if (!tag.hasKey("blockID") || !tag.hasKey("blockMeta")) return null; - IBlockState state; - NBTTagCompound tileTag = null; - - Block block = Block.getBlockById(tag.getInteger("blockID")); - state = block.getStateFromMeta(tag.getInteger("blockMeta")); - BlockPos pos = BlockPos.fromLong(tag.getLong("blockPos")); - - if (tag.hasKey("tileData")) - { - tileTag = tag.getCompoundTag("tileData"); - } - - return new ReplaceableBlock(state, pos, tileTag); - } } diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityBase.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityBase.java index 91d0ee1..cdb209d 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityBase.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityBase.java @@ -8,12 +8,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import javax.annotation.Nullable; import java.util.ArrayList; import java.util.HashMap; @@ -26,9 +26,11 @@ public static void registerTileItem(Class c, ItemStackSrc wat) { myItem.put(c, wat); } - @Override - public Packet getDescriptionPacket() { - NBTTagCompound data = new NBTTagCompound(); + @Nullable + @Override + public SPacketUpdateTileEntity getUpdatePacket() + { + NBTTagCompound data = new NBTTagCompound(); writeToNBT(data); return new SPacketUpdateTileEntity(this.pos, 1, data); } @@ -122,14 +124,14 @@ public void setName(String name) { this.customName = name; } - @Override - public void writeToNBT(NBTTagCompound nbtTagCompound) { - super.writeToNBT(nbtTagCompound); - - if (this.customName != null) { - nbtTagCompound.setString("CustomName", this.customName); - } - } + @Override + public NBTTagCompound writeToNBT(NBTTagCompound compound) + { + if (this.customName != null) { + compound.setString("CustomName", this.customName); + } + return super.writeToNBT(compound); + } @Override public void readFromNBT(NBTTagCompound nbtTagCompound) { diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveSlave.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveSlave.java index 5920260..4fa2935 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveSlave.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveSlave.java @@ -27,10 +27,11 @@ public void readFromNBT(NBTTagCompound compound) { } @Override - public void writeToNBT(NBTTagCompound compound) { - super.writeToNBT(compound); - if (masterBlock != null) { + public NBTTagCompound writeToNBT(NBTTagCompound compound) + { + if (masterBlock != null) { compound.setLong("masterBlock", masterBlock.toLong()); } - } + return super.writeToNBT(compound); + } } diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java index cd5d963..ded50a1 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java @@ -19,12 +19,13 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTUtil; -import net.minecraft.network.Packet; +import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.ITextComponent; import net.minecraft.world.EnumDifficulty; +import javax.annotation.Nullable; import java.util.Iterator; import java.util.List; import java.util.Random; @@ -54,13 +55,14 @@ public static List getPositions(BlockPos pos, EnumFacing facing) return poses; } + @Nullable @Override - public Packet getDescriptionPacket() + public SPacketUpdateTileEntity getUpdatePacket() { LogHelper.info(String.format("Gravestone (%s) at W=%s X=%s Y=%s Z=%s", this.playerProfile == null ? "null" : this.playerProfile.getName(), this.worldObj.getWorldInfo().getWorldName(), this.pos.getX(), this.pos.getY(), this.pos.getZ())); - return super.getDescriptionPacket(); - } + return super.getUpdatePacket(); + } public void addGraveItems(List itemsList) { @@ -168,8 +170,8 @@ public void readFromNBT(NBTTagCompound nbtTagCompound) { } @Override - public void writeToNBT(NBTTagCompound nbtTagCompound) { - super.writeToNBT(nbtTagCompound); + public NBTTagCompound writeToNBT(NBTTagCompound nbtTagCompound) + { nbtTagCompound.setBoolean("hasLid", this.hasLid); @@ -194,18 +196,20 @@ public void writeToNBT(NBTTagCompound nbtTagCompound) { { replaceableItemsTag.setTag("item:" + i, replaceableItems[i].writeToNBT(new NBTTagCompound())); } } nbtTagCompound.setTag("replaceableItems", replaceableItemsTag); + return super.writeToNBT(nbtTagCompound); } public void breakBlocks() { // Adding slaves - EnumFacing facing = worldObj.getBlockState(pos).getValue(BlockGraveStone.FACING); - IBlockState state = Blocks.BLOCK_GRAVESTONE_SLAVE.block.getDefaultState(); + IBlockState defSlaveState = Blocks.BLOCK_GRAVESTONE_SLAVE.block.getDefaultState(); + IBlockState state = worldObj.getBlockState(pos); + EnumFacing facing = state.getBlock().getActualState(state, worldObj, pos).getValue(BlockGraveStone.FACING); TileEntityGraveSlave tileEntityGraveSlave; for(BlockPos slavePos : getSlaves(pos, facing)) { worldObj.removeTileEntity(slavePos); - worldObj.setBlockState(slavePos, BlockGraveSlave.getActualStatePre(state, worldObj, slavePos, pos)); + worldObj.setBlockState(slavePos, BlockGraveSlave.getActualStatePre(defSlaveState, worldObj, slavePos, pos)); tileEntityGraveSlave = TileTools.getTileEntity(worldObj, slavePos, TileEntityGraveSlave.class); tileEntityGraveSlave.setMasterBlock(pos); diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityInventoryBase.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityInventoryBase.java index b83ac8d..1377cd4 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityInventoryBase.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityInventoryBase.java @@ -31,8 +31,8 @@ public void readFromNBT(NBTTagCompound nbtTagCompound) { } @Override - public void writeToNBT(NBTTagCompound nbtTagCompound) { - super.writeToNBT(nbtTagCompound); + public NBTTagCompound writeToNBT(NBTTagCompound nbtTagCompound) + { if (getInternalInventory() instanceof IInventoryCustom) { IInventoryCustom inventoryCustom = (IInventoryCustom)getInternalInventory(); @@ -49,7 +49,8 @@ public void writeToNBT(NBTTagCompound nbtTagCompound) { } nbtTagCompound.setTag("Items", tagCompound); } - } + return super.writeToNBT(nbtTagCompound); + } @Override public int getSizeInventory() { diff --git a/src/main/java/com/fireball1725/graves/proxy/CommonProxy.java b/src/main/java/com/fireball1725/graves/proxy/CommonProxy.java index a45c609..6982469 100644 --- a/src/main/java/com/fireball1725/graves/proxy/CommonProxy.java +++ b/src/main/java/com/fireball1725/graves/proxy/CommonProxy.java @@ -53,33 +53,33 @@ public void registerRecipes() { " x ", "xzx", "xxx", - 'x', new ItemStack(net.minecraft.init.Blocks.stone, 1, 4), - 'z', new ItemStack(net.minecraft.init.Blocks.stone, 1, 6)); - } + 'x', new ItemStack(net.minecraft.init.Blocks.STONE, 1, 4), + 'z', new ItemStack(net.minecraft.init.Blocks.STONE, 1, 6)); + } @Override public void registerWhiteList() { - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.dirt.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.dirt.getStateFromMeta(2)); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.grass.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.stone.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.stone.getStateFromMeta(1)); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.stone.getStateFromMeta(3)); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.stone.getStateFromMeta(5)); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.cobblestone.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.sand.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.sand.getStateFromMeta(1)); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.gravel.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.soul_sand.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.netherrack.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.clay.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.water.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.lava.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.flowing_water.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.flowing_lava.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.snow_layer.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.ice.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.packed_ice.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.mycelium.getDefaultState()); - } + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.DIRT.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.DIRT.getStateFromMeta(2)); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.GRASS.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.STONE.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.STONE.getStateFromMeta(1)); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.STONE.getStateFromMeta(3)); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.STONE.getStateFromMeta(5)); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.COBBLESTONE.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.SAND.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.SAND.getStateFromMeta(1)); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.GRAVEL.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.SOUL_SAND.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.NETHERRACK.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.CLAY.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.WATER.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.LAVA.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.FLOWING_WATER.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.FLOWING_LAVA.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.SNOW_LAYER.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.ICE.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.PACKED_ICE.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.MYCELIUM.getDefaultState()); + } } From b9a912573e8a64259a62692081d168351c8126d9 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Thu, 23 Jun 2016 13:32:51 -0700 Subject: [PATCH 12/47] Work on null worldObj --- build.gradle | 2 +- gradle.properties | 2 +- .../graves/common/event/EventDeathHandler.java | 3 +++ .../graves/common/tileentity/TileEntityGraveStone.java | 8 +++++++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 84ae5fb..9990aae 100644 --- a/build.gradle +++ b/build.gradle @@ -51,7 +51,7 @@ if (hasProperty("teamcity")) { } minecraft { - version = minecraft_version + "-" + forge_version + "-" + minecraft_version + version = minecraft_version + "-" + forge_version replaceIn "ModInfo.java" diff --git a/gradle.properties b/gradle.properties index 4f9bc18..abfbcff 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ minecraft_version=1.9 -forge_version=12.16.0.1865 +forge_version=12.16.1.1907 mcp_mappings=snapshot_20160312 cibuild=0 cibasename=graves \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java index af2b701..ed054f9 100644 --- a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java +++ b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java @@ -131,9 +131,12 @@ public void onPlayerDrops(PlayerDropsEvent event) { blocks.add(new ReplaceableBlock(world.getBlockState(pos), pos, tag)); } + // world.setTileEntity(playerPos, state.getBlock().createTileEntity(world, state)); world.setBlockState(playerPos, state); TileEntityGraveStone graveStoneTileEntity = TileTools.getTileEntity(world, playerPos, TileEntityGraveStone.class); + if(graveStoneTileEntity.getWorld() == null) + { graveStoneTileEntity.setWorldObj(world); } graveStoneTileEntity.addGraveItemsWithReplaceables(inventories.remove(player.getPersistentID()), itemsList); graveStoneTileEntity.setReplaceableBlocks(blocks); graveStoneTileEntity.breakBlocks(); diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java index cd5d963..069abdd 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java @@ -198,7 +198,13 @@ public void writeToNBT(NBTTagCompound nbtTagCompound) { public void breakBlocks() { // Adding slaves - EnumFacing facing = worldObj.getBlockState(pos).getValue(BlockGraveStone.FACING); + if(worldObj == null) + { + LogHelper.info("World is null??"); + return; + } + IBlockState state2 = worldObj.getBlockState(pos); + EnumFacing facing = state2.getValue(BlockGraveStone.FACING); IBlockState state = Blocks.BLOCK_GRAVESTONE_SLAVE.block.getDefaultState(); TileEntityGraveSlave tileEntityGraveSlave; From 51485e772333b9d5413c5737c57eb11cc1028171 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Thu, 23 Jun 2016 16:04:12 -0700 Subject: [PATCH 13/47] Update to 1.10 --- gradle.properties | 4 ++-- gradle/scripts/dependencies.gradle | 2 +- .../graves/common/block/BlockBase.java | 7 ++++--- .../common/event/EventDeathHandler.java | 1 + .../common/tileentity/TileEntityBase.java | 20 ++++++++++++++++++- .../tileentity/TileEntityGraveStone.java | 12 ----------- 6 files changed, 27 insertions(+), 19 deletions(-) diff --git a/gradle.properties b/gradle.properties index 161225a..5a80cdc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -minecraft_version=1.9.4 -forge_version=12.17.0.1968 +minecraft_version=1.10 +forge_version=12.18.0.1986-1.10.0 mcp_mappings=snapshot_20160518 cibuild=0 cibasename=graves \ No newline at end of file diff --git a/gradle/scripts/dependencies.gradle b/gradle/scripts/dependencies.gradle index a8473bb..cd0403f 100644 --- a/gradle/scripts/dependencies.gradle +++ b/gradle/scripts/dependencies.gradle @@ -48,7 +48,7 @@ configurations { } dependencies { - mods "com.fireball1725.devworld:devworld:1.9-b10-universal" +// mods "com.fireball1725.devworld:devworld:1.9-b10-universal" //mods(group: 'journeymap', name: 'journeymap', version: '1.8.8-5.1.3') //compile(group: 'journeymap-api', name: 'journeymap-api', version: '1.8.9-0.9') } \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockBase.java b/src/main/java/com/fireball1725/graves/common/block/BlockBase.java index 01b2d04..73ec393 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockBase.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockBase.java @@ -39,10 +39,11 @@ protected BlockBase(Material material) { } @Override - public TileEntity createNewTileEntity(World var1, int var2) { - if (hasBlockTileEntity()) { + public TileEntity createNewTileEntity(World world, int meta) + { + if (hasBlockTileEntity()) { try { - return this.tileEntityType.newInstance(); + return tileEntityType.newInstance(); } catch (Throwable e) { throw new RuntimeException(e); } diff --git a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java index ad7f024..e71e097 100644 --- a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java +++ b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java @@ -137,6 +137,7 @@ public void onPlayerDrops(PlayerDropsEvent event) { world.setBlockState(playerPos, state); TileEntityGraveStone graveStoneTileEntity = TileTools.getTileEntity(world, playerPos, TileEntityGraveStone.class); + // if (graveStoneTileEntity.getWorld() == null) graveStoneTileEntity.setWorldObj(world); graveStoneTileEntity.addGraveItemsWithReplaceables(inventories.remove(player.getPersistentID()), itemsList); graveStoneTileEntity.setReplaceableBlocks(blocks); graveStoneTileEntity.breakBlocks(); diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityBase.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityBase.java index cdb209d..b862e46 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityBase.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityBase.java @@ -35,7 +35,7 @@ public SPacketUpdateTileEntity getUpdatePacket() return new SPacketUpdateTileEntity(this.pos, 1, data); } - @Override + @Override public void onDataPacket(NetworkManager networkManager, SPacketUpdateTileEntity sPacketUpdateTileEntity) { readFromNBT(sPacketUpdateTileEntity.getNbtCompound()); @@ -43,6 +43,24 @@ public void onDataPacket(NetworkManager networkManager, SPacketUpdateTileEntity markForUpdate(); } + @Override + public NBTTagCompound getUpdateTag() + { + NBTTagCompound tag = new NBTTagCompound(); + tag.setInteger("x", pos.getX()); + tag.setInteger("y", pos.getY()); + tag.setInteger("z", pos.getZ()); + return writeToNBT(tag); + } + + @Override + public void handleUpdateTag(NBTTagCompound tag) + { + readFromNBT(tag); + worldObj.markBlockRangeForRenderUpdate(this.pos, this.pos); + markForUpdate(); + } + public void markForUpdate() { if (this.renderedFragment > 0) { this.renderedFragment |= 0x1; diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java index ded50a1..3fe377c 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java @@ -5,7 +5,6 @@ import com.fireball1725.graves.common.block.Blocks; import com.fireball1725.graves.common.configuration.ConfigZombie; import com.fireball1725.graves.common.entity.EntityPlayerZombie; -import com.fireball1725.graves.common.helpers.LogHelper; import com.fireball1725.graves.common.structure.ReplaceableBlock; import com.fireball1725.graves.common.tileentity.inventory.InternalDynamicInventory; import com.fireball1725.graves.common.tileentity.inventory.InventoryOperation; @@ -19,13 +18,11 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTUtil; -import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.ITextComponent; import net.minecraft.world.EnumDifficulty; -import javax.annotation.Nullable; import java.util.Iterator; import java.util.List; import java.util.Random; @@ -55,15 +52,6 @@ public static List getPositions(BlockPos pos, EnumFacing facing) return poses; } - @Nullable - @Override - public SPacketUpdateTileEntity getUpdatePacket() - { - LogHelper.info(String.format("Gravestone (%s) at W=%s X=%s Y=%s Z=%s", this.playerProfile == null ? "null" : this.playerProfile.getName(), this.worldObj.getWorldInfo().getWorldName(), this.pos.getX(), this.pos.getY(), this.pos.getZ())); - - return super.getUpdatePacket(); - } - public void addGraveItems(List itemsList) { for(ItemStack stack : itemsList) From fe2c4fa45fd0f657afd9a4ee3a3e130d637d576e Mon Sep 17 00:00:00 2001 From: FusionLord Date: Thu, 23 Jun 2016 18:37:17 -0700 Subject: [PATCH 14/47] Fixed a crash with null items. --- .../fireball1725/graves/common/event/EventBlockBreak.java | 5 ++++- .../com/fireball1725/graves/common/reference/ModInfo.java | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java b/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java index bd06854..0f29247 100644 --- a/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java +++ b/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java @@ -49,7 +49,10 @@ public void onBreakBlock(BlockEvent.BreakEvent event) InventoryPlayer inventoryPlayer = player.inventory; for(int i = 0; i < inventoryPlayer.getSizeInventory(); i++) { - player.dropItem(inventoryPlayer.getStackInSlot(i), true, true); + if(inventoryPlayer.getStackInSlot(i) != null) + { + player.dropItem(inventoryPlayer.getStackInSlot(i), true, true); + } } graveStone.replaceItems(player.inventory); diff --git a/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java b/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java index d4c3266..a6bf853 100644 --- a/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java +++ b/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java @@ -9,5 +9,5 @@ public class ModInfo { public static final String SERVER_PROXY_CLASS = "com.fireball1725." + MOD_ID + ".proxy.ServerProxy"; public static final String CLIENT_PROXY_CLASS = "com.fireball1725." + MOD_ID + ".proxy.ClientProxy"; public static final String FINGERPRINT = "@FINGERPRINT@"; - public static final String GUI_FACTORY = "com.fireball1725." + MOD_ID + ".configuration.GravesConfigGuiFactory"; + public static final String GUI_FACTORY = "com.fireball1725." + MOD_ID + ".common.configuration.GravesConfigGuiFactory"; } From da177abf52b5a1f07753d4b2c520e1b0a512bfeb Mon Sep 17 00:00:00 2001 From: FusionLord Date: Thu, 23 Jun 2016 18:46:27 -0700 Subject: [PATCH 15/47] Refactored Item drop code. --- .../graves/common/event/EventBlockBreak.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java b/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java index 0f29247..70b9d35 100644 --- a/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java +++ b/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java @@ -7,7 +7,6 @@ import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; import com.fireball1725.graves.common.util.TileTools; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -46,14 +45,7 @@ public void onBreakBlock(BlockEvent.BreakEvent event) { List blocks = graveStone.getReplaceableBlocks(); EntityPlayer player = event.getPlayer(); - InventoryPlayer inventoryPlayer = player.inventory; - for(int i = 0; i < inventoryPlayer.getSizeInventory(); i++) - { - if(inventoryPlayer.getStackInSlot(i) != null) - { - player.dropItem(inventoryPlayer.getStackInSlot(i), true, true); - } - } + player.inventory.dropAllItems(); graveStone.replaceItems(player.inventory); From f414a73f2e7691324c75c976f40ce72dfdfb335f Mon Sep 17 00:00:00 2001 From: FusionLord Date: Fri, 24 Jun 2016 09:47:55 -0700 Subject: [PATCH 16/47] Fixed crash with tinkers smeltery and possibly other TileEntities. --- .../common/structure/ReplaceableBlock.java | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java b/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java index b70a3a4..4755767 100644 --- a/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java +++ b/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java @@ -4,6 +4,7 @@ import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.state.IBlockState; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; @@ -20,6 +21,25 @@ public ReplaceableBlock(IBlockState state, BlockPos pos, NBTTagCompound tagCompo this.tagCompound = tagCompound; } + public static ReplaceableBlock readNBT(NBTTagCompound tag) + { + if(!tag.hasKey("blockID") || !tag.hasKey("blockMeta")) + { return null; } + IBlockState state; + NBTTagCompound tileTag = null; + + Block block = Block.getBlockById(tag.getInteger("blockID")); + state = block.getStateFromMeta(tag.getInteger("blockMeta")); + BlockPos pos = BlockPos.fromLong(tag.getLong("blockPos")); + + if(tag.hasKey("tileData")) + { + tileTag = tag.getCompoundTag("tileData"); + } + + return new ReplaceableBlock(state, pos, tileTag); + } + public boolean placeBlock(World world) { if (state == null) return false; @@ -27,7 +47,7 @@ public boolean placeBlock(World world) Block block = state.getBlock(); if (block instanceof ITileEntityProvider && tagCompound != null) { - world.getTileEntity(pos).readFromNBT(tagCompound); + world.setTileEntity(pos, TileEntity.createTileEntity(null, tagCompound)); } return true; } @@ -47,22 +67,4 @@ public NBTTagCompound writeNBT() } return tag; } - - public static ReplaceableBlock readNBT(NBTTagCompound tag) - { - if (!tag.hasKey("blockID") || !tag.hasKey("blockMeta")) return null; - IBlockState state; - NBTTagCompound tileTag = null; - - Block block = Block.getBlockById(tag.getInteger("blockID")); - state = block.getStateFromMeta(tag.getInteger("blockMeta")); - BlockPos pos = BlockPos.fromLong(tag.getLong("blockPos")); - - if (tag.hasKey("tileData")) - { - tileTag = tag.getCompoundTag("tileData"); - } - - return new ReplaceableBlock(state, pos, tileTag); - } } From 08db2c0d17212525b2576005581faf45992d15f8 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Fri, 24 Jun 2016 09:51:07 -0700 Subject: [PATCH 17/47] Fixed crash with tinkers smeltery and possibly other TileEntities. --- .../fireball1725/graves/common/structure/ReplaceableBlock.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java b/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java index e645f37..57f81b6 100644 --- a/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java +++ b/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java @@ -4,6 +4,7 @@ import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.state.IBlockState; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; @@ -46,7 +47,7 @@ public boolean placeBlock(World world) Block block = state.getBlock(); if (block instanceof ITileEntityProvider && tagCompound != null) { - world.getTileEntity(pos).readFromNBT(tagCompound); + world.setTileEntity(pos, TileEntity.func_190200_a(world, tagCompound)); } return true; } From e51b88c935e786f3b85f781995ae5eb4e824ef47 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Wed, 29 Jun 2016 13:10:32 -0700 Subject: [PATCH 18/47] EnderDragons cannot break graves anymore. --- .../com/fireball1725/graves/common/block/BlockBase.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockBase.java b/src/main/java/com/fireball1725/graves/common/block/BlockBase.java index 01b2d04..d9e57fe 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockBase.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockBase.java @@ -8,7 +8,9 @@ import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.EntityDragon; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; @@ -143,6 +145,12 @@ public void onBlockPlacedBy(World world, BlockPos blockPos, IBlockState state, E } } + @Override + public boolean canEntityDestroy(IBlockState state, IBlockAccess world, BlockPos pos, Entity entity) + { + return !(entity instanceof EntityDragon) && super.canEntityDestroy(state, world, pos, entity); + } + @Override public EnumBlockRenderType getRenderType(IBlockState state) { From 2aea5fe9f133b9460685722ee45e5bb5498bdca5 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Wed, 29 Jun 2016 13:16:23 -0700 Subject: [PATCH 19/47] EnderDragons cannot break graves anymore. --- gradle.properties | 2 +- .../com/fireball1725/graves/common/block/BlockBase.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 5a80cdc..8146eae 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ minecraft_version=1.10 -forge_version=12.18.0.1986-1.10.0 +forge_version=12.18.0.2000-1.10.0 mcp_mappings=snapshot_20160518 cibuild=0 cibasename=graves \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockBase.java b/src/main/java/com/fireball1725/graves/common/block/BlockBase.java index 73ec393..662448c 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockBase.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockBase.java @@ -8,7 +8,9 @@ import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.EntityDragon; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; @@ -144,6 +146,12 @@ public void onBlockPlacedBy(World world, BlockPos blockPos, IBlockState state, E } } + @Override + public boolean canEntityDestroy(IBlockState state, IBlockAccess world, BlockPos pos, Entity entity) + { + return !(entity instanceof EntityDragon) && super.canEntityDestroy(state, world, pos, entity); + } + @Override public EnumBlockRenderType getRenderType(IBlockState state) { From 7072a961039edd955b65254d373aaf945cd4a646 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Wed, 29 Jun 2016 13:31:25 -0700 Subject: [PATCH 20/47] Graves now respect vertical bounds. --- .../graves/common/event/EventDeathHandler.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java index e71e097..2e1af68 100644 --- a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java +++ b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java @@ -119,8 +119,11 @@ public void onPlayerDrops(PlayerDropsEvent event) { BlockPos playerPos = player.getPosition(); IBlockState state = Blocks.BLOCK_GRAVESTONE.block.getDefaultState().withProperty(BlockGraveStone.FACING, playerFacing); - if(playerPos.getY() < 2) - { playerPos = new BlockPos(playerPos.getX(), 2, playerPos.getZ()); } + if(playerPos.getY() <= 2) + { playerPos = new BlockPos(playerPos.getX(), 3, playerPos.getZ()); } + + if(playerPos.getY() >= 254) + { playerPos = new BlockPos(playerPos.getX(), 253, playerPos.getZ()); } List blocks = Lists.newArrayList(); for (BlockPos pos : TileEntityGraveStone.getPositions(playerPos, playerFacing)) From 852f07c2f668c3588bcef5d0d6c9173e12d2771a Mon Sep 17 00:00:00 2001 From: FusionLord Date: Wed, 29 Jun 2016 13:32:38 -0700 Subject: [PATCH 21/47] Graves now respect vertical bounds. --- .../fireball1725/graves/common/event/EventDeathHandler.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java index ed054f9..af013cb 100644 --- a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java +++ b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java @@ -119,6 +119,12 @@ public void onPlayerDrops(PlayerDropsEvent event) { BlockPos playerPos = player.getPosition(); IBlockState state = Blocks.BLOCK_GRAVESTONE.block.getDefaultState().withProperty(BlockGraveStone.FACING, playerFacing); + if(playerPos.getY() <= 2) + { playerPos = new BlockPos(playerPos.getX(), 3, playerPos.getZ()); } + + if(playerPos.getY() >= 254) + { playerPos = new BlockPos(playerPos.getX(), 253, playerPos.getZ()); } + List blocks = Lists.newArrayList(); for (BlockPos pos : TileEntityGraveStone.getPositions(playerPos, playerFacing)) { From f16ba1a2ca316a171160df5a6a6dcad06f05d68d Mon Sep 17 00:00:00 2001 From: FusionLord Date: Wed, 29 Jun 2016 17:22:09 -0700 Subject: [PATCH 22/47] Graves now respect vertical bounds. --- .../java/com/fireball1725/graves/Graves.java | 9 +- .../chiselsandbits/GraveCapability.java | 170 ++++++++++++++++++ .../graves/common/block/BlockHeadStone.java | 26 ++- .../common/event/EventDeathHandler.java | 51 +++++- .../graves/common/reference/ModInfo.java | 6 +- 5 files changed, 248 insertions(+), 14 deletions(-) create mode 100644 src/main/java/com/fireball1725/graves/chiselsandbits/GraveCapability.java diff --git a/src/main/java/com/fireball1725/graves/Graves.java b/src/main/java/com/fireball1725/graves/Graves.java index 04b3bd2..1737b28 100644 --- a/src/main/java/com/fireball1725/graves/Graves.java +++ b/src/main/java/com/fireball1725/graves/Graves.java @@ -1,10 +1,11 @@ package com.fireball1725.graves; +import com.fireball1725.graves.chiselsandbits.GraveCapability; import com.fireball1725.graves.common.helpers.LogHelper; import com.fireball1725.graves.common.network.PacketHandler; -import com.fireball1725.graves.proxy.IProxy; import com.fireball1725.graves.common.reference.ModInfo; import com.fireball1725.graves.common.util.GuiHandler; +import com.fireball1725.graves.proxy.IProxy; import com.google.common.base.Stopwatch; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.fml.common.Mod; @@ -28,7 +29,8 @@ public class Graves { @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { - final Stopwatch stopWatch = Stopwatch.createStarted(); + GraveCapability.register(); + final Stopwatch stopWatch = Stopwatch.createStarted(); LogHelper.info("Pre Initialization ( started )"); // Setup Configuration @@ -64,6 +66,5 @@ public void init(FMLInitializationEvent event) { @Mod.EventHandler public void postInit(FMLPostInitializationEvent event) { - - } + } } diff --git a/src/main/java/com/fireball1725/graves/chiselsandbits/GraveCapability.java b/src/main/java/com/fireball1725/graves/chiselsandbits/GraveCapability.java new file mode 100644 index 0000000..0ca14bb --- /dev/null +++ b/src/main/java/com/fireball1725/graves/chiselsandbits/GraveCapability.java @@ -0,0 +1,170 @@ +package com.fireball1725.graves.chiselsandbits; + +import com.fireball1725.graves.common.reference.ModInfo; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.Capability.IStorage; +import net.minecraftforge.common.capabilities.CapabilityInject; +import net.minecraftforge.common.capabilities.CapabilityManager; +import net.minecraftforge.common.capabilities.ICapabilitySerializable; +import net.minecraftforge.event.AttachCapabilitiesEvent; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.registry.ForgeRegistries; + +public class GraveCapability +{ + @CapabilityInject(IGraveCapability.class) + public static final Capability GRAVE_CAP = null; + + public static void register() + { + boolean load = ModInfo.chiselsAndBits = Loader.isModLoaded("chiselsandbits"); + if(load) + { + CapabilityManager.INSTANCE.register(IGraveCapability.class, new Storage(), DefaultImpl.class); + MinecraftForge.EVENT_BUS.register(new GraveCapability()); + } + } + + @SubscribeEvent + public void onPlayerLoad(AttachCapabilitiesEvent.Entity event) + { + class Provider implements ICapabilitySerializable + { + private IGraveCapability inst = GRAVE_CAP.getDefaultInstance(); + + @Override + public boolean hasCapability(Capability capability, EnumFacing enumFacing) + { + return capability == GRAVE_CAP; + } + + @Override + public T getCapability(Capability capability, EnumFacing enumFacing) + { + return capability == GRAVE_CAP ? GRAVE_CAP.cast(inst) : null; + } + + @Override + public NBTBase serializeNBT() + { + return GRAVE_CAP.getStorage().writeNBT(GRAVE_CAP, inst, null); + } + + @Override + public void deserializeNBT(NBTBase tag) + { + GRAVE_CAP.getStorage().readNBT(GRAVE_CAP, inst, null, tag); + } + } + + if(event.getEntity() instanceof EntityPlayer) + { event.addCapability(new ResourceLocation(ModInfo.MOD_ID, "GraveCap"), new Provider()); } + } + + public interface IGraveCapability + { + Block getGraveBlock(); + + void setGraveBlock(Block block); + + int getGraveMeta(); + + void setGraveMeta(int meta); + + NBTTagCompound getGraveTag(); + + void setGraveTag(NBTTagCompound tag); + + boolean hasTag(); + } + + + + public static class Storage implements IStorage + { + @Override + public NBTBase writeNBT(Capability capability, IGraveCapability instance, EnumFacing side) + { + NBTTagCompound tagCompound = new NBTTagCompound(); + if(instance.getGraveBlock() == null) + { return tagCompound; } + + tagCompound.setString("graveBlock", ForgeRegistries.BLOCKS.getKey(instance.getGraveBlock()).toString()); + tagCompound.setInteger("graveMeta", instance.getGraveMeta()); + if(instance.hasTag()) + { tagCompound.setTag("graveTag", instance.getGraveTag()); } + return tagCompound; + } + + @Override + public void readNBT(Capability capability, IGraveCapability instance, EnumFacing side, NBTBase nbt) + { + if(nbt.hasNoTags()) + { return; } + + instance.setGraveBlock(ForgeRegistries.BLOCKS.getValue(new ResourceLocation(((NBTTagCompound) nbt).getString("graveBlock")))); + instance.setGraveMeta(((NBTTagCompound) nbt).getInteger("graveMeta")); + if(((NBTTagCompound) nbt).hasKey("graveTag")) + { instance.setGraveTag(((NBTTagCompound) nbt).getCompoundTag("graveTag")); } + } + } + + + + public static class DefaultImpl implements IGraveCapability + { + Block graveBlock; + int graveMeta; + NBTTagCompound graveTag; + + @Override + public NBTTagCompound getGraveTag() + { + return graveTag; + } + + @Override + public void setGraveTag(NBTTagCompound chiselAndBitsGrave) + { + this.graveTag = chiselAndBitsGrave; + } + + @Override + public boolean hasTag() + { + return graveTag != null; + } + + @Override + public Block getGraveBlock() + { + return graveBlock; + } + + @Override + public void setGraveBlock(Block block) + { + graveBlock = block; + } + + @Override + public int getGraveMeta() + { + return graveMeta; + } + + @Override + public void setGraveMeta(int meta) + { + this.graveMeta = meta; + } + } +} \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java index 527e73a..bf3642f 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java @@ -1,8 +1,11 @@ package com.fireball1725.graves.common.block; import com.fireball1725.graves.Graves; +import com.fireball1725.graves.chiselsandbits.GraveCapability; +import com.fireball1725.graves.common.reference.ModInfo; import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; import com.fireball1725.graves.common.util.TileTools; +import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockStateContainer; @@ -11,6 +14,7 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; @@ -74,10 +78,30 @@ public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBloc @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { - if(playerIn.capabilities.isCreativeMode) + if(playerIn.isSneaking() && playerIn.capabilities.isCreativeMode) { playerIn.openGui(Graves.instance, 0, worldIn, pos.getX(), pos.getY(), pos.getZ()); } + else if(ModInfo.chiselsAndBits) + { + if(heldItem.hasTagCompound() && heldItem.getTagCompound().hasKey("BlockEntityTag")) // Chisel and Bits Support + { + final GraveCapability.IGraveCapability grave = playerIn.getCapability(GraveCapability.GRAVE_CAP, null); + if(grave != null) + { + NBTTagCompound tag = heldItem.getTagCompound().getCompoundTag("BlockEntityTag"); + Block block = Block.getBlockFromItem(heldItem.getItem()); + grave.setGraveBlock(block); + grave.setGraveMeta(heldItem.getMetadata()); + grave.setGraveTag(tag); + if(block != null) + { + worldIn.setBlockState(pos, block.getDefaultState()); + worldIn.setTileEntity(pos, TileEntity.createTileEntity(null, tag)); + } + } + } + } return super.onBlockActivated(worldIn, pos, state, playerIn, hand, heldItem, side, hitX, hitY, hitZ); } diff --git a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java index af013cb..bb98383 100644 --- a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java +++ b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java @@ -1,23 +1,27 @@ package com.fireball1725.graves.common.event; import com.fireball1725.graves.Graves; +import com.fireball1725.graves.chiselsandbits.GraveCapability; import com.fireball1725.graves.common.block.BlockGraveStone; import com.fireball1725.graves.common.block.BlockHeadStone; import com.fireball1725.graves.common.block.Blocks; import com.fireball1725.graves.common.entity.EntityPlayerZombie; import com.fireball1725.graves.common.helpers.LogHelper; +import com.fireball1725.graves.common.reference.ModInfo; import com.fireball1725.graves.common.structure.ReplaceableBlock; import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; import com.fireball1725.graves.common.util.TileTools; import com.google.common.collect.Lists; import com.google.common.collect.Maps; +import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.GameRules; @@ -115,9 +119,9 @@ public void onPlayerDrops(PlayerDropsEvent event) { if(spawnGrave) { - EnumFacing playerFacing = player.getHorizontalFacing(); + EnumFacing facing = player.getHorizontalFacing(); BlockPos playerPos = player.getPosition(); - IBlockState state = Blocks.BLOCK_GRAVESTONE.block.getDefaultState().withProperty(BlockGraveStone.FACING, playerFacing); + IBlockState state = Blocks.BLOCK_GRAVESTONE.block.getDefaultState().withProperty(BlockGraveStone.FACING, facing); if(playerPos.getY() <= 2) { playerPos = new BlockPos(playerPos.getX(), 3, playerPos.getZ()); } @@ -126,7 +130,7 @@ public void onPlayerDrops(PlayerDropsEvent event) { { playerPos = new BlockPos(playerPos.getX(), 253, playerPos.getZ()); } List blocks = Lists.newArrayList(); - for (BlockPos pos : TileEntityGraveStone.getPositions(playerPos, playerFacing)) + for(BlockPos pos : TileEntityGraveStone.getPositions(playerPos, facing)) { NBTTagCompound tag = null; if (world.getTileEntity(pos) != null) @@ -149,15 +153,48 @@ public void onPlayerDrops(PlayerDropsEvent event) { graveStoneTileEntity.setPlayerProfile(player.getGameProfile()); // Adding Headstone - world.setBlockState(playerPos.offset(playerFacing.getOpposite()), Blocks.BLOCK_GRAVE_HEADSTONE.block.getDefaultState().withProperty(BlockHeadStone.FACING, playerFacing)); - TileEntityHeadStone tileEntityHeadStone = TileTools.getTileEntity(world, playerPos.offset(playerFacing.getOpposite()), TileEntityHeadStone.class); - if(tileEntityHeadStone != null) + + BlockPos pos = playerPos.offset(facing.getOpposite()); + + boolean success = false; + if(ModInfo.chiselsAndBits) { - tileEntityHeadStone.setCustomName(player.getDisplayName().getFormattedText()); + final GraveCapability.IGraveCapability graveCap = player.getCapability(GraveCapability.GRAVE_CAP, null); + if(graveCap != null) + { + System.out.println("test0"); + NBTTagCompound tag = graveCap.getGraveTag(); + graveCap.setGraveTag(tag); + Block block = graveCap.getGraveBlock(); + if(block != null) + { + System.out.println("test1 - " + block.getUnlocalizedName()); + world.setBlockState(pos, block.getStateFromMeta(graveCap.getGraveMeta())); + if(graveCap.hasTag()) + { + System.out.println("test2"); + world.setTileEntity(pos, TileEntity.createTileEntity(null, tag)); + } + success = true; + } + } } + if(!success) + { placeDefaultGrave(world, pos, facing, player.getDisplayName().getFormattedText()); } + sendTomTomPos(Graves.instance, player, playerPos, "Grave this way!"); } event.getDrops().clear(); } + + private void placeDefaultGrave(World world, BlockPos pos, EnumFacing facing, String text) + { + world.setBlockState(pos, Blocks.BLOCK_GRAVE_HEADSTONE.block.getDefaultState().withProperty(BlockHeadStone.FACING, facing)); + TileEntityHeadStone tileEntityHeadStone = TileTools.getTileEntity(world, pos, TileEntityHeadStone.class); + if(tileEntityHeadStone != null) + { + tileEntityHeadStone.setCustomName(text); + } + } } diff --git a/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java b/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java index a6bf853..25f26fe 100644 --- a/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java +++ b/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java @@ -5,9 +5,11 @@ public class ModInfo { public static final String MOD_NAME = "Graves"; public static final String VERSION_BUILD = "@VERSION@"; public static final String MINECRAFT_VERSION = "@MCVERSION@"; - public static final String DEPENDENCIES = ""; - public static final String SERVER_PROXY_CLASS = "com.fireball1725." + MOD_ID + ".proxy.ServerProxy"; + public static final String DEPENDENCIES = "after:chiselsandbits;"; + public static final String SERVER_PROXY_CLASS = "com.fireball1725." + MOD_ID + ".proxy.ServerProxy"; public static final String CLIENT_PROXY_CLASS = "com.fireball1725." + MOD_ID + ".proxy.ClientProxy"; public static final String FINGERPRINT = "@FINGERPRINT@"; public static final String GUI_FACTORY = "com.fireball1725." + MOD_ID + ".common.configuration.GravesConfigGuiFactory"; + + public static boolean chiselsAndBits = false; } From 855268b2675a7d9ea4d0446855fdede663020758 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Thu, 30 Jun 2016 15:11:50 -0700 Subject: [PATCH 23/47] Graves now Support Chisels & Bits as well as all blocks. --- .../java/com/fireball1725/graves/Graves.java | 7 +- .../chiselsandbits/GraveCapability.java | 98 +++-------- .../graves/client/events/RenderEvents.java | 8 +- .../render/TileEntityHeadStoneRenderer.java | 166 ++++++++++++------ .../graves/common/block/BlockHeadStone.java | 57 +++--- .../common/event/EventDeathHandler.java | 36 +--- .../common/tileentity/TileEntityBase.java | 7 - .../tileentity/TileEntityHeadStone.java | 63 ++++++- .../graves/proxy/ClientProxy.java | 3 +- .../assets/graves/blockstates/headstone.json | 4 + 10 files changed, 253 insertions(+), 196 deletions(-) diff --git a/src/main/java/com/fireball1725/graves/Graves.java b/src/main/java/com/fireball1725/graves/Graves.java index 1737b28..a92bc02 100644 --- a/src/main/java/com/fireball1725/graves/Graves.java +++ b/src/main/java/com/fireball1725/graves/Graves.java @@ -8,6 +8,7 @@ import com.fireball1725.graves.proxy.IProxy; import com.google.common.base.Stopwatch; import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; @@ -29,7 +30,11 @@ public class Graves { @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { - GraveCapability.register(); + boolean load = ModInfo.chiselsAndBits = Loader.isModLoaded("chiselsandbits"); + if(load) + { + GraveCapability.register(); + } final Stopwatch stopWatch = Stopwatch.createStarted(); LogHelper.info("Pre Initialization ( started )"); diff --git a/src/main/java/com/fireball1725/graves/chiselsandbits/GraveCapability.java b/src/main/java/com/fireball1725/graves/chiselsandbits/GraveCapability.java index 0ca14bb..b40cb7d 100644 --- a/src/main/java/com/fireball1725/graves/chiselsandbits/GraveCapability.java +++ b/src/main/java/com/fireball1725/graves/chiselsandbits/GraveCapability.java @@ -1,8 +1,8 @@ package com.fireball1725.graves.chiselsandbits; import com.fireball1725.graves.common.reference.ModInfo; -import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; @@ -14,9 +14,8 @@ import net.minecraftforge.common.capabilities.CapabilityManager; import net.minecraftforge.common.capabilities.ICapabilitySerializable; import net.minecraftforge.event.AttachCapabilitiesEvent; -import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.registry.ForgeRegistries; public class GraveCapability { @@ -25,12 +24,16 @@ public class GraveCapability public static void register() { - boolean load = ModInfo.chiselsAndBits = Loader.isModLoaded("chiselsandbits"); - if(load) - { - CapabilityManager.INSTANCE.register(IGraveCapability.class, new Storage(), DefaultImpl.class); - MinecraftForge.EVENT_BUS.register(new GraveCapability()); - } + CapabilityManager.INSTANCE.register(IGraveCapability.class, new Storage(), DefaultImpl.class); + MinecraftForge.EVENT_BUS.register(new GraveCapability()); + } + + // Handles playerData props from being wiped on death + @SubscribeEvent + public void cloneEvent(PlayerEvent.Clone evt) + { + NBTTagCompound grave = evt.getOriginal().getCapability(GRAVE_CAP, null).serializeNBT(); + evt.getEntityPlayer().getCapability(GRAVE_CAP, null).deserializeNBT(grave); } @SubscribeEvent @@ -71,100 +74,57 @@ public void deserializeNBT(NBTBase tag) public interface IGraveCapability { - Block getGraveBlock(); - - void setGraveBlock(Block block); - - int getGraveMeta(); + ItemStack getGraveItemStack(); - void setGraveMeta(int meta); + void setGraveItemStack(ItemStack itemStack); - NBTTagCompound getGraveTag(); + NBTTagCompound serializeNBT(); - void setGraveTag(NBTTagCompound tag); - - boolean hasTag(); + void deserializeNBT(NBTTagCompound tag); } - - public static class Storage implements IStorage { @Override public NBTBase writeNBT(Capability capability, IGraveCapability instance, EnumFacing side) { - NBTTagCompound tagCompound = new NBTTagCompound(); - if(instance.getGraveBlock() == null) - { return tagCompound; } - - tagCompound.setString("graveBlock", ForgeRegistries.BLOCKS.getKey(instance.getGraveBlock()).toString()); - tagCompound.setInteger("graveMeta", instance.getGraveMeta()); - if(instance.hasTag()) - { tagCompound.setTag("graveTag", instance.getGraveTag()); } - return tagCompound; + return instance.serializeNBT(); } @Override public void readNBT(Capability capability, IGraveCapability instance, EnumFacing side, NBTBase nbt) { - if(nbt.hasNoTags()) - { return; } - - instance.setGraveBlock(ForgeRegistries.BLOCKS.getValue(new ResourceLocation(((NBTTagCompound) nbt).getString("graveBlock")))); - instance.setGraveMeta(((NBTTagCompound) nbt).getInteger("graveMeta")); - if(((NBTTagCompound) nbt).hasKey("graveTag")) - { instance.setGraveTag(((NBTTagCompound) nbt).getCompoundTag("graveTag")); } + instance.deserializeNBT((NBTTagCompound) nbt); } } - - public static class DefaultImpl implements IGraveCapability { - Block graveBlock; - int graveMeta; - NBTTagCompound graveTag; - - @Override - public NBTTagCompound getGraveTag() - { - return graveTag; - } - - @Override - public void setGraveTag(NBTTagCompound chiselAndBitsGrave) - { - this.graveTag = chiselAndBitsGrave; - } - + ItemStack stack; @Override - public boolean hasTag() + public ItemStack getGraveItemStack() { - return graveTag != null; + return stack; } @Override - public Block getGraveBlock() + public void setGraveItemStack(ItemStack stack) { - return graveBlock; + this.stack = stack; } @Override - public void setGraveBlock(Block block) + public NBTTagCompound serializeNBT() { - graveBlock = block; + return stack == null ? new NBTTagCompound() : stack.serializeNBT(); } @Override - public int getGraveMeta() + public void deserializeNBT(NBTTagCompound tag) { - return graveMeta; - } - - @Override - public void setGraveMeta(int meta) - { - this.graveMeta = meta; + if(tag.hasNoTags()) + { return; } + setGraveItemStack(ItemStack.loadItemStackFromNBT(tag)); } } } \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java b/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java index 542e9c6..e3e28c2 100644 --- a/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java +++ b/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java @@ -1,5 +1,6 @@ package com.fireball1725.graves.client.events; +import com.fireball1725.graves.client.render.TileEntityHeadStoneRenderer; import com.fireball1725.graves.common.block.BlockGraveSlave; import com.fireball1725.graves.common.block.BlockGraveStone; import com.fireball1725.graves.common.tileentity.TileEntityGraveSlave; @@ -34,7 +35,6 @@ public class RenderEvents implements IResourceManagerReloadListener { - private final TextureAtlasSprite[] destroyBlockIcons = new TextureAtlasSprite[10]; @SubscribeEvent @@ -143,11 +143,13 @@ public void drawBlockDamageTexture(Tessellator tessellatorIn, VertexBuffer world @Override public void onResourceManagerReload(IResourceManager resourceManager) { - TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks(); + TextureMap textureMap = Minecraft.getMinecraft().getTextureMapBlocks(); for (int i = 0; i < this.destroyBlockIcons.length; ++i) { - this.destroyBlockIcons[i] = texturemap.getAtlasSprite("minecraft:blocks/destroy_stage_" + i); + this.destroyBlockIcons[i] = textureMap.getAtlasSprite("minecraft:blocks/destroy_stage_" + i); } + + TileEntityHeadStoneRenderer.bakeModel(textureMap); } } diff --git a/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java b/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java index 949abab..4d234c7 100644 --- a/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java +++ b/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java @@ -1,21 +1,59 @@ package com.fireball1725.graves.client.render; import com.fireball1725.graves.common.block.BlockHeadStone; -import com.fireball1725.graves.common.helpers.OpenGLHelper; +import com.fireball1725.graves.common.reference.ModInfo; import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; +import com.google.common.base.Function; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; -import org.lwjgl.opengl.GL11; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.model.obj.OBJLoader; +import net.minecraftforge.client.model.obj.OBJModel; import java.awt.*; public class TileEntityHeadStoneRenderer extends TileEntityBaseRenderer { public static TileEntityHeadStoneRenderer _instance = null; + public static IBakedModel bakedModel;// = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(Blocks.BLOCK_GRAVE_HEADSTONE.block.getDefaultState()); - public static TileEntityHeadStoneRenderer instance() { - if (_instance == null) { - _instance = new TileEntityHeadStoneRenderer(); + public TileEntityHeadStoneRenderer() + { + bakeModel(mc.getTextureMapBlocks()); + } + + public static void bakeModel(final TextureMap textureMap) + { + try + { + OBJModel model = (OBJModel) OBJLoader.INSTANCE.loadModel(new ResourceLocation(ModInfo.MOD_ID, "models/block/headstone.obj")); + bakedModel = model.bake(model.getDefaultState(), DefaultVertexFormats.BLOCK, new Function() + { + @Override + public TextureAtlasSprite apply(ResourceLocation input) + { + return textureMap.getAtlasSprite(input.toString()); + } + }); + } + catch(Exception e) + { + e.printStackTrace(); + } + } + + public static TileEntityHeadStoneRenderer instance() + { + + if(_instance == null) + { + _instance = new TileEntityHeadStoneRenderer(); } return _instance; } @@ -23,55 +61,76 @@ public static TileEntityHeadStoneRenderer instance() { @Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage) { + GlStateManager.pushMatrix(); + GlStateManager.translate(x + .5, y + .5, z + .5); if(te instanceof TileEntityHeadStone) { - if(te.getWorld().getBlockState(te.getPos()).getBlock() instanceof BlockHeadStone) + TileEntityHeadStone headStone = (TileEntityHeadStone) te; + IBlockState state = headStone.getWorld().getBlockState(te.getPos()); + EnumFacing facing = state.getValue(BlockHeadStone.FACING); + GlStateManager.pushMatrix(); + int rot = facing.getHorizontalIndex(); + if(facing == EnumFacing.WEST || facing == EnumFacing.EAST) { - this.saveBoundTexture(); - int[][] savedGLState = OpenGLHelper.modifyGLState(new int[] {GL11.GL_BLEND, GL11.GL_LIGHTING}, null); - TileEntityHeadStone headStone = (TileEntityHeadStone) te; - renderTextOnHeadstone(headStone.getCustomName().split("\\\\n"), headStone.getWorld().getBlockState(te.getPos()).getValue(BlockHeadStone.FACING), x, y, z, 0, 0, .0365f, 1f / 200f, Color.RED.hashCode(), true); - - OpenGLHelper.restoreGLState(savedGLState); + GlStateManager.rotate(180, 0, 1, 0); + } + GlStateManager.rotate(90 * rot, 0, 1, 0); + if(headStone.getDisplayStack() != null) + { + ItemStack stack = headStone.getDisplayStack(); + if(ModInfo.chiselsAndBits) + { + IBakedModel model = mc.getRenderItem().getItemModelWithOverrides(stack, null, null); + GlStateManager.pushMatrix(); + GlStateManager.enableLighting(); + GlStateManager.enableRescaleNormal(); + GlStateManager.enableAlpha(); + GlStateManager.alphaFunc(516, 0.1F); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + bindTexture(TextureMap.locationBlocksTexture); + mc.getRenderItem().renderItem(stack, model); + GlStateManager.disableAlpha(); + GlStateManager.disableRescaleNormal(); + GlStateManager.disableLighting(); + GlStateManager.popMatrix(); + } + } + else + { + { + GlStateManager.pushMatrix(); + GlStateManager.enableLighting(); + GlStateManager.enableRescaleNormal(); + GlStateManager.enableAlpha(); + GlStateManager.alphaFunc(516, 0.1F); + GlStateManager.enableBlend(); + GlStateManager.translate(.5, -.5, .5); + GlStateManager.rotate(180, 0, 1, 0); + bindTexture(TextureMap.locationBlocksTexture); + mc.getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightnessColor(bakedModel, 1, 1, 1, 1); + GlStateManager.disableAlpha(); + GlStateManager.disableRescaleNormal(); + GlStateManager.disableLighting(); + GlStateManager.popMatrix(); + } + GlStateManager.pushMatrix(); + GlStateManager.rotate(180, 0, 1, 0); + GlStateManager.rotate(180, 0, 0, 1); + GlStateManager.translate(0, -5 * 0.0625, -7.5 * 0.0625); + GlStateManager.scale(0.00625, 0.00625, 1); + renderTextOnHeadstone(headStone.getCustomName().split("\\\\n"), Color.RED.hashCode(), true); + GlStateManager.popMatrix(); } + GlStateManager.popMatrix(); } - } - - public void renderTextOnHeadstone(String[] text, EnumFacing orientation, double x, double y, double z, float xOffset, float yOffset, float zOffset, float scale, int color, boolean shadow) { - int rotationIndex = 0; - switch (orientation) { - case NORTH: - xOffset -= 1; - zOffset += 1; - rotationIndex = 2; - break; - case SOUTH: - rotationIndex = 0; - break; - case WEST: - zOffset += 1; - rotationIndex = 1; - break; - case EAST: - xOffset -= 1; - rotationIndex = 3; - break; - } - - GlStateManager.pushMatrix(); - GlStateManager.translate(x, y, z); + GlStateManager.popMatrix(); + } - GlStateManager.pushMatrix(); - GlStateManager.rotate(180f, 1f, 0f, 0f); - GlStateManager.rotate(90f * rotationIndex, 0f, 1f, 0f); - - GlStateManager.pushMatrix(); - GlStateManager.translate(.5 + xOffset, -.815f + yOffset, zOffset - 1); - - GlStateManager.pushMatrix(); - GlStateManager.scale(scale, scale, scale); + public void renderTextOnHeadstone(String[] text, int color, boolean shadow) + { - GlStateManager.pushMatrix(); int i = 0; for (String s : text) { int stringWidth = mc.fontRendererObj.getStringWidth(s); @@ -80,7 +139,9 @@ public void renderTextOnHeadstone(String[] text, EnumFacing orientation, double } int xCenter = stringWidth / 2; int yCenter = mc.fontRendererObj.FONT_HEIGHT / 2; - if (shadow) { + if(i == 7) + { GlStateManager.translate(0, 8, -.01); } + if (shadow) { mc.fontRendererObj.drawString(s, -xCenter - 1, -yCenter + 1 + (renderFont.FONT_HEIGHT * i + 2), (color & 16579836) >> 2 | color & -16777216); GlStateManager.translate(0f, 0f, -.001f); } @@ -88,14 +149,5 @@ public void renderTextOnHeadstone(String[] text, EnumFacing orientation, double i++; } - GlStateManager.popMatrix(); - - GlStateManager.popMatrix(); - - GlStateManager.popMatrix(); - - GlStateManager.popMatrix(); - - GlStateManager.popMatrix(); } } diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java index bf3642f..0fcd346 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java @@ -2,11 +2,10 @@ import com.fireball1725.graves.Graves; import com.fireball1725.graves.chiselsandbits.GraveCapability; -import com.fireball1725.graves.common.reference.ModInfo; import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; import com.fireball1725.graves.common.util.TileTools; -import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; @@ -14,7 +13,6 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; @@ -30,11 +28,12 @@ public class BlockHeadStone extends BlockBase { public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + public static final PropertyBool RENDER = PropertyBool.create("render"); protected BlockHeadStone() { super(Material.rock); - this.setDefaultState(blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); - this.setHardness(1.5F); + this.setDefaultState(blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(RENDER, true)); + this.setHardness(1.5F); this.setResistance(10.0F); this.setHarvestLevel("pickaxe", 0); this.setTileEntity(TileEntityHeadStone.class); @@ -43,7 +42,7 @@ protected BlockHeadStone() { @Override public EnumBlockRenderType getRenderType(IBlockState state) { - return EnumBlockRenderType.MODEL; + return EnumBlockRenderType.INVISIBLE; } @Override @@ -78,29 +77,27 @@ public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBloc @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { - if(playerIn.isSneaking() && playerIn.capabilities.isCreativeMode) + if(playerIn.capabilities.isCreativeMode) { playerIn.openGui(Graves.instance, 0, worldIn, pos.getX(), pos.getY(), pos.getZ()); } - else if(ModInfo.chiselsAndBits) + if(worldIn.isRemote) + { return true; } + + final GraveCapability.IGraveCapability grave = playerIn.getCapability(GraveCapability.GRAVE_CAP, null); + if(grave != null) { - if(heldItem.hasTagCompound() && heldItem.getTagCompound().hasKey("BlockEntityTag")) // Chisel and Bits Support + grave.setGraveItemStack(heldItem); + TileEntity te = worldIn.getTileEntity(pos); + if(te instanceof TileEntityHeadStone) { - final GraveCapability.IGraveCapability grave = playerIn.getCapability(GraveCapability.GRAVE_CAP, null); - if(grave != null) - { - NBTTagCompound tag = heldItem.getTagCompound().getCompoundTag("BlockEntityTag"); - Block block = Block.getBlockFromItem(heldItem.getItem()); - grave.setGraveBlock(block); - grave.setGraveMeta(heldItem.getMetadata()); - grave.setGraveTag(tag); - if(block != null) - { - worldIn.setBlockState(pos, block.getDefaultState()); - worldIn.setTileEntity(pos, TileEntity.createTileEntity(null, tag)); - } - } + ((TileEntityHeadStone) te).setDisplayStack(heldItem); + te.markDirty(); + worldIn.notifyBlockUpdate(pos, state, ((TileEntityHeadStone) te).getBlockState(), 3); + worldIn.notifyBlockOfStateChange(pos, state.getBlock()); + worldIn.markChunkDirty(pos, te); } + return true; } return super.onBlockActivated(worldIn, pos, state, playerIn, hand, heldItem, side, hitX, hitY, hitZ); } @@ -108,7 +105,7 @@ else if(ModInfo.chiselsAndBits) @Override protected BlockStateContainer createBlockState() { - return new BlockStateContainer(this, FACING); + return new BlockStateContainer(this, FACING, RENDER); } @Override @@ -134,6 +131,18 @@ public IBlockState getStateFromMeta(int meta) { return getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)); } + @Override + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + { + TileEntity te = worldIn.getTileEntity(pos); + if(te instanceof TileEntityHeadStone) + { + TileEntityHeadStone headStone = (TileEntityHeadStone) te; + return state.withProperty(RENDER, headStone.getDisplayStack() == null); + } + return state; + } + @Override public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB mask, List list, Entity p_185477_6_) { diff --git a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java index bb98383..b052bee 100644 --- a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java +++ b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java @@ -7,21 +7,18 @@ import com.fireball1725.graves.common.block.Blocks; import com.fireball1725.graves.common.entity.EntityPlayerZombie; import com.fireball1725.graves.common.helpers.LogHelper; -import com.fireball1725.graves.common.reference.ModInfo; import com.fireball1725.graves.common.structure.ReplaceableBlock; import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; import com.fireball1725.graves.common.util.TileTools; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.GameRules; @@ -156,31 +153,7 @@ public void onPlayerDrops(PlayerDropsEvent event) { BlockPos pos = playerPos.offset(facing.getOpposite()); - boolean success = false; - if(ModInfo.chiselsAndBits) - { - final GraveCapability.IGraveCapability graveCap = player.getCapability(GraveCapability.GRAVE_CAP, null); - if(graveCap != null) - { - System.out.println("test0"); - NBTTagCompound tag = graveCap.getGraveTag(); - graveCap.setGraveTag(tag); - Block block = graveCap.getGraveBlock(); - if(block != null) - { - System.out.println("test1 - " + block.getUnlocalizedName()); - world.setBlockState(pos, block.getStateFromMeta(graveCap.getGraveMeta())); - if(graveCap.hasTag()) - { - System.out.println("test2"); - world.setTileEntity(pos, TileEntity.createTileEntity(null, tag)); - } - success = true; - } - } - } - if(!success) - { placeDefaultGrave(world, pos, facing, player.getDisplayName().getFormattedText()); } + placeHeadStone(world, pos, facing, player, player.getDisplayName().getFormattedText()); sendTomTomPos(Graves.instance, player, playerPos, "Grave this way!"); } @@ -188,13 +161,18 @@ public void onPlayerDrops(PlayerDropsEvent event) { event.getDrops().clear(); } - private void placeDefaultGrave(World world, BlockPos pos, EnumFacing facing, String text) + private void placeHeadStone(World world, BlockPos pos, EnumFacing facing, EntityPlayer player, String text) { world.setBlockState(pos, Blocks.BLOCK_GRAVE_HEADSTONE.block.getDefaultState().withProperty(BlockHeadStone.FACING, facing)); TileEntityHeadStone tileEntityHeadStone = TileTools.getTileEntity(world, pos, TileEntityHeadStone.class); if(tileEntityHeadStone != null) { tileEntityHeadStone.setCustomName(text); + GraveCapability.IGraveCapability grave = player.getCapability(GraveCapability.GRAVE_CAP, null); + if(grave != null) + { + tileEntityHeadStone.setDisplayStack(grave.getGraveItemStack()); + } } } } diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityBase.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityBase.java index 91d0ee1..bda1c8e 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityBase.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityBase.java @@ -62,13 +62,6 @@ public void markForUpdate() { } } - public void onChunkLoad() { - if (this.isInvalid()) - this.validate(); - - markForUpdate(); - } - @Override public void onChunkUnload() { if (!this.isInvalid()) diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityHeadStone.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityHeadStone.java index a083a27..2a470ab 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityHeadStone.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityHeadStone.java @@ -1,12 +1,65 @@ package com.fireball1725.graves.common.tileentity; -public class TileEntityHeadStone extends TileEntityBase { - public TileEntityHeadStone() { - super(); +import com.fireball1725.graves.common.helpers.LogHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.SPacketUpdateTileEntity; + +public class TileEntityHeadStone extends TileEntityBase +{ + private ItemStack displayStack = null; + + public TileEntityHeadStone() + { + super(); } - @Override - public String getCustomName() { + @Override + public Packet getDescriptionPacket() + { + return new SPacketUpdateTileEntity(getPos(), getBlockMetadata(), serializeNBT()); + } + + @Override + public void onDataPacket(NetworkManager networkManager, SPacketUpdateTileEntity sPacketUpdateTileEntity) + { + deserializeNBT(sPacketUpdateTileEntity.getNbtCompound()); + } + + @Override + public String getCustomName() { return hasCustomName() ? this.customName : ""; } + + public ItemStack getDisplayStack() + { + return displayStack; + } + + public void setDisplayStack(ItemStack displayStack) + { + this.displayStack = displayStack; + } + + @Override + public void writeToNBT(NBTTagCompound nbtTagCompound) + { + super.writeToNBT(nbtTagCompound); + if(displayStack != null) + { nbtTagCompound.setTag("displayStack", displayStack.serializeNBT()); } + } + + @Override + public void readFromNBT(NBTTagCompound nbtTagCompound) + { + super.readFromNBT(nbtTagCompound); + displayStack = null; + if(nbtTagCompound.hasKey("displayStack")) + { + LogHelper.info("Loading stack!"); + displayStack = ItemStack.loadItemStackFromNBT(nbtTagCompound.getCompoundTag("displayStack")); + } + } } diff --git a/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java b/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java index 216d9e2..74a19c4 100644 --- a/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java +++ b/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java @@ -1,10 +1,10 @@ package com.fireball1725.graves.proxy; -import com.fireball1725.graves.common.block.Blocks; import com.fireball1725.graves.client.events.RenderEvents; import com.fireball1725.graves.client.render.TileEntityHeadStoneRenderer; import com.fireball1725.graves.client.render.entity.EntityRenderers; import com.fireball1725.graves.client.render.entity.RenderPlayerZombie; +import com.fireball1725.graves.common.block.Blocks; import com.fireball1725.graves.common.entity.EntityPlayerZombie; import com.fireball1725.graves.common.reference.ModInfo; import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; @@ -46,6 +46,7 @@ public void registerRenderers() { ClientRegistry.bindTileEntitySpecialRenderer(TileEntityHeadStone.class, TileEntityHeadStoneRenderer.instance()); RenderEvents renderEvents = new RenderEvents(); MinecraftForge.EVENT_BUS.register(renderEvents); + ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(renderEvents); } } diff --git a/src/main/resources/assets/graves/blockstates/headstone.json b/src/main/resources/assets/graves/blockstates/headstone.json index 18e81bf..80314e9 100644 --- a/src/main/resources/assets/graves/blockstates/headstone.json +++ b/src/main/resources/assets/graves/blockstates/headstone.json @@ -25,6 +25,10 @@ } } ], + "render": { + "true": {}, + "false": {} + }, "facing": { "north": {}, "south": { From 8a63fe4672dc58ab4048bfce0a0d2bcce5e493e2 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Thu, 30 Jun 2016 15:42:46 -0700 Subject: [PATCH 24/47] Graves now Support Chisels & Bits as well as all blocks. --- .../java/com/fireball1725/graves/Graves.java | 11 +- .../chiselsandbits/GraveCapability.java | 135 +++++++++++ .../graves/client/events/RenderEvents.java | 7 +- .../render/TileEntityHeadStoneRenderer.java | 209 +++++++++++------- .../graves/common/block/BlockHeadStone.java | 113 ++++++---- .../common/event/EventDeathHandler.java | 76 ++++--- .../graves/common/reference/ModInfo.java | 2 + .../tileentity/TileEntityHeadStone.java | 72 +++++- .../assets/graves/blockstates/headstone.json | 4 + 9 files changed, 472 insertions(+), 157 deletions(-) create mode 100644 src/main/java/com/fireball1725/graves/chiselsandbits/GraveCapability.java diff --git a/src/main/java/com/fireball1725/graves/Graves.java b/src/main/java/com/fireball1725/graves/Graves.java index 04b3bd2..99b9eb5 100644 --- a/src/main/java/com/fireball1725/graves/Graves.java +++ b/src/main/java/com/fireball1725/graves/Graves.java @@ -1,12 +1,14 @@ package com.fireball1725.graves; +import com.fireball1725.graves.chiselsandbits.GraveCapability; import com.fireball1725.graves.common.helpers.LogHelper; import com.fireball1725.graves.common.network.PacketHandler; -import com.fireball1725.graves.proxy.IProxy; import com.fireball1725.graves.common.reference.ModInfo; import com.fireball1725.graves.common.util.GuiHandler; +import com.fireball1725.graves.proxy.IProxy; import com.google.common.base.Stopwatch; import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; @@ -28,7 +30,12 @@ public class Graves { @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { - final Stopwatch stopWatch = Stopwatch.createStarted(); + boolean load = ModInfo.chiselsAndBits = Loader.isModLoaded("chiselsandbits"); + if(load) + { + GraveCapability.register(); + } + final Stopwatch stopWatch = Stopwatch.createStarted(); LogHelper.info("Pre Initialization ( started )"); // Setup Configuration diff --git a/src/main/java/com/fireball1725/graves/chiselsandbits/GraveCapability.java b/src/main/java/com/fireball1725/graves/chiselsandbits/GraveCapability.java new file mode 100644 index 0000000..00d1bb8 --- /dev/null +++ b/src/main/java/com/fireball1725/graves/chiselsandbits/GraveCapability.java @@ -0,0 +1,135 @@ +package com.fireball1725.graves.chiselsandbits; + +import com.fireball1725.graves.common.reference.ModInfo; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.Capability.IStorage; +import net.minecraftforge.common.capabilities.CapabilityInject; +import net.minecraftforge.common.capabilities.CapabilityManager; +import net.minecraftforge.common.capabilities.ICapabilitySerializable; +import net.minecraftforge.event.AttachCapabilitiesEvent; +import net.minecraftforge.event.entity.player.PlayerEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class GraveCapability +{ + @CapabilityInject(IGraveCapability.class) + public static final Capability GRAVE_CAP = null; + + public static void register() + { + CapabilityManager.INSTANCE.register(IGraveCapability.class, new Storage(), DefaultImpl.class); + MinecraftForge.EVENT_BUS.register(new GraveCapability()); + } + + // Handles playerData props from being wiped on death + @SubscribeEvent + public void cloneEvent(PlayerEvent.Clone evt) + { + NBTTagCompound grave = evt.getOriginal().getCapability(GRAVE_CAP, null).serializeNBT(); + evt.getEntityPlayer().getCapability(GRAVE_CAP, null).deserializeNBT(grave); + } + + @SubscribeEvent + public void onPlayerLoad(AttachCapabilitiesEvent.Entity event) + { + class Provider implements ICapabilitySerializable + { + private IGraveCapability inst = GRAVE_CAP.getDefaultInstance(); + + @Override + public boolean hasCapability(Capability capability, EnumFacing enumFacing) + { + return capability == GRAVE_CAP; + } + + @Override + public T getCapability(Capability capability, EnumFacing enumFacing) + { + return capability == GRAVE_CAP ? GRAVE_CAP.cast(inst) : null; + } + + @Override + public NBTBase serializeNBT() + { + return GRAVE_CAP.getStorage().writeNBT(GRAVE_CAP, inst, null); + } + + @Override + public void deserializeNBT(NBTBase tag) + { + GRAVE_CAP.getStorage().readNBT(GRAVE_CAP, inst, null, tag); + } + } + + if(event.getEntity() instanceof EntityPlayer) + { event.addCapability(new ResourceLocation(ModInfo.MOD_ID, "GraveCap"), new Provider()); } + } + + public interface IGraveCapability + { + ItemStack getGraveItemStack(); + + void setGraveItemStack(ItemStack itemStack); + + NBTTagCompound serializeNBT(); + + void deserializeNBT(NBTTagCompound tag); + } + + + + public static class Storage implements IStorage + { + @Override + public NBTBase writeNBT(Capability capability, IGraveCapability instance, EnumFacing side) + { + return instance.serializeNBT(); + } + + @Override + public void readNBT(Capability capability, IGraveCapability instance, EnumFacing side, NBTBase nbt) + { + instance.deserializeNBT((NBTTagCompound) nbt); + } + } + + + + public static class DefaultImpl implements IGraveCapability + { + ItemStack stack; + + @Override + public ItemStack getGraveItemStack() + { + return stack; + } + + @Override + public void setGraveItemStack(ItemStack stack) + { + this.stack = stack; + } + + @Override + public NBTTagCompound serializeNBT() + { + return stack == null ? new NBTTagCompound() : stack.serializeNBT(); + } + + @Override + public void deserializeNBT(NBTTagCompound tag) + { + if(tag.hasNoTags()) + { return; } + setGraveItemStack(ItemStack.loadItemStackFromNBT(tag)); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java b/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java index 132bb00..cff3bbb 100644 --- a/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java +++ b/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java @@ -1,5 +1,6 @@ package com.fireball1725.graves.client.events; +import com.fireball1725.graves.client.render.TileEntityHeadStoneRenderer; import com.fireball1725.graves.common.block.BlockGraveSlave; import com.fireball1725.graves.common.block.BlockGraveStone; import com.fireball1725.graves.common.tileentity.TileEntityGraveSlave; @@ -143,11 +144,13 @@ public void drawBlockDamageTexture(Tessellator tessellatorIn, VertexBuffer world @Override public void onResourceManagerReload(IResourceManager resourceManager) { - TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks(); + TextureMap textureMap = Minecraft.getMinecraft().getTextureMapBlocks(); for (int i = 0; i < this.destroyBlockIcons.length; ++i) { - this.destroyBlockIcons[i] = texturemap.getAtlasSprite("minecraft:blocks/destroy_stage_" + i); + this.destroyBlockIcons[i] = textureMap.getAtlasSprite("minecraft:blocks/destroy_stage_" + i); } + + TileEntityHeadStoneRenderer.bakeModel(textureMap); } } diff --git a/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java b/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java index 949abab..c825519 100644 --- a/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java +++ b/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java @@ -1,101 +1,156 @@ package com.fireball1725.graves.client.render; import com.fireball1725.graves.common.block.BlockHeadStone; -import com.fireball1725.graves.common.helpers.OpenGLHelper; +import com.fireball1725.graves.common.reference.ModInfo; import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; +import com.google.common.base.Function; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; -import org.lwjgl.opengl.GL11; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.model.obj.OBJLoader; +import net.minecraftforge.client.model.obj.OBJModel; import java.awt.*; public class TileEntityHeadStoneRenderer extends TileEntityBaseRenderer { - public static TileEntityHeadStoneRenderer _instance = null; + public static TileEntityHeadStoneRenderer _instance = null; + public static IBakedModel bakedModel;// = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(Blocks.BLOCK_GRAVE_HEADSTONE.block.getDefaultState()); - public static TileEntityHeadStoneRenderer instance() { - if (_instance == null) { - _instance = new TileEntityHeadStoneRenderer(); - } - return _instance; - } + public TileEntityHeadStoneRenderer() + { + bakeModel(mc.getTextureMapBlocks()); + } - @Override - public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage) + public static void bakeModel(final TextureMap textureMap) { - if(te instanceof TileEntityHeadStone) + try { - if(te.getWorld().getBlockState(te.getPos()).getBlock() instanceof BlockHeadStone) + OBJModel model = (OBJModel) OBJLoader.INSTANCE.loadModel(new ResourceLocation(ModInfo.MOD_ID, "models/block/headstone.obj")); + bakedModel = model.bake(model.getDefaultState(), DefaultVertexFormats.BLOCK, new Function() { - this.saveBoundTexture(); - int[][] savedGLState = OpenGLHelper.modifyGLState(new int[] {GL11.GL_BLEND, GL11.GL_LIGHTING}, null); - TileEntityHeadStone headStone = (TileEntityHeadStone) te; - renderTextOnHeadstone(headStone.getCustomName().split("\\\\n"), headStone.getWorld().getBlockState(te.getPos()).getValue(BlockHeadStone.FACING), x, y, z, 0, 0, .0365f, 1f / 200f, Color.RED.hashCode(), true); - - OpenGLHelper.restoreGLState(savedGLState); - } + @Override + public TextureAtlasSprite apply(ResourceLocation input) + { + return textureMap.getAtlasSprite(input.toString()); + } + }); } - } - - public void renderTextOnHeadstone(String[] text, EnumFacing orientation, double x, double y, double z, float xOffset, float yOffset, float zOffset, float scale, int color, boolean shadow) { - int rotationIndex = 0; - switch (orientation) { - case NORTH: - xOffset -= 1; - zOffset += 1; - rotationIndex = 2; - break; - case SOUTH: - rotationIndex = 0; - break; - case WEST: - zOffset += 1; - rotationIndex = 1; - break; - case EAST: - xOffset -= 1; - rotationIndex = 3; - break; - } - - GlStateManager.pushMatrix(); - GlStateManager.translate(x, y, z); - - GlStateManager.pushMatrix(); - GlStateManager.rotate(180f, 1f, 0f, 0f); - GlStateManager.rotate(90f * rotationIndex, 0f, 1f, 0f); - - GlStateManager.pushMatrix(); - GlStateManager.translate(.5 + xOffset, -.815f + yOffset, zOffset - 1); - - GlStateManager.pushMatrix(); - GlStateManager.scale(scale, scale, scale); + catch(Exception e) + { + e.printStackTrace(); + } + } - GlStateManager.pushMatrix(); - int i = 0; - for (String s : text) { - int stringWidth = mc.fontRendererObj.getStringWidth(s); - if (stringWidth == 0) { - stringWidth = 1; - } - int xCenter = stringWidth / 2; - int yCenter = mc.fontRendererObj.FONT_HEIGHT / 2; - if (shadow) { - mc.fontRendererObj.drawString(s, -xCenter - 1, -yCenter + 1 + (renderFont.FONT_HEIGHT * i + 2), (color & 16579836) >> 2 | color & -16777216); - GlStateManager.translate(0f, 0f, -.001f); - } - mc.fontRendererObj.drawString(s, -xCenter, -yCenter + (renderFont.FONT_HEIGHT * i + 2), color); + public static TileEntityHeadStoneRenderer instance() + { - i++; - } - GlStateManager.popMatrix(); + if(_instance == null) + { + _instance = new TileEntityHeadStoneRenderer(); + } + return _instance; + } - GlStateManager.popMatrix(); + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage) + { + GlStateManager.pushMatrix(); + GlStateManager.translate(x + .5, y + .5, z + .5); + if(te instanceof TileEntityHeadStone) + { + TileEntityHeadStone headStone = (TileEntityHeadStone) te; + IBlockState state = headStone.getWorld().getBlockState(te.getPos()); + EnumFacing facing = state.getValue(BlockHeadStone.FACING); + GlStateManager.pushMatrix(); + int rot = facing.getHorizontalIndex(); + if(facing == EnumFacing.WEST || facing == EnumFacing.EAST) + { + GlStateManager.rotate(180, 0, 1, 0); + } + GlStateManager.rotate(90 * rot, 0, 1, 0); + if(headStone.getDisplayStack() != null) + { + ItemStack stack = headStone.getDisplayStack(); + if(ModInfo.chiselsAndBits) + { + IBakedModel model = mc.getRenderItem().getItemModelWithOverrides(stack, null, null); + GlStateManager.pushMatrix(); + GlStateManager.enableLighting(); + GlStateManager.enableRescaleNormal(); + GlStateManager.enableAlpha(); + GlStateManager.alphaFunc(516, 0.1F); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + mc.getRenderItem().renderItem(stack, model); + GlStateManager.disableAlpha(); + GlStateManager.disableRescaleNormal(); + GlStateManager.disableLighting(); + GlStateManager.popMatrix(); + } + } + else + { + { + GlStateManager.pushMatrix(); + GlStateManager.enableLighting(); + GlStateManager.enableRescaleNormal(); + GlStateManager.enableAlpha(); + GlStateManager.alphaFunc(516, 0.1F); + GlStateManager.enableBlend(); + GlStateManager.translate(.5, -.5, .5); + GlStateManager.rotate(180, 0, 1, 0); + bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + mc.getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightnessColor(bakedModel, 1, 1, 1, 1); + GlStateManager.disableAlpha(); + GlStateManager.disableRescaleNormal(); + GlStateManager.disableLighting(); + GlStateManager.popMatrix(); + } + GlStateManager.pushMatrix(); + GlStateManager.rotate(180, 0, 1, 0); + GlStateManager.rotate(180, 0, 0, 1); + GlStateManager.translate(0, -5 * 0.0625, -7.5 * 0.0625); + GlStateManager.scale(0.00625, 0.00625, 1); + renderTextOnHeadstone(headStone.getCustomName().split("\\\\n"), Color.RED.hashCode(), true); + GlStateManager.popMatrix(); + } + GlStateManager.popMatrix(); + } + GlStateManager.popMatrix(); + } - GlStateManager.popMatrix(); + public void renderTextOnHeadstone(String[] text, int color, boolean shadow) + { - GlStateManager.popMatrix(); + int i = 0; + for(String s : text) + { + int stringWidth = mc.fontRendererObj.getStringWidth(s); + if(stringWidth == 0) + { + stringWidth = 1; + } + int xCenter = stringWidth / 2; + int yCenter = mc.fontRendererObj.FONT_HEIGHT / 2; + if(i == 7) + { GlStateManager.translate(0, 8, -.01); } + if(shadow) + { + mc.fontRendererObj.drawString(s, -xCenter - 1, -yCenter + 1 + (renderFont.FONT_HEIGHT * i + 2), (color & 16579836) >> 2 | color & -16777216); + GlStateManager.translate(0f, 0f, -.001f); + } + mc.fontRendererObj.drawString(s, -xCenter, -yCenter + (renderFont.FONT_HEIGHT * i + 2), color); - GlStateManager.popMatrix(); - } + i++; + } + } } diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java index e6e59ee..5d8bd7a 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java @@ -1,10 +1,11 @@ package com.fireball1725.graves.common.block; import com.fireball1725.graves.Graves; +import com.fireball1725.graves.chiselsandbits.GraveCapability; import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; import com.fireball1725.graves.common.util.TileTools; -import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; @@ -26,22 +27,23 @@ import java.util.List; public class BlockHeadStone extends BlockBase { - public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + public static final PropertyBool RENDER = PropertyBool.create("render"); - protected BlockHeadStone() { + protected BlockHeadStone() + { super(Material.ROCK); - this.setDefaultState(blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); - this.setSoundType(SoundType.STONE); + this.setDefaultState(blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(RENDER, true)); this.setHardness(1.5F); - this.setResistance(10.0F); - this.setHarvestLevel("pickaxe", 0); - this.setTileEntity(TileEntityHeadStone.class); - } + this.setResistance(10.0F); + this.setHarvestLevel("pickaxe", 0); + this.setTileEntity(TileEntityHeadStone.class); + } - @Override + @Override public EnumBlockRenderType getRenderType(IBlockState state) { - return EnumBlockRenderType.MODEL; + return EnumBlockRenderType.INVISIBLE; } @Override @@ -50,21 +52,22 @@ public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, Ent return willHarvest || super.removedByPlayer(state, world, pos, player, false); } - @Override - public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { - TileEntityHeadStone headStone = TileTools.getTileEntity(world, pos, TileEntityHeadStone.class); + @Override + public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { + TileEntityHeadStone headStone = TileTools.getTileEntity(world, pos, TileEntityHeadStone.class); if(headStone != null && !headStone.getCustomName().isEmpty()) { final ItemStack itemStack = new ItemStack(this); itemStack.setStackDisplayName(headStone.getCustomName()); - ArrayList drops = new ArrayList(); - drops.add(itemStack); + ArrayList drops = new ArrayList(); + drops.add(itemStack); - return drops; - } - return super.getDrops(world, pos, state, fortune); - } + return drops; + } + return super.getDrops(world, pos, state, fortune); + } @Override public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te, ItemStack stack) @@ -80,37 +83,68 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, { playerIn.openGui(Graves.instance, 0, worldIn, pos.getX(), pos.getY(), pos.getZ()); } + if(worldIn.isRemote) + { return true; } + + final GraveCapability.IGraveCapability grave = playerIn.getCapability(GraveCapability.GRAVE_CAP, null); + if(grave != null) + { + grave.setGraveItemStack(heldItem); + TileEntity te = worldIn.getTileEntity(pos); + if(te instanceof TileEntityHeadStone) + { + ((TileEntityHeadStone) te).setDisplayStack(heldItem); + te.markDirty(); + worldIn.notifyBlockUpdate(pos, state, ((TileEntityHeadStone) te).getBlockState(), 3); + worldIn.notifyBlockOfStateChange(pos, state.getBlock()); + worldIn.markChunkDirty(pos, te); + } + return true; + } return super.onBlockActivated(worldIn, pos, state, playerIn, hand, heldItem, side, hitX, hitY, hitZ); } - @Override + @Override protected BlockStateContainer createBlockState() { - return new BlockStateContainer(this, FACING); + return new BlockStateContainer(this, FACING, RENDER); } - @Override + @Override public boolean isOpaqueCube(IBlockState state) { return false; } - @Override + @Override public boolean isFullBlock(IBlockState state) { return false; } - @Override + @Override public boolean isFullCube(IBlockState state) { return false; } - @Override - public IBlockState getStateFromMeta(int meta) { - return getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)); - } + @Override + public IBlockState getStateFromMeta(int meta) + { + return getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)); + } + + @Override + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + { + TileEntity te = worldIn.getTileEntity(pos); + if(te instanceof TileEntityHeadStone) + { + TileEntityHeadStone headStone = (TileEntityHeadStone) te; + return state.withProperty(RENDER, headStone.getDisplayStack() == null); + } + return state; + } @Override public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB mask, List list, Entity p_185477_6_) @@ -131,7 +165,7 @@ public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(.7f, 0f, .1f, 1f, .95f, .9f)); break; } - } + } @Override public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) @@ -158,16 +192,17 @@ public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, Bloc public int getMetaFromState(IBlockState state) { return state.getValue(FACING).getHorizontalIndex(); - } - + } - @Override - public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { - return getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()); - } + @Override + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + return getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()); + } - @Override - public void onBlockExploded(World world, BlockPos pos, Explosion explosion) { + @Override + public void onBlockExploded(World world, BlockPos pos, Explosion explosion) + { - } + } } diff --git a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java index 2e1af68..7353de1 100644 --- a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java +++ b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java @@ -1,6 +1,7 @@ package com.fireball1725.graves.common.event; import com.fireball1725.graves.Graves; +import com.fireball1725.graves.chiselsandbits.GraveCapability; import com.fireball1725.graves.common.block.BlockGraveStone; import com.fireball1725.graves.common.block.BlockHeadStone; import com.fireball1725.graves.common.block.Blocks; @@ -64,24 +65,27 @@ public void onLivingDeath(LivingDeathEvent event) } } - @SubscribeEvent(priority = EventPriority.LOW, receiveCanceled = true) - public void onPlayerDrops(PlayerDropsEvent event) { + @SubscribeEvent(priority = EventPriority.LOW, receiveCanceled = true) + public void onPlayerDrops(PlayerDropsEvent event) + { World world = event.getEntityPlayer().worldObj; - if (world.isRemote) - return; + if(world.isRemote) + { return; } - if (event.isCanceled()) { - LogHelper.warn(">>>"); - return; - } + if(event.isCanceled()) + { + LogHelper.warn(">>>"); + return; + } - // Check to see if the gamerule keep inventory is enabled - final GameRules gameRules = world.getGameRules(); - if (gameRules.hasRule("keepInventory")) { - if (gameRules.getBoolean("keepInventory")) - return; - } + // Check to see if the gamerule keep inventory is enabled + final GameRules gameRules = world.getGameRules(); + if(gameRules.hasRule("keepInventory")) + { + if(gameRules.getBoolean("keepInventory")) + { return; } + } EntityPlayer player = event.getEntityPlayer(); List itemsList = Lists.newArrayList(); @@ -90,11 +94,11 @@ public void onPlayerDrops(PlayerDropsEvent event) { itemsList.add(entityItem.getEntityItem()); } - // If there are no items, then cancel spawning a grave - if (itemsList.isEmpty()) - return; + // If there are no items, then cancel spawning a grave + if(itemsList.isEmpty()) + { return; } - boolean spawnGrave = true; + boolean spawnGrave = true; if(event.getEntityLiving() instanceof EntityPlayer) { @@ -115,9 +119,9 @@ public void onPlayerDrops(PlayerDropsEvent event) { if(spawnGrave) { - EnumFacing playerFacing = player.getHorizontalFacing(); + EnumFacing facing = player.getHorizontalFacing(); BlockPos playerPos = player.getPosition(); - IBlockState state = Blocks.BLOCK_GRAVESTONE.block.getDefaultState().withProperty(BlockGraveStone.FACING, playerFacing); + IBlockState state = Blocks.BLOCK_GRAVESTONE.block.getDefaultState().withProperty(BlockGraveStone.FACING, facing); if(playerPos.getY() <= 2) { playerPos = new BlockPos(playerPos.getX(), 3, playerPos.getZ()); } @@ -126,7 +130,7 @@ public void onPlayerDrops(PlayerDropsEvent event) { { playerPos = new BlockPos(playerPos.getX(), 253, playerPos.getZ()); } List blocks = Lists.newArrayList(); - for (BlockPos pos : TileEntityGraveStone.getPositions(playerPos, playerFacing)) + for(BlockPos pos : TileEntityGraveStone.getPositions(playerPos, facing)) { NBTTagCompound tag = null; if (world.getTileEntity(pos) != null) @@ -137,25 +141,41 @@ public void onPlayerDrops(PlayerDropsEvent event) { blocks.add(new ReplaceableBlock(world.getBlockState(pos), pos, tag)); } + // world.setTileEntity(playerPos, state.getBlock().createTileEntity(world, state)); world.setBlockState(playerPos, state); TileEntityGraveStone graveStoneTileEntity = TileTools.getTileEntity(world, playerPos, TileEntityGraveStone.class); - // if (graveStoneTileEntity.getWorld() == null) graveStoneTileEntity.setWorldObj(world); + if(graveStoneTileEntity.getWorld() == null) + { graveStoneTileEntity.setWorldObj(world); } graveStoneTileEntity.addGraveItemsWithReplaceables(inventories.remove(player.getPersistentID()), itemsList); graveStoneTileEntity.setReplaceableBlocks(blocks); graveStoneTileEntity.breakBlocks(); graveStoneTileEntity.setPlayerProfile(player.getGameProfile()); // Adding Headstone - world.setBlockState(playerPos.offset(playerFacing.getOpposite()), Blocks.BLOCK_GRAVE_HEADSTONE.block.getDefaultState().withProperty(BlockHeadStone.FACING, playerFacing)); - TileEntityHeadStone tileEntityHeadStone = TileTools.getTileEntity(world, playerPos.offset(playerFacing.getOpposite()), TileEntityHeadStone.class); - if(tileEntityHeadStone != null) - { - tileEntityHeadStone.setCustomName(player.getDisplayName().getFormattedText()); - } + + BlockPos pos = playerPos.offset(facing.getOpposite()); + + placeHeadStone(world, pos, facing, player, player.getDisplayName().getFormattedText()); + sendTomTomPos(Graves.instance, player, playerPos, "Grave this way!"); } event.getDrops().clear(); } + + private void placeHeadStone(World world, BlockPos pos, EnumFacing facing, EntityPlayer player, String text) + { + world.setBlockState(pos, Blocks.BLOCK_GRAVE_HEADSTONE.block.getDefaultState().withProperty(BlockHeadStone.FACING, facing)); + TileEntityHeadStone tileEntityHeadStone = TileTools.getTileEntity(world, pos, TileEntityHeadStone.class); + if(tileEntityHeadStone != null) + { + tileEntityHeadStone.setCustomName(text); + GraveCapability.IGraveCapability grave = player.getCapability(GraveCapability.GRAVE_CAP, null); + if(grave != null) + { + tileEntityHeadStone.setDisplayStack(grave.getGraveItemStack()); + } + } + } } diff --git a/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java b/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java index a6bf853..1bf0d74 100644 --- a/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java +++ b/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java @@ -10,4 +10,6 @@ public class ModInfo { public static final String CLIENT_PROXY_CLASS = "com.fireball1725." + MOD_ID + ".proxy.ClientProxy"; public static final String FINGERPRINT = "@FINGERPRINT@"; public static final String GUI_FACTORY = "com.fireball1725." + MOD_ID + ".common.configuration.GravesConfigGuiFactory"; + + public static boolean chiselsAndBits; } diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityHeadStone.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityHeadStone.java index a083a27..7e0ab76 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityHeadStone.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityHeadStone.java @@ -1,12 +1,66 @@ package com.fireball1725.graves.common.tileentity; -public class TileEntityHeadStone extends TileEntityBase { - public TileEntityHeadStone() { - super(); - } - - @Override - public String getCustomName() { - return hasCustomName() ? this.customName : ""; - } +import com.fireball1725.graves.common.helpers.LogHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.play.server.SPacketUpdateTileEntity; + +public class TileEntityHeadStone extends TileEntityBase +{ + private ItemStack displayStack = null; + + public TileEntityHeadStone() + { + super(); + } + + @Override + public SPacketUpdateTileEntity getUpdatePacket() + { + return new SPacketUpdateTileEntity(getPos(), getBlockMetadata(), serializeNBT()); + } + + @Override + public void onDataPacket(NetworkManager networkManager, SPacketUpdateTileEntity sPacketUpdateTileEntity) + { + deserializeNBT(sPacketUpdateTileEntity.getNbtCompound()); + } + + @Override + public String getCustomName() + { + return hasCustomName() ? this.customName : ""; + } + + public ItemStack getDisplayStack() + { + return displayStack; + } + + public void setDisplayStack(ItemStack displayStack) + { + this.displayStack = displayStack; + } + + @Override + public NBTTagCompound writeToNBT(NBTTagCompound nbtTagCompound) + { + super.writeToNBT(nbtTagCompound); + if(displayStack != null) + { nbtTagCompound.setTag("displayStack", displayStack.serializeNBT()); } + return nbtTagCompound; + } + + @Override + public void readFromNBT(NBTTagCompound nbtTagCompound) + { + super.readFromNBT(nbtTagCompound); + displayStack = null; + if(nbtTagCompound.hasKey("displayStack")) + { + LogHelper.info("Loading stack!"); + displayStack = ItemStack.loadItemStackFromNBT(nbtTagCompound.getCompoundTag("displayStack")); + } + } } diff --git a/src/main/resources/assets/graves/blockstates/headstone.json b/src/main/resources/assets/graves/blockstates/headstone.json index 18e81bf..80314e9 100644 --- a/src/main/resources/assets/graves/blockstates/headstone.json +++ b/src/main/resources/assets/graves/blockstates/headstone.json @@ -25,6 +25,10 @@ } } ], + "render": { + "true": {}, + "false": {} + }, "facing": { "north": {}, "south": { From dfbe779e0c74132a3df2270e6a0f8ed6bd62e172 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Thu, 30 Jun 2016 16:32:46 -0700 Subject: [PATCH 25/47] Removed redundant code. --- .../java/com/fireball1725/graves/Graves.java | 7 +--- .../render/TileEntityHeadStoneRenderer.java | 33 +++++++++---------- .../graves/common/block/BlockHeadStone.java | 28 +++++++++------- .../graves/common/reference/ModInfo.java | 4 +-- 4 files changed, 34 insertions(+), 38 deletions(-) diff --git a/src/main/java/com/fireball1725/graves/Graves.java b/src/main/java/com/fireball1725/graves/Graves.java index a92bc02..1737b28 100644 --- a/src/main/java/com/fireball1725/graves/Graves.java +++ b/src/main/java/com/fireball1725/graves/Graves.java @@ -8,7 +8,6 @@ import com.fireball1725.graves.proxy.IProxy; import com.google.common.base.Stopwatch; import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; @@ -30,11 +29,7 @@ public class Graves { @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { - boolean load = ModInfo.chiselsAndBits = Loader.isModLoaded("chiselsandbits"); - if(load) - { - GraveCapability.register(); - } + GraveCapability.register(); final Stopwatch stopWatch = Stopwatch.createStarted(); LogHelper.info("Pre Initialization ( started )"); diff --git a/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java b/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java index 4d234c7..ae2ac0c 100644 --- a/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java +++ b/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java @@ -78,24 +78,21 @@ public void renderTileEntityAt(TileEntity te, double x, double y, double z, floa if(headStone.getDisplayStack() != null) { ItemStack stack = headStone.getDisplayStack(); - if(ModInfo.chiselsAndBits) - { - IBakedModel model = mc.getRenderItem().getItemModelWithOverrides(stack, null, null); - GlStateManager.pushMatrix(); - GlStateManager.enableLighting(); - GlStateManager.enableRescaleNormal(); - GlStateManager.enableAlpha(); - GlStateManager.alphaFunc(516, 0.1F); - GlStateManager.enableBlend(); - GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - bindTexture(TextureMap.locationBlocksTexture); - mc.getRenderItem().renderItem(stack, model); - GlStateManager.disableAlpha(); - GlStateManager.disableRescaleNormal(); - GlStateManager.disableLighting(); - GlStateManager.popMatrix(); - } + IBakedModel model = mc.getRenderItem().getItemModelWithOverrides(stack, null, null); + GlStateManager.pushMatrix(); + GlStateManager.enableLighting(); + GlStateManager.enableRescaleNormal(); + GlStateManager.enableAlpha(); + GlStateManager.alphaFunc(516, 0.1F); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + bindTexture(TextureMap.locationBlocksTexture); + mc.getRenderItem().renderItem(stack, model); + GlStateManager.disableAlpha(); + GlStateManager.disableRescaleNormal(); + GlStateManager.disableLighting(); + GlStateManager.popMatrix(); } else { diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java index 0fcd346..fc44327 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java @@ -4,6 +4,7 @@ import com.fireball1725.graves.chiselsandbits.GraveCapability; import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; import com.fireball1725.graves.common.util.TileTools; +import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyDirection; @@ -12,6 +13,7 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumBlockRenderType; @@ -22,6 +24,7 @@ import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.fml.common.registry.ForgeRegistries; import java.util.ArrayList; import java.util.List; @@ -84,20 +87,23 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, if(worldIn.isRemote) { return true; } - final GraveCapability.IGraveCapability grave = playerIn.getCapability(GraveCapability.GRAVE_CAP, null); - if(grave != null) + if(heldItem == null || (heldItem.getItem() instanceof ItemBlock && ForgeRegistries.BLOCKS.getKey(Block.getBlockFromItem(heldItem.getItem())).getResourceDomain().equals("chiselsandbits"))) { - grave.setGraveItemStack(heldItem); - TileEntity te = worldIn.getTileEntity(pos); - if(te instanceof TileEntityHeadStone) + final GraveCapability.IGraveCapability grave = playerIn.getCapability(GraveCapability.GRAVE_CAP, null); + if(grave != null) { - ((TileEntityHeadStone) te).setDisplayStack(heldItem); - te.markDirty(); - worldIn.notifyBlockUpdate(pos, state, ((TileEntityHeadStone) te).getBlockState(), 3); - worldIn.notifyBlockOfStateChange(pos, state.getBlock()); - worldIn.markChunkDirty(pos, te); + grave.setGraveItemStack(heldItem); + TileEntity te = worldIn.getTileEntity(pos); + if(te instanceof TileEntityHeadStone) + { + ((TileEntityHeadStone) te).setDisplayStack(heldItem); + te.markDirty(); + worldIn.notifyBlockUpdate(pos, state, ((TileEntityHeadStone) te).getBlockState(), 3); + worldIn.notifyBlockOfStateChange(pos, state.getBlock()); + worldIn.markChunkDirty(pos, te); + } + return true; } - return true; } return super.onBlockActivated(worldIn, pos, state, playerIn, hand, heldItem, side, hitX, hitY, hitZ); } diff --git a/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java b/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java index 25f26fe..661aa76 100644 --- a/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java +++ b/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java @@ -5,11 +5,9 @@ public class ModInfo { public static final String MOD_NAME = "Graves"; public static final String VERSION_BUILD = "@VERSION@"; public static final String MINECRAFT_VERSION = "@MCVERSION@"; - public static final String DEPENDENCIES = "after:chiselsandbits;"; + public static final String DEPENDENCIES = ""; public static final String SERVER_PROXY_CLASS = "com.fireball1725." + MOD_ID + ".proxy.ServerProxy"; public static final String CLIENT_PROXY_CLASS = "com.fireball1725." + MOD_ID + ".proxy.ClientProxy"; public static final String FINGERPRINT = "@FINGERPRINT@"; public static final String GUI_FACTORY = "com.fireball1725." + MOD_ID + ".common.configuration.GravesConfigGuiFactory"; - - public static boolean chiselsAndBits = false; } From 80d5874ddbca98ba9a1e51421bbf4b060766a79d Mon Sep 17 00:00:00 2001 From: FusionLord Date: Sat, 2 Jul 2016 21:02:21 -0700 Subject: [PATCH 26/47] Fixed dupe with SoulBound items. If there is already in a hotbar slot it is skipped and the item is placed in the inventory in the next empty slot or dropped if Inventory is full --- .../java/com/fireball1725/graves/Graves.java | 9 +- .../chiselsandbits/GraveCapability.java | 135 --------- .../graves/common/block/BlockHeadStone.java | 31 +- .../graves/common/event/EventBlockBreak.java | 3 +- .../common/event/EventDeathHandler.java | 11 +- .../graves/common/helpers/ItemHelper.java | 32 ++ .../common/structure/ReplaceableBlock.java | 2 +- .../tileentity/TileEntityGraveStone.java | 285 +++++++++++------- 8 files changed, 230 insertions(+), 278 deletions(-) delete mode 100644 src/main/java/com/fireball1725/graves/chiselsandbits/GraveCapability.java create mode 100644 src/main/java/com/fireball1725/graves/common/helpers/ItemHelper.java diff --git a/src/main/java/com/fireball1725/graves/Graves.java b/src/main/java/com/fireball1725/graves/Graves.java index 99b9eb5..7df139c 100644 --- a/src/main/java/com/fireball1725/graves/Graves.java +++ b/src/main/java/com/fireball1725/graves/Graves.java @@ -1,6 +1,6 @@ package com.fireball1725.graves; -import com.fireball1725.graves.chiselsandbits.GraveCapability; +//import com.fireball1725.graves.chiselsandbits.GraveCapability; import com.fireball1725.graves.common.helpers.LogHelper; import com.fireball1725.graves.common.network.PacketHandler; import com.fireball1725.graves.common.reference.ModInfo; @@ -8,7 +8,6 @@ import com.fireball1725.graves.proxy.IProxy; import com.google.common.base.Stopwatch; import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; @@ -30,11 +29,7 @@ public class Graves { @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { - boolean load = ModInfo.chiselsAndBits = Loader.isModLoaded("chiselsandbits"); - if(load) - { - GraveCapability.register(); - } + // GraveCapability.register(); final Stopwatch stopWatch = Stopwatch.createStarted(); LogHelper.info("Pre Initialization ( started )"); diff --git a/src/main/java/com/fireball1725/graves/chiselsandbits/GraveCapability.java b/src/main/java/com/fireball1725/graves/chiselsandbits/GraveCapability.java deleted file mode 100644 index 00d1bb8..0000000 --- a/src/main/java/com/fireball1725/graves/chiselsandbits/GraveCapability.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.fireball1725.graves.chiselsandbits; - -import com.fireball1725.graves.common.reference.ModInfo; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.Capability.IStorage; -import net.minecraftforge.common.capabilities.CapabilityInject; -import net.minecraftforge.common.capabilities.CapabilityManager; -import net.minecraftforge.common.capabilities.ICapabilitySerializable; -import net.minecraftforge.event.AttachCapabilitiesEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; - -public class GraveCapability -{ - @CapabilityInject(IGraveCapability.class) - public static final Capability GRAVE_CAP = null; - - public static void register() - { - CapabilityManager.INSTANCE.register(IGraveCapability.class, new Storage(), DefaultImpl.class); - MinecraftForge.EVENT_BUS.register(new GraveCapability()); - } - - // Handles playerData props from being wiped on death - @SubscribeEvent - public void cloneEvent(PlayerEvent.Clone evt) - { - NBTTagCompound grave = evt.getOriginal().getCapability(GRAVE_CAP, null).serializeNBT(); - evt.getEntityPlayer().getCapability(GRAVE_CAP, null).deserializeNBT(grave); - } - - @SubscribeEvent - public void onPlayerLoad(AttachCapabilitiesEvent.Entity event) - { - class Provider implements ICapabilitySerializable - { - private IGraveCapability inst = GRAVE_CAP.getDefaultInstance(); - - @Override - public boolean hasCapability(Capability capability, EnumFacing enumFacing) - { - return capability == GRAVE_CAP; - } - - @Override - public T getCapability(Capability capability, EnumFacing enumFacing) - { - return capability == GRAVE_CAP ? GRAVE_CAP.cast(inst) : null; - } - - @Override - public NBTBase serializeNBT() - { - return GRAVE_CAP.getStorage().writeNBT(GRAVE_CAP, inst, null); - } - - @Override - public void deserializeNBT(NBTBase tag) - { - GRAVE_CAP.getStorage().readNBT(GRAVE_CAP, inst, null, tag); - } - } - - if(event.getEntity() instanceof EntityPlayer) - { event.addCapability(new ResourceLocation(ModInfo.MOD_ID, "GraveCap"), new Provider()); } - } - - public interface IGraveCapability - { - ItemStack getGraveItemStack(); - - void setGraveItemStack(ItemStack itemStack); - - NBTTagCompound serializeNBT(); - - void deserializeNBT(NBTTagCompound tag); - } - - - - public static class Storage implements IStorage - { - @Override - public NBTBase writeNBT(Capability capability, IGraveCapability instance, EnumFacing side) - { - return instance.serializeNBT(); - } - - @Override - public void readNBT(Capability capability, IGraveCapability instance, EnumFacing side, NBTBase nbt) - { - instance.deserializeNBT((NBTTagCompound) nbt); - } - } - - - - public static class DefaultImpl implements IGraveCapability - { - ItemStack stack; - - @Override - public ItemStack getGraveItemStack() - { - return stack; - } - - @Override - public void setGraveItemStack(ItemStack stack) - { - this.stack = stack; - } - - @Override - public NBTTagCompound serializeNBT() - { - return stack == null ? new NBTTagCompound() : stack.serializeNBT(); - } - - @Override - public void deserializeNBT(NBTTagCompound tag) - { - if(tag.hasNoTags()) - { return; } - setGraveItemStack(ItemStack.loadItemStackFromNBT(tag)); - } - } -} \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java index 5d8bd7a..c38333c 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java @@ -1,7 +1,6 @@ package com.fireball1725.graves.common.block; import com.fireball1725.graves.Graves; -import com.fireball1725.graves.chiselsandbits.GraveCapability; import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; import com.fireball1725.graves.common.util.TileTools; import net.minecraft.block.material.Material; @@ -86,21 +85,21 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, if(worldIn.isRemote) { return true; } - final GraveCapability.IGraveCapability grave = playerIn.getCapability(GraveCapability.GRAVE_CAP, null); - if(grave != null) - { - grave.setGraveItemStack(heldItem); - TileEntity te = worldIn.getTileEntity(pos); - if(te instanceof TileEntityHeadStone) - { - ((TileEntityHeadStone) te).setDisplayStack(heldItem); - te.markDirty(); - worldIn.notifyBlockUpdate(pos, state, ((TileEntityHeadStone) te).getBlockState(), 3); - worldIn.notifyBlockOfStateChange(pos, state.getBlock()); - worldIn.markChunkDirty(pos, te); - } - return true; - } + // final GraveCapability.IGraveCapability grave = playerIn.getCapability(GraveCapability.GRAVE_CAP, null); + // if(grave != null) + // { + // grave.setGraveItemStack(heldItem); + // TileEntity te = worldIn.getTileEntity(pos); + // if(te instanceof TileEntityHeadStone) + // { + // ((TileEntityHeadStone) te).setDisplayStack(heldItem); + // te.markDirty(); + // worldIn.notifyBlockUpdate(pos, state, ((TileEntityHeadStone) te).getBlockState(), 3); + // worldIn.notifyBlockOfStateChange(pos, state.getBlock()); + // worldIn.markChunkDirty(pos, te); + // } + // return true; + // } return super.onBlockActivated(worldIn, pos, state, playerIn, hand, heldItem, side, hitX, hitY, hitZ); } diff --git a/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java b/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java index 408339e..9bdc0b4 100644 --- a/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java +++ b/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java @@ -45,8 +45,7 @@ public void onBreakBlock(BlockEvent.BreakEvent event) { List blocks = graveStone.getReplaceableBlocks(); EntityPlayer player = event.getPlayer(); - player.inventory.dropAllItems(); - graveStone.replaceItems(player.inventory); + graveStone.replaceItems(player); event.getWorld().destroyBlock(graveStone.getPos().down(), false); event.getWorld().destroyBlock(graveStone.getPos().down().offset(graveStone.getBlockState().getValue(BlockGraveStone.FACING)), false); diff --git a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java index 7353de1..0a76567 100644 --- a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java +++ b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java @@ -1,7 +1,6 @@ package com.fireball1725.graves.common.event; import com.fireball1725.graves.Graves; -import com.fireball1725.graves.chiselsandbits.GraveCapability; import com.fireball1725.graves.common.block.BlockGraveStone; import com.fireball1725.graves.common.block.BlockHeadStone; import com.fireball1725.graves.common.block.Blocks; @@ -171,11 +170,11 @@ private void placeHeadStone(World world, BlockPos pos, EnumFacing facing, Entity if(tileEntityHeadStone != null) { tileEntityHeadStone.setCustomName(text); - GraveCapability.IGraveCapability grave = player.getCapability(GraveCapability.GRAVE_CAP, null); - if(grave != null) - { - tileEntityHeadStone.setDisplayStack(grave.getGraveItemStack()); - } + // GraveCapability.IGraveCapability grave = player.getCapability(GraveCapability.GRAVE_CAP, null); + // if(grave != null) + // { + // tileEntityHeadStone.setDisplayStack(grave.getGraveItemStack()); + // } } } } diff --git a/src/main/java/com/fireball1725/graves/common/helpers/ItemHelper.java b/src/main/java/com/fireball1725/graves/common/helpers/ItemHelper.java new file mode 100644 index 0000000..e54364f --- /dev/null +++ b/src/main/java/com/fireball1725/graves/common/helpers/ItemHelper.java @@ -0,0 +1,32 @@ +package com.fireball1725.graves.common.helpers; + +import net.minecraft.enchantment.Enchantment; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; + +public class ItemHelper +{ + public static boolean doesItemHaveEnchant(ItemStack stack, String enchant) + { + if(stack != null && stack.getTagCompound() != null && stack.getTagCompound().hasKey("ench")) + { + NBTTagList tagList = stack.getTagCompound().getTagList("ench", 10); + for(int i = 0; i < tagList.tagCount(); i++) + { + NBTTagCompound tag = tagList.getCompoundTagAt(i); + if(tag.getString("id").equals(enchant)) + { + return true; + } + } + } + + return false; + } + + public static boolean doesItemHaveEnchant(ItemStack stack, Enchantment enchantment) + { + return doesItemHaveEnchant(stack, enchantment.getName()); + } +} diff --git a/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java b/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java index 57f81b6..b84d326 100644 --- a/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java +++ b/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java @@ -47,7 +47,7 @@ public boolean placeBlock(World world) Block block = state.getBlock(); if (block instanceof ITileEntityProvider && tagCompound != null) { - world.setTileEntity(pos, TileEntity.func_190200_a(world, tagCompound)); + world.setTileEntity(pos, TileEntity.create(tagCompound)); } return true; } diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java index 3fe377c..3385f4f 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java @@ -5,6 +5,8 @@ import com.fireball1725.graves.common.block.Blocks; import com.fireball1725.graves.common.configuration.ConfigZombie; import com.fireball1725.graves.common.entity.EntityPlayerZombie; +import com.fireball1725.graves.common.helpers.ItemHelper; +import com.fireball1725.graves.common.helpers.LogHelper; import com.fireball1725.graves.common.structure.ReplaceableBlock; import com.fireball1725.graves.common.tileentity.inventory.InternalDynamicInventory; import com.fireball1725.graves.common.tileentity.inventory.InventoryOperation; @@ -12,26 +14,30 @@ import com.google.common.collect.Lists; import com.mojang.authlib.GameProfile; import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTUtil; +import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.ITextComponent; import net.minecraft.world.EnumDifficulty; -import java.util.Iterator; +import javax.annotation.Nullable; +import java.util.ArrayList; import java.util.List; +import java.util.ListIterator; import java.util.Random; public class TileEntityGraveStone extends TileEntityInventoryBase { private boolean hasLid = true; - private InternalDynamicInventory internalInventory = new InternalDynamicInventory(this); - private GameProfile playerProfile; + private InternalDynamicInventory internalInventory = new InternalDynamicInventory(this); + private GameProfile playerProfile; private List replaceableBlocks = Lists.newArrayList(); private ItemStack[] replaceableItems = new ItemStack[14]; @@ -52,6 +58,15 @@ public static List getPositions(BlockPos pos, EnumFacing facing) return poses; } + @Nullable + @Override + public SPacketUpdateTileEntity getUpdatePacket() + { + LogHelper.info(String.format("Gravestone (%s) at W=%s X=%s Y=%s Z=%s", this.playerProfile == null ? "null" : this.playerProfile.getName(), this.worldObj.getWorldInfo().getWorldName(), this.pos.getX(), this.pos.getY(), this.pos.getZ())); + + return super.getUpdatePacket(); + } + public void addGraveItems(List itemsList) { for(ItemStack stack : itemsList) @@ -62,84 +77,86 @@ public void addGraveItems(List itemsList) public void addGraveItemsWithReplaceables(InventoryPlayer inventory, List itemsList) { - replaceableItems = new ItemStack[InventoryPlayer.getHotbarSize() + inventory.armorInventory.length + inventory.offHandInventory.length]; - ItemStack itemStack; - int placeAt; - for(int i = 0; i < InventoryPlayer.getHotbarSize(); i++) - { - placeAt = i; - itemStack = inventory.mainInventory[i]; - replaceableItems[placeAt] = itemStack; - } - for(int i = 0; i < inventory.armorInventory.length; i++) + System.arraycopy(inventory.mainInventory, 0, replaceableItems, 0, InventoryPlayer.getHotbarSize()); + + rItems: + for(ItemStack stack : replaceableItems) { - placeAt = i + InventoryPlayer.getHotbarSize(); - itemStack = inventory.armorInventory[i]; - replaceableItems[placeAt] = itemStack; + ListIterator iterator = itemsList.listIterator(); + ItemStack stack1; + while(iterator.hasNext()) + { + stack1 = iterator.next(); + + if(ItemHelper.doesItemHaveEnchant(stack1, "soulBound")) + { + iterator.remove(); + continue; + } + + if(areItemEqual(stack, stack1)) + { + iterator.remove(); + continue rItems; + } + } } - for(int i = 0; i < inventory.offHandInventory.length; i++) + for(int i = 0; i < replaceableItems.length; i++) { - placeAt = i + InventoryPlayer.getHotbarSize() + inventory.armorInventory.length; - itemStack = inventory.offHandInventory[i]; - replaceableItems[placeAt] = itemStack; + ItemStack stack = replaceableItems[i]; + if(ItemHelper.doesItemHaveEnchant(stack, "soulBound")) + { + replaceableItems[i] = null; + } } - Iterator listIterator = itemsList.listIterator(); - listIterator: - while(listIterator.hasNext()) + addGraveItems(itemsList); + } + + private boolean areItemEqual(ItemStack stack, ItemStack stack1) + { + boolean flag = ItemStack.areItemsEqual(stack, stack1); + if(stack != null && stack1 != null) { - ItemStack stack1 = listIterator.next(); - if(stack1 != null) + if((stack.hasTagCompound() && !stack1.hasTagCompound()) || (!stack.hasTagCompound() && stack1.hasTagCompound())) { - for(ItemStack stack : replaceableItems) - { - if(stack != null) - { - if(stack1.isItemEqual(stack)) - { - if(stack1.hasTagCompound() && stack.hasTagCompound()) - { - if(stack1.getTagCompound().equals(stack.getTagCompound())) - { - listIterator.remove(); - continue listIterator; - } - } - else - { - listIterator.remove(); - continue listIterator; - } - } - } - } + return false; + } + if(stack.hasTagCompound() && stack1.hasTagCompound()) + { + return flag && stack.getTagCompound().equals(stack1.getTagCompound()); } } - addGraveItems(itemsList); + return flag; } - public boolean getHasLid() { - return hasLid; - } + public boolean getHasLid() + { + return hasLid; + } - public void setHasLid(boolean hasLid) { - this.hasLid = hasLid; + public void setHasLid(boolean hasLid) + { + this.hasLid = hasLid; worldObj.notifyBlockUpdate(pos, getBlockState(), getBlockState().withProperty(BlockGraveStone.HASLID, false), 3); } - private GameProfile getPlayerProfile() { - return playerProfile; - } + private GameProfile getPlayerProfile() + { + return playerProfile; + } - public void setPlayerProfile(GameProfile playerProfile) { - this.playerProfile = playerProfile; - } + public void setPlayerProfile(GameProfile playerProfile) + { + this.playerProfile = playerProfile; + } - @Override - public void readFromNBT(NBTTagCompound nbtTagCompound) { - super.readFromNBT(nbtTagCompound); + @Override + public void readFromNBT(NBTTagCompound nbtTagCompound) + { + super.readFromNBT(nbtTagCompound); - this.hasLid = nbtTagCompound.getBoolean("hasLid"); - this.playerProfile = NBTUtil.readGameProfileFromNBT(nbtTagCompound.getCompoundTag("playerProfile")); + this.hasLid = nbtTagCompound.getBoolean("hasLid"); + this.playerProfile = NBTUtil.readGameProfileFromNBT(nbtTagCompound.getCompoundTag("playerProfile")); NBTTagCompound replaceableTag = nbtTagCompound.getCompoundTag("replaceableBlocks"); int size = replaceableTag.getInteger("size"); @@ -153,21 +170,24 @@ public void readFromNBT(NBTTagCompound nbtTagCompound) { for(int i = 0; i < replaceableItems.length; i++) { if(tag.hasKey("item:" + i)) - { replaceableItems[i] = ItemStack.loadItemStackFromNBT(tag.getCompoundTag("item:" + i)); } + { + replaceableItems[i] = ItemStack.loadItemStackFromNBT(tag.getCompoundTag("item:" + i)); + } } } - @Override + @Override public NBTTagCompound writeToNBT(NBTTagCompound nbtTagCompound) { - nbtTagCompound.setBoolean("hasLid", this.hasLid); + nbtTagCompound.setBoolean("hasLid", this.hasLid); - if (playerProfile != null) { - NBTTagCompound profileTag = new NBTTagCompound(); - NBTUtil.writeGameProfile(profileTag, playerProfile); - nbtTagCompound.setTag("playerProfile", profileTag); - } + if(playerProfile != null) + { + NBTTagCompound profileTag = new NBTTagCompound(); + NBTUtil.writeGameProfile(profileTag, playerProfile); + nbtTagCompound.setTag("playerProfile", profileTag); + } NBTTagCompound replaceableBlocksTag = new NBTTagCompound(); replaceableBlocksTag.setInteger("size", replaceableBlocks.size()); @@ -187,8 +207,9 @@ public NBTTagCompound writeToNBT(NBTTagCompound nbtTagCompound) return super.writeToNBT(nbtTagCompound); } - public void breakBlocks() { - // Adding slaves + public void breakBlocks() + { + // Adding slaves IBlockState defSlaveState = Blocks.BLOCK_GRAVESTONE_SLAVE.block.getDefaultState(); IBlockState state = worldObj.getBlockState(pos); EnumFacing facing = state.getBlock().getActualState(state, worldObj, pos).getValue(BlockGraveStone.FACING); @@ -204,54 +225,63 @@ public void breakBlocks() { } // End of adding slaves - } + } @Override - public IInventory getInternalInventory() { - return this.internalInventory; - } + public IInventory getInternalInventory() + { + return this.internalInventory; + } - @Override - public void saveChanges() { + @Override + public void saveChanges() + { - } + } - @Override - public void onChangeInventory(IInventory inv, int slot, InventoryOperation operation, ItemStack removed, ItemStack added) { + @Override + public void onChangeInventory(IInventory inv, int slot, InventoryOperation operation, ItemStack removed, ItemStack added) + { - } + } - @Override - public int[] getAccessibleSlotsBySide(EnumFacing side) { - return new int[0]; - } + @Override + public int[] getAccessibleSlotsBySide(EnumFacing side) + { + return new int[0]; + } - @Override - public ItemStack removeStackFromSlot(int index) { - return null; - } + @Override + public ItemStack removeStackFromSlot(int index) + { + return null; + } - @Override - public int getField(int id) { - return 0; - } + @Override + public int getField(int id) + { + return 0; + } - @Override - public void setField(int id, int value) { + @Override + public void setField(int id, int value) + { - } + } - @Override - public int getFieldCount() { - return 0; - } + @Override + public int getFieldCount() + { + return 0; + } - @Override - public void clear() { + @Override + public void clear() + { - } + } - @Override + @Override public ITextComponent getDisplayName() { return null; @@ -359,11 +389,44 @@ public void setReplaceableBlocks(List replaceableBlocks) this.replaceableBlocks = replaceableBlocks; } - public void replaceItems(InventoryPlayer inventory) + public void replaceItems(EntityPlayer player) { - System.arraycopy(replaceableItems, 0, inventory.mainInventory, 0, InventoryPlayer.getHotbarSize()); - System.arraycopy(replaceableItems, InventoryPlayer.getHotbarSize(), inventory.armorInventory, 0, inventory.armorInventory.length); - System.arraycopy(replaceableItems, InventoryPlayer.getHotbarSize() + inventory.armorInventory.length, inventory.offHandInventory, 0, inventory.offHandInventory.length); + InventoryPlayer inventory = player.inventory; + List remaining = new ArrayList(); + for(int i = 0; i < inventory.mainInventory.length; i++) + { + if(i >= replaceableItems.length) + { break; } + ItemStack currentItem = inventory.mainInventory[i]; + ItemStack replaceItem = replaceableItems[i]; + if(InventoryPlayer.isHotbar(i)) + { + LogHelper.info(String.format("CurrentItem: %s, replaceItem: %s", currentItem, replaceItem)); + if(currentItem == null && replaceItem != null) + { + inventory.mainInventory[i] = replaceItem; + } + else + { + remaining.add(replaceItem); + } + } + else + { + remaining.add(replaceItem); + } + } + + for(ItemStack remainingStack : remaining) + { + LogHelper.info(String.format("remainingStack: %s", remainingStack)); + if(!inventory.addItemStackToInventory(remainingStack)) + { + if(remainingStack != null && remainingStack.stackSize >= 1) + { worldObj.spawnEntityInWorld(new EntityItem(worldObj, player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ(), remainingStack)); } + } + } + inventory.markDirty(); } } From d91a2cd40bba33b565e08d07cd2019cd86d1d1aa Mon Sep 17 00:00:00 2001 From: FusionLord Date: Sat, 2 Jul 2016 21:05:17 -0700 Subject: [PATCH 27/47] Fixed Mapping issue from 1.9.4 to 1.10 --- .../fireball1725/graves/common/structure/ReplaceableBlock.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java b/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java index b84d326..93717ca 100644 --- a/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java +++ b/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java @@ -47,7 +47,7 @@ public boolean placeBlock(World world) Block block = state.getBlock(); if (block instanceof ITileEntityProvider && tagCompound != null) { - world.setTileEntity(pos, TileEntity.create(tagCompound)); + world.setTileEntity(pos, TileEntity.func_190200_a(null, tagCompound)); } return true; } From e1e3e5060f557ae4d334cae6594466486044b9e4 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Sun, 3 Jul 2016 02:20:49 -0700 Subject: [PATCH 28/47] Fixed Mapping issue from 1.9.4 to 1.10 --- .../java/com/fireball1725/graves/Graves.java | 4 +- .../render/TileEntityHeadStoneRenderer.java | 35 +++-- .../graves/common/block/BlockHeadStone.java | 38 +++-- .../entity/capabilities/GraveCapability.java | 143 ++++++++++++++++++ .../common/event/EventDeathHandler.java | 11 +- .../graves/common/reference/ModInfo.java | 2 - 6 files changed, 190 insertions(+), 43 deletions(-) create mode 100644 src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapability.java diff --git a/src/main/java/com/fireball1725/graves/Graves.java b/src/main/java/com/fireball1725/graves/Graves.java index 7df139c..bebe701 100644 --- a/src/main/java/com/fireball1725/graves/Graves.java +++ b/src/main/java/com/fireball1725/graves/Graves.java @@ -1,6 +1,6 @@ package com.fireball1725.graves; -//import com.fireball1725.graves.chiselsandbits.GraveCapability; +import com.fireball1725.graves.common.entity.capabilities.GraveCapability; import com.fireball1725.graves.common.helpers.LogHelper; import com.fireball1725.graves.common.network.PacketHandler; import com.fireball1725.graves.common.reference.ModInfo; @@ -29,7 +29,7 @@ public class Graves { @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { - // GraveCapability.register(); + GraveCapability.register(); final Stopwatch stopWatch = Stopwatch.createStarted(); LogHelper.info("Pre Initialization ( started )"); diff --git a/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java b/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java index c825519..f551cb8 100644 --- a/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java +++ b/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java @@ -1,6 +1,7 @@ package com.fireball1725.graves.client.render; import com.fireball1725.graves.common.block.BlockHeadStone; +import com.fireball1725.graves.common.helpers.LogHelper; import com.fireball1725.graves.common.reference.ModInfo; import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; import com.google.common.base.Function; @@ -78,24 +79,22 @@ public void renderTileEntityAt(TileEntity te, double x, double y, double z, floa if(headStone.getDisplayStack() != null) { ItemStack stack = headStone.getDisplayStack(); - if(ModInfo.chiselsAndBits) - { - IBakedModel model = mc.getRenderItem().getItemModelWithOverrides(stack, null, null); - GlStateManager.pushMatrix(); - GlStateManager.enableLighting(); - GlStateManager.enableRescaleNormal(); - GlStateManager.enableAlpha(); - GlStateManager.alphaFunc(516, 0.1F); - GlStateManager.enableBlend(); - GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); - mc.getRenderItem().renderItem(stack, model); - GlStateManager.disableAlpha(); - GlStateManager.disableRescaleNormal(); - GlStateManager.disableLighting(); - GlStateManager.popMatrix(); - } + IBakedModel model = mc.getRenderItem().getItemModelWithOverrides(stack, null, null); + GlStateManager.pushMatrix(); + GlStateManager.enableLighting(); + GlStateManager.enableRescaleNormal(); + GlStateManager.enableAlpha(); + GlStateManager.alphaFunc(516, 0.1F); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + mc.getRenderItem().renderItem(stack, model); + GlStateManager.disableAlpha(); + GlStateManager.disableRescaleNormal(); + GlStateManager.disableLighting(); + GlStateManager.popMatrix(); + LogHelper.info("Rendering!..."); } else { diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java index c38333c..1774d2c 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java @@ -1,6 +1,7 @@ package com.fireball1725.graves.common.block; import com.fireball1725.graves.Graves; +import com.fireball1725.graves.common.entity.capabilities.GraveCapability; import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; import com.fireball1725.graves.common.util.TileTools; import net.minecraft.block.material.Material; @@ -11,6 +12,7 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumBlockRenderType; @@ -21,6 +23,7 @@ import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.fml.common.registry.ForgeRegistries; import java.util.ArrayList; import java.util.List; @@ -42,7 +45,7 @@ protected BlockHeadStone() @Override public EnumBlockRenderType getRenderType(IBlockState state) { - return EnumBlockRenderType.INVISIBLE; + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override @@ -85,21 +88,24 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, if(worldIn.isRemote) { return true; } - // final GraveCapability.IGraveCapability grave = playerIn.getCapability(GraveCapability.GRAVE_CAP, null); - // if(grave != null) - // { - // grave.setGraveItemStack(heldItem); - // TileEntity te = worldIn.getTileEntity(pos); - // if(te instanceof TileEntityHeadStone) - // { - // ((TileEntityHeadStone) te).setDisplayStack(heldItem); - // te.markDirty(); - // worldIn.notifyBlockUpdate(pos, state, ((TileEntityHeadStone) te).getBlockState(), 3); - // worldIn.notifyBlockOfStateChange(pos, state.getBlock()); - // worldIn.markChunkDirty(pos, te); - // } - // return true; - // } + if(heldItem != null && heldItem.getItem() instanceof ItemBlock && ForgeRegistries.BLOCKS.getKey(((ItemBlock) heldItem.getItem()).block).getResourceDomain().equals("chiselsandbits")) + { + final GraveCapability.IGraveCapability grave = playerIn.getCapability(GraveCapability.GRAVE_CAPABILITY, null); + if(grave != null) + { + grave.setGraveItemStack(heldItem); + TileEntity te = worldIn.getTileEntity(pos); + if(te instanceof TileEntityHeadStone) + { + ((TileEntityHeadStone) te).setDisplayStack(heldItem); + te.markDirty(); + worldIn.notifyBlockUpdate(pos, state, ((TileEntityHeadStone) te).getBlockState(), 3); + worldIn.notifyBlockOfStateChange(pos, state.getBlock()); + worldIn.markChunkDirty(pos, te); + } + return true; + } + } return super.onBlockActivated(worldIn, pos, state, playerIn, hand, heldItem, side, hitX, hitY, hitZ); } diff --git a/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapability.java b/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapability.java new file mode 100644 index 0000000..5402e85 --- /dev/null +++ b/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapability.java @@ -0,0 +1,143 @@ +package com.fireball1725.graves.common.entity.capabilities; + +import com.fireball1725.graves.common.reference.ModInfo; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.CapabilityInject; +import net.minecraftforge.common.capabilities.CapabilityManager; +import net.minecraftforge.common.capabilities.ICapabilitySerializable; +import net.minecraftforge.event.AttachCapabilitiesEvent; +import net.minecraftforge.event.entity.player.PlayerEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import javax.annotation.Nullable; + +public class GraveCapability +{ + @CapabilityInject(IGraveCapability.class) + public static final Capability GRAVE_CAPABILITY = null; + + public static void register() + { + CapabilityManager.INSTANCE.register(IGraveCapability.class, new Storage(), DefaultImpl.class); + MinecraftForge.EVENT_BUS.register(new GraveCapability()); + } + + @SubscribeEvent + public void cloneEvent(PlayerEvent.Clone event) + { + NBTTagCompound grave = event.getOriginal().getCapability(GRAVE_CAPABILITY, null).serializeNBT(); + event.getEntityPlayer().getCapability(GRAVE_CAPABILITY, null).deserializeNBT(grave); + } + + @SubscribeEvent + public void onPlayerLoad(AttachCapabilitiesEvent.Entity event) + { + class Provider implements ICapabilitySerializable + { + private IGraveCapability inst = GRAVE_CAPABILITY.getDefaultInstance(); + + @Override + public T getCapability(Capability capability, + @Nullable + EnumFacing enumFacing) + { + return capability == GRAVE_CAPABILITY ? GRAVE_CAPABILITY.cast(inst) : null; + } + + @Override + public boolean hasCapability(Capability capability, + @Nullable + EnumFacing enumFacing) + { + return capability == GRAVE_CAPABILITY; + } + + @Override + public void deserializeNBT(NBTBase tagCompound) + { + GRAVE_CAPABILITY.getStorage().readNBT(GRAVE_CAPABILITY, inst, null, tagCompound); + } + + @Override + public NBTBase serializeNBT() + { + return GRAVE_CAPABILITY.getStorage().writeNBT(GRAVE_CAPABILITY, inst, null); + } + } + + if(event.getEntity() instanceof EntityPlayer) + { event.addCapability(new ResourceLocation(ModInfo.MOD_ID, "gravecap"), new Provider()); } + } + + public interface IGraveCapability + { + ItemStack getGraveItemStack(); + + void setGraveItemStack(ItemStack displayStack); + + NBTTagCompound serializeNBT(); + + void deserializeNBT(NBTTagCompound tagCompound); + } + + + + public static class Storage implements Capability.IStorage + { + @Override + public void readNBT(Capability capability, IGraveCapability iGraveCapability, EnumFacing enumFacing, NBTBase nbtBase) + { + iGraveCapability.deserializeNBT((NBTTagCompound) nbtBase); + } + + @Override + public NBTBase writeNBT(Capability capability, IGraveCapability iGraveCapability, EnumFacing enumFacing) + { + return iGraveCapability.serializeNBT(); + } + } + + + + public static class DefaultImpl implements IGraveCapability + { + ItemStack displayStack; + + @Override + public ItemStack getGraveItemStack() + { + return displayStack; + } + + @Override + public void setGraveItemStack(ItemStack displayStack) + { + this.displayStack = displayStack; + } + + @Override + public NBTTagCompound serializeNBT() + { + if(displayStack != null) + { return displayStack.writeToNBT(new NBTTagCompound()); } + else + { return new NBTTagCompound(); } + } + + @Override + public void deserializeNBT(NBTTagCompound tagCompound) + { + if(!tagCompound.hasNoTags()) + { + displayStack = ItemStack.loadItemStackFromNBT(tagCompound); + } + } + } +} diff --git a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java index 0a76567..b86c921 100644 --- a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java +++ b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java @@ -5,6 +5,7 @@ import com.fireball1725.graves.common.block.BlockHeadStone; import com.fireball1725.graves.common.block.Blocks; import com.fireball1725.graves.common.entity.EntityPlayerZombie; +import com.fireball1725.graves.common.entity.capabilities.GraveCapability; import com.fireball1725.graves.common.helpers.LogHelper; import com.fireball1725.graves.common.structure.ReplaceableBlock; import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; @@ -170,11 +171,11 @@ private void placeHeadStone(World world, BlockPos pos, EnumFacing facing, Entity if(tileEntityHeadStone != null) { tileEntityHeadStone.setCustomName(text); - // GraveCapability.IGraveCapability grave = player.getCapability(GraveCapability.GRAVE_CAP, null); - // if(grave != null) - // { - // tileEntityHeadStone.setDisplayStack(grave.getGraveItemStack()); - // } + GraveCapability.IGraveCapability grave = player.getCapability(GraveCapability.GRAVE_CAPABILITY, null); + if(grave != null) + { + tileEntityHeadStone.setDisplayStack(grave.getGraveItemStack()); + } } } } diff --git a/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java b/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java index 1bf0d74..a6bf853 100644 --- a/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java +++ b/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java @@ -10,6 +10,4 @@ public class ModInfo { public static final String CLIENT_PROXY_CLASS = "com.fireball1725." + MOD_ID + ".proxy.ClientProxy"; public static final String FINGERPRINT = "@FINGERPRINT@"; public static final String GUI_FACTORY = "com.fireball1725." + MOD_ID + ".common.configuration.GravesConfigGuiFactory"; - - public static boolean chiselsAndBits; } From cbac0ca62e72bde43024f0d239d3fdea22a62f8c Mon Sep 17 00:00:00 2001 From: FusionLord Date: Sun, 3 Jul 2016 02:32:08 -0700 Subject: [PATCH 29/47] Real support for chiselsandbits headstones. --- .../graves/common/block/BlockHeadStone.java | 3 +- .../capabilities/GraveCapDefaultImpl.java | 39 +++++++ .../entity/capabilities/GraveCapProvider.java | 43 +++++++ .../entity/capabilities/GraveCapStorage.java | 21 ++++ .../entity/capabilities/GraveCapability.java | 108 +----------------- .../entity/capabilities/IGraveCapability.java | 15 +++ .../common/event/EventDeathHandler.java | 3 +- 7 files changed, 124 insertions(+), 108 deletions(-) create mode 100644 src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapDefaultImpl.java create mode 100644 src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapProvider.java create mode 100644 src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapStorage.java create mode 100644 src/main/java/com/fireball1725/graves/common/entity/capabilities/IGraveCapability.java diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java index 1774d2c..b346f19 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java @@ -2,6 +2,7 @@ import com.fireball1725.graves.Graves; import com.fireball1725.graves.common.entity.capabilities.GraveCapability; +import com.fireball1725.graves.common.entity.capabilities.IGraveCapability; import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; import com.fireball1725.graves.common.util.TileTools; import net.minecraft.block.material.Material; @@ -90,7 +91,7 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, if(heldItem != null && heldItem.getItem() instanceof ItemBlock && ForgeRegistries.BLOCKS.getKey(((ItemBlock) heldItem.getItem()).block).getResourceDomain().equals("chiselsandbits")) { - final GraveCapability.IGraveCapability grave = playerIn.getCapability(GraveCapability.GRAVE_CAPABILITY, null); + final IGraveCapability grave = playerIn.getCapability(GraveCapability.GRAVE_CAPABILITY, null); if(grave != null) { grave.setGraveItemStack(heldItem); diff --git a/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapDefaultImpl.java b/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapDefaultImpl.java new file mode 100644 index 0000000..4468f4b --- /dev/null +++ b/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapDefaultImpl.java @@ -0,0 +1,39 @@ +package com.fireball1725.graves.common.entity.capabilities; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public class GraveCapDefaultImpl implements IGraveCapability +{ + ItemStack displayStack; + + @Override + public ItemStack getGraveItemStack() + { + return displayStack; + } + + @Override + public void setGraveItemStack(ItemStack displayStack) + { + this.displayStack = displayStack; + } + + @Override + public NBTTagCompound serializeNBT() + { + if(displayStack != null) + { return displayStack.writeToNBT(new NBTTagCompound()); } + else + { return new NBTTagCompound(); } + } + + @Override + public void deserializeNBT(NBTTagCompound tagCompound) + { + if(!tagCompound.hasNoTags()) + { + displayStack = ItemStack.loadItemStackFromNBT(tagCompound); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapProvider.java b/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapProvider.java new file mode 100644 index 0000000..62bef8c --- /dev/null +++ b/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapProvider.java @@ -0,0 +1,43 @@ +package com.fireball1725.graves.common.entity.capabilities; + +import net.minecraft.nbt.NBTBase; +import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.ICapabilitySerializable; + +import javax.annotation.Nullable; + +import static com.fireball1725.graves.common.entity.capabilities.GraveCapability.GRAVE_CAPABILITY; + +public class GraveCapProvider implements ICapabilitySerializable +{ + private IGraveCapability inst = GRAVE_CAPABILITY.getDefaultInstance(); + + @Override + public T getCapability(Capability capability, + @Nullable + EnumFacing enumFacing) + { + return capability == GRAVE_CAPABILITY ? GRAVE_CAPABILITY.cast(inst) : null; + } + + @Override + public boolean hasCapability(Capability capability, + @Nullable + EnumFacing enumFacing) + { + return capability == GRAVE_CAPABILITY; + } + + @Override + public void deserializeNBT(NBTBase tagCompound) + { + GRAVE_CAPABILITY.getStorage().readNBT(GRAVE_CAPABILITY, inst, null, tagCompound); + } + + @Override + public NBTBase serializeNBT() + { + return GRAVE_CAPABILITY.getStorage().writeNBT(GRAVE_CAPABILITY, inst, null); + } +} \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapStorage.java b/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapStorage.java new file mode 100644 index 0000000..6528f9d --- /dev/null +++ b/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapStorage.java @@ -0,0 +1,21 @@ +package com.fireball1725.graves.common.entity.capabilities; + +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.capabilities.Capability; + +public class GraveCapStorage implements Capability.IStorage +{ + @Override + public void readNBT(Capability capability, IGraveCapability iGraveCapability, EnumFacing enumFacing, NBTBase nbtBase) + { + iGraveCapability.deserializeNBT((NBTTagCompound) nbtBase); + } + + @Override + public NBTBase writeNBT(Capability capability, IGraveCapability iGraveCapability, EnumFacing enumFacing) + { + return iGraveCapability.serializeNBT(); + } +} \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapability.java b/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapability.java index 5402e85..0df52f6 100644 --- a/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapability.java +++ b/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapability.java @@ -2,22 +2,16 @@ import com.fireball1725.graves.common.reference.ModInfo; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.CapabilityInject; import net.minecraftforge.common.capabilities.CapabilityManager; -import net.minecraftforge.common.capabilities.ICapabilitySerializable; import net.minecraftforge.event.AttachCapabilitiesEvent; import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import javax.annotation.Nullable; - public class GraveCapability { @CapabilityInject(IGraveCapability.class) @@ -25,7 +19,7 @@ public class GraveCapability public static void register() { - CapabilityManager.INSTANCE.register(IGraveCapability.class, new Storage(), DefaultImpl.class); + CapabilityManager.INSTANCE.register(IGraveCapability.class, new GraveCapStorage(), GraveCapDefaultImpl.class); MinecraftForge.EVENT_BUS.register(new GraveCapability()); } @@ -39,105 +33,7 @@ public void cloneEvent(PlayerEvent.Clone event) @SubscribeEvent public void onPlayerLoad(AttachCapabilitiesEvent.Entity event) { - class Provider implements ICapabilitySerializable - { - private IGraveCapability inst = GRAVE_CAPABILITY.getDefaultInstance(); - - @Override - public T getCapability(Capability capability, - @Nullable - EnumFacing enumFacing) - { - return capability == GRAVE_CAPABILITY ? GRAVE_CAPABILITY.cast(inst) : null; - } - - @Override - public boolean hasCapability(Capability capability, - @Nullable - EnumFacing enumFacing) - { - return capability == GRAVE_CAPABILITY; - } - - @Override - public void deserializeNBT(NBTBase tagCompound) - { - GRAVE_CAPABILITY.getStorage().readNBT(GRAVE_CAPABILITY, inst, null, tagCompound); - } - - @Override - public NBTBase serializeNBT() - { - return GRAVE_CAPABILITY.getStorage().writeNBT(GRAVE_CAPABILITY, inst, null); - } - } - if(event.getEntity() instanceof EntityPlayer) - { event.addCapability(new ResourceLocation(ModInfo.MOD_ID, "gravecap"), new Provider()); } - } - - public interface IGraveCapability - { - ItemStack getGraveItemStack(); - - void setGraveItemStack(ItemStack displayStack); - - NBTTagCompound serializeNBT(); - - void deserializeNBT(NBTTagCompound tagCompound); - } - - - - public static class Storage implements Capability.IStorage - { - @Override - public void readNBT(Capability capability, IGraveCapability iGraveCapability, EnumFacing enumFacing, NBTBase nbtBase) - { - iGraveCapability.deserializeNBT((NBTTagCompound) nbtBase); - } - - @Override - public NBTBase writeNBT(Capability capability, IGraveCapability iGraveCapability, EnumFacing enumFacing) - { - return iGraveCapability.serializeNBT(); - } - } - - - - public static class DefaultImpl implements IGraveCapability - { - ItemStack displayStack; - - @Override - public ItemStack getGraveItemStack() - { - return displayStack; - } - - @Override - public void setGraveItemStack(ItemStack displayStack) - { - this.displayStack = displayStack; - } - - @Override - public NBTTagCompound serializeNBT() - { - if(displayStack != null) - { return displayStack.writeToNBT(new NBTTagCompound()); } - else - { return new NBTTagCompound(); } - } - - @Override - public void deserializeNBT(NBTTagCompound tagCompound) - { - if(!tagCompound.hasNoTags()) - { - displayStack = ItemStack.loadItemStackFromNBT(tagCompound); - } - } + { event.addCapability(new ResourceLocation(ModInfo.MOD_ID, "gravecap"), new GraveCapProvider()); } } } diff --git a/src/main/java/com/fireball1725/graves/common/entity/capabilities/IGraveCapability.java b/src/main/java/com/fireball1725/graves/common/entity/capabilities/IGraveCapability.java new file mode 100644 index 0000000..8e91606 --- /dev/null +++ b/src/main/java/com/fireball1725/graves/common/entity/capabilities/IGraveCapability.java @@ -0,0 +1,15 @@ +package com.fireball1725.graves.common.entity.capabilities; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public interface IGraveCapability +{ + ItemStack getGraveItemStack(); + + void setGraveItemStack(ItemStack displayStack); + + NBTTagCompound serializeNBT(); + + void deserializeNBT(NBTTagCompound tagCompound); +} \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java index b86c921..117ad2b 100644 --- a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java +++ b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java @@ -6,6 +6,7 @@ import com.fireball1725.graves.common.block.Blocks; import com.fireball1725.graves.common.entity.EntityPlayerZombie; import com.fireball1725.graves.common.entity.capabilities.GraveCapability; +import com.fireball1725.graves.common.entity.capabilities.IGraveCapability; import com.fireball1725.graves.common.helpers.LogHelper; import com.fireball1725.graves.common.structure.ReplaceableBlock; import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; @@ -171,7 +172,7 @@ private void placeHeadStone(World world, BlockPos pos, EnumFacing facing, Entity if(tileEntityHeadStone != null) { tileEntityHeadStone.setCustomName(text); - GraveCapability.IGraveCapability grave = player.getCapability(GraveCapability.GRAVE_CAPABILITY, null); + IGraveCapability grave = player.getCapability(GraveCapability.GRAVE_CAPABILITY, null); if(grave != null) { tileEntityHeadStone.setDisplayStack(grave.getGraveItemStack()); From a8706ee97836245bf1bf9ab352501c384f6168ed Mon Sep 17 00:00:00 2001 From: FusionLord Date: Sun, 3 Jul 2016 02:54:32 -0700 Subject: [PATCH 30/47] Fixed a crash where Client would try to render the TileEntity before the block has been sent from server. --- .../graves/client/render/TileEntityHeadStoneRenderer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java b/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java index f551cb8..ee51ee5 100644 --- a/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java +++ b/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java @@ -22,7 +22,7 @@ public class TileEntityHeadStoneRenderer extends TileEntityBaseRenderer { public static TileEntityHeadStoneRenderer _instance = null; - public static IBakedModel bakedModel;// = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(Blocks.BLOCK_GRAVE_HEADSTONE.block.getDefaultState()); + public static IBakedModel bakedModel; public TileEntityHeadStoneRenderer() { @@ -64,7 +64,7 @@ public void renderTileEntityAt(TileEntity te, double x, double y, double z, floa { GlStateManager.pushMatrix(); GlStateManager.translate(x + .5, y + .5, z + .5); - if(te instanceof TileEntityHeadStone) + if(te instanceof TileEntityHeadStone && getWorld().getBlockState(te.getPos()).getBlock() instanceof BlockHeadStone) { TileEntityHeadStone headStone = (TileEntityHeadStone) te; IBlockState state = headStone.getWorld().getBlockState(te.getPos()); From ce8a3a74524017fa8487fe19f2b212e03400194f Mon Sep 17 00:00:00 2001 From: FusionLord Date: Sun, 3 Jul 2016 03:09:01 -0700 Subject: [PATCH 31/47] Real Support for Chisels and Bits. --- .../java/com/fireball1725/graves/Graves.java | 2 +- .../chiselsandbits/GraveCapability.java | 130 ------------------ .../render/TileEntityHeadStoneRenderer.java | 4 +- .../graves/common/block/BlockHeadStone.java | 8 +- .../capabilities/GraveCapDefaultImpl.java | 39 ++++++ .../entity/capabilities/GraveCapProvider.java | 43 ++++++ .../entity/capabilities/GraveCapStorage.java | 21 +++ .../entity/capabilities/GraveCapability.java | 39 ++++++ .../entity/capabilities/IGraveCapability.java | 15 ++ .../common/event/EventDeathHandler.java | 5 +- 10 files changed, 167 insertions(+), 139 deletions(-) delete mode 100644 src/main/java/com/fireball1725/graves/chiselsandbits/GraveCapability.java create mode 100644 src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapDefaultImpl.java create mode 100644 src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapProvider.java create mode 100644 src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapStorage.java create mode 100644 src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapability.java create mode 100644 src/main/java/com/fireball1725/graves/common/entity/capabilities/IGraveCapability.java diff --git a/src/main/java/com/fireball1725/graves/Graves.java b/src/main/java/com/fireball1725/graves/Graves.java index 1737b28..98d3b77 100644 --- a/src/main/java/com/fireball1725/graves/Graves.java +++ b/src/main/java/com/fireball1725/graves/Graves.java @@ -1,6 +1,6 @@ package com.fireball1725.graves; -import com.fireball1725.graves.chiselsandbits.GraveCapability; +import com.fireball1725.graves.common.entity.capabilities.GraveCapability; import com.fireball1725.graves.common.helpers.LogHelper; import com.fireball1725.graves.common.network.PacketHandler; import com.fireball1725.graves.common.reference.ModInfo; diff --git a/src/main/java/com/fireball1725/graves/chiselsandbits/GraveCapability.java b/src/main/java/com/fireball1725/graves/chiselsandbits/GraveCapability.java deleted file mode 100644 index b40cb7d..0000000 --- a/src/main/java/com/fireball1725/graves/chiselsandbits/GraveCapability.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.fireball1725.graves.chiselsandbits; - -import com.fireball1725.graves.common.reference.ModInfo; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.Capability.IStorage; -import net.minecraftforge.common.capabilities.CapabilityInject; -import net.minecraftforge.common.capabilities.CapabilityManager; -import net.minecraftforge.common.capabilities.ICapabilitySerializable; -import net.minecraftforge.event.AttachCapabilitiesEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; - -public class GraveCapability -{ - @CapabilityInject(IGraveCapability.class) - public static final Capability GRAVE_CAP = null; - - public static void register() - { - CapabilityManager.INSTANCE.register(IGraveCapability.class, new Storage(), DefaultImpl.class); - MinecraftForge.EVENT_BUS.register(new GraveCapability()); - } - - // Handles playerData props from being wiped on death - @SubscribeEvent - public void cloneEvent(PlayerEvent.Clone evt) - { - NBTTagCompound grave = evt.getOriginal().getCapability(GRAVE_CAP, null).serializeNBT(); - evt.getEntityPlayer().getCapability(GRAVE_CAP, null).deserializeNBT(grave); - } - - @SubscribeEvent - public void onPlayerLoad(AttachCapabilitiesEvent.Entity event) - { - class Provider implements ICapabilitySerializable - { - private IGraveCapability inst = GRAVE_CAP.getDefaultInstance(); - - @Override - public boolean hasCapability(Capability capability, EnumFacing enumFacing) - { - return capability == GRAVE_CAP; - } - - @Override - public T getCapability(Capability capability, EnumFacing enumFacing) - { - return capability == GRAVE_CAP ? GRAVE_CAP.cast(inst) : null; - } - - @Override - public NBTBase serializeNBT() - { - return GRAVE_CAP.getStorage().writeNBT(GRAVE_CAP, inst, null); - } - - @Override - public void deserializeNBT(NBTBase tag) - { - GRAVE_CAP.getStorage().readNBT(GRAVE_CAP, inst, null, tag); - } - } - - if(event.getEntity() instanceof EntityPlayer) - { event.addCapability(new ResourceLocation(ModInfo.MOD_ID, "GraveCap"), new Provider()); } - } - - public interface IGraveCapability - { - ItemStack getGraveItemStack(); - - void setGraveItemStack(ItemStack itemStack); - - NBTTagCompound serializeNBT(); - - void deserializeNBT(NBTTagCompound tag); - } - - public static class Storage implements IStorage - { - @Override - public NBTBase writeNBT(Capability capability, IGraveCapability instance, EnumFacing side) - { - return instance.serializeNBT(); - } - - @Override - public void readNBT(Capability capability, IGraveCapability instance, EnumFacing side, NBTBase nbt) - { - instance.deserializeNBT((NBTTagCompound) nbt); - } - } - - public static class DefaultImpl implements IGraveCapability - { - ItemStack stack; - @Override - public ItemStack getGraveItemStack() - { - return stack; - } - - @Override - public void setGraveItemStack(ItemStack stack) - { - this.stack = stack; - } - - @Override - public NBTTagCompound serializeNBT() - { - return stack == null ? new NBTTagCompound() : stack.serializeNBT(); - } - - @Override - public void deserializeNBT(NBTTagCompound tag) - { - if(tag.hasNoTags()) - { return; } - setGraveItemStack(ItemStack.loadItemStackFromNBT(tag)); - } - } -} \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java b/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java index ae2ac0c..a2315c6 100644 --- a/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java +++ b/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java @@ -21,7 +21,7 @@ public class TileEntityHeadStoneRenderer extends TileEntityBaseRenderer { public static TileEntityHeadStoneRenderer _instance = null; - public static IBakedModel bakedModel;// = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(Blocks.BLOCK_GRAVE_HEADSTONE.block.getDefaultState()); + public static IBakedModel bakedModel; public TileEntityHeadStoneRenderer() { @@ -63,7 +63,7 @@ public void renderTileEntityAt(TileEntity te, double x, double y, double z, floa { GlStateManager.pushMatrix(); GlStateManager.translate(x + .5, y + .5, z + .5); - if(te instanceof TileEntityHeadStone) + if(te instanceof TileEntityHeadStone && getWorld().getBlockState(te.getPos()).getBlock() instanceof BlockHeadStone) { TileEntityHeadStone headStone = (TileEntityHeadStone) te; IBlockState state = headStone.getWorld().getBlockState(te.getPos()); diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java index fc44327..3d633c7 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java @@ -1,10 +1,10 @@ package com.fireball1725.graves.common.block; import com.fireball1725.graves.Graves; -import com.fireball1725.graves.chiselsandbits.GraveCapability; +import com.fireball1725.graves.common.entity.capabilities.GraveCapability; +import com.fireball1725.graves.common.entity.capabilities.IGraveCapability; import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; import com.fireball1725.graves.common.util.TileTools; -import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyDirection; @@ -87,9 +87,9 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, if(worldIn.isRemote) { return true; } - if(heldItem == null || (heldItem.getItem() instanceof ItemBlock && ForgeRegistries.BLOCKS.getKey(Block.getBlockFromItem(heldItem.getItem())).getResourceDomain().equals("chiselsandbits"))) + if(heldItem == null || (heldItem.getItem() instanceof ItemBlock && ForgeRegistries.BLOCKS.getKey(((ItemBlock) heldItem.getItem()).block).getResourceDomain().equals("chiselsandbits"))) { - final GraveCapability.IGraveCapability grave = playerIn.getCapability(GraveCapability.GRAVE_CAP, null); + final IGraveCapability grave = playerIn.getCapability(GraveCapability.GRAVE_CAPABILITY, null); if(grave != null) { grave.setGraveItemStack(heldItem); diff --git a/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapDefaultImpl.java b/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapDefaultImpl.java new file mode 100644 index 0000000..4468f4b --- /dev/null +++ b/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapDefaultImpl.java @@ -0,0 +1,39 @@ +package com.fireball1725.graves.common.entity.capabilities; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public class GraveCapDefaultImpl implements IGraveCapability +{ + ItemStack displayStack; + + @Override + public ItemStack getGraveItemStack() + { + return displayStack; + } + + @Override + public void setGraveItemStack(ItemStack displayStack) + { + this.displayStack = displayStack; + } + + @Override + public NBTTagCompound serializeNBT() + { + if(displayStack != null) + { return displayStack.writeToNBT(new NBTTagCompound()); } + else + { return new NBTTagCompound(); } + } + + @Override + public void deserializeNBT(NBTTagCompound tagCompound) + { + if(!tagCompound.hasNoTags()) + { + displayStack = ItemStack.loadItemStackFromNBT(tagCompound); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapProvider.java b/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapProvider.java new file mode 100644 index 0000000..62bef8c --- /dev/null +++ b/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapProvider.java @@ -0,0 +1,43 @@ +package com.fireball1725.graves.common.entity.capabilities; + +import net.minecraft.nbt.NBTBase; +import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.ICapabilitySerializable; + +import javax.annotation.Nullable; + +import static com.fireball1725.graves.common.entity.capabilities.GraveCapability.GRAVE_CAPABILITY; + +public class GraveCapProvider implements ICapabilitySerializable +{ + private IGraveCapability inst = GRAVE_CAPABILITY.getDefaultInstance(); + + @Override + public T getCapability(Capability capability, + @Nullable + EnumFacing enumFacing) + { + return capability == GRAVE_CAPABILITY ? GRAVE_CAPABILITY.cast(inst) : null; + } + + @Override + public boolean hasCapability(Capability capability, + @Nullable + EnumFacing enumFacing) + { + return capability == GRAVE_CAPABILITY; + } + + @Override + public void deserializeNBT(NBTBase tagCompound) + { + GRAVE_CAPABILITY.getStorage().readNBT(GRAVE_CAPABILITY, inst, null, tagCompound); + } + + @Override + public NBTBase serializeNBT() + { + return GRAVE_CAPABILITY.getStorage().writeNBT(GRAVE_CAPABILITY, inst, null); + } +} \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapStorage.java b/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapStorage.java new file mode 100644 index 0000000..6528f9d --- /dev/null +++ b/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapStorage.java @@ -0,0 +1,21 @@ +package com.fireball1725.graves.common.entity.capabilities; + +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.capabilities.Capability; + +public class GraveCapStorage implements Capability.IStorage +{ + @Override + public void readNBT(Capability capability, IGraveCapability iGraveCapability, EnumFacing enumFacing, NBTBase nbtBase) + { + iGraveCapability.deserializeNBT((NBTTagCompound) nbtBase); + } + + @Override + public NBTBase writeNBT(Capability capability, IGraveCapability iGraveCapability, EnumFacing enumFacing) + { + return iGraveCapability.serializeNBT(); + } +} \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapability.java b/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapability.java new file mode 100644 index 0000000..0df52f6 --- /dev/null +++ b/src/main/java/com/fireball1725/graves/common/entity/capabilities/GraveCapability.java @@ -0,0 +1,39 @@ +package com.fireball1725.graves.common.entity.capabilities; + +import com.fireball1725.graves.common.reference.ModInfo; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.CapabilityInject; +import net.minecraftforge.common.capabilities.CapabilityManager; +import net.minecraftforge.event.AttachCapabilitiesEvent; +import net.minecraftforge.event.entity.player.PlayerEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class GraveCapability +{ + @CapabilityInject(IGraveCapability.class) + public static final Capability GRAVE_CAPABILITY = null; + + public static void register() + { + CapabilityManager.INSTANCE.register(IGraveCapability.class, new GraveCapStorage(), GraveCapDefaultImpl.class); + MinecraftForge.EVENT_BUS.register(new GraveCapability()); + } + + @SubscribeEvent + public void cloneEvent(PlayerEvent.Clone event) + { + NBTTagCompound grave = event.getOriginal().getCapability(GRAVE_CAPABILITY, null).serializeNBT(); + event.getEntityPlayer().getCapability(GRAVE_CAPABILITY, null).deserializeNBT(grave); + } + + @SubscribeEvent + public void onPlayerLoad(AttachCapabilitiesEvent.Entity event) + { + if(event.getEntity() instanceof EntityPlayer) + { event.addCapability(new ResourceLocation(ModInfo.MOD_ID, "gravecap"), new GraveCapProvider()); } + } +} diff --git a/src/main/java/com/fireball1725/graves/common/entity/capabilities/IGraveCapability.java b/src/main/java/com/fireball1725/graves/common/entity/capabilities/IGraveCapability.java new file mode 100644 index 0000000..8e91606 --- /dev/null +++ b/src/main/java/com/fireball1725/graves/common/entity/capabilities/IGraveCapability.java @@ -0,0 +1,15 @@ +package com.fireball1725.graves.common.entity.capabilities; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public interface IGraveCapability +{ + ItemStack getGraveItemStack(); + + void setGraveItemStack(ItemStack displayStack); + + NBTTagCompound serializeNBT(); + + void deserializeNBT(NBTTagCompound tagCompound); +} \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java index b052bee..25d959a 100644 --- a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java +++ b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java @@ -1,11 +1,12 @@ package com.fireball1725.graves.common.event; import com.fireball1725.graves.Graves; -import com.fireball1725.graves.chiselsandbits.GraveCapability; import com.fireball1725.graves.common.block.BlockGraveStone; import com.fireball1725.graves.common.block.BlockHeadStone; import com.fireball1725.graves.common.block.Blocks; import com.fireball1725.graves.common.entity.EntityPlayerZombie; +import com.fireball1725.graves.common.entity.capabilities.GraveCapability; +import com.fireball1725.graves.common.entity.capabilities.IGraveCapability; import com.fireball1725.graves.common.helpers.LogHelper; import com.fireball1725.graves.common.structure.ReplaceableBlock; import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; @@ -168,7 +169,7 @@ private void placeHeadStone(World world, BlockPos pos, EnumFacing facing, Entity if(tileEntityHeadStone != null) { tileEntityHeadStone.setCustomName(text); - GraveCapability.IGraveCapability grave = player.getCapability(GraveCapability.GRAVE_CAP, null); + IGraveCapability grave = player.getCapability(GraveCapability.GRAVE_CAPABILITY, null); if(grave != null) { tileEntityHeadStone.setDisplayStack(grave.getGraveItemStack()); From f05f05f992722db8a38ee4c59d81902dd97c425e Mon Sep 17 00:00:00 2001 From: FusionLord Date: Sun, 3 Jul 2016 04:07:40 -0700 Subject: [PATCH 32/47] Fixed some small bugs, and cleaned up code. --- .../java/com/fireball1725/graves/Graves.java | 1 + .../graves/client/events/RenderEvents.java | 1 + .../render/TileEntityHeadStoneRenderer.java | 47 +-- .../graves/common/block/BlockBase.java | 10 +- .../graves/common/block/BlockGraveStone.java | 4 +- .../graves/common/block/BlockHeadStone.java | 78 ++--- .../graves/common/entity/EntityFlying.java | 16 +- .../common/entity/EntityPlayerZombie.java | 68 ++-- .../graves/common/event/EventBlockBreak.java | 4 +- .../common/event/EventDeathHandler.java | 39 +-- .../graves/common/reference/ModInfo.java | 2 +- .../common/structure/ReplaceableBlock.java | 6 +- .../common/tileentity/TileEntityBase.java | 54 +++- .../tileentity/TileEntityGraveSlave.java | 12 +- .../tileentity/TileEntityGraveStone.java | 297 ++++++++++-------- .../tileentity/TileEntityHeadStone.java | 13 +- .../tileentity/TileEntityInventoryBase.java | 7 +- .../graves/proxy/ClientProxy.java | 1 - .../graves/proxy/CommonProxy.java | 52 +-- 19 files changed, 407 insertions(+), 305 deletions(-) diff --git a/src/main/java/com/fireball1725/graves/Graves.java b/src/main/java/com/fireball1725/graves/Graves.java index 98d3b77..09cbc55 100644 --- a/src/main/java/com/fireball1725/graves/Graves.java +++ b/src/main/java/com/fireball1725/graves/Graves.java @@ -66,5 +66,6 @@ public void init(FMLInitializationEvent event) { @Mod.EventHandler public void postInit(FMLPostInitializationEvent event) { + } } diff --git a/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java b/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java index e3e28c2..5495716 100644 --- a/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java +++ b/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java @@ -35,6 +35,7 @@ public class RenderEvents implements IResourceManagerReloadListener { + private final TextureAtlasSprite[] destroyBlockIcons = new TextureAtlasSprite[10]; @SubscribeEvent diff --git a/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java b/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java index a2315c6..5b5da77 100644 --- a/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java +++ b/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java @@ -20,7 +20,7 @@ import java.awt.*; public class TileEntityHeadStoneRenderer extends TileEntityBaseRenderer { - public static TileEntityHeadStoneRenderer _instance = null; + public static TileEntityHeadStoneRenderer _instance = null; public static IBakedModel bakedModel; public TileEntityHeadStoneRenderer() @@ -54,12 +54,12 @@ public static TileEntityHeadStoneRenderer instance() if(_instance == null) { _instance = new TileEntityHeadStoneRenderer(); - } - return _instance; - } + } + return _instance; + } - @Override - public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage) + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage) { GlStateManager.pushMatrix(); GlStateManager.translate(x + .5, y + .5, z + .5); @@ -128,23 +128,26 @@ public void renderTileEntityAt(TileEntity te, double x, double y, double z, floa public void renderTextOnHeadstone(String[] text, int color, boolean shadow) { - int i = 0; - for (String s : text) { - int stringWidth = mc.fontRendererObj.getStringWidth(s); - if (stringWidth == 0) { - stringWidth = 1; - } - int xCenter = stringWidth / 2; - int yCenter = mc.fontRendererObj.FONT_HEIGHT / 2; + int i = 0; + for(String s : text) + { + int stringWidth = mc.fontRendererObj.getStringWidth(s); + if(stringWidth == 0) + { + stringWidth = 1; + } + int xCenter = stringWidth / 2; + int yCenter = mc.fontRendererObj.FONT_HEIGHT / 2; if(i == 7) { GlStateManager.translate(0, 8, -.01); } - if (shadow) { - mc.fontRendererObj.drawString(s, -xCenter - 1, -yCenter + 1 + (renderFont.FONT_HEIGHT * i + 2), (color & 16579836) >> 2 | color & -16777216); - GlStateManager.translate(0f, 0f, -.001f); - } - mc.fontRendererObj.drawString(s, -xCenter, -yCenter + (renderFont.FONT_HEIGHT * i + 2), color); + if(shadow) + { + mc.fontRendererObj.drawString(s, -xCenter - 1, -yCenter + 1 + (renderFont.FONT_HEIGHT * i + 2), (color & 16579836) >> 2 | color & -16777216); + GlStateManager.translate(0f, 0f, -.001f); + } + mc.fontRendererObj.drawString(s, -xCenter, -yCenter + (renderFont.FONT_HEIGHT * i + 2), color); - i++; - } - } + i++; + } + } } diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockBase.java b/src/main/java/com/fireball1725/graves/common/block/BlockBase.java index d9e57fe..0d7fd10 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockBase.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockBase.java @@ -41,10 +41,12 @@ protected BlockBase(Material material) { } @Override - public TileEntity createNewTileEntity(World var1, int var2) { - if (hasBlockTileEntity()) { - try { - return this.tileEntityType.newInstance(); + public TileEntity createNewTileEntity(World world, int meta) + { + if(hasBlockTileEntity()) + { + try { + return tileEntityType.newInstance(); } catch (Throwable e) { throw new RuntimeException(e); } diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockGraveStone.java b/src/main/java/com/fireball1725/graves/common/block/BlockGraveStone.java index 8b20466..ec139be 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockGraveStone.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockGraveStone.java @@ -3,6 +3,7 @@ import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; import com.fireball1725.graves.common.util.TileTools; import net.minecraft.block.BlockHorizontal; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyDirection; @@ -30,9 +31,10 @@ public class BlockGraveStone extends BlockBase { public static final PropertyBool HASLID = PropertyBool.create("haslid"); public BlockGraveStone() { - super(Material.cloth); + super(Material.cloth); setDefaultState(this.blockState.getBaseState().withProperty(HASLID, true).withProperty(FACING, EnumFacing.NORTH)); setHardness(1F); + setStepSound(SoundType.STONE); this.setResistance(10000F); this.setTileEntity(TileEntityGraveStone.class); } diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java index 3d633c7..ed42e66 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java @@ -30,22 +30,23 @@ import java.util.List; public class BlockHeadStone extends BlockBase { - public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); public static final PropertyBool RENDER = PropertyBool.create("render"); - protected BlockHeadStone() { - super(Material.rock); + protected BlockHeadStone() + { + super(Material.rock); this.setDefaultState(blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(RENDER, true)); this.setHardness(1.5F); - this.setResistance(10.0F); - this.setHarvestLevel("pickaxe", 0); - this.setTileEntity(TileEntityHeadStone.class); - } + this.setResistance(10.0F); + this.setHarvestLevel("pickaxe", 0); + this.setTileEntity(TileEntityHeadStone.class); + } - @Override + @Override public EnumBlockRenderType getRenderType(IBlockState state) { - return EnumBlockRenderType.INVISIBLE; + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override @@ -54,21 +55,22 @@ public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, Ent return willHarvest || super.removedByPlayer(state, world, pos, player, false); } - @Override - public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { - TileEntityHeadStone headStone = TileTools.getTileEntity(world, pos, TileEntityHeadStone.class); + @Override + public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { + TileEntityHeadStone headStone = TileTools.getTileEntity(world, pos, TileEntityHeadStone.class); if(headStone != null && !headStone.getCustomName().isEmpty()) { final ItemStack itemStack = new ItemStack(this); itemStack.setStackDisplayName(headStone.getCustomName()); - ArrayList drops = new ArrayList(); - drops.add(itemStack); + ArrayList drops = new ArrayList(); + drops.add(itemStack); - return drops; - } - return super.getDrops(world, pos, state, fortune); - } + return drops; + } + return super.getDrops(world, pos, state, fortune); + } @Override public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te, ItemStack stack) @@ -87,7 +89,7 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, if(worldIn.isRemote) { return true; } - if(heldItem == null || (heldItem.getItem() instanceof ItemBlock && ForgeRegistries.BLOCKS.getKey(((ItemBlock) heldItem.getItem()).block).getResourceDomain().equals("chiselsandbits"))) + if(heldItem != null && heldItem.getItem() instanceof ItemBlock && ForgeRegistries.BLOCKS.getKey(((ItemBlock) heldItem.getItem()).block).getResourceDomain().equals("chiselsandbits")) { final IGraveCapability grave = playerIn.getCapability(GraveCapability.GRAVE_CAPABILITY, null); if(grave != null) @@ -108,34 +110,35 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, return super.onBlockActivated(worldIn, pos, state, playerIn, hand, heldItem, side, hitX, hitY, hitZ); } - @Override + @Override protected BlockStateContainer createBlockState() { return new BlockStateContainer(this, FACING, RENDER); } - @Override + @Override public boolean isOpaqueCube(IBlockState state) { return false; } - @Override + @Override public boolean isFullBlock(IBlockState state) { return false; } - @Override + @Override public boolean isFullCube(IBlockState state) { return false; } - @Override - public IBlockState getStateFromMeta(int meta) { - return getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)); - } + @Override + public IBlockState getStateFromMeta(int meta) + { + return getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)); + } @Override public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) @@ -168,7 +171,7 @@ public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(.7f, 0f, .1f, 1f, .95f, .9f)); break; } - } + } @Override public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) @@ -195,16 +198,17 @@ public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, Bloc public int getMetaFromState(IBlockState state) { return state.getValue(FACING).getHorizontalIndex(); - } - + } - @Override - public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { - return getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()); - } + @Override + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + return getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()); + } - @Override - public void onBlockExploded(World world, BlockPos pos, Explosion explosion) { + @Override + public void onBlockExploded(World world, BlockPos pos, Explosion explosion) + { - } + } } diff --git a/src/main/java/com/fireball1725/graves/common/entity/EntityFlying.java b/src/main/java/com/fireball1725/graves/common/entity/EntityFlying.java index ef7f1f8..c91a5bc 100644 --- a/src/main/java/com/fireball1725/graves/common/entity/EntityFlying.java +++ b/src/main/java/com/fireball1725/graves/common/entity/EntityFlying.java @@ -28,17 +28,17 @@ public void moveEntityWithHeading(float strafe, float forward) { if (this.isInWater()) { - this.moveFlying(strafe, forward, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.800000011920929D; + this.moveFlying(strafe, forward, 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.800000011920929D; this.motionY *= 0.800000011920929D; this.motionZ *= 0.800000011920929D; } else if (this.isInLava()) { - this.moveFlying(strafe, forward, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.5D; + this.moveFlying(strafe, forward, 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.5D; this.motionY *= 0.5D; this.motionZ *= 0.5D; } @@ -52,8 +52,8 @@ else if (this.isInLava()) } float f1 = 0.16277136F / (f * f * f); - this.moveFlying(strafe, forward, this.onGround ? 0.1F * f1 : 0.02F); - f = 0.91F; + this.moveFlying(strafe, forward, this.onGround ? 0.1F * f1 : 0.02F); + f = 0.91F; if (this.onGround) { diff --git a/src/main/java/com/fireball1725/graves/common/entity/EntityPlayerZombie.java b/src/main/java/com/fireball1725/graves/common/entity/EntityPlayerZombie.java index 17cb45a..27a863e 100644 --- a/src/main/java/com/fireball1725/graves/common/entity/EntityPlayerZombie.java +++ b/src/main/java/com/fireball1725/graves/common/entity/EntityPlayerZombie.java @@ -240,9 +240,9 @@ public ItemStack getPickedResult(RayTraceResult target) { ItemStack stack = new ItemStack(Items.spawn_egg); NBTTagCompound nbt = new NBTTagCompound(); - nbt.setString("entity_name", EntityList.classToStringMapping.get(getClass())); - stack.setTagCompound(nbt); - return stack; + nbt.setString("entity_name", EntityList.classToStringMapping.get(getClass())); + stack.setTagCompound(nbt); + return stack; } @Override @@ -337,32 +337,40 @@ public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLi } if (rng > rngNothing + rngSword + rngLeatherKit + rngIronKit + rngGoldKit) { // Diamond Kit - slot0 = new ItemStack(Items.diamond_sword); - slot1 = new ItemStack(Items.diamond_boots); - slot2 = new ItemStack(Items.diamond_leggings); - slot3 = new ItemStack(Items.diamond_chestplate); - slot4 = new ItemStack(Items.diamond_helmet); - } else if (rng > rngNothing + rngSword + rngLeatherKit + rngIronKit) { // Gold Kit - slot0 = new ItemStack(Items.golden_sword); - slot1 = new ItemStack(Items.golden_boots); - slot2 = new ItemStack(Items.golden_leggings); - slot3 = new ItemStack(Items.golden_chestplate); - slot4 = new ItemStack(Items.golden_helmet); - } else if (rng > rngNothing + rngSword + rngLeatherKit) { // Iron Kit - slot0 = new ItemStack(Items.iron_sword); - slot1 = new ItemStack(Items.iron_boots); - slot2 = new ItemStack(Items.iron_leggings); - slot3 = new ItemStack(Items.iron_chestplate); - slot4 = new ItemStack(Items.iron_helmet); - } else if (rng > rngNothing + rngSword) { // Leather Kit - slot0 = new ItemStack(Items.wooden_sword); - slot1 = new ItemStack(Items.leather_boots); - slot2 = new ItemStack(Items.leather_leggings); - slot3 = new ItemStack(Items.leather_chestplate); - slot4 = new ItemStack(Items.leather_helmet); - } else if (rng > rngNothing) { // Wooden Sword - slot0 = new ItemStack(Items.wooden_sword); - } + slot0 = new ItemStack(Items.diamond_sword); + slot1 = new ItemStack(Items.diamond_boots); + slot2 = new ItemStack(Items.diamond_leggings); + slot3 = new ItemStack(Items.diamond_chestplate); + slot4 = new ItemStack(Items.diamond_helmet); + } + else if(rng > rngNothing + rngSword + rngLeatherKit + rngIronKit) + { // Gold Kit + slot0 = new ItemStack(Items.golden_sword); + slot1 = new ItemStack(Items.golden_boots); + slot2 = new ItemStack(Items.golden_leggings); + slot3 = new ItemStack(Items.golden_chestplate); + slot4 = new ItemStack(Items.golden_helmet); + } + else if(rng > rngNothing + rngSword + rngLeatherKit) + { // Iron Kit + slot0 = new ItemStack(Items.iron_sword); + slot1 = new ItemStack(Items.iron_boots); + slot2 = new ItemStack(Items.iron_leggings); + slot3 = new ItemStack(Items.iron_chestplate); + slot4 = new ItemStack(Items.iron_helmet); + } + else if(rng > rngNothing + rngSword) + { // Leather Kit + slot0 = new ItemStack(Items.wooden_sword); + slot1 = new ItemStack(Items.leather_boots); + slot2 = new ItemStack(Items.leather_leggings); + slot3 = new ItemStack(Items.leather_chestplate); + slot4 = new ItemStack(Items.leather_helmet); + } + else if(rng > rngNothing) + { // Wooden Sword + slot0 = new ItemStack(Items.wooden_sword); + } if (ConfigZombie.configZombieArmorEnabled) { if(slot0 != null) @@ -458,7 +466,7 @@ public ITextComponent getDisplayName() private Style style; - @Override + @Override public Style getChatStyle() { if(style == null) diff --git a/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java b/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java index 70b9d35..9bdc0b4 100644 --- a/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java +++ b/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java @@ -45,9 +45,7 @@ public void onBreakBlock(BlockEvent.BreakEvent event) { List blocks = graveStone.getReplaceableBlocks(); EntityPlayer player = event.getPlayer(); - player.inventory.dropAllItems(); - - graveStone.replaceItems(player.inventory); + graveStone.replaceItems(player); event.getWorld().destroyBlock(graveStone.getPos().down(), false); event.getWorld().destroyBlock(graveStone.getPos().down().offset(graveStone.getBlockState().getValue(BlockGraveStone.FACING)), false); diff --git a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java index 25d959a..117ad2b 100644 --- a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java +++ b/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java @@ -66,24 +66,27 @@ public void onLivingDeath(LivingDeathEvent event) } } - @SubscribeEvent(priority = EventPriority.LOW, receiveCanceled = true) - public void onPlayerDrops(PlayerDropsEvent event) { + @SubscribeEvent(priority = EventPriority.LOW, receiveCanceled = true) + public void onPlayerDrops(PlayerDropsEvent event) + { World world = event.getEntityPlayer().worldObj; - if (world.isRemote) - return; + if(world.isRemote) + { return; } - if (event.isCanceled()) { - LogHelper.warn(">>>"); - return; - } + if(event.isCanceled()) + { + LogHelper.warn(">>>"); + return; + } - // Check to see if the gamerule keep inventory is enabled - final GameRules gameRules = world.getGameRules(); - if (gameRules.hasRule("keepInventory")) { - if (gameRules.getBoolean("keepInventory")) - return; - } + // Check to see if the gamerule keep inventory is enabled + final GameRules gameRules = world.getGameRules(); + if(gameRules.hasRule("keepInventory")) + { + if(gameRules.getBoolean("keepInventory")) + { return; } + } EntityPlayer player = event.getEntityPlayer(); List itemsList = Lists.newArrayList(); @@ -92,11 +95,11 @@ public void onPlayerDrops(PlayerDropsEvent event) { itemsList.add(entityItem.getEntityItem()); } - // If there are no items, then cancel spawning a grave - if (itemsList.isEmpty()) - return; + // If there are no items, then cancel spawning a grave + if(itemsList.isEmpty()) + { return; } - boolean spawnGrave = true; + boolean spawnGrave = true; if(event.getEntityLiving() instanceof EntityPlayer) { diff --git a/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java b/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java index 661aa76..d50d4b4 100644 --- a/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java +++ b/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java @@ -7,7 +7,7 @@ public class ModInfo { public static final String MINECRAFT_VERSION = "@MCVERSION@"; public static final String DEPENDENCIES = ""; public static final String SERVER_PROXY_CLASS = "com.fireball1725." + MOD_ID + ".proxy.ServerProxy"; - public static final String CLIENT_PROXY_CLASS = "com.fireball1725." + MOD_ID + ".proxy.ClientProxy"; + public static final String CLIENT_PROXY_CLASS = "com.fireball1725." + MOD_ID + ".proxy.ClientProxy"; public static final String FINGERPRINT = "@FINGERPRINT@"; public static final String GUI_FACTORY = "com.fireball1725." + MOD_ID + ".common.configuration.GravesConfigGuiFactory"; } diff --git a/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java b/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java index 4755767..48cf3fb 100644 --- a/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java +++ b/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java @@ -5,8 +5,10 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.fml.common.registry.ForgeRegistries; public class ReplaceableBlock { @@ -28,7 +30,7 @@ public static ReplaceableBlock readNBT(NBTTagCompound tag) IBlockState state; NBTTagCompound tileTag = null; - Block block = Block.getBlockById(tag.getInteger("blockID")); + Block block = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(tag.getString("blockID"))); state = block.getStateFromMeta(tag.getInteger("blockMeta")); BlockPos pos = BlockPos.fromLong(tag.getLong("blockPos")); @@ -57,7 +59,7 @@ public NBTTagCompound writeNBT() NBTTagCompound tag = new NBTTagCompound(); if (state != null) { - tag.setInteger("blockID", Block.blockRegistry.getIDForObject(state.getBlock())); + tag.setString("blockID", ForgeRegistries.BLOCKS.getKey(state.getBlock()).toString()); tag.setInteger("blockMeta", state.getBlock().getMetaFromState(state)); tag.setLong("blockPos", pos.toLong()); } diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityBase.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityBase.java index bda1c8e..680614d 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityBase.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityBase.java @@ -26,14 +26,15 @@ public static void registerTileItem(Class c, ItemStackSrc wat) { myItem.put(c, wat); } - @Override - public Packet getDescriptionPacket() { - NBTTagCompound data = new NBTTagCompound(); - writeToNBT(data); + @Override + public Packet getDescriptionPacket() + { + NBTTagCompound data = new NBTTagCompound(); + writeToNBT(data); return new SPacketUpdateTileEntity(this.pos, 1, data); } - @Override + @Override public void onDataPacket(NetworkManager networkManager, SPacketUpdateTileEntity sPacketUpdateTileEntity) { readFromNBT(sPacketUpdateTileEntity.getNbtCompound()); @@ -41,6 +42,24 @@ public void onDataPacket(NetworkManager networkManager, SPacketUpdateTileEntity markForUpdate(); } + // @Override + // public NBTTagCompound getUpdateTag() + // { + // NBTTagCompound tag = new NBTTagCompound(); + // tag.setInteger("x", pos.getX()); + // tag.setInteger("y", pos.getY()); + // tag.setInteger("z", pos.getZ()); + // return writeToNBT(tag); + // } + // + // @Override + // public void handleUpdateTag(NBTTagCompound tag) + // { + // readFromNBT(tag); + // worldObj.markBlockRangeForRenderUpdate(this.pos, this.pos); + // markForUpdate(); + // } + public void markForUpdate() { if (this.renderedFragment > 0) { this.renderedFragment |= 0x1; @@ -62,6 +81,14 @@ public void markForUpdate() { } } + public void onChunkLoad() + { + if(this.isInvalid()) + { this.validate(); } + + markForUpdate(); + } + @Override public void onChunkUnload() { if (!this.isInvalid()) @@ -115,14 +142,15 @@ public void setName(String name) { this.customName = name; } - @Override - public void writeToNBT(NBTTagCompound nbtTagCompound) { - super.writeToNBT(nbtTagCompound); - - if (this.customName != null) { - nbtTagCompound.setString("CustomName", this.customName); - } - } + @Override + public void writeToNBT(NBTTagCompound compound) + { + if(this.customName != null) + { + compound.setString("CustomName", this.customName); + } + super.writeToNBT(compound); + } @Override public void readFromNBT(NBTTagCompound nbtTagCompound) { diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveSlave.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveSlave.java index 5920260..6ce3905 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveSlave.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveSlave.java @@ -27,10 +27,12 @@ public void readFromNBT(NBTTagCompound compound) { } @Override - public void writeToNBT(NBTTagCompound compound) { - super.writeToNBT(compound); - if (masterBlock != null) { - compound.setLong("masterBlock", masterBlock.toLong()); + public void writeToNBT(NBTTagCompound compound) + { + if(masterBlock != null) + { + compound.setLong("masterBlock", masterBlock.toLong()); } - } + super.writeToNBT(compound); + } } diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java index 069abdd..27de9ff 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java @@ -5,6 +5,7 @@ import com.fireball1725.graves.common.block.Blocks; import com.fireball1725.graves.common.configuration.ConfigZombie; import com.fireball1725.graves.common.entity.EntityPlayerZombie; +import com.fireball1725.graves.common.helpers.ItemHelper; import com.fireball1725.graves.common.helpers.LogHelper; import com.fireball1725.graves.common.structure.ReplaceableBlock; import com.fireball1725.graves.common.tileentity.inventory.InternalDynamicInventory; @@ -13,6 +14,7 @@ import com.google.common.collect.Lists; import com.mojang.authlib.GameProfile; import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.IInventory; @@ -25,15 +27,16 @@ import net.minecraft.util.text.ITextComponent; import net.minecraft.world.EnumDifficulty; -import java.util.Iterator; +import java.util.ArrayList; import java.util.List; +import java.util.ListIterator; import java.util.Random; public class TileEntityGraveStone extends TileEntityInventoryBase { private boolean hasLid = true; - private InternalDynamicInventory internalInventory = new InternalDynamicInventory(this); - private GameProfile playerProfile; + private InternalDynamicInventory internalInventory = new InternalDynamicInventory(this); + private GameProfile playerProfile; private List replaceableBlocks = Lists.newArrayList(); private ItemStack[] replaceableItems = new ItemStack[14]; @@ -55,12 +58,12 @@ public static List getPositions(BlockPos pos, EnumFacing facing) } @Override - public Packet getDescriptionPacket() + public Packet getDescriptionPacket() { LogHelper.info(String.format("Gravestone (%s) at W=%s X=%s Y=%s Z=%s", this.playerProfile == null ? "null" : this.playerProfile.getName(), this.worldObj.getWorldInfo().getWorldName(), this.pos.getX(), this.pos.getY(), this.pos.getZ())); - return super.getDescriptionPacket(); - } + return super.getDescriptionPacket(); + } public void addGraveItems(List itemsList) { @@ -72,84 +75,86 @@ public void addGraveItems(List itemsList) public void addGraveItemsWithReplaceables(InventoryPlayer inventory, List itemsList) { - replaceableItems = new ItemStack[InventoryPlayer.getHotbarSize() + inventory.armorInventory.length + inventory.offHandInventory.length]; - ItemStack itemStack; - int placeAt; - for(int i = 0; i < InventoryPlayer.getHotbarSize(); i++) - { - placeAt = i; - itemStack = inventory.mainInventory[i]; - replaceableItems[placeAt] = itemStack; - } - for(int i = 0; i < inventory.armorInventory.length; i++) + System.arraycopy(inventory.mainInventory, 0, replaceableItems, 0, InventoryPlayer.getHotbarSize()); + + rItems: + for(ItemStack stack : replaceableItems) { - placeAt = i + InventoryPlayer.getHotbarSize(); - itemStack = inventory.armorInventory[i]; - replaceableItems[placeAt] = itemStack; + ListIterator iterator = itemsList.listIterator(); + ItemStack stack1; + while(iterator.hasNext()) + { + stack1 = iterator.next(); + + if(ItemHelper.doesItemHaveEnchant(stack1, "soulBound")) + { + iterator.remove(); + continue; + } + + if(areItemEqual(stack, stack1)) + { + iterator.remove(); + continue rItems; + } + } } - for(int i = 0; i < inventory.offHandInventory.length; i++) + for(int i = 0; i < replaceableItems.length; i++) { - placeAt = i + InventoryPlayer.getHotbarSize() + inventory.armorInventory.length; - itemStack = inventory.offHandInventory[i]; - replaceableItems[placeAt] = itemStack; + ItemStack stack = replaceableItems[i]; + if(ItemHelper.doesItemHaveEnchant(stack, "soulBound")) + { + replaceableItems[i] = null; + } } - Iterator listIterator = itemsList.listIterator(); - listIterator: - while(listIterator.hasNext()) + addGraveItems(itemsList); + } + + private boolean areItemEqual(ItemStack stack, ItemStack stack1) + { + boolean flag = ItemStack.areItemsEqual(stack, stack1); + if(stack != null && stack1 != null) { - ItemStack stack1 = listIterator.next(); - if(stack1 != null) + if((stack.hasTagCompound() && !stack1.hasTagCompound()) || (!stack.hasTagCompound() && stack1.hasTagCompound())) { - for(ItemStack stack : replaceableItems) - { - if(stack != null) - { - if(stack1.isItemEqual(stack)) - { - if(stack1.hasTagCompound() && stack.hasTagCompound()) - { - if(stack1.getTagCompound().equals(stack.getTagCompound())) - { - listIterator.remove(); - continue listIterator; - } - } - else - { - listIterator.remove(); - continue listIterator; - } - } - } - } + return false; + } + if(stack.hasTagCompound() && stack1.hasTagCompound()) + { + return flag && stack.getTagCompound().equals(stack1.getTagCompound()); } } - addGraveItems(itemsList); + return flag; } - public boolean getHasLid() { - return hasLid; - } + public boolean getHasLid() + { + return hasLid; + } - public void setHasLid(boolean hasLid) { - this.hasLid = hasLid; + public void setHasLid(boolean hasLid) + { + this.hasLid = hasLid; worldObj.notifyBlockUpdate(pos, getBlockState(), getBlockState().withProperty(BlockGraveStone.HASLID, false), 3); } - private GameProfile getPlayerProfile() { - return playerProfile; - } + private GameProfile getPlayerProfile() + { + return playerProfile; + } - public void setPlayerProfile(GameProfile playerProfile) { - this.playerProfile = playerProfile; - } + public void setPlayerProfile(GameProfile playerProfile) + { + this.playerProfile = playerProfile; + } - @Override - public void readFromNBT(NBTTagCompound nbtTagCompound) { - super.readFromNBT(nbtTagCompound); + @Override + public void readFromNBT(NBTTagCompound nbtTagCompound) + { + super.readFromNBT(nbtTagCompound); - this.hasLid = nbtTagCompound.getBoolean("hasLid"); - this.playerProfile = NBTUtil.readGameProfileFromNBT(nbtTagCompound.getCompoundTag("playerProfile")); + this.hasLid = nbtTagCompound.getBoolean("hasLid"); + this.playerProfile = NBTUtil.readGameProfileFromNBT(nbtTagCompound.getCompoundTag("playerProfile")); NBTTagCompound replaceableTag = nbtTagCompound.getCompoundTag("replaceableBlocks"); int size = replaceableTag.getInteger("size"); @@ -163,21 +168,24 @@ public void readFromNBT(NBTTagCompound nbtTagCompound) { for(int i = 0; i < replaceableItems.length; i++) { if(tag.hasKey("item:" + i)) - { replaceableItems[i] = ItemStack.loadItemStackFromNBT(tag.getCompoundTag("item:" + i)); } + { + replaceableItems[i] = ItemStack.loadItemStackFromNBT(tag.getCompoundTag("item:" + i)); + } } } - @Override - public void writeToNBT(NBTTagCompound nbtTagCompound) { - super.writeToNBT(nbtTagCompound); + @Override + public void writeToNBT(NBTTagCompound nbtTagCompound) + { - nbtTagCompound.setBoolean("hasLid", this.hasLid); + nbtTagCompound.setBoolean("hasLid", this.hasLid); - if (playerProfile != null) { - NBTTagCompound profileTag = new NBTTagCompound(); - NBTUtil.writeGameProfile(profileTag, playerProfile); - nbtTagCompound.setTag("playerProfile", profileTag); - } + if(playerProfile != null) + { + NBTTagCompound profileTag = new NBTTagCompound(); + NBTUtil.writeGameProfile(profileTag, playerProfile); + nbtTagCompound.setTag("playerProfile", profileTag); + } NBTTagCompound replaceableBlocksTag = new NBTTagCompound(); replaceableBlocksTag.setInteger("size", replaceableBlocks.size()); @@ -194,78 +202,84 @@ public void writeToNBT(NBTTagCompound nbtTagCompound) { { replaceableItemsTag.setTag("item:" + i, replaceableItems[i].writeToNBT(new NBTTagCompound())); } } nbtTagCompound.setTag("replaceableItems", replaceableItemsTag); + super.writeToNBT(nbtTagCompound); } - public void breakBlocks() { - // Adding slaves - if(worldObj == null) - { - LogHelper.info("World is null??"); - return; - } - IBlockState state2 = worldObj.getBlockState(pos); - EnumFacing facing = state2.getValue(BlockGraveStone.FACING); - IBlockState state = Blocks.BLOCK_GRAVESTONE_SLAVE.block.getDefaultState(); + public void breakBlocks() + { + // Adding slaves + IBlockState defSlaveState = Blocks.BLOCK_GRAVESTONE_SLAVE.block.getDefaultState(); + IBlockState state = worldObj.getBlockState(pos); + EnumFacing facing = state.getBlock().getActualState(state, worldObj, pos).getValue(BlockGraveStone.FACING); TileEntityGraveSlave tileEntityGraveSlave; for(BlockPos slavePos : getSlaves(pos, facing)) { worldObj.removeTileEntity(slavePos); - worldObj.setBlockState(slavePos, BlockGraveSlave.getActualStatePre(state, worldObj, slavePos, pos)); + worldObj.setBlockState(slavePos, BlockGraveSlave.getActualStatePre(defSlaveState, worldObj, slavePos, pos)); tileEntityGraveSlave = TileTools.getTileEntity(worldObj, slavePos, TileEntityGraveSlave.class); tileEntityGraveSlave.setMasterBlock(pos); } // End of adding slaves - } + } @Override - public IInventory getInternalInventory() { - return this.internalInventory; - } + public IInventory getInternalInventory() + { + return this.internalInventory; + } - @Override - public void saveChanges() { + @Override + public void saveChanges() + { - } + } - @Override - public void onChangeInventory(IInventory inv, int slot, InventoryOperation operation, ItemStack removed, ItemStack added) { + @Override + public void onChangeInventory(IInventory inv, int slot, InventoryOperation operation, ItemStack removed, ItemStack added) + { - } + } - @Override - public int[] getAccessibleSlotsBySide(EnumFacing side) { - return new int[0]; - } + @Override + public int[] getAccessibleSlotsBySide(EnumFacing side) + { + return new int[0]; + } - @Override - public ItemStack removeStackFromSlot(int index) { - return null; - } + @Override + public ItemStack removeStackFromSlot(int index) + { + return null; + } - @Override - public int getField(int id) { - return 0; - } + @Override + public int getField(int id) + { + return 0; + } - @Override - public void setField(int id, int value) { + @Override + public void setField(int id, int value) + { - } + } - @Override - public int getFieldCount() { - return 0; - } + @Override + public int getFieldCount() + { + return 0; + } - @Override - public void clear() { + @Override + public void clear() + { - } + } - @Override + @Override public ITextComponent getDisplayName() { return null; @@ -373,11 +387,44 @@ public void setReplaceableBlocks(List replaceableBlocks) this.replaceableBlocks = replaceableBlocks; } - public void replaceItems(InventoryPlayer inventory) + public void replaceItems(EntityPlayer player) { - System.arraycopy(replaceableItems, 0, inventory.mainInventory, 0, InventoryPlayer.getHotbarSize()); - System.arraycopy(replaceableItems, InventoryPlayer.getHotbarSize(), inventory.armorInventory, 0, inventory.armorInventory.length); - System.arraycopy(replaceableItems, InventoryPlayer.getHotbarSize() + inventory.armorInventory.length, inventory.offHandInventory, 0, inventory.offHandInventory.length); + InventoryPlayer inventory = player.inventory; + List remaining = new ArrayList(); + for(int i = 0; i < inventory.mainInventory.length; i++) + { + if(i >= replaceableItems.length) + { break; } + ItemStack currentItem = inventory.mainInventory[i]; + ItemStack replaceItem = replaceableItems[i]; + if(InventoryPlayer.isHotbar(i)) + { + LogHelper.info(String.format("CurrentItem: %s, replaceItem: %s", currentItem, replaceItem)); + if(currentItem == null && replaceItem != null) + { + inventory.mainInventory[i] = replaceItem; + } + else + { + remaining.add(replaceItem); + } + } + else + { + remaining.add(replaceItem); + } + } + + for(ItemStack remainingStack : remaining) + { + LogHelper.info(String.format("remainingStack: %s", remainingStack)); + if(!inventory.addItemStackToInventory(remainingStack)) + { + if(remainingStack != null && remainingStack.stackSize >= 1) + { worldObj.spawnEntityInWorld(new EntityItem(worldObj, player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ(), remainingStack)); } + } + } + inventory.markDirty(); } } diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityHeadStone.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityHeadStone.java index 2a470ab..d4b25ba 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityHeadStone.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityHeadStone.java @@ -14,10 +14,10 @@ public class TileEntityHeadStone extends TileEntityBase public TileEntityHeadStone() { super(); - } + } @Override - public Packet getDescriptionPacket() + public Packet getDescriptionPacket() { return new SPacketUpdateTileEntity(getPos(), getBlockMetadata(), serializeNBT()); } @@ -29,9 +29,10 @@ public void onDataPacket(NetworkManager networkManager, SPacketUpdateTileEntity } @Override - public String getCustomName() { - return hasCustomName() ? this.customName : ""; - } + public String getCustomName() + { + return hasCustomName() ? this.customName : ""; + } public ItemStack getDisplayStack() { @@ -46,9 +47,9 @@ public void setDisplayStack(ItemStack displayStack) @Override public void writeToNBT(NBTTagCompound nbtTagCompound) { - super.writeToNBT(nbtTagCompound); if(displayStack != null) { nbtTagCompound.setTag("displayStack", displayStack.serializeNBT()); } + super.writeToNBT(nbtTagCompound); } @Override diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityInventoryBase.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityInventoryBase.java index b83ac8d..a6bbf2f 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityInventoryBase.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityInventoryBase.java @@ -31,8 +31,8 @@ public void readFromNBT(NBTTagCompound nbtTagCompound) { } @Override - public void writeToNBT(NBTTagCompound nbtTagCompound) { - super.writeToNBT(nbtTagCompound); + public void writeToNBT(NBTTagCompound nbtTagCompound) + { if (getInternalInventory() instanceof IInventoryCustom) { IInventoryCustom inventoryCustom = (IInventoryCustom)getInternalInventory(); @@ -49,7 +49,8 @@ public void writeToNBT(NBTTagCompound nbtTagCompound) { } nbtTagCompound.setTag("Items", tagCompound); } - } + super.writeToNBT(nbtTagCompound); + } @Override public int getSizeInventory() { diff --git a/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java b/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java index 74a19c4..b0095a5 100644 --- a/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java +++ b/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java @@ -46,7 +46,6 @@ public void registerRenderers() { ClientRegistry.bindTileEntitySpecialRenderer(TileEntityHeadStone.class, TileEntityHeadStoneRenderer.instance()); RenderEvents renderEvents = new RenderEvents(); MinecraftForge.EVENT_BUS.register(renderEvents); - ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(renderEvents); } } diff --git a/src/main/java/com/fireball1725/graves/proxy/CommonProxy.java b/src/main/java/com/fireball1725/graves/proxy/CommonProxy.java index a45c609..d47fc66 100644 --- a/src/main/java/com/fireball1725/graves/proxy/CommonProxy.java +++ b/src/main/java/com/fireball1725/graves/proxy/CommonProxy.java @@ -53,33 +53,33 @@ public void registerRecipes() { " x ", "xzx", "xxx", - 'x', new ItemStack(net.minecraft.init.Blocks.stone, 1, 4), - 'z', new ItemStack(net.minecraft.init.Blocks.stone, 1, 6)); - } + 'x', new ItemStack(net.minecraft.init.Blocks.stone, 1, 4), + 'z', new ItemStack(net.minecraft.init.Blocks.stone, 1, 6)); + } @Override public void registerWhiteList() { - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.dirt.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.dirt.getStateFromMeta(2)); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.grass.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.stone.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.stone.getStateFromMeta(1)); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.stone.getStateFromMeta(3)); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.stone.getStateFromMeta(5)); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.cobblestone.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.sand.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.sand.getStateFromMeta(1)); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.gravel.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.soul_sand.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.netherrack.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.clay.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.water.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.lava.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.flowing_water.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.flowing_lava.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.snow_layer.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.ice.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.packed_ice.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.mycelium.getDefaultState()); - } + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.dirt.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.dirt.getStateFromMeta(2)); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.grass.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.stone.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.stone.getStateFromMeta(1)); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.stone.getStateFromMeta(3)); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.stone.getStateFromMeta(5)); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.cobblestone.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.sand.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.sand.getStateFromMeta(1)); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.gravel.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.soul_sand.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.netherrack.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.clay.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.water.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.lava.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.flowing_water.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.flowing_lava.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.snow_layer.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.ice.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.packed_ice.getDefaultState()); + BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.mycelium.getDefaultState()); + } } From 31c87962c9bb51d783b9a9353cf26355dc8c0c8b Mon Sep 17 00:00:00 2001 From: FusionLord Date: Sun, 3 Jul 2016 04:08:47 -0700 Subject: [PATCH 33/47] Forgot this class in last commit. --- .../graves/common/helpers/ItemHelper.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/main/java/com/fireball1725/graves/common/helpers/ItemHelper.java diff --git a/src/main/java/com/fireball1725/graves/common/helpers/ItemHelper.java b/src/main/java/com/fireball1725/graves/common/helpers/ItemHelper.java new file mode 100644 index 0000000..e54364f --- /dev/null +++ b/src/main/java/com/fireball1725/graves/common/helpers/ItemHelper.java @@ -0,0 +1,32 @@ +package com.fireball1725.graves.common.helpers; + +import net.minecraft.enchantment.Enchantment; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; + +public class ItemHelper +{ + public static boolean doesItemHaveEnchant(ItemStack stack, String enchant) + { + if(stack != null && stack.getTagCompound() != null && stack.getTagCompound().hasKey("ench")) + { + NBTTagList tagList = stack.getTagCompound().getTagList("ench", 10); + for(int i = 0; i < tagList.tagCount(); i++) + { + NBTTagCompound tag = tagList.getCompoundTagAt(i); + if(tag.getString("id").equals(enchant)) + { + return true; + } + } + } + + return false; + } + + public static boolean doesItemHaveEnchant(ItemStack stack, Enchantment enchantment) + { + return doesItemHaveEnchant(stack, enchantment.getName()); + } +} From 1c3e626d2b12c334f447222393bb475c65482141 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Sun, 3 Jul 2016 04:10:05 -0700 Subject: [PATCH 34/47] Removed debug code causing some fps issues. --- .../graves/client/render/TileEntityHeadStoneRenderer.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java b/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java index ee51ee5..473af3e 100644 --- a/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java +++ b/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java @@ -1,7 +1,6 @@ package com.fireball1725.graves.client.render; import com.fireball1725.graves.common.block.BlockHeadStone; -import com.fireball1725.graves.common.helpers.LogHelper; import com.fireball1725.graves.common.reference.ModInfo; import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; import com.google.common.base.Function; @@ -94,7 +93,6 @@ public void renderTileEntityAt(TileEntity te, double x, double y, double z, floa GlStateManager.disableRescaleNormal(); GlStateManager.disableLighting(); GlStateManager.popMatrix(); - LogHelper.info("Rendering!..."); } else { From 54de74fc45797e3ba0641819824cc49203ba83a2 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Sun, 3 Jul 2016 13:01:27 -0700 Subject: [PATCH 35/47] Fixed a bug where you couldn't clear the headstone display stack. --- .../com/fireball1725/graves/common/block/BlockHeadStone.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java index b346f19..692ae32 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java @@ -89,7 +89,7 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, if(worldIn.isRemote) { return true; } - if(heldItem != null && heldItem.getItem() instanceof ItemBlock && ForgeRegistries.BLOCKS.getKey(((ItemBlock) heldItem.getItem()).block).getResourceDomain().equals("chiselsandbits")) + if(heldItem == null || (heldItem.getItem() instanceof ItemBlock && ForgeRegistries.BLOCKS.getKey(((ItemBlock) heldItem.getItem()).block).getResourceDomain().equals("chiselsandbits"))) { final IGraveCapability grave = playerIn.getCapability(GraveCapability.GRAVE_CAPABILITY, null); if(grave != null) From 345da9567e4461904bf7d376b0624f08abb967c6 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Sun, 3 Jul 2016 13:02:14 -0700 Subject: [PATCH 36/47] Fixed a bug where you couldn't clear the headstone display stack. --- .../com/fireball1725/graves/common/block/BlockHeadStone.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java index ed42e66..b2089b5 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java @@ -89,7 +89,7 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, if(worldIn.isRemote) { return true; } - if(heldItem != null && heldItem.getItem() instanceof ItemBlock && ForgeRegistries.BLOCKS.getKey(((ItemBlock) heldItem.getItem()).block).getResourceDomain().equals("chiselsandbits")) + if(heldItem == null || (heldItem.getItem() instanceof ItemBlock && ForgeRegistries.BLOCKS.getKey(((ItemBlock) heldItem.getItem()).block).getResourceDomain().equals("chiselsandbits"))) { final IGraveCapability grave = playerIn.getCapability(GraveCapability.GRAVE_CAPABILITY, null); if(grave != null) From 6a024580a8bce368a6a98bd5e9b940d49f9451ca Mon Sep 17 00:00:00 2001 From: FusionLord Date: Wed, 13 Jul 2016 01:51:44 -0700 Subject: [PATCH 37/47] Graves Rewrite, with legacy support. --- gradle.properties | 4 +- .../java/com/fireball1725/graves/Graves.java | 52 +- .../graves/client/event/EventTick.java | 24 + .../graves/client/events/RenderEvents.java | 156 -- .../graves/client/gui/GuiScreenHeadstone.java | 72 - .../graves/client/render/TEGraveSR.java | 178 ++ .../client/render/TileEntityBaseRenderer.java | 94 - .../render/TileEntityHeadStoneRenderer.java | 153 -- ...tityRenderers.java => EntityRenderer.java} | 2 +- .../render/entity/RenderPlayerZombie.java | 5 - .../graves/common/block/BlockBase.java | 33 - .../{BlockHeadStone.java => BlockGrave.java} | 101 +- .../graves/common/block/BlockGraveLegacy.java | 49 + .../graves/common/block/BlockGraveSlave.java | 288 --- .../graves/common/block/BlockGraveStone.java | 148 -- .../graves/common/block/Blocks.java | 9 +- .../common/creativetab/ModCreativeTabs.java | 15 - .../common/entity/EntityPlayerZombie.java | 1142 +++++---- .../graves/common/event/EventBlockBreak.java | 63 - .../{EventDeathHandler.java => Events.java} | 116 +- .../helpers/BreakableWhiteListHelper.java | 18 - .../graves/common/helpers/ItemHelper.java | 24 +- .../graves/common/helpers/LogHelper.java | 43 - .../graves/common/helpers/OpenGLHelper.java | 72 - .../common/helpers/SafeBlockReplacer.java | 183 -- .../graves/common/item/ItemHeadStone.java | 22 - .../messages/MessageSetHeadstoneName.java | 6 +- .../common/structure/ReplaceableBlock.java | 12 +- .../common/tileentity/TileEntityBase.java | 6 +- .../common/tileentity/TileEntityGrave.java | 382 +++ .../tileentity/TileEntityGraveSlave.java | 37 - .../tileentity/TileEntityGraveStone.java | 432 ---- .../tileentity/TileEntityHeadStone.java | 66 - .../tileentity/TileEntityInventoryBase.java | 200 +- .../graves/common/util/GuiHandler.java | 27 - .../graves/proxy/ClientProxy.java | 62 +- .../graves/proxy/CommonProxy.java | 107 +- .../com/fireball1725/graves/proxy/IProxy.java | 20 +- .../graves/proxy/ServerProxy.java | 5 - .../assets/graves/blockstates/grave.json | 29 + .../assets/graves/blockstates/graveslave.json | 48 - .../assets/graves/blockstates/gravestone.json | 53 - .../assets/graves/blockstates/headstone.json | 45 - .../resources/assets/graves/lang/en_US.lang | 6 +- .../assets/graves/models/block/grave.mtl | 32 + .../assets/graves/models/block/grave.obj | 2258 +++++++++++++++++ .../graves/models/block/graveboxsection.mtl | 24 - .../graves/models/block/graveboxsection.obj | 176 -- .../models/block/graveboxsectionfoot.mtl | 24 - .../models/block/graveboxsectionfoot.obj | 176 -- .../graves/models/block/gravelidsection.mtl | 23 - .../graves/models/block/gravelidsection.obj | 118 - .../models/block/gravelidsectionfoot.mtl | 13 - .../models/block/gravelidsectionfoot.obj | 109 - .../assets/graves/models/block/gravestone.mtl | 14 - .../assets/graves/models/block/gravestone.obj | 196 -- .../assets/graves/models/block/headstone.mtl | 24 - .../assets/graves/models/block/headstone.obj | 1638 ------------ .../assets/graves/models/block/nothing.mtl | 2 - .../assets/graves/models/block/nothing.obj | 3 - 60 files changed, 3907 insertions(+), 5532 deletions(-) create mode 100644 src/main/java/com/fireball1725/graves/client/event/EventTick.java delete mode 100644 src/main/java/com/fireball1725/graves/client/events/RenderEvents.java delete mode 100644 src/main/java/com/fireball1725/graves/client/gui/GuiScreenHeadstone.java create mode 100644 src/main/java/com/fireball1725/graves/client/render/TEGraveSR.java delete mode 100644 src/main/java/com/fireball1725/graves/client/render/TileEntityBaseRenderer.java delete mode 100644 src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java rename src/main/java/com/fireball1725/graves/client/render/entity/{EntityRenderers.java => EntityRenderer.java} (97%) rename src/main/java/com/fireball1725/graves/common/block/{BlockHeadStone.java => BlockGrave.java} (63%) create mode 100644 src/main/java/com/fireball1725/graves/common/block/BlockGraveLegacy.java delete mode 100644 src/main/java/com/fireball1725/graves/common/block/BlockGraveSlave.java delete mode 100644 src/main/java/com/fireball1725/graves/common/block/BlockGraveStone.java delete mode 100644 src/main/java/com/fireball1725/graves/common/creativetab/ModCreativeTabs.java delete mode 100644 src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java rename src/main/java/com/fireball1725/graves/common/event/{EventDeathHandler.java => Events.java} (56%) delete mode 100644 src/main/java/com/fireball1725/graves/common/helpers/BreakableWhiteListHelper.java delete mode 100644 src/main/java/com/fireball1725/graves/common/helpers/LogHelper.java delete mode 100644 src/main/java/com/fireball1725/graves/common/helpers/OpenGLHelper.java delete mode 100644 src/main/java/com/fireball1725/graves/common/helpers/SafeBlockReplacer.java delete mode 100644 src/main/java/com/fireball1725/graves/common/item/ItemHeadStone.java create mode 100644 src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGrave.java delete mode 100644 src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveSlave.java delete mode 100644 src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java delete mode 100644 src/main/java/com/fireball1725/graves/common/tileentity/TileEntityHeadStone.java delete mode 100644 src/main/java/com/fireball1725/graves/common/util/GuiHandler.java delete mode 100644 src/main/java/com/fireball1725/graves/proxy/ServerProxy.java create mode 100644 src/main/resources/assets/graves/blockstates/grave.json delete mode 100644 src/main/resources/assets/graves/blockstates/graveslave.json delete mode 100644 src/main/resources/assets/graves/blockstates/gravestone.json delete mode 100644 src/main/resources/assets/graves/blockstates/headstone.json create mode 100644 src/main/resources/assets/graves/models/block/grave.mtl create mode 100644 src/main/resources/assets/graves/models/block/grave.obj delete mode 100644 src/main/resources/assets/graves/models/block/graveboxsection.mtl delete mode 100644 src/main/resources/assets/graves/models/block/graveboxsection.obj delete mode 100644 src/main/resources/assets/graves/models/block/graveboxsectionfoot.mtl delete mode 100644 src/main/resources/assets/graves/models/block/graveboxsectionfoot.obj delete mode 100644 src/main/resources/assets/graves/models/block/gravelidsection.mtl delete mode 100644 src/main/resources/assets/graves/models/block/gravelidsection.obj delete mode 100644 src/main/resources/assets/graves/models/block/gravelidsectionfoot.mtl delete mode 100644 src/main/resources/assets/graves/models/block/gravelidsectionfoot.obj delete mode 100644 src/main/resources/assets/graves/models/block/gravestone.mtl delete mode 100644 src/main/resources/assets/graves/models/block/gravestone.obj delete mode 100644 src/main/resources/assets/graves/models/block/headstone.mtl delete mode 100644 src/main/resources/assets/graves/models/block/headstone.obj delete mode 100644 src/main/resources/assets/graves/models/block/nothing.mtl diff --git a/gradle.properties b/gradle.properties index 8146eae..309a92d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -minecraft_version=1.10 -forge_version=12.18.0.2000-1.10.0 +minecraft_version=1.10.2 +forge_version=12.18.0.2008 mcp_mappings=snapshot_20160518 cibuild=0 cibasename=graves \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/Graves.java b/src/main/java/com/fireball1725/graves/Graves.java index bebe701..a8c9197 100644 --- a/src/main/java/com/fireball1725/graves/Graves.java +++ b/src/main/java/com/fireball1725/graves/Graves.java @@ -1,10 +1,6 @@ package com.fireball1725.graves; -import com.fireball1725.graves.common.entity.capabilities.GraveCapability; -import com.fireball1725.graves.common.helpers.LogHelper; -import com.fireball1725.graves.common.network.PacketHandler; import com.fireball1725.graves.common.reference.ModInfo; -import com.fireball1725.graves.common.util.GuiHandler; import com.fireball1725.graves.proxy.IProxy; import com.google.common.base.Stopwatch; import net.minecraftforge.common.config.Configuration; @@ -13,7 +9,7 @@ import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; -import net.minecraftforge.fml.common.network.NetworkRegistry; +import org.apache.logging.log4j.Logger; import java.util.concurrent.TimeUnit; @@ -25,47 +21,35 @@ public class Graves { @SidedProxy(clientSide = ModInfo.CLIENT_PROXY_CLASS, serverSide = ModInfo.SERVER_PROXY_CLASS) public static IProxy proxy; + public static Logger logger; + public static Configuration configuration; @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { - GraveCapability.register(); - final Stopwatch stopWatch = Stopwatch.createStarted(); - LogHelper.info("Pre Initialization ( started )"); - - // Setup Configuration - proxy.registerConfiguration(event.getSuggestedConfigurationFile()); - - // Register Blocks - proxy.registerBlocks(); - - // Register Items - proxy.registerItems(); - - // Register Entities - proxy.registerEntities(); - - // Register Events - proxy.registerEvents(); + logger = event.getModLog(); - // Register Crafting Recipes - proxy.registerRecipes(); + final Stopwatch stopWatch = Stopwatch.createStarted(); + logger.info("Pre-Initialization ( started )"); - // Register Whitelist - proxy.registerWhiteList(); + proxy.preInit(event); - LogHelper.info("Pre Initalization ( ended after " + stopWatch.elapsed(TimeUnit.MILLISECONDS) + "ms )"); + logger.info("Pre-Initialization ( ended after " + stopWatch.elapsed(TimeUnit.MILLISECONDS) + "ms )"); } @Mod.EventHandler public void init(FMLInitializationEvent event) { - PacketHandler.init(); - NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler()); - proxy.registerRenderers(); - } + final Stopwatch stopWatch = Stopwatch.createStarted(); + logger.info("Initialization ( started )"); + proxy.init(event); + logger.info("Initialization ( ended after " + stopWatch.elapsed(TimeUnit.MILLISECONDS) + "ms )"); + } @Mod.EventHandler public void postInit(FMLPostInitializationEvent event) { - - } + final Stopwatch stopWatch = Stopwatch.createStarted(); + logger.info("Post-Initialization ( started )"); + proxy.postInit(event); + logger.info("Post-Initialization ( ended after " + stopWatch.elapsed(TimeUnit.MILLISECONDS) + "ms )"); + } } diff --git a/src/main/java/com/fireball1725/graves/client/event/EventTick.java b/src/main/java/com/fireball1725/graves/client/event/EventTick.java new file mode 100644 index 0000000..2478619 --- /dev/null +++ b/src/main/java/com/fireball1725/graves/client/event/EventTick.java @@ -0,0 +1,24 @@ +package com.fireball1725.graves.client.event; + +import net.minecraft.client.Minecraft; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + +public class EventTick +{ + private static int tick = 0; + + public static int getTick() + { + return tick; + } + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) + { + if(event.phase == TickEvent.Phase.END && !Minecraft.getMinecraft().isGamePaused() && Minecraft.getMinecraft().theWorld != null) + { + tick++; + } + } +} diff --git a/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java b/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java deleted file mode 100644 index cff3bbb..0000000 --- a/src/main/java/com/fireball1725/graves/client/events/RenderEvents.java +++ /dev/null @@ -1,156 +0,0 @@ -package com.fireball1725.graves.client.events; - -import com.fireball1725.graves.client.render.TileEntityHeadStoneRenderer; -import com.fireball1725.graves.common.block.BlockGraveSlave; -import com.fireball1725.graves.common.block.BlockGraveStone; -import com.fireball1725.graves.common.tileentity.TileEntityGraveSlave; -import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; -import com.fireball1725.graves.common.util.TileTools; -import net.minecraft.block.*; -import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.Minecraft; -import net.minecraft.client.multiplayer.PlayerControllerMP; -import net.minecraft.client.renderer.BlockRendererDispatcher; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.VertexBuffer; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.texture.TextureManager; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.client.resources.IResourceManager; -import net.minecraft.client.resources.IResourceManagerReloadListener; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import net.minecraftforge.client.event.RenderWorldLastEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import org.lwjgl.opengl.GL11; - -import java.util.ArrayList; -import java.util.List; - -public class RenderEvents implements IResourceManagerReloadListener -{ - - private final TextureAtlasSprite[] destroyBlockIcons = new TextureAtlasSprite[10]; - - @SubscribeEvent - public void renderExtraBlockBreak(RenderWorldLastEvent event) { - PlayerControllerMP controllerMP = Minecraft.getMinecraft().playerController; - EntityPlayer player = Minecraft.getMinecraft().thePlayer; - World world = player.worldObj; - - List blocks = new ArrayList(); - - // extra-blockbreak animation - if(controllerMP.isHittingBlock) { - if(controllerMP.currentBlock != null) - { - Block block = world.getBlockState(controllerMP.currentBlock).getBlock(); - if (block instanceof BlockGraveSlave || block instanceof BlockGraveStone) - { - BlockPos pos = controllerMP.currentBlock; - if(block instanceof BlockGraveSlave) - { - TileEntityGraveSlave slave = TileTools.getTileEntity(world, pos, TileEntityGraveSlave.class); - if(slave == null || slave.getMasterBlock() == null) - return; - pos = slave.getMasterBlock(); - } - if(pos == null) - return; - TileEntityGraveStone master = TileTools.getTileEntity(world, pos, TileEntityGraveStone.class); - if (master == null) return; - blocks.add(pos); - blocks.add(pos.offset(master.getBlockState().getValue(BlockGraveStone.FACING))); - blocks.add(pos.down()); - blocks.add(pos.down().offset(master.getBlockState().getValue(BlockGraveStone.FACING))); - - drawBlockDamageTexture(Tessellator.getInstance(), - Tessellator.getInstance().getBuffer(), - player, - event.getPartialTicks(), - world, - blocks); - } - } - } - } - - // RenderGlobal.drawBlockDamageTexture - public void drawBlockDamageTexture(Tessellator tessellatorIn, VertexBuffer worldRendererIn, Entity entityIn, float partialTicks, World world, List blocks) - { - double d0 = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * (double)partialTicks; - double d1 = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double)partialTicks; - double d2 = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * (double)partialTicks; - - TextureManager renderEngine = Minecraft.getMinecraft().renderEngine; - int progress = (int)(Minecraft.getMinecraft().playerController.curBlockDamageMP * 10f) - 1; // 0-10 - - if(progress < 0) - return; - - renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); - //preRenderDamagedBlocks BEGIN - GlStateManager.pushMatrix(); - GlStateManager.tryBlendFuncSeparate(774, 768, 1, 0); - GlStateManager.enableBlend(); - GlStateManager.color(1.0F, 1.0F, 1.0F, 0.5F); - GlStateManager.doPolygonOffset(-3.0F, -3.0F); - GlStateManager.enablePolygonOffset(); - GlStateManager.alphaFunc(516, 0.1F); - GlStateManager.enableAlpha(); - //preRenderDamagedBlocks END - - worldRendererIn.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK); - worldRendererIn.setTranslation(-d0, -d1, -d2); -// worldRendererIn.markDirty(); - - for(BlockPos blockpos : blocks) { - Block block = world.getBlockState(blockpos).getBlock(); - TileEntity te = world.getTileEntity(blockpos); - boolean hasBreak = block instanceof BlockChest || block instanceof BlockEnderChest - || block instanceof BlockSign || block instanceof BlockSkull; - if (!hasBreak) hasBreak = te != null && te.canRenderBreaking(); - - if (!hasBreak) - { - IBlockState iblockstate = world.getBlockState(blockpos); - - if(iblockstate.getBlock().getMaterial(iblockstate) != Material.AIR) - { - TextureAtlasSprite textureatlassprite = this.destroyBlockIcons[progress]; - BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher(); - blockrendererdispatcher.renderBlockDamage(iblockstate, blockpos, textureatlassprite, world); - } - } - } - - tessellatorIn.draw(); - worldRendererIn.setTranslation(0.0D, 0.0D, 0.0D); - // postRenderDamagedBlocks BEGIN - GlStateManager.disableAlpha(); - GlStateManager.doPolygonOffset(0.0F, 0.0F); - GlStateManager.disablePolygonOffset(); - GlStateManager.disableBlend(); - GlStateManager.depthMask(true); - GlStateManager.popMatrix(); - // postRenderDamagedBlocks END - } - - @Override - public void onResourceManagerReload(IResourceManager resourceManager) { - TextureMap textureMap = Minecraft.getMinecraft().getTextureMapBlocks(); - - for (int i = 0; i < this.destroyBlockIcons.length; ++i) - { - this.destroyBlockIcons[i] = textureMap.getAtlasSprite("minecraft:blocks/destroy_stage_" + i); - } - - TileEntityHeadStoneRenderer.bakeModel(textureMap); - } -} diff --git a/src/main/java/com/fireball1725/graves/client/gui/GuiScreenHeadstone.java b/src/main/java/com/fireball1725/graves/client/gui/GuiScreenHeadstone.java deleted file mode 100644 index 408a61b..0000000 --- a/src/main/java/com/fireball1725/graves/client/gui/GuiScreenHeadstone.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.fireball1725.graves.client.gui; - -import com.fireball1725.graves.common.network.PacketHandler; -import com.fireball1725.graves.common.network.messages.MessageSetHeadstoneName; -import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.util.ChatAllowedCharacters; - -import java.io.IOException; - -/** - * Created by FusionLord on 1/21/2016. - */ -public class GuiScreenHeadstone extends GuiScreen { - protected TileEntityHeadStone headStone; - protected String name; - - public GuiScreenHeadstone(TileEntityHeadStone headStone) { - super(); - this.headStone = headStone; - } - - @Override - public void initGui() { - super.initGui(); - this.width = 176; - this.height = 69; - name = headStone.getCustomName(); - } - - @Override - public void onGuiClosed() { - PacketHandler.INSTANCE.sendToServer(new MessageSetHeadstoneName(headStone.getPos(), name)); - super.onGuiClosed(); - } - - @Override - public void drawScreen(int mouseX, int mouseY, float partialTicks) { - super.drawScreen(mouseX, mouseY, partialTicks); - } - - @Override - protected void keyTyped(char typedChar, int keyCode) throws IOException { - super.keyTyped(typedChar, keyCode); - switch (keyCode) { - case 14: - if (name.length() > 0) { - if (name.length() > 2 && name.substring(name.length() - 2).equalsIgnoreCase("\\n")) { - name = name.substring(0, name.length() - 2); - } else { - name = name.substring(0, name.length() - 1); - } - } - break; - case 28: - case 156: - name = name + "\\n"; - break; - default: - - if (ChatAllowedCharacters.isAllowedCharacter(typedChar)) { - name = name + Character.toString(typedChar); - } - } - headStone.setCustomName(name); - } - - @Override - public void updateScreen() { - super.updateScreen(); - } -} diff --git a/src/main/java/com/fireball1725/graves/client/render/TEGraveSR.java b/src/main/java/com/fireball1725/graves/client/render/TEGraveSR.java new file mode 100644 index 0000000..7683296 --- /dev/null +++ b/src/main/java/com/fireball1725/graves/client/render/TEGraveSR.java @@ -0,0 +1,178 @@ +package com.fireball1725.graves.client.render; + +import com.fireball1725.graves.client.event.EventTick; +import com.fireball1725.graves.common.block.BlockGrave; +import com.fireball1725.graves.common.tileentity.TileEntityGrave; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.minecraft.MinecraftProfileTexture; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelHumanoidHead; +import net.minecraft.client.model.ModelSkeletonHead; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.client.resources.DefaultPlayerSkin; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; + +import java.awt.*; +import java.util.Map; +import java.util.Random; +import java.util.UUID; + +public class TEGraveSR extends TileEntitySpecialRenderer +{ + private final ModelSkeletonHead humanoidHead = new ModelHumanoidHead(); + private Minecraft mc = Minecraft.getMinecraft(); + private Random rand = new Random(); + + @Override + public void renderTileEntityAt(TileEntityGrave grave, double x, double y, double z, float partialTicks, int destroyStage) + { + GlStateManager.pushMatrix(); + GlStateManager.translate(x + .5, y + .5, z + .5); + if(getWorld().getBlockState(grave.getPos()).getBlock() instanceof BlockGrave) + { + GlStateManager.pushMatrix(); + if(grave.getDisplayStack() != null) + { + ItemStack stack = grave.getDisplayStack(); + GlStateManager.pushMatrix(); + GlStateManager.enableLighting(); + GlStateManager.enableRescaleNormal(); + GlStateManager.enableAlpha(); + GlStateManager.alphaFunc(516, 0.1F); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + IBakedModel model = mc.getRenderItem().getItemModelWithOverrides(stack, mc.theWorld, mc.thePlayer); + mc.getRenderItem().renderItem(stack, model); + GlStateManager.disableAlpha(); + GlStateManager.disableRescaleNormal(); + GlStateManager.disableLighting(); + GlStateManager.popMatrix(); + } + else + { + if(grave.getProfile() != null) + { + IBlockState state = getWorld().getBlockState(grave.getPos().offset(EnumFacing.UP)); + if(!state.getBlock().isFullBlock(state.getActualState(getWorld(), grave.getPos().offset(EnumFacing.UP)))) + { + GlStateManager.pushMatrix(); + GlStateManager.enableRescaleNormal(); + GlStateManager.enableAlpha(); + GlStateManager.alphaFunc(516, 0.1F); + GlStateManager.enableBlend(); + + GlStateManager.translate(0, .5, 0); + rand.setSeed(grave.getPos().toLong()); + + int dir = rand.nextBoolean() ? 1 : -1; + GlStateManager.pushMatrix(); + if(grave.getProfile() != null && grave.getProfile().getId().toString().equals("4f3a8d1e-33c1-44e7-bce8-e683027c7dac")) + { + GlStateManager.rotate(EventTick.getTick() * 10, 0, dir, 0); + } + else + { + GlStateManager.rotate(EventTick.getTick(), 0, dir, 0); + } + if(Minecraft.getMinecraft().gameSettings.fancyGraphics) + { + GlStateManager.rotate(rand.nextFloat() * 360f, 0, 1, 0); + } + GlStateManager.scale(.65, .65, .65); + GlStateManager.color(1, 1, 1, .8f); + renderSkull(-.5f, 0, -.5f, grave.getProfile(), destroyStage, partialTicks); + GlStateManager.popMatrix(); + if(Minecraft.getMinecraft().gameSettings.fancyGraphics) + { + drawText(grave.getProfile().getName()); + } + GlStateManager.disableBlend(); + GlStateManager.disableAlpha(); + GlStateManager.disableRescaleNormal(); + GlStateManager.popMatrix(); + } + } + } + GlStateManager.popMatrix(); + } + GlStateManager.popMatrix(); + } + + private void drawText(String text) + { + GlStateManager.pushMatrix(); + for(EnumFacing facing : EnumFacing.HORIZONTALS) + { + GlStateManager.pushMatrix(); + GlStateManager.disableLighting(); + GlStateManager.rotate(180, 0, 0, 1); + GlStateManager.rotate((facing.getHorizontalIndex() * 90), 0, 1, 0); + GlStateManager.translate(-.375, .55, -.38); + GlStateManager.scale(.00625, .00625, .00625); + int strWidth = mc.fontRendererObj.getStringWidth(text); + mc.fontRendererObj.drawString(text, strWidth / 2, 0, Color.WHITE.hashCode()); + GlStateManager.enableLighting(); + GlStateManager.popMatrix(); + } + GlStateManager.popMatrix(); + } + + private void renderSkull(float x, float y, float z, GameProfile profile, int destroyStage, float animateTicks) + { + if(destroyStage >= 0) + { + bindTexture(DESTROY_STAGES[destroyStage]); + GlStateManager.matrixMode(5890); + GlStateManager.pushMatrix(); + GlStateManager.scale(4.0F, 2.0F, 1.0F); + GlStateManager.translate(0.0625F, 0.0625F, 0.0625F); + GlStateManager.matrixMode(5888); + } + ResourceLocation resourcelocation = DefaultPlayerSkin.getDefaultSkinLegacy(); + + if(profile != null) + { + Minecraft minecraft = Minecraft.getMinecraft(); + Map map = minecraft.getSkinManager().loadSkinFromCache(profile); + + if(map.containsKey(MinecraftProfileTexture.Type.SKIN)) + { + resourcelocation = minecraft.getSkinManager().loadSkin(map.get(MinecraftProfileTexture.Type.SKIN), MinecraftProfileTexture.Type.SKIN); + } + else + { + UUID uuid = EntityPlayer.getUUID(profile); + resourcelocation = DefaultPlayerSkin.getDefaultSkin(uuid); + } + } + + bindTexture(resourcelocation); + + GlStateManager.pushMatrix(); + GlStateManager.translate(x + 0.5F, y, z + 0.5F); + + GlStateManager.enableRescaleNormal(); + GlStateManager.scale(-1.0F, -1.0F, 1.0F); + GlStateManager.enableAlpha(); + GlStateManager.enableBlendProfile(GlStateManager.Profile.PLAYER_SKIN); + + humanoidHead.render(null, animateTicks, 0.0F, 0.0F, 0, 0.0F, 0.0625F); + GlStateManager.popMatrix(); + + if(destroyStage >= 0) + { + GlStateManager.matrixMode(5890); + GlStateManager.popMatrix(); + GlStateManager.matrixMode(5888); + } + } +} diff --git a/src/main/java/com/fireball1725/graves/client/render/TileEntityBaseRenderer.java b/src/main/java/com/fireball1725/graves/client/render/TileEntityBaseRenderer.java deleted file mode 100644 index 66ecfc8..0000000 --- a/src/main/java/com/fireball1725/graves/client/render/TileEntityBaseRenderer.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.fireball1725.graves.client.render; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.client.renderer.texture.TextureManager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; -import org.lwjgl.opengl.GL11; - -public abstract class TileEntityBaseRenderer extends TileEntitySpecialRenderer { - static final int orientRotation[] = {0, 0, 0, 2, 3, 1, 0}; - static final int sideRotation[] = {1, 3, 0, 0, 0, 0}; - protected float scale = 1f / 256f; - protected Minecraft mc = Minecraft.getMinecraft(); - protected TextureManager texManager = mc.renderEngine; - protected FontRenderer renderFont = mc.fontRendererObj; - protected int boundTexIndex; - - protected void setLight(TileEntity tileEntity, EnumFacing side) { - float ambientLight = tileEntity.getWorld().getLightBrightness(tileEntity.getPos()); - float var6 = ambientLight % 65536; - float var7 = ambientLight / 65536; - float var8 = 1.0F; - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, var6 * var8, var7 * var8); - } - - protected void renderTextOnBlock(String renderString, EnumFacing side, EnumFacing orientation, double x, double y, double z, float size, double posx, double posy, int red, int green, int blue, int alpha, byte align) { - int color = (alpha << 24) | (red << 16) | (blue << 8) | green; - this.renderTextOnBlock(renderString, side, orientation, x, y, z, size, posx, posy, color, align); - } - - protected void renderTextOnBlock(String renderString, EnumFacing side, EnumFacing orientation, double x, double y, double z, float size, double posx, double posy, int color) { - this.renderTextOnBlock(renderString, side, orientation, x, y, z, size, posx, posy, 0F, color); - } - - protected void renderTextOnBlock(String renderString, EnumFacing side, EnumFacing orientation, double x, double y, double z, float size, double posx, double posy, float angle, int color) { - if (renderString == null || renderString.equals("")) { - return; - } - - int stringWidth = renderFont.getStringWidth(renderString); - - GL11.glPushMatrix(); - - this.alignRendering(side, orientation, x, y, z); - this.moveRendering(size, posx, posy, -0.001); - - GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f); - - GL11.glDepthMask(false); - GL11.glDisable(GL11.GL_LIGHTING); - - this.renderFont.drawSplitString(renderString, -44, -7, 90, color); - - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDepthMask(true); - GL11.glPopMatrix(); - GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); - } - - protected void alignRendering(EnumFacing side, EnumFacing orientation, double x, double y, double z) { - GL11.glTranslated(x + 0.5F, y + 0.5F, z + 0.5F); // We align the rendering on the center of the block - GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(this.getRotationYForSide(side, orientation), 0.0F, 1.0F, 0.0F); // We rotate it so it face the right face - GL11.glRotatef(this.getRotationXForSide(side), 1.0F, 0.0F, 0.0F); - GL11.glTranslated(-0.5F, -0.5F, -0.5f); - } - - protected void moveRendering(float size, double posX, double posY, double posz) { - GL11.glTranslated(0, 0, posz); - GL11.glScalef(scale, scale, -0.0001f); // We flatten the rendering and scale it to the right size - GL11.glTranslated(posX, posY, 0); // Finally, we translate the icon itself to the correct position - GL11.glScalef(size, size, 1.0f); - } - - protected float getRotationYForSide(EnumFacing side, EnumFacing orientation) { - int sideRotation[] = {orientRotation[orientation.ordinal()], orientRotation[orientation.ordinal()], 0, 2, 3, 1}; - return sideRotation[side.ordinal()] * 90F; - } - - protected float getRotationXForSide(EnumFacing side) { - return sideRotation[side.ordinal()] * 90F; - } - - protected void saveBoundTexture() { - boundTexIndex = GL11.glGetInteger(GL11.GL_TEXTURE_BINDING_2D); - } - - protected void loadBoundTexture() { - GL11.glBindTexture(GL11.GL_TEXTURE_2D, boundTexIndex); - } -} diff --git a/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java b/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java deleted file mode 100644 index 473af3e..0000000 --- a/src/main/java/com/fireball1725/graves/client/render/TileEntityHeadStoneRenderer.java +++ /dev/null @@ -1,153 +0,0 @@ -package com.fireball1725.graves.client.render; - -import com.fireball1725.graves.common.block.BlockHeadStone; -import com.fireball1725.graves.common.reference.ModInfo; -import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; -import com.google.common.base.Function; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.model.obj.OBJLoader; -import net.minecraftforge.client.model.obj.OBJModel; - -import java.awt.*; - -public class TileEntityHeadStoneRenderer extends TileEntityBaseRenderer { - public static TileEntityHeadStoneRenderer _instance = null; - public static IBakedModel bakedModel; - - public TileEntityHeadStoneRenderer() - { - bakeModel(mc.getTextureMapBlocks()); - } - - public static void bakeModel(final TextureMap textureMap) - { - try - { - OBJModel model = (OBJModel) OBJLoader.INSTANCE.loadModel(new ResourceLocation(ModInfo.MOD_ID, "models/block/headstone.obj")); - bakedModel = model.bake(model.getDefaultState(), DefaultVertexFormats.BLOCK, new Function() - { - @Override - public TextureAtlasSprite apply(ResourceLocation input) - { - return textureMap.getAtlasSprite(input.toString()); - } - }); - } - catch(Exception e) - { - e.printStackTrace(); - } - } - - public static TileEntityHeadStoneRenderer instance() - { - - if(_instance == null) - { - _instance = new TileEntityHeadStoneRenderer(); - } - return _instance; - } - - @Override - public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage) - { - GlStateManager.pushMatrix(); - GlStateManager.translate(x + .5, y + .5, z + .5); - if(te instanceof TileEntityHeadStone && getWorld().getBlockState(te.getPos()).getBlock() instanceof BlockHeadStone) - { - TileEntityHeadStone headStone = (TileEntityHeadStone) te; - IBlockState state = headStone.getWorld().getBlockState(te.getPos()); - EnumFacing facing = state.getValue(BlockHeadStone.FACING); - GlStateManager.pushMatrix(); - int rot = facing.getHorizontalIndex(); - if(facing == EnumFacing.WEST || facing == EnumFacing.EAST) - { - GlStateManager.rotate(180, 0, 1, 0); - } - GlStateManager.rotate(90 * rot, 0, 1, 0); - if(headStone.getDisplayStack() != null) - { - ItemStack stack = headStone.getDisplayStack(); - IBakedModel model = mc.getRenderItem().getItemModelWithOverrides(stack, null, null); - GlStateManager.pushMatrix(); - GlStateManager.enableLighting(); - GlStateManager.enableRescaleNormal(); - GlStateManager.enableAlpha(); - GlStateManager.alphaFunc(516, 0.1F); - GlStateManager.enableBlend(); - GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); - mc.getRenderItem().renderItem(stack, model); - GlStateManager.disableAlpha(); - GlStateManager.disableRescaleNormal(); - GlStateManager.disableLighting(); - GlStateManager.popMatrix(); - } - else - { - { - GlStateManager.pushMatrix(); - GlStateManager.enableLighting(); - GlStateManager.enableRescaleNormal(); - GlStateManager.enableAlpha(); - GlStateManager.alphaFunc(516, 0.1F); - GlStateManager.enableBlend(); - GlStateManager.translate(.5, -.5, .5); - GlStateManager.rotate(180, 0, 1, 0); - bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); - mc.getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightnessColor(bakedModel, 1, 1, 1, 1); - GlStateManager.disableAlpha(); - GlStateManager.disableRescaleNormal(); - GlStateManager.disableLighting(); - GlStateManager.popMatrix(); - } - GlStateManager.pushMatrix(); - GlStateManager.rotate(180, 0, 1, 0); - GlStateManager.rotate(180, 0, 0, 1); - GlStateManager.translate(0, -5 * 0.0625, -7.5 * 0.0625); - GlStateManager.scale(0.00625, 0.00625, 1); - renderTextOnHeadstone(headStone.getCustomName().split("\\\\n"), Color.RED.hashCode(), true); - GlStateManager.popMatrix(); - } - GlStateManager.popMatrix(); - } - GlStateManager.popMatrix(); - } - - public void renderTextOnHeadstone(String[] text, int color, boolean shadow) - { - - int i = 0; - for(String s : text) - { - int stringWidth = mc.fontRendererObj.getStringWidth(s); - if(stringWidth == 0) - { - stringWidth = 1; - } - int xCenter = stringWidth / 2; - int yCenter = mc.fontRendererObj.FONT_HEIGHT / 2; - if(i == 7) - { GlStateManager.translate(0, 8, -.01); } - if(shadow) - { - mc.fontRendererObj.drawString(s, -xCenter - 1, -yCenter + 1 + (renderFont.FONT_HEIGHT * i + 2), (color & 16579836) >> 2 | color & -16777216); - GlStateManager.translate(0f, 0f, -.001f); - } - mc.fontRendererObj.drawString(s, -xCenter, -yCenter + (renderFont.FONT_HEIGHT * i + 2), color); - - i++; - } - } -} diff --git a/src/main/java/com/fireball1725/graves/client/render/entity/EntityRenderers.java b/src/main/java/com/fireball1725/graves/client/render/entity/EntityRenderer.java similarity index 97% rename from src/main/java/com/fireball1725/graves/client/render/entity/EntityRenderers.java rename to src/main/java/com/fireball1725/graves/client/render/entity/EntityRenderer.java index 200a3b8..ec89930 100644 --- a/src/main/java/com/fireball1725/graves/client/render/entity/EntityRenderers.java +++ b/src/main/java/com/fireball1725/graves/client/render/entity/EntityRenderer.java @@ -6,7 +6,7 @@ import net.minecraftforge.fml.client.registry.IRenderFactory; import net.minecraftforge.fml.client.registry.RenderingRegistry; -public class EntityRenderers +public class EntityRenderer { public static void registerEntityRenderer(Class entity, Class> render) { diff --git a/src/main/java/com/fireball1725/graves/client/render/entity/RenderPlayerZombie.java b/src/main/java/com/fireball1725/graves/client/render/entity/RenderPlayerZombie.java index 68e5220..ead6aed 100644 --- a/src/main/java/com/fireball1725/graves/client/render/entity/RenderPlayerZombie.java +++ b/src/main/java/com/fireball1725/graves/client/render/entity/RenderPlayerZombie.java @@ -1,6 +1,5 @@ package com.fireball1725.graves.client.render.entity; -import com.fireball1725.graves.common.configuration.ConfigZombie; import com.fireball1725.graves.common.entity.EntityPlayerZombie; import com.fireball1725.graves.common.util.TextureUtils; import net.minecraft.client.model.ModelBiped; @@ -44,10 +43,6 @@ public void transformHeldFull3DItemLayer() { @Override public void doRender(EntityPlayerZombie entity, double x, double y, double z, float f0, float partialTickTime) { setModel(entity); - if (ConfigZombie.configZombieShowBossBar) - { - // TODO: Do what was done here... - } if(entity.getHeldItem(EnumHand.MAIN_HAND) != null && entity.getHeldItem(EnumHand.MAIN_HAND).getItem() instanceof ItemBow) { modelBipedMain.rightArmPose = ModelBiped.ArmPose.BOW_AND_ARROW; } diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockBase.java b/src/main/java/com/fireball1725/graves/common/block/BlockBase.java index 662448c..c5b0013 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockBase.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockBase.java @@ -73,39 +73,6 @@ public Class getTileEntityClass() { return this.tileEntityType; } - // @Override - // public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) { - // dropInventory(world, blockPos); - // - // super.breakBlock(world, blockPos, blockState); - // } - // - // protected void dropInventory(World world, BlockPos blockPos) { - // for (ItemStack itemStack : getDrops(world, blockPos, null, 0)) { - // - // if (itemStack != null && itemStack.stackSize > 0) { - // Random rand = new Random(); - // - // float dX = rand.nextFloat() * 0.8F + 0.1F; - // float dY = rand.nextFloat() * 0.8F + 0.1F; - // float dZ = rand.nextFloat() * 0.8F + 0.1F; - // - // EntityItem entityItem = new EntityItem(world, blockPos.getX() + dX, blockPos.getY() + dY, blockPos.getZ() + dZ, itemStack.copy()); - // - // if (itemStack.hasTagCompound()) { - // entityItem.getEntityItem().setTagCompound((NBTTagCompound) itemStack.getTagCompound().copy()); - // } - // - // float factor = 0.05F; - // entityItem.motionX = rand.nextGaussian() * factor; - // entityItem.motionY = rand.nextGaussian() * factor + 0.2F; - // entityItem.motionZ = rand.nextGaussian() * factor; - // world.spawnEntityInWorld(entityItem); - // itemStack.stackSize = 0; - // } - // } - // } - @Override public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java b/src/main/java/com/fireball1725/graves/common/block/BlockGrave.java similarity index 63% rename from src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java rename to src/main/java/com/fireball1725/graves/common/block/BlockGrave.java index 692ae32..5fd7225 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockHeadStone.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockGrave.java @@ -1,13 +1,11 @@ package com.fireball1725.graves.common.block; -import com.fireball1725.graves.Graves; import com.fireball1725.graves.common.entity.capabilities.GraveCapability; import com.fireball1725.graves.common.entity.capabilities.IGraveCapability; -import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; +import com.fireball1725.graves.common.tileentity.TileEntityGrave; import com.fireball1725.graves.common.util.TileTools; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyBool; -import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; @@ -29,24 +27,40 @@ import java.util.ArrayList; import java.util.List; -public class BlockHeadStone extends BlockBase { - public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); +public class BlockGrave extends BlockBase +{ public static final PropertyBool RENDER = PropertyBool.create("render"); - protected BlockHeadStone() + protected BlockGrave() { super(Material.ROCK); - this.setDefaultState(blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(RENDER, true)); + this.setDefaultState(blockState.getBaseState().withProperty(RENDER, true)); this.setHardness(1.5F); this.setResistance(10.0F); this.setHarvestLevel("pickaxe", 0); - this.setTileEntity(TileEntityHeadStone.class); + this.setTileEntity(TileEntityGrave.class); } @Override public EnumBlockRenderType getRenderType(IBlockState state) { - return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; + return EnumBlockRenderType.MODEL; + } + + @Override + public void onBlockPlacedBy(World world, BlockPos blockPos, IBlockState state, EntityLivingBase placer, ItemStack itemStack) + { + super.onBlockPlacedBy(world, blockPos, state, placer, itemStack); + if(placer instanceof EntityPlayer) + { + TileEntityGrave grave = TileTools.getTileEntity(world, blockPos, TileEntityGrave.class); + if(grave != null) + { + grave.setProfile(((EntityPlayer) placer).getGameProfile()); + grave.setGhostDefeated(true); + grave.markDirty(); + } + } } @Override @@ -58,7 +72,7 @@ public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, Ent @Override public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { - TileEntityHeadStone headStone = TileTools.getTileEntity(world, pos, TileEntityHeadStone.class); + TileEntityGrave headStone = TileTools.getTileEntity(world, pos, TileEntityGrave.class); if(headStone != null && !headStone.getCustomName().isEmpty()) { final ItemStack itemStack = new ItemStack(this); @@ -82,10 +96,6 @@ public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBloc @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { - if(playerIn.capabilities.isCreativeMode) - { - playerIn.openGui(Graves.instance, 0, worldIn, pos.getX(), pos.getY(), pos.getZ()); - } if(worldIn.isRemote) { return true; } @@ -96,11 +106,11 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, { grave.setGraveItemStack(heldItem); TileEntity te = worldIn.getTileEntity(pos); - if(te instanceof TileEntityHeadStone) + if(te instanceof TileEntityGrave) { - ((TileEntityHeadStone) te).setDisplayStack(heldItem); + ((TileEntityGrave) te).setDisplayStack(heldItem); te.markDirty(); - worldIn.notifyBlockUpdate(pos, state, ((TileEntityHeadStone) te).getBlockState(), 3); + worldIn.notifyBlockUpdate(pos, state, ((TileEntityGrave) te).getBlockState(), 3); worldIn.notifyBlockOfStateChange(pos, state.getBlock()); worldIn.markChunkDirty(pos, te); } @@ -113,7 +123,7 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, @Override protected BlockStateContainer createBlockState() { - return new BlockStateContainer(this, FACING, RENDER); + return new BlockStateContainer(this, RENDER); } @Override @@ -134,19 +144,13 @@ public boolean isFullCube(IBlockState state) return false; } - @Override - public IBlockState getStateFromMeta(int meta) - { - return getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)); - } - @Override public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) { TileEntity te = worldIn.getTileEntity(pos); - if(te instanceof TileEntityHeadStone) + if(te instanceof TileEntityGrave) { - TileEntityHeadStone headStone = (TileEntityHeadStone) te; + TileEntityGrave headStone = (TileEntityGrave) te; return state.withProperty(RENDER, headStone.getDisplayStack() == null); } return state; @@ -155,60 +159,35 @@ public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, Block @Override public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB mask, List list, Entity p_185477_6_) { - IBlockState astate = worldIn.getBlockState(pos); - switch(astate.getValue(FACING)) - { - case NORTH: - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(.1f, 0f, 0f, .9f, .95f, .3f)); - break; - case SOUTH: - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(.1f, 0f, .7f, .9f, .95f, 1f)); - break; - case WEST: - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, .1f, .3f, .95f, .9f)); - break; - case EAST: - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(.7f, 0f, .1f, 1f, .95f, .9f)); - break; - } + addCollisionBoxToList(pos, mask, list, getBoundingBox(state, worldIn, pos)); } @Override public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { - IBlockState astate = source.getBlockState(pos); - if(astate.getBlock() instanceof BlockHeadStone) - { - switch(astate.getValue(FACING)) - { - case NORTH: - return new AxisAlignedBB(.1f, 0f, 0f, .9f, .95f, .3f); - case SOUTH: - return new AxisAlignedBB(.1f, 0f, .7f, .9f, .95f, 1f); - case WEST: - return new AxisAlignedBB(0f, 0f, .1f, .3f, .95f, .9f); - case EAST: - return new AxisAlignedBB(.7f, 0f, .1f, 1f, .95f, .9f); - } - } - return null; + return new AxisAlignedBB(0.0625f, 0f, 0.062f, 0.9375f, 1f, 0.9375f); } @Override public int getMetaFromState(IBlockState state) { - return state.getValue(FACING).getHorizontalIndex(); + return 0; } @Override - public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + public IBlockState getStateFromMeta(int meta) { - return getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()); + return getDefaultState(); } @Override public void onBlockExploded(World world, BlockPos pos, Explosion explosion) { + } + @Override + public int getLightValue(IBlockState state) + { + return 15; } } diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockGraveLegacy.java b/src/main/java/com/fireball1725/graves/common/block/BlockGraveLegacy.java new file mode 100644 index 0000000..75561d7 --- /dev/null +++ b/src/main/java/com/fireball1725/graves/common/block/BlockGraveLegacy.java @@ -0,0 +1,49 @@ +package com.fireball1725.graves.common.block; + +import com.fireball1725.graves.common.tileentity.TileEntityGrave; +import net.minecraft.block.BlockHorizontal; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +public class BlockGraveLegacy extends BlockBase +{ + public static final PropertyDirection FACING = BlockHorizontal.FACING; + public static final PropertyBool HASLID = PropertyBool.create("haslid"); + + public BlockGraveLegacy() + { + super(Material.CLOTH); + setDefaultState(this.blockState.getBaseState().withProperty(HASLID, true).withProperty(FACING, EnumFacing.NORTH)); + this.setTileEntity(TileEntityGrave.class); + } + + @Override + protected BlockStateContainer createBlockState() + { + return new BlockStateContainer(this, HASLID, FACING); + } + + @Override + public IBlockState getStateFromMeta(int meta) + { + return getDefaultState().withProperty(FACING, EnumFacing.values()[meta]); + } + + public int getMetaFromState(IBlockState state) + { + return state.getValue(FACING).getIndex(); + } + + @Override + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + return Blocks.BLOCK_GRAVE.block.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer); + } +} diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockGraveSlave.java b/src/main/java/com/fireball1725/graves/common/block/BlockGraveSlave.java deleted file mode 100644 index 29594e0..0000000 --- a/src/main/java/com/fireball1725/graves/common/block/BlockGraveSlave.java +++ /dev/null @@ -1,288 +0,0 @@ -package com.fireball1725.graves.common.block; - -import com.fireball1725.graves.common.tileentity.TileEntityGraveSlave; -import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; -import com.fireball1725.graves.common.util.TileTools; -import net.minecraft.block.SoundType; -import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyBool; -import net.minecraft.block.properties.PropertyEnum; -import net.minecraft.block.state.BlockStateContainer; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumBlockRenderType; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.IStringSerializable; -import net.minecraft.util.math.AxisAlignedBB; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.RayTraceResult; -import net.minecraft.world.Explosion; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -import java.util.List; -import java.util.Random; - -public class BlockGraveSlave extends BlockBase { - private static final PropertyBool isFoot = PropertyBool.create("isfoot"); - private static final PropertyEnum slaveType = PropertyEnum.create("slavetype", SlaveType.class); - - BlockGraveSlave() - { - super(Material.CLOTH); - setDefaultState(blockState.getBaseState().withProperty(slaveType, SlaveType.LID).withProperty(isFoot, true).withProperty(BlockGraveStone.FACING, EnumFacing.NORTH)); - setSoundType(SoundType.STONE); - setHardness(1.0F); - setResistance(10000.0F); - setTileEntity(TileEntityGraveSlave.class); - } - - public static IBlockState getActualStatePre(IBlockState state, IBlockAccess worldIn, BlockPos pos, BlockPos masterPos) - { - if(masterPos != null) - { - TileEntityGraveStone master = TileTools.getTileEntity(worldIn, masterPos, TileEntityGraveStone.class); - if(master != null) - { - IBlockState masterState = master.getBlockState(); - EnumFacing masterFacing = masterState.getValue(BlockGraveStone.FACING); - - SlaveType st = SlaveType.NORENDER; - if(pos.offset(masterFacing.getOpposite()).up().equals(master.getPos())) - { - st = SlaveType.BOXFOOT; - } - if(pos.up().equals(master.getPos())) - { - st = SlaveType.BOX; - } - if(master.getPos().offset(masterFacing).equals(pos) && master.getHasLid()) - { - st = SlaveType.LID; - } - - return state - .withProperty(slaveType, st) - .withProperty(isFoot, !pos.up().equals(master.getPos())) - .withProperty(BlockGraveStone.FACING, master.getFacing()); - } - } - return null; - } - - @Override - protected BlockStateContainer createBlockState() - { - return new BlockStateContainer(this, slaveType, isFoot, BlockGraveStone.FACING); - } - - @Override - public int getMetaFromState(IBlockState state) - { - return 0; - } - - @Override - public IBlockState getStateFromMeta(int meta) - { - return getDefaultState(); - } - - @Override - public EnumBlockRenderType getRenderType(IBlockState state) - { - return EnumBlockRenderType.MODEL; - } - - @Override - public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) - { - TileEntityGraveSlave slave = TileTools.getTileEntity(world, pos, TileEntityGraveSlave.class); - if(slave == null) - { - return null; - } - return world.getBlockState(slave.getMasterBlock()).getBlock().getPickBlock(state, target, world, slave.getMasterBlock(), player); - } - - @Override - public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) - { - AxisAlignedBB selectionBox = new AxisAlignedBB(0f, 0f, 0f, 1f, 1f, 1f); - TileEntityGraveSlave graveSlave = TileTools.getTileEntity(source, pos, TileEntityGraveSlave.class); - if(graveSlave != null) - { - SlaveType st = getActualState(state, source, pos).getValue(slaveType); - if(st == SlaveType.LID || st == SlaveType.NORENDER) - { - selectionBox = new AxisAlignedBB(0, 0, 0, 1, .1425f, 1); - } - } - return selectionBox;//.offset(pos.getX(), pos.getY(), pos.getZ()); - } - - @Override - public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB mask, List list, Entity p_185477_6_) - { - TileEntityGraveSlave graveSlave = TileTools.getTileEntity(worldIn, pos, TileEntityGraveSlave.class); - if(graveSlave != null) - { - IBlockState actualState = getActualState(state, worldIn, pos); - EnumFacing facing = actualState.getValue(BlockGraveStone.FACING); - - float pixel = 0.0625f; - boolean isFoot = worldIn.getBlockState(pos.up()).getBlock() instanceof BlockGraveSlave; - SlaveType type = actualState.getValue(slaveType); - if(type == SlaveType.BOX || type == SlaveType.BOXFOOT) - { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, 1f, 0.01f, 1f)); - switch(facing) - { - case NORTH: - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, pixel, 1f, 1f)); - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(1f - pixel, 0f, 0f, 1f, 1f, 1f)); - if(isFoot) - { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, 1f, 1f, pixel)); - } - else - { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 1f - pixel, 1f, 1f, 1f)); - } - break; - case SOUTH: - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, pixel, 1f, 1f)); - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(1f - pixel, 0f, 0f, 1f, 1f, 1f)); - if(!isFoot) - { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, 1f, 1f, pixel)); - } - else - { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 1f - pixel, 1f, 1f, 1f)); - } - break; - case WEST: - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, 1f, 1f, pixel)); - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 1f - pixel, 1f, 1f, 1f)); - if(isFoot) - { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, pixel, 1f, 1f)); - } - else - { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(1f - pixel, 0f, 0f, 1f, 1f, 1f)); - } - break; - case EAST: - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, 1f, 1f, pixel)); - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 1f - pixel, 1f, 1f, 1f)); - if(!isFoot) - { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0f, 0f, 0f, pixel, 1f, 1f)); - } - else - { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(1f - pixel, 0f, 0f, 1f, 1f, 1f)); - } - break; - } - } - if(type == SlaveType.NORENDER) - { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0, 0, 0, 0, 0, 0)); - } - if(type == SlaveType.LID) - { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0, 0, 0, 1, .1425f, 1)); - } - } - } - - @SuppressWarnings("Duplicates") - @Override - public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) - { - TileEntityGraveSlave slave = TileTools.getTileEntity(worldIn, pos, TileEntityGraveSlave.class); - if(slave != null) - { - if(slave.getMasterBlock() != null) - { - TileEntityGraveStone master = TileTools.getTileEntity(worldIn, slave.getMasterBlock(), TileEntityGraveStone.class); - if(master != null) - { - IBlockState masterState = master.getBlockState(); - EnumFacing masterFacing = masterState.getValue(BlockGraveStone.FACING); - - SlaveType st = SlaveType.NORENDER; - if(pos.offset(masterFacing.getOpposite()).up().equals(master.getPos())) - { - st = SlaveType.BOXFOOT; - } - if(pos.up().equals(master.getPos())) - { - st = SlaveType.BOX; - } - if(master.getPos().offset(masterFacing).equals(pos) && master.getHasLid()) - { - st = SlaveType.LID; - } - - return getDefaultState() - .withProperty(slaveType, st) - .withProperty(isFoot, !pos.up().equals(master.getPos())) - .withProperty(BlockGraveStone.FACING, master.getFacing()); - } - } - } - return super.getActualState(state, worldIn, pos); - } - - - - @Override - public boolean isOpaqueCube(IBlockState state) - { - return false; - } - - @Override - public boolean isFullBlock(IBlockState state) - { - return false; - } - - @Override - public boolean isFullCube(IBlockState state) - { - return false; - } - - @Override - public Item getItemDropped(IBlockState state, Random rand, int fortune) - { - return null; - } - - @Override - public void onBlockExploded(World world, BlockPos pos, Explosion explosion) { - - } - - private enum SlaveType implements IStringSerializable - { - LID, - BOX, - BOXFOOT, - NORENDER,; - - @Override - public String getName() - { - return name().toLowerCase(); - } - } -} diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockGraveStone.java b/src/main/java/com/fireball1725/graves/common/block/BlockGraveStone.java deleted file mode 100644 index f1707bc..0000000 --- a/src/main/java/com/fireball1725/graves/common/block/BlockGraveStone.java +++ /dev/null @@ -1,148 +0,0 @@ -package com.fireball1725.graves.common.block; - -import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; -import com.fireball1725.graves.common.util.TileTools; -import net.minecraft.block.BlockHorizontal; -import net.minecraft.block.SoundType; -import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyBool; -import net.minecraft.block.properties.PropertyDirection; -import net.minecraft.block.state.BlockStateContainer; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumBlockRenderType; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.AxisAlignedBB; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.Explosion; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -import java.util.List; -import java.util.Random; - -public class BlockGraveStone extends BlockBase { - public static final PropertyDirection FACING = BlockHorizontal.FACING; - public static final PropertyBool HASLID = PropertyBool.create("haslid"); - - public BlockGraveStone() { - super(Material.CLOTH); - setDefaultState(this.blockState.getBaseState().withProperty(HASLID, true).withProperty(FACING, EnumFacing.NORTH)); - setHardness(1F); - setSoundType(SoundType.STONE); - this.setResistance(10000F); - this.setTileEntity(TileEntityGraveStone.class); - } - - @Override - public boolean canEntityDestroy(IBlockState state, IBlockAccess world, BlockPos pos, Entity entity) - { - return false; - } - - @Override - public Item getItemDropped(IBlockState state, Random rand, int fortune) { - return null; - } - - @Override - public EnumBlockRenderType getRenderType(IBlockState state) - { - return EnumBlockRenderType.MODEL; - } - - @Override - public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player) { - return false; - } - - @Override - protected BlockStateContainer createBlockState() - { - return new BlockStateContainer(this, HASLID, FACING); - } - - @Override - public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) { - TileEntity tileEntity = worldIn.getTileEntity(pos); - if (tileEntity != null && tileEntity instanceof TileEntityGraveStone) { - TileEntityGraveStone graveStone = (TileEntityGraveStone) tileEntity; - return state.withProperty(HASLID, graveStone.getHasLid()); - } - return state.withProperty(HASLID, false); - } - - @Override - public IBlockState getStateFromMeta(int meta) { - return getDefaultState().withProperty(FACING, EnumFacing.values()[meta]); - } - - public int getMetaFromState(IBlockState state) { - return state.getValue(FACING).getIndex(); - } - - @Override - public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB mask, List list, Entity p_185477_6_) - { - IBlockState actualState = getActualState(state, worldIn, pos); - boolean hasLid = actualState.getValue(BlockGraveStone.HASLID); - if (hasLid) { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0, 0, 0, 1, .1425f, 1)); - } - else - { - addCollisionBoxToList(pos, mask, list, new AxisAlignedBB(0, 0, 0, 0, 0, 0)); - } - } - - @Override - public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) - { - return new AxisAlignedBB(0, 0, 0, 1, .1425f, 1); - } - - @Override - public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { - return getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()); - } - - @Override - public void onBlockPlacedBy(World world, BlockPos blockPos, IBlockState state, EntityLivingBase placer, ItemStack itemStack) { - super.onBlockPlacedBy(world, blockPos, state, placer, itemStack); - - TileEntityGraveStone graveStoneTileEntity = TileTools.getTileEntity(world, blockPos, TileEntityGraveStone.class); - if(graveStoneTileEntity != null) - { - graveStoneTileEntity.breakBlocks(); - graveStoneTileEntity.setPlayerProfile(((EntityPlayer) placer).getGameProfile()); - } - } - - @Override - public boolean isOpaqueCube(IBlockState state) - { - return false; - } - - @Override - public boolean isFullBlock(IBlockState state) - { - return false; - } - - @Override - public boolean isFullCube(IBlockState state) - { - return false; - } - - @Override - public void onBlockExploded(World world, BlockPos pos, Explosion explosion) - { - } -} diff --git a/src/main/java/com/fireball1725/graves/common/block/Blocks.java b/src/main/java/com/fireball1725/graves/common/block/Blocks.java index 64f0e68..f7a4ce1 100644 --- a/src/main/java/com/fireball1725/graves/common/block/Blocks.java +++ b/src/main/java/com/fireball1725/graves/common/block/Blocks.java @@ -1,8 +1,5 @@ package com.fireball1725.graves.common.block; -import com.fireball1725.graves.common.creativetab.ModCreativeTabs; -import com.fireball1725.graves.common.helpers.LogHelper; -import com.fireball1725.graves.common.item.ItemHeadStone; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemBlock; @@ -10,9 +7,8 @@ import net.minecraftforge.fml.common.registry.GameRegistry; public enum Blocks { - BLOCK_GRAVESTONE("gravestone", new BlockGraveStone(), ModCreativeTabs.tabGraves), - BLOCK_GRAVESTONE_SLAVE("graveslave", new BlockGraveSlave()), - BLOCK_GRAVE_HEADSTONE("headstone", new BlockHeadStone(), ItemHeadStone.class, ModCreativeTabs.tabGraves); + BLOCK_GRAVE("grave", new BlockGrave(), CreativeTabs.DECORATIONS), + BLOCK_GRAVE_LEGACY("gravestone", new BlockGraveLegacy()); private static boolean registered = false; public final Block block; @@ -57,6 +53,5 @@ public String getStatName() { private void register() { GameRegistry.registerBlock(block.setCreativeTab(creativeTabs).setUnlocalizedName(internalName), itemBlockClass, internalName); - LogHelper.info("Registered Block: " + internalName); } } diff --git a/src/main/java/com/fireball1725/graves/common/creativetab/ModCreativeTabs.java b/src/main/java/com/fireball1725/graves/common/creativetab/ModCreativeTabs.java deleted file mode 100644 index 739d6a5..0000000 --- a/src/main/java/com/fireball1725/graves/common/creativetab/ModCreativeTabs.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.fireball1725.graves.common.creativetab; - -import com.fireball1725.graves.common.block.Blocks; -import com.fireball1725.graves.common.reference.ModInfo; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; - -public class ModCreativeTabs { - public static final CreativeTabs tabGraves = new CreativeTabs(ModInfo.MOD_ID) { - @Override - public Item getTabIconItem() { - return Item.getItemFromBlock(Blocks.BLOCK_GRAVE_HEADSTONE.block); - } - }; -} diff --git a/src/main/java/com/fireball1725/graves/common/entity/EntityPlayerZombie.java b/src/main/java/com/fireball1725/graves/common/entity/EntityPlayerZombie.java index 9fdd63f..cdf8618 100644 --- a/src/main/java/com/fireball1725/graves/common/entity/EntityPlayerZombie.java +++ b/src/main/java/com/fireball1725/graves/common/entity/EntityPlayerZombie.java @@ -1,9 +1,11 @@ package com.fireball1725.graves.common.entity; +import com.fireball1725.graves.Graves; import com.fireball1725.graves.common.configuration.ConfigZombie; import com.fireball1725.graves.common.helpers.IDeadPlayerEntity; -import com.fireball1725.graves.common.helpers.LogHelper; import com.fireball1725.graves.common.helpers.SoundHelper; +import com.fireball1725.graves.common.tileentity.TileEntityGrave; +import com.fireball1725.graves.common.util.TileTools; import com.google.common.base.Predicate; import com.mojang.authlib.GameProfile; import net.minecraft.entity.*; @@ -17,7 +19,6 @@ import net.minecraft.network.datasync.DataParameter; import net.minecraft.network.datasync.DataSerializers; import net.minecraft.network.datasync.EntityDataManager; -import net.minecraft.tileentity.TileEntitySkull; import net.minecraft.util.*; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; @@ -44,43 +45,46 @@ public class EntityPlayerZombie extends EntityFlying implements IDeadPlayerEntit private static Map sounds = new HashMap(); private final EntityAIBreakDoor breakDoorAI = new EntityAIBreakDoor(this); private double prevCapeX, prevCapeY, prevCapeZ; - private double capeX, capeY, capeZ; - private GameProfile profile; - private EntityPlayer player; - private BlockPos graveMaster; + private double capeX, capeY, capeZ; + private GameProfile profile; + private EntityPlayer player; + private BlockPos gravePos; - public EntityPlayerZombie(World world) { - super(world); + public EntityPlayerZombie(World world) + { + super(world); - this.noClip = true; - this.isImmuneToFire = true; - this.moveHelper = new PlayerZombieMoveHelper(); + this.noClip = true; + this.isImmuneToFire = true; + this.moveHelper = new PlayerZombieMoveHelper(); - tasks.addTask(3, new AIPlayerZombieRandomFly()); - tasks.addTask(4, new AIPlayerZombieAttackTarget()); + tasks.addTask(3, new AIPlayerZombieRandomFly()); + tasks.addTask(4, new AIPlayerZombieAttackTarget()); - tasks.addTask(1, new EntityAIOpenDoor(this, true)); + tasks.addTask(1, new EntityAIOpenDoor(this, true)); tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false)); tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D)); - tasks.addTask(7, new EntityAIWander(this, 1.0D)); - tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + tasks.addTask(7, new EntityAIWander(this, 1.0D)); + tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); - targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true, false, new Predicate() { - @Override - public boolean apply(EntityPlayer input) { - return input.getName().equals(getUsername()); - } - })); + targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); + targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true, false, new Predicate() + { + @Override + public boolean apply(EntityPlayer input) + { + return input.getName().equals(getUsername()); + } + })); - setSize(0.6F, 1.8F); - } + setSize(0.6F, 1.8F); + } public EntityPlayerZombie(World world, BlockPos pos) { this(world); - graveMaster = pos; + gravePos = pos; } public static void registerSounds() @@ -91,9 +95,10 @@ public static void registerSounds() SoundHelper.registerSound("playerzombie.death", sounds); } - public void setPlayer(EntityPlayer player) { - this.player = player; - } + public void setPlayer(EntityPlayer player) + { + this.player = player; + } @Override public NBTTagCompound writeToNBT(NBTTagCompound tagCompund) @@ -102,82 +107,90 @@ public NBTTagCompound writeToNBT(NBTTagCompound tagCompund) return super.writeToNBT(tagCompund); } - @Override - public boolean canPickUpLoot() { - return true; - } - - @Override - protected void damageEntity(DamageSource damageSrc, float damageAmount) { - //Entity entity = damageSrc.getEntity(); - //if (entity instanceof EntityPlayer) { - // EntityPlayer player = (EntityPlayer) entity; - - //if (!player.getName().equals(this.getName())) { - // damageAmount = 0; - //} - //} - - super.damageEntity(damageSrc, damageAmount); - } - - @Override - public void onUpdate() { - prevCapeX = capeX; - prevCapeY = capeY; - prevCapeZ = capeZ; - double x = posX - capeX; - double y = posY - capeY; - double z = posZ - capeZ; - double maxCapeAngle = 10.0; - - if (x > maxCapeAngle) - prevCapeX = capeX = posX; - if (z > maxCapeAngle) - prevCapeZ = capeZ = posZ; - if (y > maxCapeAngle) - prevCapeY = capeY = posY; - if (x < -maxCapeAngle) - prevCapeX = capeX = posX; - if (z < -maxCapeAngle) - prevCapeZ = capeZ = posZ; - if (y < -maxCapeAngle) - prevCapeY = capeY = posY; - - capeX += x * 0.25; - capeZ += z * 0.25; - capeY += y * 0.25; - - if (worldObj.isRemote) { + @Override + public boolean canPickUpLoot() + { + return true; + } + + @Override + protected void damageEntity(DamageSource damageSrc, float damageAmount) + { + //Entity entity = damageSrc.getEntity(); + //if (entity instanceof EntityPlayer) { + // EntityPlayer player = (EntityPlayer) entity; + + //if (!player.getName().equals(this.getName())) { + // damageAmount = 0; + //} + //} + + super.damageEntity(damageSrc, damageAmount); + } + + @Override + public void onUpdate() + { + prevCapeX = capeX; + prevCapeY = capeY; + prevCapeZ = capeZ; + double x = posX - capeX; + double y = posY - capeY; + double z = posZ - capeZ; + double maxCapeAngle = 10.0; + + if(x > maxCapeAngle) + { prevCapeX = capeX = posX; } + if(z > maxCapeAngle) + { prevCapeZ = capeZ = posZ; } + if(y > maxCapeAngle) + { prevCapeY = capeY = posY; } + if(x < -maxCapeAngle) + { prevCapeX = capeX = posX; } + if(z < -maxCapeAngle) + { prevCapeZ = capeZ = posZ; } + if(y < -maxCapeAngle) + { prevCapeY = capeY = posY; } + + capeX += x * 0.25; + capeZ += z * 0.25; + capeY += y * 0.25; + + if(worldObj.isRemote) + { float w = dataManager.get(WIDTH); if(w != width) width = w; float h = dataManager.get(HEIGHT); if(h != height) height = h; - } + } - if (this.player != null) { - if (this.player.isDead) { - this.setDead(); - return; - } - } + if(this.player != null) + { + if(this.player.isDead) + { + this.setDead(); + return; + } + } - super.onUpdate(); - } + super.onUpdate(); + } - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); + @Override + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(ConfigZombie.configZombieDefaultFollowRange); getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(ConfigZombie.configZombieDefaultSpeed); getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(ConfigZombie.configZombieDefaultBaseDamage); } - @Override - protected void entityInit() { - super.entityInit(); + @Override + protected void entityInit() + { + super.entityInit(); dataManager.register(NAME, ""); dataManager.register(CHILD, (byte) 0); dataManager.register(WIDTH, width); @@ -185,7 +198,6 @@ protected void entityInit() { playSound(getSound("spawn"), getSoundVolume(), getSoundPitch()); } - //TODO: Add Sounds when not completely broken. @Override public SoundCategory getSoundCategory() { @@ -210,17 +222,31 @@ protected SoundEvent getDeathSound() return getSound("death"); } - @Override - protected void dropFewItems(boolean recentHit, int looting) { + @Override + protected void dropFewItems(boolean recentHit, int looting) + { - } + } - @Override - protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty) { - super.setEquipmentBasedOnDifficulty(difficulty); + @Override + public void setDead() + { + TileEntityGrave grave = TileTools.getTileEntity(worldObj, gravePos, TileEntityGrave.class); + if(grave != null) + { + grave.setGhostDefeated(true); + } + super.setDead(); + } - if (rand.nextFloat() < (worldObj.getDifficulty() == EnumDifficulty.HARD ? 0.1F : 0.05F)) { - int i = rand.nextInt(3); + @Override + protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty) + { + super.setEquipmentBasedOnDifficulty(difficulty); + + if(rand.nextFloat() < (worldObj.getDifficulty() == EnumDifficulty.HARD ? 0.1F : 0.05F)) + { + int i = rand.nextInt(3); if(i == 0) { setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.STONE_SWORD)); } @@ -235,28 +261,29 @@ public void setItemStackToSlot(EntityEquipmentSlot slotIn, ItemStack stack) super.setItemStackToSlot(slotIn, stack); } - @Override + @Override public ItemStack getPickedResult(RayTraceResult target) { ItemStack stack = new ItemStack(Items.SPAWN_EGG); NBTTagCompound nbt = new NBTTagCompound(); nbt.setString("entity_name", EntityList.CLASS_TO_NAME.get(getClass())); stack.setTagCompound(nbt); - return stack; - } + return stack; + } - @Override - public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata) { - boolean hardcoreEnabled = worldObj.getWorldInfo().isHardcoreModeEnabled(); - EnumDifficulty gameDifficulty = worldObj.getDifficulty(); + @Override + public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata) + { + boolean hardcoreEnabled = worldObj.getWorldInfo().isHardcoreModeEnabled(); + EnumDifficulty gameDifficulty = worldObj.getDifficulty(); - setEquipmentBasedOnDifficulty(difficulty); - setEnchantmentBasedOnDifficulty(difficulty); + setEquipmentBasedOnDifficulty(difficulty); + setEnchantmentBasedOnDifficulty(difficulty); float additionalDifficulty = difficulty.getClampedAdditionalDifficulty(); getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(new AttributeModifier("Knockback Resistance Bonus", rand.nextDouble() * 50, 0)); - double rangeBonus = rand.nextDouble() * 1.5 * additionalDifficulty; + double rangeBonus = rand.nextDouble() * 1.5 * additionalDifficulty; if(rangeBonus > 1.0) { getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).applyModifier(new AttributeModifier("Range Bonus", rangeBonus, 2)); } @@ -269,102 +296,115 @@ public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLi if(rand.nextFloat() < additionalDifficulty * 0.2F) { getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).applyModifier(new AttributeModifier("Speed Bonus", rand.nextDouble() * 2.0 * 0.24 + 0.01, 2)); } - if (rand.nextFloat() < additionalDifficulty * 0.1F) - tasks.addTask(1, breakDoorAI); - - Random random = new Random(); - int rng = random.nextInt(100); - - ItemStack slot0 = null; - ItemStack slot1 = null; - ItemStack slot2 = null; - ItemStack slot3 = null; - ItemStack slot4 = null; - - int rngNothing = 0; - int rngSword = 0; - int rngLeatherKit = 0; - int rngIronKit = 0; - int rngGoldKit = 0; - int rngDiamondKit = 0; - - switch (gameDifficulty) { - case EASY: - rngNothing = ConfigZombie.configZombieArmorChanceEasyNone; - rngSword = ConfigZombie.configZombieArmorChanceEasyWoodSword; - rngLeatherKit = ConfigZombie.configZombieArmorChanceEasyLeatherKit; - rngIronKit = ConfigZombie.configZombieArmorChanceEasyIronKit; - rngGoldKit = ConfigZombie.configZombieArmorChanceEasyGoldKit; - rngDiamondKit = ConfigZombie.configZombieArmorChanceEasyDiamondKit; - break; - - case NORMAL: - rngNothing = ConfigZombie.configZombieArmorChanceNormalNone; - rngSword = ConfigZombie.configZombieArmorChanceNormalWoodSword; - rngLeatherKit = ConfigZombie.configZombieArmorChanceNormalLeatherKit; - rngIronKit = ConfigZombie.configZombieArmorChanceNormalIronKit; - rngGoldKit = ConfigZombie.configZombieArmorChanceNormalGoldKit; - rngDiamondKit = ConfigZombie.configZombieArmorChanceNormalDiamondKit; - break; - - case HARD: - rngNothing = ConfigZombie.configZombieArmorChanceHardNone; - rngSword = ConfigZombie.configZombieArmorChanceHardWoodSword; - rngLeatherKit = ConfigZombie.configZombieArmorChanceHardLeatherKit; - rngIronKit = ConfigZombie.configZombieArmorChanceHardIronKit; - rngGoldKit = ConfigZombie.configZombieArmorChanceHardGoldKit; - rngDiamondKit = ConfigZombie.configZombieArmorChanceHardDiamondKit; - break; - } - - if (hardcoreEnabled) { - rngNothing = ConfigZombie.configZombieArmorChanceHardCoreNone; - rngSword = ConfigZombie.configZombieArmorChanceHardCoreWoodSword; - rngLeatherKit = ConfigZombie.configZombieArmorChanceHardCoreLeatherKit; - rngIronKit = ConfigZombie.configZombieArmorChanceHardCoreIronKit; - rngGoldKit = ConfigZombie.configZombieArmorChanceHardCoreGoldKit; - rngDiamondKit = ConfigZombie.configZombieArmorChanceHardCoreDiamondKit; - } - - if (rngNothing + rngSword + rngLeatherKit + rngIronKit + rngGoldKit + rngDiamondKit != 100) { - rngNothing = 30; - rngSword = 20; - rngLeatherKit = 20; - rngIronKit = 16; - rngGoldKit = 8; - rngDiamondKit = 6; - LogHelper.error("RNG Values did not add up to 100, please check your config and fix this! using default RNG values for Zombie Armor!"); - } - - if (rng > rngNothing + rngSword + rngLeatherKit + rngIronKit + rngGoldKit) { // Diamond Kit + if(rand.nextFloat() < additionalDifficulty * 0.1F) + { tasks.addTask(1, breakDoorAI); } + + Random random = new Random(); + int rng = random.nextInt(100); + + ItemStack slot0 = null; + ItemStack slot1 = null; + ItemStack slot2 = null; + ItemStack slot3 = null; + ItemStack slot4 = null; + + int rngNothing = 0; + int rngSword = 0; + int rngLeatherKit = 0; + int rngIronKit = 0; + int rngGoldKit = 0; + int rngDiamondKit = 0; + + switch(gameDifficulty) + { + case EASY: + rngNothing = ConfigZombie.configZombieArmorChanceEasyNone; + rngSword = ConfigZombie.configZombieArmorChanceEasyWoodSword; + rngLeatherKit = ConfigZombie.configZombieArmorChanceEasyLeatherKit; + rngIronKit = ConfigZombie.configZombieArmorChanceEasyIronKit; + rngGoldKit = ConfigZombie.configZombieArmorChanceEasyGoldKit; + rngDiamondKit = ConfigZombie.configZombieArmorChanceEasyDiamondKit; + break; + + case NORMAL: + rngNothing = ConfigZombie.configZombieArmorChanceNormalNone; + rngSword = ConfigZombie.configZombieArmorChanceNormalWoodSword; + rngLeatherKit = ConfigZombie.configZombieArmorChanceNormalLeatherKit; + rngIronKit = ConfigZombie.configZombieArmorChanceNormalIronKit; + rngGoldKit = ConfigZombie.configZombieArmorChanceNormalGoldKit; + rngDiamondKit = ConfigZombie.configZombieArmorChanceNormalDiamondKit; + break; + + case HARD: + rngNothing = ConfigZombie.configZombieArmorChanceHardNone; + rngSword = ConfigZombie.configZombieArmorChanceHardWoodSword; + rngLeatherKit = ConfigZombie.configZombieArmorChanceHardLeatherKit; + rngIronKit = ConfigZombie.configZombieArmorChanceHardIronKit; + rngGoldKit = ConfigZombie.configZombieArmorChanceHardGoldKit; + rngDiamondKit = ConfigZombie.configZombieArmorChanceHardDiamondKit; + break; + } + + if(hardcoreEnabled) + { + rngNothing = ConfigZombie.configZombieArmorChanceHardCoreNone; + rngSword = ConfigZombie.configZombieArmorChanceHardCoreWoodSword; + rngLeatherKit = ConfigZombie.configZombieArmorChanceHardCoreLeatherKit; + rngIronKit = ConfigZombie.configZombieArmorChanceHardCoreIronKit; + rngGoldKit = ConfigZombie.configZombieArmorChanceHardCoreGoldKit; + rngDiamondKit = ConfigZombie.configZombieArmorChanceHardCoreDiamondKit; + } + + if(rngNothing + rngSword + rngLeatherKit + rngIronKit + rngGoldKit + rngDiamondKit != 100) + { + rngNothing = 30; + rngSword = 20; + rngLeatherKit = 20; + rngIronKit = 16; + rngGoldKit = 8; + rngDiamondKit = 6; + Graves.logger.error("RNG Values did not add up to 100, please check your config and fix this! using default RNG values for Zombie Armor!"); + } + + if(rng > rngNothing + rngSword + rngLeatherKit + rngIronKit + rngGoldKit) + { // Diamond Kit slot0 = new ItemStack(Items.DIAMOND_SWORD); slot1 = new ItemStack(Items.DIAMOND_BOOTS); slot2 = new ItemStack(Items.DIAMOND_LEGGINGS); slot3 = new ItemStack(Items.DIAMOND_CHESTPLATE); slot4 = new ItemStack(Items.DIAMOND_HELMET); - } else if (rng > rngNothing + rngSword + rngLeatherKit + rngIronKit) { // Gold Kit + } + else if(rng > rngNothing + rngSword + rngLeatherKit + rngIronKit) + { // Gold Kit slot0 = new ItemStack(Items.GOLDEN_SWORD); slot1 = new ItemStack(Items.GOLDEN_BOOTS); slot2 = new ItemStack(Items.GOLDEN_LEGGINGS); slot3 = new ItemStack(Items.GOLDEN_CHESTPLATE); slot4 = new ItemStack(Items.GOLDEN_HELMET); - } else if (rng > rngNothing + rngSword + rngLeatherKit) { // Iron Kit + } + else if(rng > rngNothing + rngSword + rngLeatherKit) + { // Iron Kit slot0 = new ItemStack(Items.IRON_SWORD); slot1 = new ItemStack(Items.IRON_BOOTS); slot2 = new ItemStack(Items.IRON_LEGGINGS); slot3 = new ItemStack(Items.IRON_CHESTPLATE); slot4 = new ItemStack(Items.IRON_HELMET); - } else if (rng > rngNothing + rngSword) { // Leather Kit + } + else if(rng > rngNothing + rngSword) + { // Leather Kit slot0 = new ItemStack(Items.WOODEN_SWORD); slot1 = new ItemStack(Items.LEATHER_BOOTS); slot2 = new ItemStack(Items.LEATHER_LEGGINGS); slot3 = new ItemStack(Items.LEATHER_CHESTPLATE); slot4 = new ItemStack(Items.LEATHER_HELMET); - } else if (rng > rngNothing) { // Wooden Sword + } + else if(rng > rngNothing) + { // Wooden Sword slot0 = new ItemStack(Items.WOODEN_SWORD); } - if (ConfigZombie.configZombieArmorEnabled) { + if(ConfigZombie.configZombieArmorEnabled) + { if(slot0 != null) { this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, slot0); } @@ -381,76 +421,89 @@ public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLi { this.setItemStackToSlot(EntityEquipmentSlot.HEAD, slot4); } } - this.setHealth(ConfigZombie.configZombieDefaultHealth); + this.setHealth(ConfigZombie.configZombieDefaultHealth); - return null; - } + playSound(getSound("spawn"), this.getSoundVolume(), this.getSoundPitch()); - @Override - protected void despawnEntity() { - super.despawnEntity(); + return null; + } + + @Override + protected void despawnEntity() + { + super.despawnEntity(); if(isDead && this.getRidingEntity() != null) { getRidingEntity().setDead(); } } - @Override - public double getYOffset() { - return -0.3; - } + @Override + public double getYOffset() + { + return -0.3; + } - @Override - public void writeEntityToNBT(NBTTagCompound nbt) { - super.writeEntityToNBT(nbt); - if(graveMaster != null) - { nbt.setLong("graveMaster", graveMaster.toLong()); } + @Override + public void writeEntityToNBT(NBTTagCompound nbt) + { + super.writeEntityToNBT(nbt); + if(gravePos != null) + { nbt.setLong("gravePos", gravePos.toLong()); } - String username = getUsername(); - if (!StringUtils.isBlank(username)) - nbt.setString("Username", username); - } + String username = getUsername(); + if(!StringUtils.isBlank(username)) + { nbt.setString("Username", username); } + } - @Override - public void readEntityFromNBT(NBTTagCompound nbt) { - super.readEntityFromNBT(nbt); + @Override + public void readEntityFromNBT(NBTTagCompound nbt) + { + super.readEntityFromNBT(nbt); - String username; - if (nbt.hasKey("Username")) { - username = nbt.getString("Username"); - } else - username = "FireBall1725"; - setUsername(username); - if(nbt.hasKey("graveMaster")) - { graveMaster = BlockPos.fromLong(nbt.getLong("graveMaster")); } + String username; + if(nbt.hasKey("Username")) + { + username = nbt.getString("Username"); + } + else + { username = "FireBall1725"; } + setUsername(username); + if(nbt.hasKey("gravePos")) + { gravePos = BlockPos.fromLong(nbt.getLong("gravePos")); } } - @Override - public boolean attackEntityAsMob(Entity target) { - boolean result = super.attackEntityAsMob(target); + @Override + public boolean attackEntityAsMob(Entity target) + { + boolean result = super.attackEntityAsMob(target); if(result) { swingArm(EnumHand.MAIN_HAND); } return result; } - @Override - public String getName() { - return getUsername(); - } + @Override + public String getName() + { + return getUsername(); + } - @Override - public String getCustomNameTag() { - return getUsername(); - } + @Override + public String getCustomNameTag() + { + return getUsername(); + } - @Override - public void setCustomNameTag(String name) { - } + @Override + public void setCustomNameTag(String name) + { + } - @Override - public boolean hasCustomName() { - return true; - } + @Override + public boolean hasCustomName() + { + return true; + } - @Override + @Override public ITextComponent getDisplayName() { return new TextComponentString(getName()) @@ -466,34 +519,40 @@ public Style getStyle() style = new Style() { - @Override - @SideOnly(Side.CLIENT) - public String getFormattingCode() { - return ""; - } + @Override + @SideOnly(Side.CLIENT) + public String getFormattingCode() + { + return ""; + } - }; - Iterator iterator = siblings.iterator(); + }; - while (iterator.hasNext()) { - ITextComponent ITextComponent = (ITextComponent) iterator.next(); - ITextComponent.getStyle().setParentStyle(style); + for(ITextComponent iTextComponent : siblings) + { + iTextComponent.getStyle().setParentStyle(style); } } - return style; - } - }; - } + return style; + } + }; + } - @Override - public GameProfile getProfile() { - if (profile == null) - setProfile(TileEntitySkull.updateGameprofile(new GameProfile(null, getUsername()))); - return profile; - } + @Override + public GameProfile getProfile() + { + if(profile == null) + { + TileEntityGrave grave = TileTools.getTileEntity(worldObj, gravePos, TileEntityGrave.class); + if(grave != null) + { setProfile(grave.getProfile()); } + } + return profile; + } - public void setProfile(GameProfile profile) { + public void setProfile(GameProfile profile) + { if(profile != null) { this.profile = profile; @@ -503,34 +562,39 @@ public void setProfile(GameProfile profile) { this.setUsername("FireBall1725"); } - @Override - public String getUsername() { + @Override + public String getUsername() + { String username = dataManager.get(NAME); if(StringUtils.isBlank(username)) { dataManager.set(NAME, "FireBall1725"); } if(username.equals("Soaryn")) return "direwolf20"; - if (username.equals("direwolf20")) - return "Soaryn"; - return username; - } + if(username.equals("direwolf20")) + { return "Soaryn"; } + return username; + } - @Override - public void setUsername(String name) { - String newName = ""; + @Override + public void setUsername(String name) + { + String newName = ""; - if ("Herobrine".equals(name)) { + if("Herobrine".equals(name)) + { getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).applyModifier(new AttributeModifier("Herobrine Damage Bonus", 1, 2)); getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).applyModifier(new AttributeModifier("Herobrine Speed Bonus", 0.5, 2)); } - if ("direwolf20".equals(name)) { - newName = "Soaryn"; - } + if("direwolf20".equals(name)) + { + newName = "Soaryn"; + } - if ("Soaryn".equals(name)) { - newName = "direwolf20"; - } + if("Soaryn".equals(name)) + { + newName = "direwolf20"; + } if(!newName.isEmpty()) { @@ -539,36 +603,41 @@ public void setUsername(String name) { dataManager.set(NAME, name); } - @Override - public double getInterpolatedCapeX(float partialTickTime) { - return prevCapeX + (capeX - prevCapeX) * partialTickTime - (prevPosX + (posX - prevPosX) * partialTickTime); - } + @Override + public double getInterpolatedCapeX(float partialTickTime) + { + return prevCapeX + (capeX - prevCapeX) * partialTickTime - (prevPosX + (posX - prevPosX) * partialTickTime); + } - @Override - public double getInterpolatedCapeY(float partialTickTime) { - return prevCapeY + (capeY - prevCapeY) * partialTickTime - (prevPosY + (posY - prevPosY) * partialTickTime); - } + @Override + public double getInterpolatedCapeY(float partialTickTime) + { + return prevCapeY + (capeY - prevCapeY) * partialTickTime - (prevPosY + (posY - prevPosY) * partialTickTime); + } - @Override - public double getInterpolatedCapeZ(float partialTickTime) { - return prevCapeZ + (capeZ - prevCapeZ) * partialTickTime - (prevPosZ + (posZ - prevPosZ) * partialTickTime); - } + @Override + public double getInterpolatedCapeZ(float partialTickTime) + { + return prevCapeZ + (capeZ - prevCapeZ) * partialTickTime - (prevPosZ + (posZ - prevPosZ) * partialTickTime); + } - @Override - public boolean isChild() { + @Override + public boolean isChild() + { return dataManager.get(CHILD) == 1; } - @Override - protected void setSize(float width, float height) { - super.setSize(width, height); + @Override + protected void setSize(float width, float height) + { + super.setSize(width, height); dataManager.set(WIDTH, this.width); dataManager.set(HEIGHT, this.height); } - public BlockPos getGraveMaster() + public BlockPos getGravePos() { - return graveMaster; + return gravePos; } /** @@ -579,76 +648,78 @@ public boolean isNonBoss() return false; } - public SoundEvent getSound(String name) + private SoundEvent getSound(String name) { return sounds.get("playerzombie." + name); } - - - class PlayerZombieMoveTargetPos + private class PlayerZombieMoveTargetPos { - public double posX; - public double posY; - public double posZ; - public double distX; - public double distY; - public double distZ; - public double dist; - public double aimX; - public double aimY; - public double aimZ; + private double posX; + private double posY; + private double posZ; + private double distX; + private double distY; + private double distZ; + private double dist; + private double aimX; + private double aimY; + private double aimZ; + private EntityPlayerZombie playerZombie = EntityPlayerZombie.this; - public PlayerZombieMoveTargetPos() { - this(0, 0, 0); - } - - public PlayerZombieMoveTargetPos(double posX, double posY, double posZ) { - this.setTarget(posX, posY, posZ); - } - - public void setTarget(double posX, double posY, double posZ) { - this.posX = posX; - this.posY = posY; - this.posZ = posZ; - this.refresh(); - } - - public void refresh() { - this.distX = this.posX - this.playerZombie.posX; - this.distY = this.posY - this.playerZombie.posY; - this.distZ = this.posZ - this.playerZombie.posZ; - - this.dist = (double) MathHelper.sqrt_double(this.distX * this.distX + this.distY * this.distY + this.distZ * this.distZ); - - // (aimX,aimY,aimZ) is a unit vector in the direction we want to go - if (this.dist == 0.0D) { - this.aimX = 0.0D; - this.aimY = 0.0D; - this.aimZ = 0.0D; - } else { - this.aimX = this.distX / this.dist; - this.aimY = this.distY / this.dist; - this.aimZ = this.distZ / this.dist; - } - } - - public boolean isBoxBlocked(AxisAlignedBB box) { - //return !this.playerZombie.worldObj.getCollidingBoundingBoxes(this.playerZombie, box).isEmpty(); - return false; - } - - // check nothing will collide with the playerZombie in the direction of aim, for howFar units (or until the destination - whichever is closer) - public boolean isPathClear(double howFar) { - howFar = Math.min(howFar, this.dist); - AxisAlignedBB box = this.playerZombie.getEntityBoundingBox(); - for (double i = 0.5D; i < howFar; ++i) { - // check there's nothing in the way - if (this.isBoxBlocked(box.offset(this.aimX * i, this.aimY * i, this.aimZ * i))) { - return false; - } + private PlayerZombieMoveTargetPos() + { + this(0, 0, 0); + } + + private PlayerZombieMoveTargetPos(double posX, double posY, double posZ) + { + this.setTarget(posX, posY, posZ); + } + + private void setTarget(double posX, double posY, double posZ) + { + this.posX = posX; + this.posY = posY; + this.posZ = posZ; + this.refresh(); + } + + private void refresh() + { + this.distX = this.posX - this.playerZombie.posX; + this.distY = this.posY - this.playerZombie.posY; + this.distZ = this.posZ - this.playerZombie.posZ; + + this.dist = (double) MathHelper.sqrt_double(this.distX * this.distX + this.distY * this.distY + this.distZ * this.distZ); + + // (aimX,aimY,aimZ) is a unit vector in the direction we want to go + if(this.dist == 0.0D) + { + this.aimX = 0.0D; + this.aimY = 0.0D; + this.aimZ = 0.0D; + } + else + { + this.aimX = this.distX / this.dist; + this.aimY = this.distY / this.dist; + this.aimZ = this.distZ / this.dist; } + } + + private boolean isBoxBlocked(AxisAlignedBB box) + { + //return !this.playerZombie.worldObj.getCollidingBoundingBoxes(this.playerZombie, box).isEmpty(); + return false; + } + + // check nothing will collide with the playerZombie in the direction of aim, for howFar units (or until the destination - whichever is closer) + private boolean isPathClear(double howFar) + { + howFar = Math.min(howFar, this.dist); + AxisAlignedBB box = this.playerZombie.getEntityBoundingBox(); return !this.isBoxBlocked(box.offset(this.aimX * howFar, this.aimY * howFar, this.aimZ * howFar)); } @@ -656,54 +727,58 @@ public boolean isPathClear(double howFar) { - class PlayerZombieMoveHelper extends EntityMoveHelper { - private EntityPlayerZombie playerZombie = EntityPlayerZombie.this; - private int courseChangeCooldown = 0; - private double closeEnough = 0.3D; - private PlayerZombieMoveTargetPos targetPos = new PlayerZombieMoveTargetPos(); + private class PlayerZombieMoveHelper extends EntityMoveHelper + { + private EntityPlayerZombie playerZombie = EntityPlayerZombie.this; + private int courseChangeCooldown = 0; + private PlayerZombieMoveTargetPos targetPos = new PlayerZombieMoveTargetPos(); - public PlayerZombieMoveHelper() + PlayerZombieMoveHelper() { super(EntityPlayerZombie.this); } - @Override - public void setMoveTo(double x, double y, double z, double speedIn) { - super.setMoveTo(x, y, z, speedIn); - this.targetPos.setTarget(x, y, z); - } + @Override + public void setMoveTo(double x, double y, double z, double speedIn) + { + super.setMoveTo(x, y, z, speedIn); + this.targetPos.setTarget(x, y, z); + } - @Override - public void onUpdateMoveHelper() { + @Override + public void onUpdateMoveHelper() + { if(!this.isUpdating()) { return; - } + } - if (this.courseChangeCooldown-- > 0) { - // limit the rate at which we change course - return; - } - this.courseChangeCooldown += this.playerZombie.getRNG().nextInt(5) + 2; + if(this.courseChangeCooldown-- > 0) + { + // limit the rate at which we change course + return; + } + this.courseChangeCooldown += this.playerZombie.getRNG().nextInt(5) + 2; - // update the target position - this.targetPos.refresh(); + // update the target position + this.targetPos.refresh(); - // accelerate the playerZombie towards the target - double acceleration = 0.1D; - this.playerZombie.motionX += this.targetPos.aimX * acceleration; - this.playerZombie.motionY += this.targetPos.aimY * acceleration; - this.playerZombie.motionZ += this.targetPos.aimZ * acceleration; + // accelerate the playerZombie towards the target + double acceleration = 0.1D; + this.playerZombie.motionX += this.targetPos.aimX * acceleration; + this.playerZombie.motionY += this.targetPos.aimY * acceleration; + this.playerZombie.motionZ += this.targetPos.aimZ * acceleration; - // rotate to point at target - this.playerZombie.renderYawOffset = this.playerZombie.rotationYaw = -((float) Math.atan2(this.targetPos.distX, this.targetPos.distZ)) * 180.0F / (float) Math.PI; + // rotate to point at target + this.playerZombie.renderYawOffset = this.playerZombie.rotationYaw = -((float) Math.atan2(this.targetPos.distX, this.targetPos.distZ)) * 180.0F / (float) Math.PI; - // occasionally jerk to the side - makes them more difficult to hit - if (this.playerZombie.getRNG().nextInt(5) == 0) { - float strafeAmount = (this.playerZombie.getRNG().nextFloat() * 0.4F) - 0.2F; - this.playerZombie.motionX += (double) (strafeAmount * MathHelper.cos(this.playerZombie.rotationYaw * (float) Math.PI / 180.0F)); - this.playerZombie.motionZ += (double) (strafeAmount * MathHelper.sin(this.playerZombie.rotationYaw * (float) Math.PI / 180.0F)); - } + // occasionally jerk to the side - makes them more difficult to hit + if(this.playerZombie.getRNG().nextInt(5) == 0) + { + float strafeAmount = (this.playerZombie.getRNG().nextFloat() * 0.4F) - 0.2F; + this.playerZombie.motionX += (double) (strafeAmount * MathHelper.cos(this.playerZombie.rotationYaw * (float) Math.PI / 180.0F)); + this.playerZombie.motionZ += (double) (strafeAmount * MathHelper.sin(this.playerZombie.rotationYaw * (float) Math.PI / 180.0F)); + } } } @@ -711,146 +786,171 @@ public void onUpdateMoveHelper() { // AI class for implementing the random flying behaviour - class AIPlayerZombieRandomFly extends EntityAIBase { - private EntityPlayerZombie playerZombie = EntityPlayerZombie.this; - private PlayerZombieMoveTargetPos targetPos = new PlayerZombieMoveTargetPos(); - - public AIPlayerZombieRandomFly() { - this.setMutexBits(1); - } - - // should we choose a new random destination for the playerZombie to fly to? - // yes, if the playerZombie doesn't already have a destination - @Override - public boolean shouldExecute() { - //LogHelper.info(this.playerZombie.getMoveHelper().isUpdating() ? ">>> has a move target" : ">>> no move target"); - return !this.playerZombie.getMoveHelper().isUpdating(); - } - - @Override - public boolean continueExecuting() { - return false; - } - - // choose a a new random destination for the playerZombie to fly to - @Override - public void startExecuting() { - Random rand = this.playerZombie.getRNG(); - // pick a random nearby point and see if we can fly to it - if (this.tryGoingRandomDirection(rand, 6.0D)) { - return; - } - // pick a random closer point to fly to instead - if (this.tryGoingRandomDirection(rand, 2.0D)) { - return; - } - // try going straight along axes (try all 6 directions in random order) - List directions = Arrays.asList(EnumFacing.values()); - Collections.shuffle(directions); - for (EnumFacing facing : directions) { - if (this.tryGoingAlongAxis(rand, facing, 1.0D)) { - return; - } - } - } - - - // note y direction has a slight downward bias to stop them flying too high - public boolean tryGoingRandomDirection(Random rand, double maxDistance) { - double dirX = ((rand.nextDouble() * 2.0D - 1.0D) * maxDistance); - double dirY = ((rand.nextDouble() * 2.0D - 1.1D) * maxDistance); - double dirZ = ((rand.nextDouble() * 2.0D - 1.0D) * maxDistance); - return this.tryGoing(dirX, dirY, dirZ); - } - - public boolean tryGoingAlongAxis(Random rand, EnumFacing facing, double maxDistance) { - double dirX = 0.0D; - double dirY = 0.0D; - double dirZ = 0.0D; - switch (facing.getAxis()) { - case X: - dirX = rand.nextDouble() * facing.getAxisDirection().getOffset() * maxDistance; - break; - case Y: - dirY = rand.nextDouble() * facing.getAxisDirection().getOffset() * maxDistance; - break; - case Z: - default: - dirZ = rand.nextDouble() * facing.getAxisDirection().getOffset() * maxDistance; - break; - } - return this.tryGoing(dirX, dirY, dirZ); - } - - public boolean tryGoing(double dirX, double dirY, double dirZ) { - //System.out.println("("+dirX+","+dirY+","+dirZ+")"); - this.targetPos.setTarget(this.playerZombie.posX + dirX, this.playerZombie.posY + dirY, this.playerZombie.posZ + dirZ); - //LogHelper.info(">>> Testing random move target distance:" + this.targetPos.dist + " direction:(" + this.targetPos.aimX + "," + this.targetPos.aimY + "," + this.targetPos.aimZ + ")"); - boolean result = this.targetPos.isPathClear(5.0F); - if (result) { - this.playerZombie.getMoveHelper().setMoveTo(this.targetPos.posX, this.targetPos.posY, this.targetPos.posZ, 1.0D); - } - return result; - } + private class AIPlayerZombieRandomFly extends EntityAIBase + { + private EntityPlayerZombie playerZombie = EntityPlayerZombie.this; + private PlayerZombieMoveTargetPos targetPos = new PlayerZombieMoveTargetPos(); + + AIPlayerZombieRandomFly() + { + this.setMutexBits(1); + } + + // should we choose a new random destination for the playerZombie to fly to? + // yes, if the playerZombie doesn't already have a destination + @Override + public boolean shouldExecute() + { + //LogHelper.info(this.playerZombie.getMoveHelper().isUpdating() ? ">>> has a move target" : ">>> no move target"); + return !this.playerZombie.getMoveHelper().isUpdating(); + } + + @Override + public boolean continueExecuting() + { + return false; + } + + // choose a a new random destination for the playerZombie to fly to + @Override + public void startExecuting() + { + Random rand = this.playerZombie.getRNG(); + // pick a random nearby point and see if we can fly to it + if(this.tryGoingRandomDirection(rand, 6.0D)) + { + return; + } + // pick a random closer point to fly to instead + if(this.tryGoingRandomDirection(rand, 2.0D)) + { + return; + } + // try going straight along axes (try all 6 directions in random order) + List directions = Arrays.asList(EnumFacing.values()); + Collections.shuffle(directions); + for(EnumFacing facing : directions) + { + if(this.tryGoingAlongAxis(rand, facing, 1.0D)) + { + return; + } + } + } + + // note y direction has a slight downward bias to stop them flying too high + boolean tryGoingRandomDirection(Random rand, double maxDistance) + { + double dirX = ((rand.nextDouble() * 2.0D - 1.0D) * maxDistance); + double dirY = ((rand.nextDouble() * 2.0D - 1.1D) * maxDistance); + double dirZ = ((rand.nextDouble() * 2.0D - 1.0D) * maxDistance); + return this.tryGoing(dirX, dirY, dirZ); + } + + boolean tryGoingAlongAxis(Random rand, EnumFacing facing, double maxDistance) + { + double dirX = 0.0D; + double dirY = 0.0D; + double dirZ = 0.0D; + switch(facing.getAxis()) + { + case X: + dirX = rand.nextDouble() * facing.getAxisDirection().getOffset() * maxDistance; + break; + case Y: + dirY = rand.nextDouble() * facing.getAxisDirection().getOffset() * maxDistance; + break; + case Z: + default: + dirZ = rand.nextDouble() * facing.getAxisDirection().getOffset() * maxDistance; + break; + } + return this.tryGoing(dirX, dirY, dirZ); + } + + boolean tryGoing(double dirX, double dirY, double dirZ) + { + //System.out.println("("+dirX+","+dirY+","+dirZ+")"); + this.targetPos.setTarget(this.playerZombie.posX + dirX, this.playerZombie.posY + dirY, this.playerZombie.posZ + dirZ); + //LogHelper.info(">>> Testing random move target distance:" + this.targetPos.dist + " direction:(" + this.targetPos.aimX + "," + this.targetPos.aimY + "," + this.targetPos.aimZ + ")"); + boolean result = this.targetPos.isPathClear(5.0F); + if(result) + { + this.playerZombie.getMoveHelper().setMoveTo(this.targetPos.posX, this.targetPos.posY, this.targetPos.posZ, 1.0D); + } + return result; + } } // AI class for implementing the behaviour to target and attack players - class AIPlayerZombieAttackTarget extends EntityAIBase { - private EntityPlayerZombie playerZombie = EntityPlayerZombie.this; - private int attackTick = 0; - private PlayerZombieMoveTargetPos targetPos = new PlayerZombieMoveTargetPos(); - - public AIPlayerZombieAttackTarget() { - this.setMutexBits(2); - } - - public boolean attackTargetExists() { - // see if there's actually a living attack target to aim for - EntityLivingBase attackTarget = this.playerZombie.getAttackTarget(); - return (attackTarget != null && attackTarget.isEntityAlive()); - } - - @Override - public boolean shouldExecute() { - // decrement time since last attack - if (this.attackTick > 0) { - --this.attackTick; - } - - return this.attackTargetExists(); - } - - @Override - public boolean continueExecuting() { - // decrement time since last attack - if (this.attackTick > 0) { - --this.attackTick; - } - - if (!this.attackTargetExists()) { - return false; - } - - // focus attack on target position - EntityLivingBase attackTarget = this.playerZombie.getAttackTarget(); - this.targetPos.setTarget(attackTarget.posX, attackTarget.posY, attackTarget.posZ); - - // damage the target if it's in range, and it has been long enough since the last attack - double damageRange = (double) (this.playerZombie.width + attackTarget.width); - if (this.attackTick <= 0 && this.targetPos.dist < damageRange) { - this.playerZombie.attackEntityAsMob(attackTarget); - this.attackTick = 16; // 16 ticks before next attack - } - - // see if there's a straight path to the target, if there is, aim for it - if (this.targetPos.isPathClear(5.0D)) { - //LogHelper.info(">>> Setting attack target"); - this.playerZombie.getMoveHelper().setMoveTo(attackTarget.posX, attackTarget.posY, attackTarget.posZ, 1.0D); - } - //System.out.println("dist:"+this.targetPos.dist+" damageRange:"+damageRange+" attackTick:"+attackTick); - return true; - } - } + private class AIPlayerZombieAttackTarget extends EntityAIBase + { + private EntityPlayerZombie playerZombie = EntityPlayerZombie.this; + private int attackTick = 0; + private PlayerZombieMoveTargetPos targetPos = new PlayerZombieMoveTargetPos(); + + AIPlayerZombieAttackTarget() + { + this.setMutexBits(2); + } + + boolean attackTargetExists() + { + // see if there's actually a living attack target to aim for + EntityLivingBase attackTarget = this.playerZombie.getAttackTarget(); + return (attackTarget != null && attackTarget.isEntityAlive()); + } + + @Override + public boolean shouldExecute() + { + // decrement time since last attack + if(this.attackTick > 0) + { + --this.attackTick; + } + + return this.attackTargetExists(); + } + + @Override + public boolean continueExecuting() + { + // decrement time since last attack + if(this.attackTick > 0) + { + --this.attackTick; + } + + if(!this.attackTargetExists()) + { + return false; + } + + // focus attack on target position + EntityLivingBase attackTarget = this.playerZombie.getAttackTarget(); + if(attackTarget != null) + { + this.targetPos.setTarget(attackTarget.posX, attackTarget.posY, attackTarget.posZ); + + // damage the target if it's in range, and it has been long enough since the last attack + double damageRange = (double) (this.playerZombie.width + attackTarget.width); + if(this.attackTick <= 0 && this.targetPos.dist < damageRange) + { + this.playerZombie.attackEntityAsMob(attackTarget); + this.attackTick = 16; // 16 ticks before next attack + } + + // see if there's a straight path to the target, if there is, aim for it + if(this.targetPos.isPathClear(5.0D)) + { + //LogHelper.info(">>> Setting attack target"); + this.playerZombie.getMoveHelper().setMoveTo(attackTarget.posX, attackTarget.posY, attackTarget.posZ, 1.0D); + } + } + return true; + } + } } diff --git a/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java b/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java deleted file mode 100644 index 9bdc0b4..0000000 --- a/src/main/java/com/fireball1725/graves/common/event/EventBlockBreak.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.fireball1725.graves.common.event; - -import com.fireball1725.graves.common.block.BlockGraveSlave; -import com.fireball1725.graves.common.block.BlockGraveStone; -import com.fireball1725.graves.common.structure.ReplaceableBlock; -import com.fireball1725.graves.common.tileentity.TileEntityGraveSlave; -import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; -import com.fireball1725.graves.common.util.TileTools; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.event.world.BlockEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; - -import java.util.List; - -public class EventBlockBreak { - @SubscribeEvent - public void onBreakBlock(BlockEvent.BreakEvent event) - { - if(!(event.getState().getBlock() instanceof BlockGraveStone || event.getState().getBlock() instanceof BlockGraveSlave)) - { return; } - // if (event.getWorld().isRemote) return; - - TileEntityGraveStone graveStone = null; - - if(event.getState().getBlock() instanceof BlockGraveSlave) - { - TileEntityGraveSlave slave = TileTools.getTileEntity(event.getWorld(), event.getPos(), TileEntityGraveSlave.class); - if(slave != null) - { graveStone = TileTools.getTileEntity(event.getWorld(), slave.getMasterBlock(), TileEntityGraveStone.class); } - } - else - { - graveStone = TileTools.getTileEntity(event.getWorld(), event.getPos(), TileEntityGraveStone.class); - } - - if(graveStone == null) - { return; } - - if(graveStone.getBlockState().getValue(BlockGraveStone.HASLID)) - { - graveStone.breakLid(event.getPlayer()); - event.setCanceled(true); - } - else - { - List blocks = graveStone.getReplaceableBlocks(); - EntityPlayer player = event.getPlayer(); - graveStone.replaceItems(player); - - event.getWorld().destroyBlock(graveStone.getPos().down(), false); - event.getWorld().destroyBlock(graveStone.getPos().down().offset(graveStone.getBlockState().getValue(BlockGraveStone.FACING)), false); - event.getWorld().destroyBlock(graveStone.getPos().offset(graveStone.getBlockState().getValue(BlockGraveStone.FACING)), false); - event.getWorld().destroyBlock(graveStone.getPos(), true); - - for (ReplaceableBlock block : blocks) - { - block.placeBlock(event.getWorld()); - } - - event.setCanceled(true); - } - } -} diff --git a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java b/src/main/java/com/fireball1725/graves/common/event/Events.java similarity index 56% rename from src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java rename to src/main/java/com/fireball1725/graves/common/event/Events.java index 117ad2b..699f285 100644 --- a/src/main/java/com/fireball1725/graves/common/event/EventDeathHandler.java +++ b/src/main/java/com/fireball1725/graves/common/event/Events.java @@ -1,16 +1,11 @@ package com.fireball1725.graves.common.event; import com.fireball1725.graves.Graves; -import com.fireball1725.graves.common.block.BlockGraveStone; -import com.fireball1725.graves.common.block.BlockHeadStone; +import com.fireball1725.graves.common.block.BlockGrave; import com.fireball1725.graves.common.block.Blocks; import com.fireball1725.graves.common.entity.EntityPlayerZombie; -import com.fireball1725.graves.common.entity.capabilities.GraveCapability; -import com.fireball1725.graves.common.entity.capabilities.IGraveCapability; -import com.fireball1725.graves.common.helpers.LogHelper; import com.fireball1725.graves.common.structure.ReplaceableBlock; -import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; -import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; +import com.fireball1725.graves.common.tileentity.TileEntityGrave; import com.fireball1725.graves.common.util.TileTools; import com.google.common.collect.Lists; import com.google.common.collect.Maps; @@ -20,12 +15,12 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.GameRules; import net.minecraft.world.World; import net.minecraftforge.event.entity.living.LivingDeathEvent; import net.minecraftforge.event.entity.player.PlayerDropsEvent; +import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.fml.common.event.FMLInterModComms; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -34,7 +29,8 @@ import java.util.Map; import java.util.UUID; -public class EventDeathHandler { +public class Events +{ private Map inventories = Maps.newHashMap(); /** @@ -69,14 +65,13 @@ public void onLivingDeath(LivingDeathEvent event) @SubscribeEvent(priority = EventPriority.LOW, receiveCanceled = true) public void onPlayerDrops(PlayerDropsEvent event) { - World world = event.getEntityPlayer().worldObj; if(world.isRemote) { return; } if(event.isCanceled()) { - LogHelper.warn(">>>"); + Graves.logger.warn(">>>"); return; } @@ -106,12 +101,11 @@ public void onPlayerDrops(PlayerDropsEvent event) if(event.getSource().getEntity() != null && event.getSource().getEntity() instanceof EntityPlayerZombie) { EntityPlayerZombie zombie = (EntityPlayerZombie) event.getSource().getEntity(); - BlockPos gravePos = zombie.getGraveMaster(); - TileEntityGraveStone graveStone = TileTools.getTileEntity(event.getEntityLiving().worldObj, gravePos, TileEntityGraveStone.class); + BlockPos gravePos = zombie.getGravePos(); + TileEntityGrave graveStone = TileTools.getTileEntity(event.getEntityLiving().worldObj, gravePos, TileEntityGrave.class); if (graveStone != null) { - graveStone.addGraveItems(itemsList); - graveStone.setHasLid(true); + graveStone.addItems(itemsList); spawnGrave = false; // LogHelper.info(">>> : Killed by zombie added drops to grave"); } @@ -120,63 +114,75 @@ public void onPlayerDrops(PlayerDropsEvent event) if(spawnGrave) { - EnumFacing facing = player.getHorizontalFacing(); - BlockPos playerPos = player.getPosition(); - IBlockState state = Blocks.BLOCK_GRAVESTONE.block.getDefaultState().withProperty(BlockGraveStone.FACING, facing); + BlockPos pos = player.getPosition(); + IBlockState state = Blocks.BLOCK_GRAVE.block.getDefaultState(); - if(playerPos.getY() <= 2) - { playerPos = new BlockPos(playerPos.getX(), 3, playerPos.getZ()); } + if(pos.getY() <= 2) + { pos = new BlockPos(pos.getX(), 3, pos.getZ()); } - if(playerPos.getY() >= 254) - { playerPos = new BlockPos(playerPos.getX(), 253, playerPos.getZ()); } + if(pos.getY() >= 254) + { pos = new BlockPos(pos.getX(), 253, pos.getZ()); } - List blocks = Lists.newArrayList(); - for(BlockPos pos : TileEntityGraveStone.getPositions(playerPos, facing)) + ReplaceableBlock replaceableBlock; + NBTTagCompound tag = null; + if(world.getTileEntity(pos) != null) { - NBTTagCompound tag = null; - if (world.getTileEntity(pos) != null) - { - tag = new NBTTagCompound(); - world.getTileEntity(pos).writeToNBT(tag); - } - blocks.add(new ReplaceableBlock(world.getBlockState(pos), pos, tag)); + tag = new NBTTagCompound(); + world.getTileEntity(pos).writeToNBT(tag); } + replaceableBlock = new ReplaceableBlock(world.getBlockState(pos), pos, tag); - // world.setTileEntity(playerPos, state.getBlock().createTileEntity(world, state)); - world.setBlockState(playerPos, state); + world.setBlockState(pos, state); - TileEntityGraveStone graveStoneTileEntity = TileTools.getTileEntity(world, playerPos, TileEntityGraveStone.class); + TileEntityGrave graveStoneTileEntity = TileTools.getTileEntity(world, pos, TileEntityGrave.class); if(graveStoneTileEntity.getWorld() == null) { graveStoneTileEntity.setWorldObj(world); } - graveStoneTileEntity.addGraveItemsWithReplaceables(inventories.remove(player.getPersistentID()), itemsList); - graveStoneTileEntity.setReplaceableBlocks(blocks); - graveStoneTileEntity.breakBlocks(); - graveStoneTileEntity.setPlayerProfile(player.getGameProfile()); - - // Adding Headstone - - BlockPos pos = playerPos.offset(facing.getOpposite()); + graveStoneTileEntity.addGraveItemsWithHotbar(inventories.remove(player.getPersistentID()), itemsList); + graveStoneTileEntity.setOriginalBlock(replaceableBlock); + graveStoneTileEntity.setProfile(player.getGameProfile()); - placeHeadStone(world, pos, facing, player, player.getDisplayName().getFormattedText()); - - sendTomTomPos(Graves.instance, player, playerPos, "Grave this way!"); + sendTomTomPos(Graves.instance, player, pos, "Grave this way!"); } event.getDrops().clear(); } - private void placeHeadStone(World world, BlockPos pos, EnumFacing facing, EntityPlayer player, String text) + @SubscribeEvent + public void onBreakBlock(BlockEvent.BreakEvent event) { - world.setBlockState(pos, Blocks.BLOCK_GRAVE_HEADSTONE.block.getDefaultState().withProperty(BlockHeadStone.FACING, facing)); - TileEntityHeadStone tileEntityHeadStone = TileTools.getTileEntity(world, pos, TileEntityHeadStone.class); - if(tileEntityHeadStone != null) + World world = event.getWorld(); + if(!(event.getState().getBlock() instanceof BlockGrave)) + { return; } + + TileEntityGrave grave = (TileEntityGrave) world.getTileEntity(event.getPos()); + + if(grave == null) + { return; } + + if(!grave.isGhostDefeated() && !event.getPlayer().isCreative()) { - tileEntityHeadStone.setCustomName(text); - IGraveCapability grave = player.getCapability(GraveCapability.GRAVE_CAPABILITY, null); - if(grave != null) - { - tileEntityHeadStone.setDisplayStack(grave.getGraveItemStack()); - } + grave.summonGhost(event.getPlayer()); + event.setCanceled(true); + return; + } + + grave.replaceItems(event.getPlayer()); + + if(!event.getPlayer().isCreative()) + { + grave.dropItems(event.getPlayer()); + if(Blocks.BLOCK_GRAVE.block.canHarvestBlock(world, event.getPos(), event.getPlayer())) + { world.spawnEntityInWorld(new EntityItem(world, event.getPos().getX(), event.getPos().getY(), event.getPos().getZ(), new ItemStack(Blocks.BLOCK_GRAVE.block))); } } + ReplaceableBlock block = null; + if(grave.getOriginalBlock() != null) + { block = grave.getOriginalBlock().copy(); } + + world.setBlockToAir(event.getPos()); + world.removeTileEntity(event.getPos()); + + if(block != null) + { block.placeBlock(world); } + event.setCanceled(true); } } diff --git a/src/main/java/com/fireball1725/graves/common/helpers/BreakableWhiteListHelper.java b/src/main/java/com/fireball1725/graves/common/helpers/BreakableWhiteListHelper.java deleted file mode 100644 index 1cd3bc1..0000000 --- a/src/main/java/com/fireball1725/graves/common/helpers/BreakableWhiteListHelper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.fireball1725.graves.common.helpers; - -import net.minecraft.block.state.IBlockState; - -import java.util.ArrayList; -import java.util.List; - -public class BreakableWhiteListHelper { - private static List blocksWhiteList = new ArrayList(); - - public static void addBlock(IBlockState blockState) { - blocksWhiteList.add(blockState); - } - - public static boolean checkBlock(IBlockState blockState) { - return blocksWhiteList.contains(blockState); - } -} diff --git a/src/main/java/com/fireball1725/graves/common/helpers/ItemHelper.java b/src/main/java/com/fireball1725/graves/common/helpers/ItemHelper.java index e54364f..5e7cbf8 100644 --- a/src/main/java/com/fireball1725/graves/common/helpers/ItemHelper.java +++ b/src/main/java/com/fireball1725/graves/common/helpers/ItemHelper.java @@ -1,32 +1,18 @@ package com.fireball1725.graves.common.helpers; import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; public class ItemHelper { - public static boolean doesItemHaveEnchant(ItemStack stack, String enchant) + public static boolean doesItemHaveEnchant(String enchantment, ItemStack stack) { - if(stack != null && stack.getTagCompound() != null && stack.getTagCompound().hasKey("ench")) - { - NBTTagList tagList = stack.getTagCompound().getTagList("ench", 10); - for(int i = 0; i < tagList.tagCount(); i++) - { - NBTTagCompound tag = tagList.getCompoundTagAt(i); - if(tag.getString("id").equals(enchant)) - { - return true; - } - } - } - - return false; + return doesItemHaveEnchant(Enchantment.getEnchantmentByLocation(enchantment), stack); } - public static boolean doesItemHaveEnchant(ItemStack stack, Enchantment enchantment) + public static boolean doesItemHaveEnchant(Enchantment enchantment, ItemStack stack) { - return doesItemHaveEnchant(stack, enchantment.getName()); + return EnchantmentHelper.getEnchantmentLevel(enchantment, stack) > 0; } } diff --git a/src/main/java/com/fireball1725/graves/common/helpers/LogHelper.java b/src/main/java/com/fireball1725/graves/common/helpers/LogHelper.java deleted file mode 100644 index 1bad3fe..0000000 --- a/src/main/java/com/fireball1725/graves/common/helpers/LogHelper.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.fireball1725.graves.common.helpers; - -import com.fireball1725.graves.common.reference.ModInfo; -import net.minecraftforge.fml.common.FMLLog; -import org.apache.logging.log4j.Level; - -public class LogHelper { - public static void log(Level logLevel, Object object) { - FMLLog.log(ModInfo.MOD_NAME, logLevel, String.valueOf(object)); - } - - public static void all(Object object) { - log(Level.ALL, object); - } - - public static void debug(Object object) { - log(Level.DEBUG, object); - } - - public static void trace(Object object) { - log(Level.TRACE, object); - } - - public static void fatal(Object object) { - log(Level.FATAL, object); - } - - public static void error(Object object) { - log(Level.ERROR, object); - } - - public static void warn(Object object) { - log(Level.WARN, object); - } - - public static void info(Object object) { - log(Level.INFO, object); - } - - public static void off(Object object) { - log(Level.OFF, object); - } -} diff --git a/src/main/java/com/fireball1725/graves/common/helpers/OpenGLHelper.java b/src/main/java/com/fireball1725/graves/common/helpers/OpenGLHelper.java deleted file mode 100644 index 2d78313..0000000 --- a/src/main/java/com/fireball1725/graves/common/helpers/OpenGLHelper.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.fireball1725.graves.common.helpers; - -import org.lwjgl.opengl.GL11; - -public class OpenGLHelper { - public static int[][] saveGLState(int[] bitsToSave) { - if (bitsToSave == null) { - return null; - } - - int[][] savedGLState = new int[bitsToSave.length][2]; - int count = 0; - - for (int glBit : bitsToSave) { - savedGLState[count][0] = glBit; - savedGLState[count++][1] = GL11.glIsEnabled(glBit) ? 1 : 0; - } - - return savedGLState; - } - - public static int[][] modifyGLState(int[] bitsToDisable, int[] bitsToEnable) { - return modifyGLState(bitsToDisable, bitsToEnable, null); - } - - public static int[][] modifyGLState(int[] bitsToDisable, int[] bitsToEnable, int[] bitsToSave) { - if (bitsToDisable == null && bitsToEnable == null && bitsToSave == null) { - return null; - } - - int[][] savedGLState = new int[(bitsToDisable != null ? bitsToDisable.length : 0) + (bitsToEnable != null ? bitsToEnable.length : 0) + (bitsToSave != null ? bitsToSave.length : 0)][2]; - int count = 0; - - if (bitsToDisable != null) { - for (int glBit : bitsToDisable) { - savedGLState[count][0] = glBit; - savedGLState[count++][1] = GL11.glIsEnabled(glBit) ? 1 : 0; - GL11.glDisable(glBit); - } - } - - if (bitsToEnable != null) { - for (int glBit : bitsToEnable) { - savedGLState[count][0] = glBit; - savedGLState[count++][1] = GL11.glIsEnabled(glBit) ? 1 : 0; - GL11.glEnable(glBit); - } - } - - if (bitsToSave != null) { - for (int glBit : bitsToSave) { - savedGLState[count][0] = glBit; - savedGLState[count++][1] = GL11.glIsEnabled(glBit) ? 1 : 0; - } - } - - return savedGLState; - } - - public static void restoreGLState(int[][] savedGLState) { - if (savedGLState == null) { - return; - } - - for (int[] glBit : savedGLState) { - if (glBit[1] == 1) - GL11.glEnable(glBit[0]); - else - GL11.glDisable(glBit[0]); - } - } -} diff --git a/src/main/java/com/fireball1725/graves/common/helpers/SafeBlockReplacer.java b/src/main/java/com/fireball1725/graves/common/helpers/SafeBlockReplacer.java deleted file mode 100644 index 2ba4ce6..0000000 --- a/src/main/java/com/fireball1725/graves/common/helpers/SafeBlockReplacer.java +++ /dev/null @@ -1,183 +0,0 @@ -package com.fireball1725.graves.common.helpers; - -import net.minecraft.block.BlockAir; -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -public class SafeBlockReplacer { - - - private static boolean CheckBlock(World world, BlockPos blockPos, boolean forceAir) { - IBlockState blockState = world.getBlockState(blockPos); - - if (blockState == null) - return true; - - // Check to make sure it is an air block, or replaceable... - if ((blockState.getBlock() instanceof BlockAir && forceAir) || (blockState.getBlock().isReplaceable(world, blockPos) && forceAir) ) - return true; - else if (forceAir) - return false; - - // Check to make sure it is not an Tile Entity - if (blockState.getBlock().hasTileEntity(blockState)) - return false; - - // Make sure the block isn't unbreakable - if(blockState.getBlock().getBlockHardness(world.getBlockState(blockPos), world, blockPos) == -1.0F) - { return false; } - - // Make sure the block is on the whitelist - return BreakableWhiteListHelper.checkBlock(blockState); - - } - - private static boolean CheckGraveSite(World world, BlockPos blockPos, EnumFacing facing) { - BlockPos Headstone = blockPos.offset(facing, -1); - BlockPos MasterGraveTile = blockPos; - BlockPos SlaveGraveTile1 = blockPos.offset(facing); - BlockPos SlaveGraveTile2 = blockPos.down(); - BlockPos SlaveGraveTile3 = blockPos.down().offset(facing); - - boolean placeGrave = true; - - if (!CheckBlock(world, Headstone, true)) - placeGrave = false; - - if (!CheckBlock(world, MasterGraveTile, true)) - placeGrave = false; - - if (!CheckBlock(world, SlaveGraveTile1, true)) - placeGrave = false; - - if (!CheckBlock(world, SlaveGraveTile2, false)) - placeGrave = false; - - if (!CheckBlock(world, SlaveGraveTile3, false)) - placeGrave = false; - - return placeGrave; - } - - // This is whats called. - public static BlockPos GetSafeGraveSite(World world, BlockPos blockPos, EnumFacing facing) { - BlockPos finalBlockPos = CheckSafeGraveSite(world, blockPos, facing); - - if (finalBlockPos == null) { - LogHelper.info("[Graves] Unable to find place to put grave..."); - LogHelper.info("[Graves] Trying to place the grave on the surface..."); - - finalBlockPos = world.getTopSolidOrLiquidBlock(blockPos); - finalBlockPos = CheckSafeGraveSite(world, finalBlockPos, facing); - } - - // Check 5 Blocks - if (finalBlockPos == null) { - LogHelper.info("[Graves] Placing on the surface failed (Maybe fell down a 1x1 hole?"); - LogHelper.info("[Graves] Trying to place the grave on the surface 5 blocks north"); - - finalBlockPos = world.getTopSolidOrLiquidBlock(blockPos.north(5)); - finalBlockPos = CheckSafeGraveSite(world, finalBlockPos, facing); - } - - if (finalBlockPos == null) { - LogHelper.info("[Graves] Placing on the surface failed (Maybe fell down a 1x1 hole?"); - LogHelper.info("[Graves] Trying to place the grave on the surface 5 blocks east"); - - finalBlockPos = world.getTopSolidOrLiquidBlock(blockPos.east(5)); - finalBlockPos = CheckSafeGraveSite(world, finalBlockPos, facing); - } - - if (finalBlockPos == null) { - LogHelper.info("[Graves] Placing on the surface failed (Maybe fell down a 1x1 hole?"); - LogHelper.info("[Graves] Trying to place the grave on the surface 5 blocks south"); - - finalBlockPos = world.getTopSolidOrLiquidBlock(blockPos.south(5)); - finalBlockPos = CheckSafeGraveSite(world, finalBlockPos, facing); - } - - if (finalBlockPos == null) { - LogHelper.info("[Graves] Placing on the surface failed (Maybe fell down a 1x1 hole?"); - LogHelper.info("[Graves] Trying to place the grave on the surface 5 blocks west"); - - finalBlockPos = world.getTopSolidOrLiquidBlock(blockPos.west(5)); - finalBlockPos = CheckSafeGraveSite(world, finalBlockPos, facing); - } - - // Last ditch effort... just place it - if (finalBlockPos == null) { - LogHelper.info("[Graves] Sorry, still can't find a good place..."); - - // Make sure Y is ok - int y = blockPos.getY(); - - if (y < 1 ) { - y = 3; - } - else if(y > 255) - { - y = 253; - } - - blockPos = new BlockPos(blockPos.getX(), y, blockPos.getZ()); - - finalBlockPos = blockPos; - } - - return finalBlockPos; - } - - public static BlockPos CheckSafeGraveSite(World world, BlockPos blockPos, EnumFacing facing) { - int x = blockPos.getX(); - int y = blockPos.getY(); - int z = blockPos.getZ(); - - if (y < 11) { - y = 11; - } - - if (y > 245) { - y = 245; - } - - int blockX = x; - int blockY = y; - int blockZ = z; - for (int searchY = 0; searchY < 17; searchY++) { - if (searchY != 0 && searchY % 2 == 0) { - blockY = y - searchY / 2; - } else if (searchY != 0) { - blockY = y + Math.round(searchY / 2) + 1; - } else { - blockY = y; - } - - for (int searchX = 0; searchX < 17; searchX++) { - if (searchX != 0 && searchX % 2 == 0) { - blockX = x - searchX / 2; - } else if (searchX != 0) { - blockX = x + Math.round(searchX / 2) + 1; - } else { - blockX = x; - } - - for (int searchZ = 0; searchZ < 17; searchZ++) { - if (searchZ != 0 && searchZ % 2 == 0) { - blockZ = z - searchZ / 2; - } else if (searchZ != 0) { - blockZ = z + Math.round(searchZ / 2) + 1; - } else { - blockZ = z; - } - - if (CheckGraveSite(world, new BlockPos(blockX, blockY, blockZ), facing)) - return new BlockPos(blockX, blockY, blockZ); - } - } - } - - return null; - } -} diff --git a/src/main/java/com/fireball1725/graves/common/item/ItemHeadStone.java b/src/main/java/com/fireball1725/graves/common/item/ItemHeadStone.java deleted file mode 100644 index 2b17c62..0000000 --- a/src/main/java/com/fireball1725/graves/common/item/ItemHeadStone.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.fireball1725.graves.common.item; - -import com.mojang.realmsclient.gui.ChatFormatting; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; - -import java.util.List; - -public class ItemHeadStone extends ItemBlock { - public ItemHeadStone(Block block) { - super(block); - } - - @Override - public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced) { - if (!stack.hasDisplayName()) { - tooltip.add(ChatFormatting.GREEN + "Rename in anvil to name Head Stone"); - } - } -} diff --git a/src/main/java/com/fireball1725/graves/common/network/messages/MessageSetHeadstoneName.java b/src/main/java/com/fireball1725/graves/common/network/messages/MessageSetHeadstoneName.java index 425f142..0942f6a 100644 --- a/src/main/java/com/fireball1725/graves/common/network/messages/MessageSetHeadstoneName.java +++ b/src/main/java/com/fireball1725/graves/common/network/messages/MessageSetHeadstoneName.java @@ -1,6 +1,6 @@ package com.fireball1725.graves.common.network.messages; -import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; +import com.fireball1725.graves.common.tileentity.TileEntityGrave; import com.fireball1725.graves.common.util.TileTools; import io.netty.buffer.ByteBuf; import net.minecraft.util.math.BlockPos; @@ -36,8 +36,8 @@ public void toBytes(ByteBuf buf) { public static class HANDLER implements IMessageHandler { @Override public IMessage onMessage(MessageSetHeadstoneName message, MessageContext ctx) { - TileEntityHeadStone headStone = TileTools.getTileEntity(ctx.getServerHandler().playerEntity.worldObj, message.pos, TileEntityHeadStone.class); - if (headStone != null) { + TileEntityGrave headStone = TileTools.getTileEntity(ctx.getServerHandler().playerEntity.worldObj, message.pos, TileEntityGrave.class); + if (headStone != null) { headStone.setCustomName(message.playerName); headStone.markForUpdate(); } diff --git a/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java b/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java index 93717ca..016b83a 100644 --- a/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java +++ b/src/main/java/com/fireball1725/graves/common/structure/ReplaceableBlock.java @@ -47,7 +47,7 @@ public boolean placeBlock(World world) Block block = state.getBlock(); if (block instanceof ITileEntityProvider && tagCompound != null) { - world.setTileEntity(pos, TileEntity.func_190200_a(null, tagCompound)); + world.setTileEntity(pos, TileEntity.func_190200_a(world, tagCompound)); } return true; } @@ -67,4 +67,14 @@ public NBTTagCompound writeNBT() } return tag; } + + public ReplaceableBlock copy() + { + return new ReplaceableBlock(state, pos, tagCompound); + } + + public BlockPos getPos() + { + return pos; + } } diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityBase.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityBase.java index b862e46..668ba6e 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityBase.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityBase.java @@ -18,9 +18,9 @@ import java.util.HashMap; public class TileEntityBase extends TileEntity { - public static final HashMap myItem = new HashMap(); - public String customName; - public int renderedFragment = 0; + private static final HashMap myItem = new HashMap(); + private String customName; + private int renderedFragment = 0; public static void registerTileItem(Class c, ItemStackSrc wat) { myItem.put(c, wat); diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGrave.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGrave.java new file mode 100644 index 0000000..b011fc2 --- /dev/null +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGrave.java @@ -0,0 +1,382 @@ +package com.fireball1725.graves.common.tileentity; + +import com.fireball1725.graves.common.configuration.ConfigZombie; +import com.fireball1725.graves.common.entity.EntityPlayerZombie; +import com.fireball1725.graves.common.helpers.ItemHelper; +import com.fireball1725.graves.common.structure.ReplaceableBlock; +import com.google.common.collect.Lists; +import com.mojang.authlib.GameProfile; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.play.server.SPacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntitySkull; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.EnumDifficulty; + +import java.util.List; +import java.util.ListIterator; + +public class TileEntityGrave extends TileEntityBase +{ + private ItemStack displayStack = null; + private List items; + private ItemStack[] hotbar = new ItemStack[InventoryPlayer.getHotbarSize()]; + private GameProfile profile; + private ReplaceableBlock originalBlock; + private boolean ghostDefeated; + + public TileEntityGrave() + { + super(); + } + + public ItemStack getDisplayStack() + { + return displayStack; + } + + public void setDisplayStack(ItemStack displayStack) + { + this.displayStack = displayStack; + } + + public GameProfile getProfile() + { + return profile; + } + + public void setProfile(GameProfile profile) + { + this.profile = TileEntitySkull.updateGameprofile(profile); + } + + public void replaceItems(EntityPlayer player) + { + InventoryPlayer inventory = player.inventory; + List remaining = Lists.newArrayList(); + for(int i = 0; i < inventory.mainInventory.length; i++) + { + if(i >= hotbar.length) + { break; } + ItemStack currentItem = inventory.mainInventory[i]; + ItemStack replaceItem = hotbar[i]; + if(InventoryPlayer.isHotbar(i) && currentItem == null && replaceItem != null) + { + inventory.mainInventory[i] = replaceItem; + } + else + { + remaining.add(replaceItem); + } + } + for(ItemStack remainingStack : remaining) + { + if(!inventory.addItemStackToInventory(remainingStack) && remainingStack != null && remainingStack.stackSize >= 1) + { + EntityItem entityItem = new EntityItem(worldObj, player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ(), remainingStack); + entityItem.motionX = 0; + entityItem.motionY = 0; + entityItem.motionZ = 0; + worldObj.spawnEntityInWorld(entityItem); + } + } + inventory.markDirty(); + } + + public void summonGhost(EntityPlayer player) + { + boolean spawnPlayerZombie = false; + + int spawnChance = 40; + + boolean hardcoreEnabled = worldObj.getWorldInfo().isHardcoreModeEnabled(); + EnumDifficulty gameDifficulty = worldObj.getDifficulty(); + + switch(gameDifficulty) + { + case EASY: + spawnChance = ConfigZombie.configZombieSpawnChanceEasy; + break; + + case NORMAL: + spawnChance = ConfigZombie.configZombieSpawnChanceNormal; + break; + + case HARD: + spawnChance = ConfigZombie.configZombieSpawnChanceHard; + break; + } + + if(hardcoreEnabled) + { + spawnChance = ConfigZombie.configZombieSpawnChanceHardCore; + } + + if(spawnChance > 0) + { + int rng = worldObj.rand.nextInt(100); + + if(rng <= spawnChance) + { spawnPlayerZombie = true; } + } + + if(spawnPlayerZombie && ConfigZombie.configZombieEnabled) + { + EntityPlayerZombie playerZombie = new EntityPlayerZombie(worldObj, pos); + + playerZombie.setProfile(profile); + + playerZombie.setLocationAndAngles(pos.getX(), pos.down().getY(), pos.getZ(), player.getHorizontalFacing().getOpposite().getHorizontalIndex() * 90f, 0f); + playerZombie.onInitialSpawn(worldObj.getDifficultyForLocation(new BlockPos(playerZombie)), null); + playerZombie.setPlayer(player); + worldObj.spawnEntityInWorld(playerZombie); + } + else + { + setGhostDefeated(true); + } + + } + + public boolean isGhostDefeated() + { + return ghostDefeated; + } + + public void setGhostDefeated(boolean ghostDefeated) + { + this.ghostDefeated = ghostDefeated; + } + + public ReplaceableBlock getOriginalBlock() + { + return originalBlock; + } + + public void setOriginalBlock(ReplaceableBlock originalBlock) + { + this.originalBlock = originalBlock; + } + + public void addGraveItemsWithHotbar(InventoryPlayer inventory, List items) + { + System.arraycopy(inventory.mainInventory, 0, hotbar, 0, InventoryPlayer.getHotbarSize()); + + rItems: + for(ItemStack stack : hotbar) + { + ListIterator iterator = items.listIterator(); + ItemStack stack1; + while(iterator.hasNext()) + { + stack1 = iterator.next(); + + if(ItemHelper.doesItemHaveEnchant("enderio:soulBound", stack1)) + { + iterator.remove(); + continue; + } + + if(areItemEqual(stack, stack1)) + { + iterator.remove(); + continue rItems; + } + } + } + for(int i = 0; i < hotbar.length; i++) + { + ItemStack stack = hotbar[i]; + if(ItemHelper.doesItemHaveEnchant("enderio:soulBound", stack)) + { + hotbar[i] = null; + } + } + addItems(items); + } + + private boolean areItemEqual(ItemStack stack, ItemStack stack1) + { + boolean flag = ItemStack.areItemsEqual(stack, stack1); + if(stack != null && stack1 != null) + { + if((stack.hasTagCompound() && !stack1.hasTagCompound()) || (!stack.hasTagCompound() && stack1.hasTagCompound())) + { + return false; + } + if(stack.hasTagCompound() && stack1.hasTagCompound()) + { + return flag && stack.getTagCompound().equals(stack1.getTagCompound()); + } + } + return flag; + } + + public void addItems(List items) + { + this.items = Lists.newArrayList(); + this.items.addAll(items); + } + + public void dropItems(EntityPlayer player) + { + if(items == null || items.isEmpty()) + { return; } + for(ItemStack stack : items) + { + if(!player.inventory.addItemStackToInventory(stack)) + { + EntityItem entityItem = new EntityItem(worldObj, player.posX, player.posY, player.posZ, stack); + entityItem.motionX = 0; + entityItem.motionY = 0; + entityItem.motionZ = 0; + worldObj.spawnEntityInWorld(entityItem); + } + } + } + + @Override + public SPacketUpdateTileEntity getUpdatePacket() + { + return new SPacketUpdateTileEntity(getPos(), getBlockMetadata(), serializeNBT()); + } + + @Override + public void onDataPacket(NetworkManager networkManager, SPacketUpdateTileEntity sPacketUpdateTileEntity) + { + deserializeNBT(sPacketUpdateTileEntity.getNbtCompound()); + } + + @Override + public NBTTagCompound writeToNBT(NBTTagCompound nbtTagCompound) + { + super.writeToNBT(nbtTagCompound); + //Save Display Stack + if(displayStack != null) + { nbtTagCompound.setTag("displayStack", displayStack.serializeNBT()); } + nbtTagCompound.setBoolean("isGhostDefeated", isGhostDefeated()); + //Save Profile + if(profile != null) + { + NBTTagCompound profileTag = new NBTTagCompound(); + NBTUtil.writeGameProfile(profileTag, profile); + nbtTagCompound.setTag("profileTag", profileTag); + } + //Save Items + if(items != null && !items.isEmpty()) + { + NBTTagCompound itemsTag = new NBTTagCompound(); + itemsTag.setInteger("itemCount", items.size()); + for(int i = 0; i < items.size(); i++) + { + if(items.get(i) != null) + { itemsTag.setTag(String.valueOf(i), items.get(i).serializeNBT()); } + } + nbtTagCompound.setTag("itemsTag", itemsTag); + } + //Save Hotbar + if(hotbar.length > 1) + { + NBTTagCompound hotbarTag = new NBTTagCompound(); + hotbarTag.setInteger("itemCount", hotbar.length); + for(int i = 0; i < hotbar.length; i++) + if(hotbar[i] != null) + { hotbarTag.setTag(String.valueOf(i), hotbar[i].serializeNBT()); } + nbtTagCompound.setTag("hotbarTag", hotbarTag); + } + return nbtTagCompound; + } + + @Override + public void readFromNBT(NBTTagCompound nbtTagCompound) + { + super.readFromNBT(nbtTagCompound); + displayStack = null; + if(nbtTagCompound.hasKey("displayStack")) + { displayStack = ItemStack.loadItemStackFromNBT(nbtTagCompound.getCompoundTag("displayStack")); } + if(nbtTagCompound.hasKey("isGhostDefeated")) + { ghostDefeated = nbtTagCompound.getBoolean("isGhostDefeated"); } + if(nbtTagCompound.hasKey("profileTag")) + { setProfile(NBTUtil.readGameProfileFromNBT(nbtTagCompound.getCompoundTag("profileTag"))); } + if(nbtTagCompound.hasKey("itemsTag")) + { + items = Lists.newArrayList(); + NBTTagCompound itemsTag = nbtTagCompound.getCompoundTag("itemsTag"); + for(int i = 0; i < itemsTag.getInteger("itemCount"); i++) + { + items.add(ItemStack.loadItemStackFromNBT(itemsTag.getCompoundTag(String.valueOf(i)))); + } + } + if(nbtTagCompound.hasKey("hotbarTag")) + { + NBTTagCompound hotbarTag = nbtTagCompound.getCompoundTag("hotbarTag"); + hotbar = new ItemStack[hotbarTag.getInteger("itemCount")]; + for(int i = 0; i < hotbar.length; i++) + { + if(hotbarTag.hasKey(String.valueOf(i))) + { + hotbar[i] = ItemStack.loadItemStackFromNBT(hotbarTag.getCompoundTag(String.valueOf(i))); + } + } + } + + { //Legacy Support + if(nbtTagCompound.hasKey("hasLid")) + { ghostDefeated = nbtTagCompound.getBoolean("hasLid"); } + if(nbtTagCompound.hasKey("playerProfile")) + { profile = NBTUtil.readGameProfileFromNBT(nbtTagCompound.getCompoundTag("playerProfile")); } + if(nbtTagCompound.hasKey("replaceableBlocks")) + { + NBTTagCompound replaceableTag = nbtTagCompound.getCompoundTag("replaceableBlocks"); + int size = replaceableTag.getInteger("size"); + for(int i = 0; i < size; i++) + { + ReplaceableBlock block = ReplaceableBlock.readNBT((NBTTagCompound) replaceableTag.getTag("block:" + i)); + if(block != null) + { + if(block.getPos().equals(getPos())) + { + originalBlock = block; + } + else + { + worldObj.setBlockToAir(block.getPos()); + block.placeBlock(worldObj); + } + } + } + } + if(nbtTagCompound.hasKey("replaceableItems")) + { + ItemStack[] replaceableItems; + NBTTagCompound tag = nbtTagCompound.getCompoundTag("replaceableItems"); + replaceableItems = new ItemStack[tag.getInteger("size")]; + for(int i = 0; i < replaceableItems.length; i++) + { + if(tag.hasKey("item:" + i)) + { + replaceableItems[i] = ItemStack.loadItemStackFromNBT(tag.getCompoundTag("item:" + i)); + } + } + } + int invSize = 0; + if(nbtTagCompound.hasKey("inventorySize")) + { invSize = nbtTagCompound.getInteger("inventorySize"); } + if(nbtTagCompound.hasKey("Items")) + { + items = Lists.newArrayList(); + NBTTagCompound tagCompound = nbtTagCompound.getCompoundTag("Items"); + for(int i = 0; i < invSize; i++) + { + NBTTagCompound item = tagCompound.getCompoundTag("item" + i); + items.add(ItemStack.loadItemStackFromNBT(item)); + } + } + } // End of Legacy Support + } +} diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveSlave.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveSlave.java deleted file mode 100644 index 4fa2935..0000000 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveSlave.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.fireball1725.graves.common.tileentity; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.math.BlockPos; - -public class TileEntityGraveSlave extends TileEntityBase { - protected BlockPos masterBlock; - - public TileEntityGraveSlave() { - super(); - } - - public BlockPos getMasterBlock() { - return masterBlock; - } - - public void setMasterBlock(BlockPos masterBlock) { - this.masterBlock = masterBlock; - } - - @Override - public void readFromNBT(NBTTagCompound compound) { - super.readFromNBT(compound); - if (compound.hasKey("masterBlock")) { - masterBlock = BlockPos.fromLong(compound.getLong("masterBlock")); - } - } - - @Override - public NBTTagCompound writeToNBT(NBTTagCompound compound) - { - if (masterBlock != null) { - compound.setLong("masterBlock", masterBlock.toLong()); - } - return super.writeToNBT(compound); - } -} diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java deleted file mode 100644 index 3385f4f..0000000 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java +++ /dev/null @@ -1,432 +0,0 @@ -package com.fireball1725.graves.common.tileentity; - -import com.fireball1725.graves.common.block.BlockGraveSlave; -import com.fireball1725.graves.common.block.BlockGraveStone; -import com.fireball1725.graves.common.block.Blocks; -import com.fireball1725.graves.common.configuration.ConfigZombie; -import com.fireball1725.graves.common.entity.EntityPlayerZombie; -import com.fireball1725.graves.common.helpers.ItemHelper; -import com.fireball1725.graves.common.helpers.LogHelper; -import com.fireball1725.graves.common.structure.ReplaceableBlock; -import com.fireball1725.graves.common.tileentity.inventory.InternalDynamicInventory; -import com.fireball1725.graves.common.tileentity.inventory.InventoryOperation; -import com.fireball1725.graves.common.util.TileTools; -import com.google.common.collect.Lists; -import com.mojang.authlib.GameProfile; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTUtil; -import net.minecraft.network.play.server.SPacketUpdateTileEntity; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.text.ITextComponent; -import net.minecraft.world.EnumDifficulty; - -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; -import java.util.Random; - -public class TileEntityGraveStone extends TileEntityInventoryBase -{ - private boolean hasLid = true; - private InternalDynamicInventory internalInventory = new InternalDynamicInventory(this); - private GameProfile playerProfile; - private List replaceableBlocks = Lists.newArrayList(); - private ItemStack[] replaceableItems = new ItemStack[14]; - - private static List getSlaves(BlockPos pos, EnumFacing facing) - { - List poses = Lists.newArrayList(); - poses.add(pos.down()); - poses.add(pos.down().offset(facing)); - poses.add(pos.offset(facing)); - return poses; - } - - public static List getPositions(BlockPos pos, EnumFacing facing) - { - List poses = getSlaves(pos, facing); - poses.add(pos); - poses.add(pos.offset(facing.getOpposite())); - return poses; - } - - @Nullable - @Override - public SPacketUpdateTileEntity getUpdatePacket() - { - LogHelper.info(String.format("Gravestone (%s) at W=%s X=%s Y=%s Z=%s", this.playerProfile == null ? "null" : this.playerProfile.getName(), this.worldObj.getWorldInfo().getWorldName(), this.pos.getX(), this.pos.getY(), this.pos.getZ())); - - return super.getUpdatePacket(); - } - - public void addGraveItems(List itemsList) - { - for(ItemStack stack : itemsList) - { - internalInventory.addInventorySlotContents(stack); - } - } - - public void addGraveItemsWithReplaceables(InventoryPlayer inventory, List itemsList) - { - System.arraycopy(inventory.mainInventory, 0, replaceableItems, 0, InventoryPlayer.getHotbarSize()); - - rItems: - for(ItemStack stack : replaceableItems) - { - ListIterator iterator = itemsList.listIterator(); - ItemStack stack1; - while(iterator.hasNext()) - { - stack1 = iterator.next(); - - if(ItemHelper.doesItemHaveEnchant(stack1, "soulBound")) - { - iterator.remove(); - continue; - } - - if(areItemEqual(stack, stack1)) - { - iterator.remove(); - continue rItems; - } - } - } - for(int i = 0; i < replaceableItems.length; i++) - { - ItemStack stack = replaceableItems[i]; - if(ItemHelper.doesItemHaveEnchant(stack, "soulBound")) - { - replaceableItems[i] = null; - } - } - addGraveItems(itemsList); - } - - private boolean areItemEqual(ItemStack stack, ItemStack stack1) - { - boolean flag = ItemStack.areItemsEqual(stack, stack1); - if(stack != null && stack1 != null) - { - if((stack.hasTagCompound() && !stack1.hasTagCompound()) || (!stack.hasTagCompound() && stack1.hasTagCompound())) - { - return false; - } - if(stack.hasTagCompound() && stack1.hasTagCompound()) - { - return flag && stack.getTagCompound().equals(stack1.getTagCompound()); - } - } - return flag; - } - - public boolean getHasLid() - { - return hasLid; - } - - public void setHasLid(boolean hasLid) - { - this.hasLid = hasLid; - worldObj.notifyBlockUpdate(pos, getBlockState(), getBlockState().withProperty(BlockGraveStone.HASLID, false), 3); - } - - private GameProfile getPlayerProfile() - { - return playerProfile; - } - - public void setPlayerProfile(GameProfile playerProfile) - { - this.playerProfile = playerProfile; - } - - @Override - public void readFromNBT(NBTTagCompound nbtTagCompound) - { - super.readFromNBT(nbtTagCompound); - - this.hasLid = nbtTagCompound.getBoolean("hasLid"); - this.playerProfile = NBTUtil.readGameProfileFromNBT(nbtTagCompound.getCompoundTag("playerProfile")); - - NBTTagCompound replaceableTag = nbtTagCompound.getCompoundTag("replaceableBlocks"); - int size = replaceableTag.getInteger("size"); - replaceableBlocks = Lists.newArrayList(); - for (int i = 0; i < size; i++) - { - replaceableBlocks.add(ReplaceableBlock.readNBT((NBTTagCompound) replaceableTag.getTag("block:" + i))); - } - NBTTagCompound tag = nbtTagCompound.getCompoundTag("replaceableItems"); - replaceableItems = new ItemStack[tag.getInteger("size")]; - for(int i = 0; i < replaceableItems.length; i++) - { - if(tag.hasKey("item:" + i)) - { - replaceableItems[i] = ItemStack.loadItemStackFromNBT(tag.getCompoundTag("item:" + i)); - } - } - } - - @Override - public NBTTagCompound writeToNBT(NBTTagCompound nbtTagCompound) - { - - nbtTagCompound.setBoolean("hasLid", this.hasLid); - - if(playerProfile != null) - { - NBTTagCompound profileTag = new NBTTagCompound(); - NBTUtil.writeGameProfile(profileTag, playerProfile); - nbtTagCompound.setTag("playerProfile", profileTag); - } - - NBTTagCompound replaceableBlocksTag = new NBTTagCompound(); - replaceableBlocksTag.setInteger("size", replaceableBlocks.size()); - for (int i = 0; i < replaceableBlocks.size(); i++) - { - replaceableBlocksTag.setTag("block:" + i, replaceableBlocks.get(i).writeNBT()); - } - nbtTagCompound.setTag("replaceableBlocks", replaceableBlocksTag); - NBTTagCompound replaceableItemsTag = new NBTTagCompound(); - replaceableItemsTag.setInteger("size", replaceableItems.length); - for(int i = 0; i < replaceableItems.length; i++) - { - if(replaceableItems[i] != null) - { replaceableItemsTag.setTag("item:" + i, replaceableItems[i].writeToNBT(new NBTTagCompound())); } - } - nbtTagCompound.setTag("replaceableItems", replaceableItemsTag); - return super.writeToNBT(nbtTagCompound); - } - - public void breakBlocks() - { - // Adding slaves - IBlockState defSlaveState = Blocks.BLOCK_GRAVESTONE_SLAVE.block.getDefaultState(); - IBlockState state = worldObj.getBlockState(pos); - EnumFacing facing = state.getBlock().getActualState(state, worldObj, pos).getValue(BlockGraveStone.FACING); - TileEntityGraveSlave tileEntityGraveSlave; - - for(BlockPos slavePos : getSlaves(pos, facing)) - { - worldObj.removeTileEntity(slavePos); - worldObj.setBlockState(slavePos, BlockGraveSlave.getActualStatePre(defSlaveState, worldObj, slavePos, pos)); - - tileEntityGraveSlave = TileTools.getTileEntity(worldObj, slavePos, TileEntityGraveSlave.class); - tileEntityGraveSlave.setMasterBlock(pos); - } - // End of adding slaves - - } - - @Override - public IInventory getInternalInventory() - { - return this.internalInventory; - } - - @Override - public void saveChanges() - { - - } - - @Override - public void onChangeInventory(IInventory inv, int slot, InventoryOperation operation, ItemStack removed, ItemStack added) - { - - } - - @Override - public int[] getAccessibleSlotsBySide(EnumFacing side) - { - return new int[0]; - } - - @Override - public ItemStack removeStackFromSlot(int index) - { - return null; - } - - @Override - public int getField(int id) - { - return 0; - } - - @Override - public void setField(int id, int value) - { - - } - - @Override - public int getFieldCount() - { - return 0; - } - - @Override - public void clear() - { - - } - - @Override - public ITextComponent getDisplayName() - { - return null; - } - - public void breakLid(EntityPlayer player) - { - IBlockState state = getBlockState(); - if(state.getValue(BlockGraveStone.HASLID)) - { - hasLid = false; - worldObj.notifyBlockUpdate(pos, state, state.withProperty(BlockGraveStone.HASLID, false), 3); - updateSlaves(); - markForUpdate(); - markDirty(); - - spawnPlayerZombie(player); - } - } - - private void updateSlaves() - { - for(BlockPos sPos : getSlaves(pos, getFacing())) - { - IBlockState state = worldObj.getBlockState(sPos); - worldObj.markAndNotifyBlock(sPos, worldObj.getChunkFromBlockCoords(pos), state, state.getActualState(worldObj, sPos), 3); - } - } - - private void spawnPlayerZombie(EntityPlayer player) - { - boolean spawnPlayerZombie = false; - - //todo: make if player has items, make the chance less - int spawnChance = 40; - - boolean hardcoreEnabled = worldObj.getWorldInfo().isHardcoreModeEnabled(); - EnumDifficulty gameDifficulty = worldObj.getDifficulty(); - - switch(gameDifficulty) - { - case EASY: - spawnChance = ConfigZombie.configZombieSpawnChanceEasy; - break; - - case NORMAL: - spawnChance = ConfigZombie.configZombieSpawnChanceNormal; - break; - - case HARD: - spawnChance = ConfigZombie.configZombieSpawnChanceHard; - break; - } - - if(hardcoreEnabled) - { - spawnChance = ConfigZombie.configZombieSpawnChanceHardCore; - } - - /* Notes : - - Artifacts: - > 4x Artifacts, each one lowers the zombie spawning chance - - */ - - if(spawnChance > 0) - { - Random random = new Random(); - int rng = random.nextInt(100); - - if(rng <= spawnChance) - { spawnPlayerZombie = true; } - } - - if(spawnPlayerZombie && ConfigZombie.configZombieEnabled) - { - EntityPlayerZombie playerZombie = new EntityPlayerZombie(worldObj, pos); - - playerZombie.setProfile(getPlayerProfile()); - - playerZombie.setLocationAndAngles(pos.getX(), pos.down().getY(), pos.getZ(), getBlockState().getValue(BlockGraveStone.FACING).getHorizontalIndex() * 90f, 0f); - playerZombie.onInitialSpawn(worldObj.getDifficultyForLocation(new BlockPos(playerZombie)), null); - playerZombie.setPlayer(player); - // nbtTagCompound.setIntArray("MasterGrave", new int[]{graveStone.getPos().getX(), graveStone.getPos().getY(), graveStone.getPos().getZ()}); - - worldObj.spawnEntityInWorld(playerZombie); - // world.playSound(pos.getX(), pos.getY(), pos.getZ(), SoundHelper.getRegisteredSoundEvent("graves:graveZombieSpawn"), SoundCategory.HOSTILE, 1, 1, true); - } - - } - - public EnumFacing getFacing() - { - return getBlockState().getValue(BlockGraveStone.FACING); - } - - public List getReplaceableBlocks() - { - return replaceableBlocks; - } - - public void setReplaceableBlocks(List replaceableBlocks) - { - this.replaceableBlocks = replaceableBlocks; - } - - public void replaceItems(EntityPlayer player) - { - InventoryPlayer inventory = player.inventory; - List remaining = new ArrayList(); - for(int i = 0; i < inventory.mainInventory.length; i++) - { - if(i >= replaceableItems.length) - { break; } - ItemStack currentItem = inventory.mainInventory[i]; - ItemStack replaceItem = replaceableItems[i]; - if(InventoryPlayer.isHotbar(i)) - { - LogHelper.info(String.format("CurrentItem: %s, replaceItem: %s", currentItem, replaceItem)); - if(currentItem == null && replaceItem != null) - { - inventory.mainInventory[i] = replaceItem; - } - else - { - remaining.add(replaceItem); - } - } - else - { - remaining.add(replaceItem); - } - } - - for(ItemStack remainingStack : remaining) - { - LogHelper.info(String.format("remainingStack: %s", remainingStack)); - if(!inventory.addItemStackToInventory(remainingStack)) - { - if(remainingStack != null && remainingStack.stackSize >= 1) - { worldObj.spawnEntityInWorld(new EntityItem(worldObj, player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ(), remainingStack)); } - } - } - - inventory.markDirty(); - } -} diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityHeadStone.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityHeadStone.java deleted file mode 100644 index 7e0ab76..0000000 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityHeadStone.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.fireball1725.graves.common.tileentity; - -import com.fireball1725.graves.common.helpers.LogHelper; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.play.server.SPacketUpdateTileEntity; - -public class TileEntityHeadStone extends TileEntityBase -{ - private ItemStack displayStack = null; - - public TileEntityHeadStone() - { - super(); - } - - @Override - public SPacketUpdateTileEntity getUpdatePacket() - { - return new SPacketUpdateTileEntity(getPos(), getBlockMetadata(), serializeNBT()); - } - - @Override - public void onDataPacket(NetworkManager networkManager, SPacketUpdateTileEntity sPacketUpdateTileEntity) - { - deserializeNBT(sPacketUpdateTileEntity.getNbtCompound()); - } - - @Override - public String getCustomName() - { - return hasCustomName() ? this.customName : ""; - } - - public ItemStack getDisplayStack() - { - return displayStack; - } - - public void setDisplayStack(ItemStack displayStack) - { - this.displayStack = displayStack; - } - - @Override - public NBTTagCompound writeToNBT(NBTTagCompound nbtTagCompound) - { - super.writeToNBT(nbtTagCompound); - if(displayStack != null) - { nbtTagCompound.setTag("displayStack", displayStack.serializeNBT()); } - return nbtTagCompound; - } - - @Override - public void readFromNBT(NBTTagCompound nbtTagCompound) - { - super.readFromNBT(nbtTagCompound); - displayStack = null; - if(nbtTagCompound.hasKey("displayStack")) - { - LogHelper.info("Loading stack!"); - displayStack = ItemStack.loadItemStackFromNBT(nbtTagCompound.getCompoundTag("displayStack")); - } - } -} diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityInventoryBase.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityInventoryBase.java index 1377cd4..0833011 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityInventoryBase.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityInventoryBase.java @@ -11,115 +11,137 @@ import net.minecraft.util.EnumFacing; public abstract class TileEntityInventoryBase extends TileEntityBase implements ISidedInventory, IInventoryHandler { - public abstract IInventory getInternalInventory(); - - @Override - public void readFromNBT(NBTTagCompound nbtTagCompound) { - super.readFromNBT(nbtTagCompound); - - if (getInternalInventory() instanceof IInventoryCustom) { - IInventoryCustom inventoryCustom = (IInventoryCustom)getInternalInventory(); - inventoryCustom.readFromNBT(nbtTagCompound); - } else { - IInventory inventory = this.getInternalInventory(); - NBTTagCompound tagCompound = nbtTagCompound.getCompoundTag("Items"); - for (int i = 0; i < inventory.getSizeInventory(); i++) { - NBTTagCompound item = tagCompound.getCompoundTag("item" + i); - inventory.setInventorySlotContents(i, ItemStack.loadItemStackFromNBT(item)); - } - } - } - - @Override + public abstract IInventory getInternalInventory(); + + @Override + public void readFromNBT(NBTTagCompound nbtTagCompound) + { + super.readFromNBT(nbtTagCompound); + + if(getInternalInventory() instanceof IInventoryCustom) + { + IInventoryCustom inventoryCustom = (IInventoryCustom) getInternalInventory(); + inventoryCustom.readFromNBT(nbtTagCompound); + } + else + { + IInventory inventory = this.getInternalInventory(); + NBTTagCompound tagCompound = nbtTagCompound.getCompoundTag("Items"); + for(int i = 0; i < inventory.getSizeInventory(); i++) + { + NBTTagCompound item = tagCompound.getCompoundTag("item" + i); + inventory.setInventorySlotContents(i, ItemStack.loadItemStackFromNBT(item)); + } + } + } + + @Override public NBTTagCompound writeToNBT(NBTTagCompound nbtTagCompound) { - if (getInternalInventory() instanceof IInventoryCustom) { - IInventoryCustom inventoryCustom = (IInventoryCustom)getInternalInventory(); - inventoryCustom.writeToNBT(nbtTagCompound); - } else { - IInventory inventory = this.getInternalInventory(); - NBTTagCompound tagCompound = new NBTTagCompound(); - for (int i = 0; i < inventory.getSizeInventory(); i++) { - NBTTagCompound item = new NBTTagCompound(); - ItemStack itemStack = this.getStackInSlot(i); - if (itemStack != null) - itemStack.writeToNBT(item); - tagCompound.setTag("item" + i, item); - } - nbtTagCompound.setTag("Items", tagCompound); - } + if(getInternalInventory() instanceof IInventoryCustom) + { + IInventoryCustom inventoryCustom = (IInventoryCustom) getInternalInventory(); + inventoryCustom.writeToNBT(nbtTagCompound); + } + else + { + IInventory inventory = this.getInternalInventory(); + NBTTagCompound tagCompound = new NBTTagCompound(); + for(int i = 0; i < inventory.getSizeInventory(); i++) + { + NBTTagCompound item = new NBTTagCompound(); + ItemStack itemStack = this.getStackInSlot(i); + if(itemStack != null) + { itemStack.writeToNBT(item); } + tagCompound.setTag("item" + i, item); + } + nbtTagCompound.setTag("Items", tagCompound); + } return super.writeToNBT(nbtTagCompound); } - @Override - public int getSizeInventory() { - return this.getInternalInventory().getSizeInventory(); - } + @Override + public int getSizeInventory() + { + return this.getInternalInventory().getSizeInventory(); + } - @Override - public ItemStack getStackInSlot(int slot) { - return this.getInternalInventory().getStackInSlot(slot); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return this.getInternalInventory().getStackInSlot(slot); + } - @Override - public ItemStack decrStackSize(int i, int j) { - return this.getInternalInventory().decrStackSize(i, j); - } + @Override + public ItemStack decrStackSize(int i, int j) + { + return this.getInternalInventory().decrStackSize(i, j); + } - @Override - public void setInventorySlotContents(int slot, ItemStack itemStack) { - this.getInternalInventory().setInventorySlotContents(slot, itemStack); - } + @Override + public void setInventorySlotContents(int slot, ItemStack itemStack) + { + this.getInternalInventory().setInventorySlotContents(slot, itemStack); + } - @Override - public int getInventoryStackLimit() { - return 64; - } + @Override + public int getInventoryStackLimit() + { + return 64; + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - final double squaredMCReach = 64.0D; - return this.worldObj.getTileEntity(this.pos) == this && player.getDistanceSq(this.pos.getX() + 0.5D, this.pos.getY() + 0.5D, this.getPos().getZ() + 0.5D) <= squaredMCReach; - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + final double squaredMCReach = 64.0D; + return this.worldObj.getTileEntity(this.pos) == this && player.getDistanceSq(this.pos.getX() + 0.5D, this.pos.getY() + 0.5D, this.getPos().getZ() + 0.5D) <= squaredMCReach; + } - @Override - public void openInventory(EntityPlayer player) { + @Override + public void openInventory(EntityPlayer player) + { - } + } - @Override - public void closeInventory(EntityPlayer player) { + @Override + public void closeInventory(EntityPlayer player) + { - } + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack itemStack) { - return true; - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack itemStack) + { + return true; + } - @Override - public abstract void onChangeInventory(IInventory inv, int slot, InventoryOperation operation, ItemStack removed, ItemStack added); + @Override + public abstract void onChangeInventory(IInventory inv, int slot, InventoryOperation operation, ItemStack removed, ItemStack added); - @Override - public int[] getSlotsForFace(EnumFacing side) { - return this.getAccessibleSlotsBySide(side); - } + @Override + public int[] getSlotsForFace(EnumFacing side) + { + return this.getAccessibleSlotsBySide(side); + } - @Override - public boolean canInsertItem(int index, ItemStack itemStackIn, EnumFacing direction) { - return this.isItemValidForSlot(index, itemStackIn); - } + @Override + public boolean canInsertItem(int index, ItemStack itemStackIn, EnumFacing direction) + { + return this.isItemValidForSlot(index, itemStackIn); + } - @Override - public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction) { - return true; - } + @Override + public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction) + { + return true; + } - public abstract int[] getAccessibleSlotsBySide(EnumFacing side); + public abstract int[] getAccessibleSlotsBySide(EnumFacing side); - @Override - public String getName() { - return getCustomName(); - } + @Override + public String getName() + { + return getCustomName(); + } } diff --git a/src/main/java/com/fireball1725/graves/common/util/GuiHandler.java b/src/main/java/com/fireball1725/graves/common/util/GuiHandler.java deleted file mode 100644 index 3daaaf7..0000000 --- a/src/main/java/com/fireball1725/graves/common/util/GuiHandler.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.fireball1725.graves.common.util; - -import com.fireball1725.graves.client.gui.GuiScreenHeadstone; -import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import net.minecraftforge.fml.common.network.IGuiHandler; - -public class GuiHandler implements IGuiHandler { - @Override - public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - return null; - } - - @Override - public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - switch (ID) { - case 0: - TileEntityHeadStone headstone = TileTools.getTileEntity(world, new BlockPos(x, y, z), TileEntityHeadStone.class); - if (headstone != null) { - return new GuiScreenHeadstone(headstone); - } - } - return null; - } -} diff --git a/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java b/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java index 216d9e2..236e568 100644 --- a/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java +++ b/src/main/java/com/fireball1725/graves/proxy/ClientProxy.java @@ -1,51 +1,55 @@ package com.fireball1725.graves.proxy; -import com.fireball1725.graves.common.block.Blocks; -import com.fireball1725.graves.client.events.RenderEvents; -import com.fireball1725.graves.client.render.TileEntityHeadStoneRenderer; -import com.fireball1725.graves.client.render.entity.EntityRenderers; +import com.fireball1725.graves.client.event.EventTick; +import com.fireball1725.graves.client.render.TEGraveSR; +import com.fireball1725.graves.client.render.entity.EntityRenderer; import com.fireball1725.graves.client.render.entity.RenderPlayerZombie; +import com.fireball1725.graves.common.block.Blocks; import com.fireball1725.graves.common.entity.EntityPlayerZombie; import com.fireball1725.graves.common.reference.ModInfo; -import com.fireball1725.graves.common.tileentity.TileEntityHeadStone; -import net.minecraft.client.Minecraft; +import com.fireball1725.graves.common.tileentity.TileEntityGrave; import net.minecraft.client.renderer.block.model.ModelResourceLocation; -import net.minecraft.client.resources.IReloadableResourceManager; import net.minecraft.item.Item; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.client.model.obj.OBJLoader; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.client.registry.ClientRegistry; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; public class ClientProxy extends CommonProxy { - // Client side only - @Override - public void registerBlocks() { - super.registerBlocks(); + @Override + public void preInit(FMLPreInitializationEvent event) + { + super.preInit(event); + //Register Block Rendering OBJLoader.INSTANCE.addDomain(ModInfo.MOD_ID); - Item graveItem = Item.getItemFromBlock(Blocks.BLOCK_GRAVESTONE.block); - ModelLoader.setCustomModelResourceLocation(graveItem, 0, new ModelResourceLocation(ModInfo.MOD_ID + ":gravestone", "inventory")); - graveItem = Item.getItemFromBlock(Blocks.BLOCK_GRAVESTONE_SLAVE.block); - ModelLoader.setCustomModelResourceLocation(graveItem, 0, new ModelResourceLocation(ModInfo.MOD_ID + ":graveslave", "inventory")); - graveItem = Item.getItemFromBlock(Blocks.BLOCK_GRAVE_HEADSTONE.block); - ModelLoader.setCustomModelResourceLocation(graveItem, 0, new ModelResourceLocation(ModInfo.MOD_ID + ":headstone", "inventory")); - } + Item graveItem = Item.getItemFromBlock(Blocks.BLOCK_GRAVE.block); + if(graveItem != null) + { + ModelLoader.setCustomModelResourceLocation(graveItem, 0, new ModelResourceLocation(ModInfo.MOD_ID + ":grave", "inventory")); + } + //Register Entity Rendering + EntityRenderer.registerEntityRenderer(EntityPlayerZombie.class, RenderPlayerZombie.class); + EntityPlayerZombie.registerSounds(); + + //Register TileEntity Rendering + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityGrave.class, new TEGraveSR()); + //Register Event + } @Override - public void registerEntities() + public void init(FMLInitializationEvent event) { - super.registerEntities(); - EntityRenderers.registerEntityRenderer(EntityPlayerZombie.class, RenderPlayerZombie.class); - EntityPlayerZombie.registerSounds(); + super.init(event); + MinecraftForge.EVENT_BUS.register(new EventTick()); } @Override - @SuppressWarnings("unchecked") - public void registerRenderers() { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityHeadStone.class, TileEntityHeadStoneRenderer.instance()); - RenderEvents renderEvents = new RenderEvents(); - MinecraftForge.EVENT_BUS.register(renderEvents); - ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(renderEvents); - } + public void postInit(FMLPostInitializationEvent event) + { + super.postInit(event); + } } diff --git a/src/main/java/com/fireball1725/graves/proxy/CommonProxy.java b/src/main/java/com/fireball1725/graves/proxy/CommonProxy.java index 6982469..2208758 100644 --- a/src/main/java/com/fireball1725/graves/proxy/CommonProxy.java +++ b/src/main/java/com/fireball1725/graves/proxy/CommonProxy.java @@ -4,82 +4,49 @@ import com.fireball1725.graves.common.block.Blocks; import com.fireball1725.graves.common.configuration.ConfigurationFile; import com.fireball1725.graves.common.entity.Entities; -import com.fireball1725.graves.common.event.EventBlockBreak; -import com.fireball1725.graves.common.event.EventDeathHandler; -import com.fireball1725.graves.common.helpers.BreakableWhiteListHelper; +import com.fireball1725.graves.common.entity.capabilities.GraveCapability; +import com.fireball1725.graves.common.event.Events; +import com.fireball1725.graves.common.network.PacketHandler; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.registry.GameRegistry; -import java.io.File; - -public abstract class CommonProxy implements IProxy { - @Override - public void registerBlocks() { - Blocks.registerAll(); - } - - @Override - public void registerItems() { - - } - - @Override - public void registerEntities() { - Entities.registerEntities(); - } - - @Override - public void registerEvents() { - MinecraftForge.EVENT_BUS.register(new EventDeathHandler()); - MinecraftForge.EVENT_BUS.register(new EventBlockBreak()); - } - - @Override - public void registerConfiguration(File configFile) { - Graves.configuration = ConfigurationFile.init(configFile); - MinecraftForge.EVENT_BUS.register(new ConfigurationFile()); - } - - @Override - public void registerRenderers() { - /* Client Side Only */ - } +public class CommonProxy implements IProxy +{ + + @Override + public void preInit(FMLPreInitializationEvent event) + { + //Config + Graves.configuration = ConfigurationFile.init(event.getSuggestedConfigurationFile()); + MinecraftForge.EVENT_BUS.register(new ConfigurationFile()); + //Capabilities + GraveCapability.register(); + //Blocks + Blocks.registerAll(); + //Items + //Items.registerAll(); + //Entities + Entities.registerEntities(); + //Events + MinecraftForge.EVENT_BUS.register(new Events()); + //Recipes + GameRegistry.addRecipe(new ItemStack(Blocks.BLOCK_GRAVE.block), "x x", "xzx", "xxx", + 'x', new ItemStack(net.minecraft.init.Blocks.STONE), 'v', new ItemStack(net.minecraft.init.Blocks.OBSIDIAN)); + } - @Override - public void registerRecipes() { - // Headstone - GameRegistry.addRecipe(new ItemStack(Blocks.BLOCK_GRAVE_HEADSTONE.block), - " x ", - "xzx", - "xxx", - 'x', new ItemStack(net.minecraft.init.Blocks.STONE, 1, 4), - 'z', new ItemStack(net.minecraft.init.Blocks.STONE, 1, 6)); + @Override + public void init(FMLInitializationEvent event) + { + //Packet Handler + PacketHandler.init(); } - @Override - public void registerWhiteList() { - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.DIRT.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.DIRT.getStateFromMeta(2)); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.GRASS.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.STONE.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.STONE.getStateFromMeta(1)); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.STONE.getStateFromMeta(3)); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.STONE.getStateFromMeta(5)); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.COBBLESTONE.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.SAND.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.SAND.getStateFromMeta(1)); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.GRAVEL.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.SOUL_SAND.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.NETHERRACK.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.CLAY.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.WATER.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.LAVA.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.FLOWING_WATER.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.FLOWING_LAVA.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.SNOW_LAYER.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.ICE.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.PACKED_ICE.getDefaultState()); - BreakableWhiteListHelper.addBlock(net.minecraft.init.Blocks.MYCELIUM.getDefaultState()); + @Override + public void postInit(FMLPostInitializationEvent event) + { } } diff --git a/src/main/java/com/fireball1725/graves/proxy/IProxy.java b/src/main/java/com/fireball1725/graves/proxy/IProxy.java index f6234e9..d2f072c 100644 --- a/src/main/java/com/fireball1725/graves/proxy/IProxy.java +++ b/src/main/java/com/fireball1725/graves/proxy/IProxy.java @@ -1,21 +1,13 @@ package com.fireball1725.graves.proxy; -import java.io.File; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; public interface IProxy { - void registerBlocks(); + void preInit(FMLPreInitializationEvent event); - void registerItems(); + void init(FMLInitializationEvent event); - void registerEntities(); - - void registerEvents(); - - void registerConfiguration(File configFile); - - void registerRenderers(); - - void registerRecipes(); - - void registerWhiteList(); + void postInit(FMLPostInitializationEvent event); } diff --git a/src/main/java/com/fireball1725/graves/proxy/ServerProxy.java b/src/main/java/com/fireball1725/graves/proxy/ServerProxy.java deleted file mode 100644 index 26ab909..0000000 --- a/src/main/java/com/fireball1725/graves/proxy/ServerProxy.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.fireball1725.graves.proxy; - -public class ServerProxy extends CommonProxy { - // Server side only -} diff --git a/src/main/resources/assets/graves/blockstates/grave.json b/src/main/resources/assets/graves/blockstates/grave.json new file mode 100644 index 0000000..df64d5e --- /dev/null +++ b/src/main/resources/assets/graves/blockstates/grave.json @@ -0,0 +1,29 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "#main": "minecraft:blocks/stone", + "#embellishment": "minecraft:blocks/obsidian", + "#lava": "minecraft:blocks/lava_still" + } + }, + "variants": { + "normal": [ + {} + ], + "inventory": [ + { + "model": "graves:grave.obj", + "transform": "forge:default-block" + } + ], + "render": { + "true": { + "model": "graves:grave.obj" + }, + "false": { + "model": "graves:nothing.obj" + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/graves/blockstates/graveslave.json b/src/main/resources/assets/graves/blockstates/graveslave.json deleted file mode 100644 index a98e36b..0000000 --- a/src/main/resources/assets/graves/blockstates/graveslave.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "forge_marker": 1, - "defaults": { - "textures": { - "#tex": "minecraft:blocks/stone_andesite_smooth" - } - }, - "variants": { - "normal": [ - {} - ], - "inventory": [ - {} - ], - "slavetype": { - "box": { - "model": "graves:graveboxsection.obj" - }, - "boxfoot": { - "model": "graves:graveboxsectionfoot.obj" - }, - "lid": { - "model": "graves:gravelidsectionfoot.obj" - }, - "norender": { - "model": "graves:nothing.obj" - } - }, - "isfoot": { - "false": {}, - "true": {} - }, - "facing": { - "north": { - "y": 270 - }, - "south": { - "y": 90 - }, - "west": { - "y": 180 - }, - "east": { - "y": 0 - } - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/graves/blockstates/gravestone.json b/src/main/resources/assets/graves/blockstates/gravestone.json deleted file mode 100644 index c1d9545..0000000 --- a/src/main/resources/assets/graves/blockstates/gravestone.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "forge_marker": 1, - "defaults": { - "textures": { - "#box": "minecraft:blocks/stone_andesite_smooth" - } - }, - "variants": { - "normal": [ - {} - ], - "inventory": [ - { - "model": "graves:gravestone.obj", - "transform": { - "rotation": { - "y": 90 - }, - "translation": [ - 0.125, - 0.25, - -0.125 - ], - "scale": [ - 0.25, - 0.25, - 0.25 - ] - } - } - ], - "haslid": { - "false": { - "model": "graves:nothing.obj" - }, - "true": { - "model": "graves:gravelidsection.obj" - } - }, - "facing": { - "north": {}, - "south": { - "y": 180 - }, - "west": { - "y": 270 - }, - "east": { - "y": 90 - } - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/graves/blockstates/headstone.json b/src/main/resources/assets/graves/blockstates/headstone.json deleted file mode 100644 index 80314e9..0000000 --- a/src/main/resources/assets/graves/blockstates/headstone.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "forge_marker": 1, - "defaults": { - "textures": { - "#box": "minecraft:blocks/stone_andesite_smooth", - "#headstone": "minecraft:blocks/stone_diorite_smooth" - }, - "model": "graves:headstone.obj" - }, - "variants": { - "normal": [ - {} - ], - "inventory": [ - { - "transform": { - "rotation": { - "y": 225 - }, - "translation": [ - -0.25, - 0, - 0 - ] - } - } - ], - "render": { - "true": {}, - "false": {} - }, - "facing": { - "north": {}, - "south": { - "y": 180 - }, - "west": { - "y": 270 - }, - "east": { - "y": 90 - } - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/graves/lang/en_US.lang b/src/main/resources/assets/graves/lang/en_US.lang index a5bfb0b..7ae97ca 100644 --- a/src/main/resources/assets/graves/lang/en_US.lang +++ b/src/main/resources/assets/graves/lang/en_US.lang @@ -1,7 +1,3 @@ #Graves mod localization file for en_US #Blocks -tile.headstone.name=Headstone -tile.gravestone.name=Coffin - -#Creative tabs -itemGroup.graves=Graves mod \ No newline at end of file +tile.grave.name=Headstone \ No newline at end of file diff --git a/src/main/resources/assets/graves/models/block/grave.mtl b/src/main/resources/assets/graves/models/block/grave.mtl new file mode 100644 index 0000000..9fb1f4a --- /dev/null +++ b/src/main/resources/assets/graves/models/block/grave.mtl @@ -0,0 +1,32 @@ +newmtl main +Ns 94.117647 +Ka 1.000000 1.000000 1.000000 +Kd 0.800000 0.800000 0.800000 +Ks 0.164706 0.164706 0.164706 +Ke 0.000000 0.000000 0.000000 +Ni 1.000000 +d 1.000000 +illum 2 +map_Kd minecraft:blocks/stone + +newmtl embellishment +Ns 94.117647 +Ka 1.000000 1.000000 1.000000 +Kd 0.800000 0.800000 0.800000 +Ks 0.164706 0.164706 0.164706 +Ke 0.000000 0.000000 0.000000 +Ni 1.000000 +d 1.000000 +illum 2 +map_Kd minecraft:blocks/obsidian + +newmtl lava +Ns 94.117647 +Ka 1.000000 1.000000 1.000000 +Kd 0.800000 0.800000 0.800000 +Ks 0.164706 0.164706 0.164706 +Ke 0.000000 0.000000 0.000000 +Ni 1.000000 +d 1.000000 +illum 2 +map_Kd minecraft:blocks/lava_still \ No newline at end of file diff --git a/src/main/resources/assets/graves/models/block/grave.obj b/src/main/resources/assets/graves/models/block/grave.obj new file mode 100644 index 0000000..c8e153d --- /dev/null +++ b/src/main/resources/assets/graves/models/block/grave.obj @@ -0,0 +1,2258 @@ +# Blender v2.76 (sub 0) OBJ File: '' +# www.blender.org +mtllib grave.mtl +o Model_Model.001 +v 0.187500 0.625000 0.187500 +v 0.250000 0.562500 0.187500 +v 0.187500 0.562500 0.187500 +v 0.250000 0.625000 0.187500 +v 0.187500 0.562500 0.187500 +v 0.187500 0.625000 0.250000 +v 0.187500 0.625000 0.187500 +v 0.187500 0.562500 0.250000 +v 0.125000 0.562500 0.187500 +v 0.187500 0.562500 0.250000 +v 0.187500 0.562500 0.187500 +v 0.125000 0.562500 0.250000 +v 0.125000 0.562500 0.187500 +v 0.125000 -0.000000 0.250000 +v 0.125000 0.562500 0.250000 +v 0.125000 -0.000000 0.187500 +v 0.125000 0.562500 0.125000 +v 0.125000 -0.000000 0.125000 +v 0.125000 0.562500 0.125000 +v 0.187500 -0.000000 0.125000 +v 0.125000 -0.000000 0.125000 +v 0.187500 0.562500 0.125000 +v 0.250000 0.562500 0.187500 +v 0.187500 0.562500 0.125000 +v 0.250000 0.562500 0.125000 +v 0.312500 0.562500 0.187500 +v 0.312500 0.562500 0.125000 +v 0.375000 0.562500 0.187500 +v 0.375000 0.562500 0.125000 +v 0.625000 0.562500 0.187500 +v 0.625000 0.562500 0.125000 +v 0.687500 0.562500 0.125000 +v 0.687500 0.562500 0.187500 +v 0.625000 0.625000 0.187500 +v 0.687500 0.562500 0.187500 +v 0.625000 0.562500 0.187500 +v 0.687500 0.625000 0.187500 +v 0.625000 0.625000 0.187500 +v 0.687500 0.625000 0.250000 +v 0.687500 0.625000 0.187500 +v 0.625000 0.625000 0.250000 +v 0.375000 0.625000 0.187500 +v 0.375000 0.625000 0.250000 +v 0.312500 0.625000 0.187500 +v 0.312500 0.625000 0.250000 +v 0.250000 0.625000 0.187500 +v 0.250000 0.625000 0.250000 +v 0.187500 0.625000 0.250000 +v 0.250000 0.625000 0.312500 +v 0.187500 0.625000 0.312500 +v 0.187500 0.625000 0.312500 +v 0.187500 0.562500 0.312500 +v 0.187500 0.562500 0.312500 +v 0.125000 0.562500 0.312500 +v 0.125000 -0.000000 0.312500 +v 0.125000 0.562500 0.312500 +v 0.187500 -0.000000 0.250000 +v 0.125000 -0.000000 0.312500 +v 0.125000 -0.000000 0.250000 +v 0.187500 -0.000000 0.312500 +v 0.250000 -0.000000 0.250000 +v 0.250000 -0.000000 0.312500 +v 0.312500 -0.000000 0.250000 +v 0.312500 -0.000000 0.312500 +v 0.375000 -0.000000 0.250000 +v 0.375000 -0.000000 0.312500 +v 0.625000 -0.000000 0.250000 +v 0.625000 -0.000000 0.312500 +v 0.687500 -0.000000 0.250000 +v 0.687500 -0.000000 0.312500 +v 0.750000 -0.000000 0.250000 +v 0.750000 -0.000000 0.312500 +v 0.812500 -0.000000 0.250000 +v 0.812500 -0.000000 0.312500 +v 0.875000 -0.000000 0.312500 +v 0.875000 -0.000000 0.250000 +v 0.875000 -0.000000 0.187500 +v 0.812500 -0.000000 0.187500 +v 0.750000 -0.000000 0.187500 +v 0.687500 -0.000000 0.187500 +v 0.625000 -0.000000 0.187500 +v 0.375000 -0.000000 0.187500 +v 0.312500 -0.000000 0.187500 +v 0.250000 -0.000000 0.187500 +v 0.187500 -0.000000 0.187500 +v 0.125000 -0.000000 0.187500 +v 0.187500 -0.000000 0.125000 +v 0.125000 -0.000000 0.125000 +v 0.250000 -0.000000 0.125000 +v 0.312500 -0.000000 0.125000 +v 0.375000 -0.000000 0.125000 +v 0.312500 0.562500 0.125000 +v 0.375000 -0.000000 0.125000 +v 0.312500 -0.000000 0.125000 +v 0.375000 0.562500 0.125000 +v 0.625000 -0.000000 0.125000 +v 0.375000 -0.000000 0.125000 +v 0.625000 0.562500 0.125000 +v 0.687500 -0.000000 0.125000 +v 0.625000 -0.000000 0.125000 +v 0.687500 0.562500 0.125000 +v 0.750000 -0.000000 0.125000 +v 0.687500 -0.000000 0.125000 +v 0.750000 0.562500 0.125000 +v 0.750000 0.562500 0.125000 +v 0.750000 0.562500 0.187500 +v 0.750000 0.562500 0.187500 +v 0.750000 0.625000 0.187500 +v 0.750000 0.625000 0.250000 +v 0.750000 0.625000 0.187500 +v 0.687500 0.687500 0.250000 +v 0.750000 0.625000 0.250000 +v 0.687500 0.625000 0.250000 +v 0.750000 0.687500 0.250000 +v 0.687500 0.687500 0.250000 +v 0.625000 0.687500 0.312500 +v 0.687500 0.687500 0.312500 +v 0.625000 0.687500 0.250000 +v 0.625000 0.687500 0.250000 +v 0.625000 0.625000 0.250000 +v 0.375000 0.687500 0.250000 +v 0.375000 0.625000 0.250000 +v 0.312500 0.687500 0.250000 +v 0.312500 0.625000 0.250000 +v 0.250000 0.687500 0.250000 +v 0.250000 0.625000 0.250000 +v 0.250000 0.625000 0.312500 +v 0.250000 0.687500 0.250000 +v 0.250000 0.625000 0.250000 +v 0.250000 0.687500 0.312500 +v 0.250000 0.625000 0.375000 +v 0.250000 0.687500 0.375000 +v 0.250000 0.687500 0.625000 +v 0.250000 0.625000 0.625000 +v 0.187500 0.625000 0.375000 +v 0.250000 0.625000 0.625000 +v 0.250000 0.625000 0.375000 +v 0.187500 0.625000 0.625000 +v 0.187500 0.625000 0.375000 +v 0.187500 0.562500 0.625000 +v 0.187500 0.625000 0.625000 +v 0.187500 0.562500 0.375000 +v 0.187500 0.562500 0.375000 +v 0.125000 0.562500 0.375000 +v 0.125000 -0.000000 0.375000 +v 0.125000 0.562500 0.375000 +v 0.125000 -0.000000 0.375000 +v 0.187500 -0.000000 0.375000 +v 0.250000 -0.000000 0.375000 +v 0.312500 -0.000000 0.375000 +v 0.375000 -0.000000 0.375000 +v 0.625000 -0.000000 0.375000 +v 0.687500 -0.000000 0.375000 +v 0.750000 -0.000000 0.375000 +v 0.812500 -0.000000 0.375000 +v 0.875000 -0.000000 0.375000 +v 0.875000 -0.000000 0.312500 +v 0.875000 0.562500 0.375000 +v 0.875000 -0.000000 0.375000 +v 0.875000 0.562500 0.312500 +v 0.875000 -0.000000 0.250000 +v 0.875000 -0.000000 0.312500 +v 0.875000 0.562500 0.250000 +v 0.875000 -0.000000 0.187500 +v 0.875000 -0.000000 0.250000 +v 0.875000 0.562500 0.187500 +v 0.875000 -0.000000 0.125000 +v 0.875000 0.562500 0.125000 +v 0.875000 -0.000000 0.125000 +v 0.812500 0.562500 0.125000 +v 0.875000 0.562500 0.125000 +v 0.812500 -0.000000 0.125000 +v 0.812500 -0.000000 0.125000 +v 0.875000 -0.000000 0.125000 +v 0.750000 -0.000000 0.125000 +v 0.687500 -0.000000 0.125000 +v 0.625000 -0.000000 0.125000 +v 0.750000 -0.000000 0.125000 +v 0.812500 -0.000000 0.125000 +v 0.812500 0.562500 0.125000 +v 0.812500 0.562500 0.187500 +v 0.812500 0.625000 0.187500 +v 0.812500 0.562500 0.187500 +v 0.750000 0.687500 0.312500 +v 0.750000 0.625000 0.250000 +v 0.750000 0.687500 0.250000 +v 0.750000 0.625000 0.312500 +v 0.750000 0.687500 0.375000 +v 0.750000 0.625000 0.375000 +v 0.750000 0.687500 0.625000 +v 0.750000 0.625000 0.625000 +v 0.750000 0.687500 0.687500 +v 0.750000 0.625000 0.687500 +v 0.750000 0.687500 0.750000 +v 0.750000 0.625000 0.750000 +v 0.687500 0.687500 0.750000 +v 0.750000 0.625000 0.750000 +v 0.750000 0.687500 0.750000 +v 0.687500 0.625000 0.750000 +v 0.625000 0.687500 0.750000 +v 0.625000 0.625000 0.750000 +v 0.375000 0.687500 0.750000 +v 0.375000 0.625000 0.750000 +v 0.312500 0.687500 0.750000 +v 0.312500 0.625000 0.750000 +v 0.250000 0.687500 0.750000 +v 0.250000 0.625000 0.750000 +v 0.250000 0.625000 0.750000 +v 0.187500 0.625000 0.687500 +v 0.187500 0.625000 0.750000 +v 0.250000 0.625000 0.687500 +v 0.250000 0.625000 0.750000 +v 0.250000 0.687500 0.687500 +v 0.250000 0.625000 0.687500 +v 0.250000 0.687500 0.750000 +v 0.187500 0.625000 0.750000 +v 0.187500 0.562500 0.812500 +v 0.187500 0.625000 0.812500 +v 0.187500 0.562500 0.750000 +v 0.187500 0.625000 0.687500 +v 0.187500 0.562500 0.687500 +v 0.125000 0.562500 0.625000 +v 0.187500 0.562500 0.687500 +v 0.187500 0.562500 0.625000 +v 0.125000 0.562500 0.687500 +v 0.125000 -0.000000 0.625000 +v 0.125000 0.562500 0.687500 +v 0.125000 0.562500 0.625000 +v 0.125000 -0.000000 0.687500 +v 0.125000 -0.000000 0.625000 +v 0.187500 -0.000000 0.687500 +v 0.125000 -0.000000 0.687500 +v 0.187500 -0.000000 0.625000 +v 0.250000 -0.000000 0.625000 +v 0.312500 -0.000000 0.625000 +v 0.375000 -0.000000 0.625000 +v 0.625000 -0.000000 0.625000 +v 0.687500 -0.000000 0.625000 +v 0.750000 -0.000000 0.625000 +v 0.812500 -0.000000 0.625000 +v 0.875000 -0.000000 0.625000 +v 0.875000 -0.000000 0.375000 +v 0.875000 0.562500 0.625000 +v 0.875000 -0.000000 0.625000 +v 0.812500 0.562500 0.375000 +v 0.875000 0.562500 0.625000 +v 0.875000 0.562500 0.375000 +v 0.812500 0.562500 0.625000 +v 0.812500 0.562500 0.375000 +v 0.812500 0.625000 0.625000 +v 0.812500 0.562500 0.625000 +v 0.812500 0.625000 0.375000 +v 0.812500 0.562500 0.312500 +v 0.812500 0.625000 0.312500 +v 0.812500 0.562500 0.250000 +v 0.812500 0.625000 0.250000 +v 0.812500 0.562500 0.187500 +v 0.812500 0.625000 0.187500 +v 0.875000 0.562500 0.250000 +v 0.875000 0.562500 0.187500 +v 0.812500 0.562500 0.250000 +v 0.875000 0.562500 0.312500 +v 0.812500 0.562500 0.312500 +v 0.750000 0.625000 0.312500 +v 0.812500 0.625000 0.250000 +v 0.812500 0.625000 0.312500 +v 0.812500 0.625000 0.375000 +v 0.750000 0.625000 0.375000 +v 0.812500 0.625000 0.625000 +v 0.750000 0.625000 0.625000 +v 0.812500 0.625000 0.687500 +v 0.750000 0.625000 0.687500 +v 0.750000 0.625000 0.750000 +v 0.812500 0.625000 0.750000 +v 0.687500 0.625000 0.750000 +v 0.750000 0.625000 0.812500 +v 0.687500 0.625000 0.812500 +v 0.625000 0.625000 0.750000 +v 0.625000 0.625000 0.812500 +v 0.375000 0.625000 0.812500 +v 0.375000 0.625000 0.750000 +v 0.312500 0.625000 0.750000 +v 0.312500 0.625000 0.812500 +v 0.250000 0.625000 0.812500 +v 0.250000 0.625000 0.812500 +v 0.312500 0.562500 0.812500 +v 0.312500 0.625000 0.812500 +v 0.250000 0.562500 0.812500 +v 0.187500 0.625000 0.812500 +v 0.187500 0.562500 0.812500 +v 0.187500 0.562500 0.812500 +v 0.125000 0.562500 0.750000 +v 0.125000 0.562500 0.812500 +v 0.187500 0.562500 0.750000 +v 0.125000 -0.000000 0.687500 +v 0.125000 0.562500 0.750000 +v 0.125000 -0.000000 0.750000 +v 0.125000 -0.000000 0.750000 +v 0.187500 -0.000000 0.750000 +v 0.250000 -0.000000 0.750000 +v 0.250000 -0.000000 0.687500 +v 0.312500 -0.000000 0.687500 +v 0.375000 -0.000000 0.687500 +v 0.625000 -0.000000 0.687500 +v 0.687500 -0.000000 0.687500 +v 0.750000 -0.000000 0.687500 +v 0.812500 -0.000000 0.687500 +v 0.875000 -0.000000 0.687500 +v 0.875000 -0.000000 0.625000 +v 0.875000 0.562500 0.687500 +v 0.875000 -0.000000 0.687500 +v 0.875000 0.562500 0.687500 +v 0.812500 0.562500 0.687500 +v 0.812500 0.625000 0.687500 +v 0.812500 0.562500 0.687500 +v 0.812500 0.625000 0.750000 +v 0.812500 0.562500 0.750000 +v 0.812500 0.625000 0.812500 +v 0.812500 0.562500 0.812500 +v 0.750000 0.625000 0.812500 +v 0.812500 0.562500 0.812500 +v 0.812500 0.625000 0.812500 +v 0.750000 0.562500 0.812500 +v 0.687500 0.625000 0.812500 +v 0.687500 0.562500 0.812500 +v 0.625000 0.625000 0.812500 +v 0.625000 0.562500 0.812500 +v 0.375000 0.625000 0.812500 +v 0.375000 0.562500 0.812500 +v 0.312500 0.562500 0.875000 +v 0.375000 0.562500 0.812500 +v 0.312500 0.562500 0.812500 +v 0.375000 0.562500 0.875000 +v 0.312500 0.562500 0.875000 +v 0.375000 -0.000000 0.875000 +v 0.375000 0.562500 0.875000 +v 0.312500 -0.000000 0.875000 +v 0.250000 0.562500 0.875000 +v 0.250000 -0.000000 0.875000 +v 0.187500 0.562500 0.875000 +v 0.187500 -0.000000 0.875000 +v 0.125000 0.562500 0.875000 +v 0.187500 -0.000000 0.875000 +v 0.125000 -0.000000 0.875000 +v 0.125000 0.562500 0.875000 +v 0.125000 -0.000000 0.812500 +v 0.125000 -0.000000 0.875000 +v 0.125000 0.562500 0.812500 +v 0.125000 -0.000000 0.812500 +v 0.187500 -0.000000 0.812500 +v 0.125000 -0.000000 0.812500 +v 0.250000 -0.000000 0.812500 +v 0.312500 -0.000000 0.750000 +v 0.312500 -0.000000 0.812500 +v 0.375000 -0.000000 0.812500 +v 0.375000 -0.000000 0.750000 +v 0.625000 -0.000000 0.750000 +v 0.687500 -0.000000 0.750000 +v 0.750000 -0.000000 0.750000 +v 0.812500 -0.000000 0.750000 +v 0.875000 -0.000000 0.750000 +v 0.875000 0.562500 0.750000 +v 0.875000 -0.000000 0.750000 +v 0.875000 0.562500 0.750000 +v 0.812500 0.562500 0.750000 +v 0.875000 0.562500 0.812500 +v 0.812500 0.562500 0.812500 +v 0.750000 0.562500 0.812500 +v 0.812500 0.562500 0.875000 +v 0.750000 0.562500 0.875000 +v 0.687500 0.562500 0.875000 +v 0.687500 0.562500 0.812500 +v 0.625000 0.562500 0.812500 +v 0.625000 0.562500 0.875000 +v 0.625000 -0.000000 0.875000 +v 0.625000 0.562500 0.875000 +v 0.375000 -0.000000 0.875000 +v 0.375000 -0.000000 0.875000 +v 0.625000 -0.000000 0.812500 +v 0.625000 -0.000000 0.875000 +v 0.312500 -0.000000 0.875000 +v 0.250000 -0.000000 0.875000 +v 0.187500 -0.000000 0.875000 +v 0.125000 -0.000000 0.875000 +v 0.687500 -0.000000 0.812500 +v 0.750000 -0.000000 0.812500 +v 0.812500 -0.000000 0.812500 +v 0.875000 -0.000000 0.812500 +v 0.875000 -0.000000 0.750000 +v 0.875000 0.562500 0.812500 +v 0.875000 -0.000000 0.812500 +v 0.875000 0.562500 0.875000 +v 0.875000 -0.000000 0.875000 +v 0.812500 0.562500 0.875000 +v 0.875000 -0.000000 0.875000 +v 0.875000 0.562500 0.875000 +v 0.812500 -0.000000 0.875000 +v 0.750000 0.562500 0.875000 +v 0.750000 -0.000000 0.875000 +v 0.687500 0.562500 0.875000 +v 0.750000 -0.000000 0.875000 +v 0.687500 -0.000000 0.875000 +v 0.625000 -0.000000 0.875000 +v 0.687500 -0.000000 0.875000 +v 0.750000 -0.000000 0.875000 +v 0.812500 -0.000000 0.875000 +v 0.875000 -0.000000 0.875000 +v 0.250000 0.562500 0.875000 +v 0.187500 0.562500 0.875000 +v 0.250000 0.562500 0.812500 +v 0.125000 -0.000000 0.375000 +v 0.125000 -0.000000 0.625000 +v 0.312500 0.687500 0.687500 +v 0.250000 0.687500 0.625000 +v 0.250000 0.687500 0.687500 +v 0.312500 0.687500 0.625000 +v 0.312500 0.750000 0.687500 +v 0.312500 0.687500 0.625000 +v 0.312500 0.687500 0.687500 +v 0.312500 0.750000 0.625000 +v 0.312500 0.875000 0.687500 +v 0.312500 0.937500 0.625000 +v 0.312500 0.875000 0.625000 +v 0.312500 0.937500 0.687500 +v 0.312500 0.875000 0.750000 +v 0.250000 0.875000 0.687500 +v 0.312500 0.875000 0.687500 +v 0.250000 0.875000 0.750000 +v 0.312500 1.000000 0.750000 +v 0.250000 0.937500 0.750000 +v 0.312500 0.937500 0.750000 +v 0.250000 1.000000 0.750000 +v 0.312500 1.000000 0.750000 +v 0.250000 1.000000 0.687500 +v 0.250000 1.000000 0.750000 +v 0.312500 1.000000 0.687500 +v 0.375000 1.000000 0.687500 +v 0.375000 1.000000 0.750000 +v 0.375000 0.937500 0.750000 +v 0.375000 1.000000 0.750000 +v 0.312500 0.937500 0.750000 +v 0.375000 0.937500 0.687500 +v 0.375000 0.937500 0.750000 +v 0.312500 0.937500 0.687500 +v 0.375000 0.875000 0.687500 +v 0.312500 0.937500 0.687500 +v 0.312500 0.875000 0.687500 +v 0.375000 0.937500 0.687500 +v 0.625000 0.875000 0.687500 +v 0.625000 0.937500 0.687500 +v 0.687500 0.937500 0.687500 +v 0.687500 0.875000 0.687500 +v 0.625000 0.875000 0.687500 +v 0.375000 0.875000 0.625000 +v 0.625000 0.875000 0.625000 +v 0.375000 0.875000 0.687500 +v 0.625000 0.750000 0.687500 +v 0.375000 0.750000 0.625000 +v 0.375000 0.750000 0.687500 +v 0.625000 0.750000 0.625000 +v 0.625000 0.750000 0.625000 +v 0.375000 0.875000 0.625000 +v 0.375000 0.750000 0.625000 +v 0.625000 0.875000 0.625000 +v 0.625000 0.750000 0.375000 +v 0.625000 0.875000 0.625000 +v 0.625000 0.750000 0.625000 +v 0.625000 0.875000 0.375000 +v 0.375000 0.875000 0.375000 +v 0.625000 0.875000 0.312500 +v 0.625000 0.875000 0.375000 +v 0.375000 0.875000 0.312500 +v 0.625000 0.750000 0.375000 +v 0.375000 0.750000 0.312500 +v 0.375000 0.750000 0.375000 +v 0.625000 0.750000 0.312500 +v 0.625000 0.687500 0.312500 +v 0.375000 0.750000 0.312500 +v 0.625000 0.750000 0.312500 +v 0.375000 0.687500 0.312500 +v 0.375000 0.687500 0.250000 +v 0.375000 0.687500 0.312500 +v 0.312500 0.687500 0.250000 +v 0.312500 0.687500 0.312500 +v 0.250000 0.687500 0.312500 +v 0.312500 0.687500 0.375000 +v 0.250000 0.687500 0.375000 +v 0.312500 0.687500 0.375000 +v 0.312500 0.750000 0.375000 +v 0.312500 0.750000 0.375000 +v 0.312500 0.750000 0.625000 +v 0.375000 0.875000 0.625000 +v 0.375000 0.750000 0.375000 +v 0.375000 0.750000 0.625000 +v 0.375000 0.875000 0.375000 +v 0.312500 0.875000 0.375000 +v 0.312500 0.875000 0.625000 +v 0.312500 0.937500 0.375000 +v 0.312500 0.875000 0.375000 +v 0.312500 0.937500 0.625000 +v 0.250000 0.937500 0.375000 +v 0.312500 0.937500 0.375000 +v 0.250000 0.937500 0.625000 +v 0.250000 0.937500 0.687500 +v 0.250000 1.000000 0.687500 +v 0.250000 0.937500 0.625000 +v 0.250000 0.937500 0.687500 +v 0.250000 1.000000 0.625000 +v 0.250000 1.000000 0.625000 +v 0.312500 1.000000 0.625000 +v 0.375000 1.000000 0.625000 +v 0.625000 1.000000 0.687500 +v 0.625000 1.000000 0.625000 +v 0.687500 1.000000 0.687500 +v 0.687500 1.000000 0.625000 +v 0.750000 1.000000 0.687500 +v 0.750000 1.000000 0.625000 +v 0.750000 1.000000 0.687500 +v 0.750000 0.937500 0.625000 +v 0.750000 1.000000 0.625000 +v 0.750000 0.937500 0.687500 +v 0.750000 1.000000 0.750000 +v 0.750000 0.937500 0.750000 +v 0.687500 1.000000 0.750000 +v 0.750000 0.937500 0.750000 +v 0.750000 1.000000 0.750000 +v 0.687500 0.937500 0.750000 +v 0.625000 1.000000 0.750000 +v 0.625000 0.937500 0.750000 +v 0.625000 0.937500 0.687500 +v 0.625000 0.937500 0.750000 +v 0.687500 0.937500 0.687500 +v 0.687500 0.937500 0.750000 +v 0.750000 0.875000 0.687500 +v 0.687500 0.875000 0.750000 +v 0.687500 0.875000 0.687500 +v 0.750000 0.875000 0.750000 +v 0.687500 0.875000 0.625000 +v 0.687500 0.937500 0.687500 +v 0.687500 0.875000 0.687500 +v 0.687500 0.937500 0.625000 +v 0.687500 0.875000 0.375000 +v 0.687500 0.937500 0.375000 +v 0.687500 0.875000 0.312500 +v 0.687500 0.937500 0.312500 +v 0.750000 0.875000 0.250000 +v 0.687500 0.875000 0.312500 +v 0.687500 0.875000 0.250000 +v 0.750000 0.875000 0.312500 +v 0.625000 0.937500 0.312500 +v 0.687500 0.937500 0.250000 +v 0.687500 0.937500 0.312500 +v 0.625000 0.937500 0.250000 +v 0.375000 0.937500 0.312500 +v 0.375000 0.937500 0.250000 +v 0.312500 0.937500 0.312500 +v 0.312500 0.937500 0.250000 +v 0.312500 0.937500 0.312500 +v 0.312500 0.875000 0.312500 +v 0.250000 0.937500 0.312500 +v 0.250000 0.937500 0.375000 +v 0.250000 1.000000 0.312500 +v 0.250000 0.937500 0.312500 +v 0.250000 1.000000 0.375000 +v 0.250000 1.000000 0.375000 +v 0.312500 1.000000 0.375000 +v 0.375000 1.000000 0.375000 +v 0.625000 1.000000 0.375000 +v 0.687500 1.000000 0.375000 +v 0.750000 1.000000 0.375000 +v 0.750000 0.937500 0.375000 +v 0.750000 1.000000 0.375000 +v 0.750000 0.937500 0.625000 +v 0.687500 0.937500 0.375000 +v 0.750000 0.937500 0.375000 +v 0.687500 0.937500 0.625000 +v 0.750000 0.937500 0.687500 +v 0.750000 0.937500 0.312500 +v 0.750000 1.000000 0.312500 +v 0.750000 0.937500 0.312500 +v 0.750000 1.000000 0.312500 +v 0.687500 1.000000 0.312500 +v 0.750000 1.000000 0.250000 +v 0.687500 1.000000 0.250000 +v 0.750000 0.937500 0.250000 +v 0.687500 1.000000 0.250000 +v 0.750000 1.000000 0.250000 +v 0.687500 0.937500 0.250000 +v 0.625000 0.937500 0.250000 +v 0.625000 1.000000 0.250000 +v 0.375000 1.000000 0.250000 +v 0.375000 0.937500 0.250000 +v 0.312500 1.000000 0.250000 +v 0.312500 0.937500 0.250000 +v 0.250000 1.000000 0.250000 +v 0.250000 0.937500 0.250000 +v 0.312500 0.875000 0.250000 +v 0.250000 0.875000 0.312500 +v 0.250000 0.875000 0.250000 +v 0.312500 0.875000 0.312500 +v 0.250000 1.000000 0.250000 +v 0.250000 0.937500 0.250000 +v 0.312500 1.000000 0.312500 +v 0.250000 1.000000 0.250000 +v 0.250000 1.000000 0.312500 +v 0.312500 1.000000 0.250000 +v 0.375000 1.000000 0.312500 +v 0.375000 1.000000 0.250000 +v 0.625000 1.000000 0.312500 +v 0.625000 1.000000 0.250000 +v 0.250000 0.937500 0.250000 +v 0.187500 0.937500 0.187500 +v 0.250000 0.937500 0.187500 +v 0.187500 0.937500 0.250000 +v 0.312500 0.937500 0.312500 +v 0.375000 0.875000 0.312500 +v 0.312500 0.875000 0.312500 +v 0.375000 0.937500 0.312500 +v 0.625000 0.875000 0.312500 +v 0.625000 0.937500 0.312500 +v 0.687500 0.937500 0.312500 +v 0.687500 0.875000 0.312500 +v 0.687500 0.687500 0.312500 +v 0.687500 0.750000 0.312500 +v 0.687500 0.750000 0.375000 +v 0.687500 0.687500 0.312500 +v 0.687500 0.750000 0.312500 +v 0.687500 0.687500 0.375000 +v 0.687500 0.750000 0.625000 +v 0.687500 0.687500 0.625000 +v 0.687500 0.750000 0.687500 +v 0.687500 0.687500 0.687500 +v 0.625000 0.750000 0.687500 +v 0.687500 0.687500 0.687500 +v 0.687500 0.750000 0.687500 +v 0.625000 0.687500 0.687500 +v 0.375000 0.750000 0.687500 +v 0.375000 0.687500 0.687500 +v 0.312500 0.750000 0.687500 +v 0.312500 0.687500 0.687500 +v 0.312500 0.687500 0.750000 +v 0.375000 0.687500 0.687500 +v 0.375000 0.687500 0.750000 +v 0.625000 0.687500 0.687500 +v 0.625000 0.687500 0.750000 +v 0.687500 0.687500 0.750000 +v 0.687500 0.687500 0.687500 +v 0.750000 0.687500 0.687500 +v 0.687500 0.687500 0.625000 +v 0.750000 0.687500 0.625000 +v 0.687500 0.687500 0.375000 +v 0.750000 0.687500 0.375000 +v 0.750000 0.687500 0.312500 +v 0.687500 0.875000 0.625000 +v 0.687500 0.875000 0.375000 +v 0.687500 0.750000 0.625000 +v 0.687500 0.750000 0.375000 +v 0.625000 0.750000 0.375000 +v 0.375000 0.875000 0.375000 +v 0.625000 0.875000 0.375000 +v 0.375000 0.750000 0.375000 +v 0.312500 0.750000 0.312500 +v 0.312500 0.687500 0.312500 +v 0.312500 0.750000 0.312500 +v 0.312500 0.687500 0.312500 +v 0.750000 0.937500 0.250000 +v 0.750000 1.000000 0.250000 +v 0.750000 0.937500 0.187500 +v 0.812500 0.937500 0.250000 +v 0.750000 0.937500 0.250000 +v 0.812500 0.937500 0.187500 +v 0.625000 1.000000 0.750000 +v 0.687500 1.000000 0.750000 +v 0.750000 1.000000 0.750000 +v 0.750000 0.937500 0.750000 +v 0.812500 0.937500 0.812500 +v 0.750000 0.937500 0.812500 +v 0.812500 0.937500 0.750000 +v 0.250000 1.000000 0.750000 +v 0.250000 0.937500 0.750000 +v 0.250000 0.937500 0.750000 +v 0.187500 0.937500 0.812500 +v 0.187500 0.937500 0.750000 +v 0.250000 0.937500 0.812500 +v 0.250000 0.562500 0.125000 +v 0.250000 -0.000000 0.125000 +v 0.312500 0.562500 0.187500 +v 0.312500 0.625000 0.187500 +v 0.375000 0.562500 0.187500 +v 0.375000 0.625000 0.187500 +v 0.187500 0.687500 0.187500 +v 0.250000 0.687500 0.187500 +v 0.187500 0.687500 0.187500 +v 0.250000 0.687500 0.250000 +v 0.250000 0.687500 0.187500 +v 0.187500 0.687500 0.250000 +v 0.187500 0.687500 0.187500 +v 0.187500 0.687500 0.250000 +v 0.062500 -0.000000 0.125000 +v 0.062500 0.562500 0.125000 +v 0.125000 0.562500 0.125000 +v 0.062500 0.562500 0.062500 +v 0.062500 0.562500 0.125000 +v 0.125000 0.562500 0.062500 +v 0.125000 -0.000000 0.062500 +v 0.125000 0.562500 0.062500 +v 0.125000 0.625000 0.125000 +v 0.187500 0.625000 0.125000 +v 0.125000 0.625000 0.125000 +v 0.187500 0.625000 0.187500 +v 0.187500 0.625000 0.125000 +v 0.125000 0.625000 0.187500 +v 0.125000 0.625000 0.125000 +v 0.125000 0.625000 0.187500 +v 0.125000 0.562500 0.187500 +v 0.125000 0.625000 0.187500 +v 0.187500 0.625000 0.125000 +v 0.187500 0.562500 0.125000 +v 0.250000 0.687500 0.187500 +v 0.250000 0.625000 0.187500 +v 0.187500 0.625000 0.250000 +v 0.187500 0.687500 0.250000 +v 0.750000 0.750000 0.250000 +v 0.687500 0.750000 0.250000 +v 0.687500 0.687500 0.250000 +v 0.687500 0.750000 0.312500 +v 0.687500 0.750000 0.250000 +v 0.687500 0.687500 0.312500 +v 0.812500 0.687500 0.187500 +v 0.750000 0.687500 0.187500 +v 0.750000 0.625000 0.187500 +v 0.750000 0.687500 0.250000 +v 0.750000 0.687500 0.187500 +v 0.750000 0.625000 0.250000 +v 0.250000 0.625000 0.750000 +v 0.187500 0.687500 0.750000 +v 0.250000 0.687500 0.750000 +v 0.187500 0.625000 0.750000 +v 0.250000 0.687500 0.812500 +v 0.250000 0.625000 0.750000 +v 0.250000 0.687500 0.750000 +v 0.250000 0.625000 0.812500 +v 0.187500 0.687500 0.812500 +v 0.250000 0.687500 0.812500 +v 0.187500 0.687500 0.750000 +v 0.187500 0.687500 0.812500 +v 0.875000 0.562500 0.187500 +v 0.812500 0.625000 0.187500 +v 0.812500 0.562500 0.187500 +v 0.875000 0.625000 0.187500 +v 0.875000 0.625000 0.187500 +v 0.875000 0.625000 0.125000 +v 0.812500 0.625000 0.125000 +v 0.875000 0.625000 0.125000 +v 0.812500 0.562500 0.125000 +v 0.812500 0.625000 0.187500 +v 0.812500 0.625000 0.125000 +v 0.812500 0.562500 0.187500 +v 0.875000 0.625000 0.187500 +v 0.812500 0.625000 0.125000 +v 0.812500 0.625000 0.187500 +v 0.875000 0.625000 0.125000 +v 0.812500 0.687500 0.250000 +v 0.812500 0.687500 0.187500 +v 0.750000 0.687500 0.187500 +v 0.812500 0.687500 0.250000 +v 0.812500 0.687500 0.187500 +v 0.750000 0.687500 0.250000 +v 0.750000 0.625000 0.250000 +v 0.812500 0.687500 0.250000 +v 0.750000 0.687500 0.250000 +v 0.812500 0.625000 0.250000 +v 0.812500 0.625000 0.750000 +v 0.812500 0.687500 0.750000 +v 0.750000 0.687500 0.750000 +v 0.812500 0.687500 0.812500 +v 0.812500 0.687500 0.750000 +v 0.750000 0.687500 0.812500 +v 0.750000 0.687500 0.812500 +v 0.750000 0.625000 0.812500 +v 0.187500 0.625000 0.875000 +v 0.187500 0.562500 0.812500 +v 0.187500 0.625000 0.812500 +v 0.187500 0.562500 0.875000 +v 0.125000 0.625000 0.875000 +v 0.187500 0.625000 0.875000 +v 0.125000 0.625000 0.812500 +v 0.125000 0.625000 0.875000 +v 0.125000 0.625000 0.812500 +v 0.187500 0.562500 0.812500 +v 0.125000 0.562500 0.812500 +v 0.187500 0.625000 0.812500 +v 0.125000 0.625000 0.812500 +v 0.187500 0.625000 0.875000 +v 0.187500 0.625000 0.812500 +v 0.125000 0.625000 0.875000 +v 0.125000 -0.000000 0.875000 +v 0.062500 0.562500 0.875000 +v 0.125000 0.562500 0.875000 +v 0.062500 -0.000000 0.875000 +v 0.125000 -0.000000 0.937500 +v 0.062500 -0.000000 0.875000 +v 0.062500 -0.000000 0.937500 +v 0.125000 -0.000000 0.937500 +v 0.062500 0.562500 0.937500 +v 0.062500 -0.000000 0.937500 +v 0.125000 0.562500 0.937500 +v 0.125000 -0.000000 0.875000 +v 0.125000 0.562500 0.937500 +v 0.125000 -0.000000 0.937500 +v 0.125000 0.562500 0.875000 +v 0.875000 0.562500 0.812500 +v 0.875000 0.625000 0.812500 +v 0.812500 0.625000 0.812500 +v 0.875000 0.625000 0.875000 +v 0.875000 0.625000 0.812500 +v 0.812500 0.625000 0.875000 +v 0.812500 0.625000 0.875000 +v 0.812500 0.562500 0.875000 +v 0.937500 -0.000000 0.875000 +v 0.875000 -0.000000 0.875000 +v 0.937500 0.562500 0.875000 +v 0.875000 0.562500 0.875000 +v 0.937500 0.562500 0.937500 +v 0.937500 0.562500 0.875000 +v 0.875000 0.562500 0.937500 +v 0.875000 -0.000000 0.875000 +v 0.875000 0.562500 0.937500 +v 0.875000 -0.000000 0.937500 +v 0.937500 -0.000000 0.875000 +v 0.875000 -0.000000 0.937500 +v 0.937500 -0.000000 0.937500 +v 0.937500 -0.000000 0.875000 +v 0.937500 0.562500 0.937500 +v 0.937500 -0.000000 0.937500 +v 0.937500 0.562500 0.875000 +v 0.875000 0.562500 0.937500 +v 0.937500 -0.000000 0.937500 +v 0.937500 0.562500 0.937500 +v 0.875000 -0.000000 0.937500 +v 0.812500 0.625000 0.875000 +v 0.875000 0.625000 0.875000 +v 0.875000 0.625000 0.875000 +v 0.875000 0.625000 0.812500 +v 0.062500 0.562500 0.875000 +v 0.125000 0.562500 0.937500 +v 0.125000 0.562500 0.875000 +v 0.062500 0.562500 0.937500 +v 0.062500 -0.000000 0.875000 +v 0.062500 0.562500 0.937500 +v 0.062500 0.562500 0.875000 +v 0.062500 -0.000000 0.937500 +v 0.750000 0.687500 0.812500 +v 0.812500 0.687500 0.812500 +v 0.812500 0.687500 0.812500 +v 0.812500 0.687500 0.750000 +v 0.312500 0.875000 0.687500 +v 0.250000 0.937500 0.687500 +v 0.312500 0.937500 0.687500 +v 0.250000 0.875000 0.687500 +v 0.250000 0.875000 0.750000 +v 0.312500 0.875000 0.750000 +v 0.312500 0.937500 0.750000 +v 0.312500 0.875000 0.687500 +v 0.312500 0.937500 0.687500 +v 0.312500 0.875000 0.750000 +v 0.625000 0.875000 0.687500 +v 0.625000 0.750000 0.687500 +v 0.375000 0.750000 0.687500 +v 0.375000 0.875000 0.625000 +v 0.375000 0.875000 0.687500 +v 0.375000 0.750000 0.625000 +v 0.625000 0.875000 0.375000 +v 0.625000 0.750000 0.312500 +v 0.625000 0.750000 0.375000 +v 0.625000 0.875000 0.312500 +v 0.375000 0.875000 0.312500 +v 0.375000 0.750000 0.312500 +v 0.312500 0.750000 0.250000 +v 0.312500 0.687500 0.250000 +v 0.250000 0.750000 0.250000 +v 0.312500 0.750000 0.312500 +v 0.312500 0.750000 0.250000 +v 0.250000 0.750000 0.312500 +v 0.250000 0.750000 0.250000 +v 0.250000 0.750000 0.312500 +v 0.250000 0.750000 0.250000 +v 0.312500 0.750000 0.250000 +v 0.250000 0.687500 0.312500 +v 0.250000 0.750000 0.312500 +v 0.375000 0.750000 0.625000 +v 0.312500 0.875000 0.625000 +v 0.375000 0.875000 0.625000 +v 0.312500 0.750000 0.625000 +v 0.687500 0.937500 0.750000 +v 0.687500 0.875000 0.750000 +v 0.750000 0.875000 0.687500 +v 0.750000 0.875000 0.750000 +v 0.750000 0.875000 0.687500 +v 0.750000 0.937500 0.687500 +v 0.750000 0.875000 0.312500 +v 0.687500 0.937500 0.312500 +v 0.687500 0.875000 0.312500 +v 0.750000 0.937500 0.312500 +v 0.750000 0.875000 0.250000 +v 0.750000 0.875000 0.312500 +v 0.750000 0.875000 0.250000 +v 0.687500 0.875000 0.250000 +v 0.687500 0.937500 0.312500 +v 0.687500 0.875000 0.250000 +v 0.687500 0.875000 0.312500 +v 0.687500 0.937500 0.250000 +v 0.312500 0.875000 0.250000 +v 0.312500 0.937500 0.250000 +v 0.250000 0.875000 0.250000 +v 0.312500 0.875000 0.250000 +v 0.250000 0.875000 0.312500 +v 0.250000 0.937500 0.312500 +v 0.250000 0.875000 0.312500 +v 0.250000 0.875000 0.250000 +v 0.187500 0.937500 0.250000 +v 0.187500 1.000000 0.250000 +v 0.250000 1.062500 0.250000 +v 0.187500 1.062500 0.250000 +v 0.250000 1.062500 0.250000 +v 0.187500 1.062500 0.187500 +v 0.187500 1.062500 0.250000 +v 0.250000 1.062500 0.187500 +v 0.250000 1.062500 0.250000 +v 0.250000 1.000000 0.187500 +v 0.250000 1.062500 0.187500 +v 0.250000 0.937500 0.187500 +v 0.187500 1.000000 0.250000 +v 0.187500 0.937500 0.187500 +v 0.187500 0.937500 0.250000 +v 0.187500 1.000000 0.187500 +v 0.187500 1.062500 0.187500 +v 0.187500 1.062500 0.250000 +v 0.187500 1.062500 0.187500 +v 0.250000 1.000000 0.187500 +v 0.187500 1.000000 0.187500 +v 0.250000 1.062500 0.187500 +v 0.250000 0.937500 0.187500 +v 0.187500 0.937500 0.187500 +v 0.312500 0.687500 0.687500 +v 0.250000 0.750000 0.687500 +v 0.312500 0.750000 0.687500 +v 0.250000 0.687500 0.687500 +v 0.250000 0.750000 0.750000 +v 0.250000 0.750000 0.687500 +v 0.250000 0.750000 0.750000 +v 0.312500 0.750000 0.750000 +v 0.312500 0.687500 0.687500 +v 0.312500 0.750000 0.750000 +v 0.312500 0.687500 0.750000 +v 0.312500 0.750000 0.687500 +v 0.250000 0.750000 0.687500 +v 0.312500 0.750000 0.750000 +v 0.312500 0.750000 0.687500 +v 0.250000 0.750000 0.750000 +v 0.687500 0.750000 0.750000 +v 0.687500 0.687500 0.750000 +v 0.687500 0.750000 0.750000 +v 0.750000 0.750000 0.687500 +v 0.687500 0.750000 0.687500 +v 0.750000 0.750000 0.750000 +v 0.687500 0.750000 0.750000 +v 0.750000 0.750000 0.750000 +v 0.750000 0.750000 0.750000 +v 0.750000 0.750000 0.687500 +v 0.750000 0.687500 0.687500 +v 0.750000 0.750000 0.687500 +v 0.750000 0.687500 0.312500 +v 0.687500 0.750000 0.312500 +v 0.687500 0.687500 0.312500 +v 0.750000 0.750000 0.312500 +v 0.750000 0.750000 0.312500 +v 0.750000 0.750000 0.250000 +v 0.750000 0.750000 0.250000 +v 0.687500 0.750000 0.312500 +v 0.750000 0.750000 0.312500 +v 0.687500 0.750000 0.250000 +v 0.687500 0.875000 0.625000 +v 0.687500 0.750000 0.625000 +v 0.625000 0.750000 0.375000 +v 0.687500 0.875000 0.375000 +v 0.625000 0.875000 0.375000 +v 0.687500 0.750000 0.375000 +v 0.312500 0.875000 0.375000 +v 0.312500 0.750000 0.375000 +v 0.750000 1.000000 0.250000 +v 0.750000 0.937500 0.187500 +v 0.750000 0.937500 0.250000 +v 0.750000 1.000000 0.187500 +v 0.750000 1.062500 0.250000 +v 0.750000 1.062500 0.187500 +v 0.812500 1.062500 0.250000 +v 0.750000 1.062500 0.187500 +v 0.750000 1.062500 0.250000 +v 0.812500 1.062500 0.187500 +v 0.812500 1.062500 0.250000 +v 0.812500 1.000000 0.187500 +v 0.812500 1.062500 0.187500 +v 0.812500 1.000000 0.250000 +v 0.750000 1.062500 0.250000 +v 0.812500 1.000000 0.250000 +v 0.812500 1.062500 0.250000 +v 0.750000 1.000000 0.250000 +v 0.812500 0.937500 0.250000 +v 0.750000 0.937500 0.250000 +v 0.750000 0.937500 0.187500 +v 0.812500 1.000000 0.187500 +v 0.812500 0.937500 0.187500 +v 0.750000 1.000000 0.187500 +v 0.812500 1.062500 0.187500 +v 0.750000 1.062500 0.187500 +v 0.812500 0.937500 0.187500 +v 0.812500 0.937500 0.250000 +v 0.750000 0.875000 0.750000 +v 0.687500 0.875000 0.750000 +v 0.812500 0.937500 0.750000 +v 0.812500 1.000000 0.750000 +v 0.750000 1.062500 0.750000 +v 0.812500 1.062500 0.750000 +v 0.750000 1.062500 0.750000 +v 0.812500 1.062500 0.812500 +v 0.812500 1.062500 0.750000 +v 0.750000 1.062500 0.812500 +v 0.750000 1.062500 0.812500 +v 0.750000 1.062500 0.750000 +v 0.750000 1.000000 0.812500 +v 0.750000 0.937500 0.812500 +v 0.812500 0.937500 0.750000 +v 0.812500 1.000000 0.812500 +v 0.812500 0.937500 0.812500 +v 0.812500 1.000000 0.750000 +v 0.812500 1.062500 0.812500 +v 0.812500 1.062500 0.750000 +v 0.750000 1.062500 0.812500 +v 0.812500 1.000000 0.812500 +v 0.812500 1.062500 0.812500 +v 0.750000 1.000000 0.812500 +v 0.812500 0.937500 0.812500 +v 0.750000 0.937500 0.812500 +v 0.250000 0.875000 0.750000 +v 0.250000 0.875000 0.687500 +v 0.250000 0.937500 0.750000 +v 0.187500 1.000000 0.750000 +v 0.250000 1.000000 0.750000 +v 0.187500 0.937500 0.750000 +v 0.250000 0.937500 0.750000 +v 0.250000 1.000000 0.812500 +v 0.250000 0.937500 0.812500 +v 0.250000 1.000000 0.750000 +v 0.250000 1.062500 0.812500 +v 0.250000 1.062500 0.750000 +v 0.187500 1.062500 0.750000 +v 0.250000 1.062500 0.750000 +v 0.187500 1.000000 0.812500 +v 0.187500 1.062500 0.750000 +v 0.187500 1.000000 0.750000 +v 0.187500 1.062500 0.812500 +v 0.250000 1.000000 0.812500 +v 0.187500 1.062500 0.812500 +v 0.187500 1.000000 0.812500 +v 0.250000 1.062500 0.812500 +v 0.250000 1.062500 0.750000 +v 0.187500 1.062500 0.812500 +v 0.250000 1.062500 0.812500 +v 0.187500 1.062500 0.750000 +v 0.250000 0.937500 0.812500 +v 0.187500 0.937500 0.812500 +v 0.187500 0.937500 0.750000 +v 0.187500 0.937500 0.812500 +v 0.187500 0.687500 0.812500 +v 0.250000 0.687500 0.750000 +v 0.187500 0.687500 0.750000 +v 0.250000 0.687500 0.812500 +v 0.937500 -0.000000 0.125000 +v 0.875000 0.562500 0.125000 +v 0.875000 -0.000000 0.125000 +v 0.937500 0.562500 0.125000 +v 0.937500 -0.000000 0.062500 +v 0.937500 0.562500 0.125000 +v 0.937500 -0.000000 0.125000 +v 0.937500 0.562500 0.062500 +v 0.937500 -0.000000 0.062500 +v 0.875000 0.562500 0.062500 +v 0.937500 0.562500 0.062500 +v 0.875000 -0.000000 0.062500 +v 0.937500 -0.000000 0.062500 +v 0.875000 -0.000000 0.062500 +v 0.937500 -0.000000 0.125000 +v 0.875000 0.562500 0.125000 +v 0.875000 -0.000000 0.062500 +v 0.875000 -0.000000 0.125000 +v 0.875000 0.562500 0.062500 +v 0.937500 0.562500 0.125000 +v 0.875000 0.562500 0.062500 +v 0.875000 0.562500 0.125000 +v 0.937500 0.562500 0.062500 +v 0.062500 -0.000000 0.125000 +v 0.125000 -0.000000 0.062500 +v 0.062500 -0.000000 0.062500 +v 0.062500 -0.000000 0.125000 +v 0.062500 0.562500 0.062500 +v 0.062500 -0.000000 0.062500 +v 0.062500 0.562500 0.125000 +v 0.062500 0.562500 0.062500 +v 0.125000 -0.000000 0.062500 +v 0.062500 -0.000000 0.062500 +v 0.125000 0.562500 0.062500 +vt 1.000000 0.250000 +vt 0.000000 0.750000 +vt 0.000000 0.250000 +vt 1.000000 0.750000 +vt 0.062500 1.000000 +vt 0.000000 0.937500 +vt 0.062500 0.937500 +vt 0.000000 1.000000 +vt 1.000000 0.937500 +vt 0.937500 1.000000 +vt 0.937500 0.937500 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.937500 0.062500 +vt 0.937500 0.000000 +vt 1.000000 0.062500 +vt 0.062500 0.000000 +vt 0.000000 0.062500 +vt 0.000000 0.000000 +vt 0.062500 0.062500 +vt 0.812500 0.625000 +vt 0.750000 0.562500 +vt 0.812500 0.562500 +vt 0.750000 0.625000 +vt 0.187500 0.562500 +vt 0.250000 0.625000 +vt 0.187500 0.625000 +vt 0.250000 0.562500 +vt 0.125000 0.812500 +vt 0.187500 0.750000 +vt 0.187500 0.812500 +vt 0.125000 0.750000 +vt 0.250000 0.000000 +vt 0.187500 0.000000 +vt 0.125000 0.625000 +vt 0.125000 0.000000 +vt 0.875000 0.562500 +vt 0.812500 0.000000 +vt 0.875000 0.000000 +vt 0.250000 0.812500 +vt 0.187500 0.875000 +vt 0.250000 0.875000 +vt 0.312500 0.812500 +vt 0.312500 0.875000 +vt 0.375000 0.812500 +vt 0.375000 0.875000 +vt 0.625000 0.812500 +vt 0.625000 0.875000 +vt 0.687500 0.875000 +vt 0.687500 0.812500 +vt 0.375000 0.625000 +vt 0.312500 0.562500 +vt 0.375000 0.562500 +vt 0.312500 0.625000 +vt 0.687500 0.750000 +vt 0.625000 0.750000 +vt 0.375000 0.750000 +vt 0.312500 0.750000 +vt 0.250000 0.750000 +vt 0.250000 0.687500 +vt 0.187500 0.687500 +vt 0.125000 0.687500 +vt 0.312500 0.000000 +vt 0.187500 0.250000 +vt 0.125000 0.312500 +vt 0.125000 0.250000 +vt 0.187500 0.312500 +vt 0.250000 0.250000 +vt 0.250000 0.312500 +vt 0.312500 0.250000 +vt 0.312500 0.312500 +vt 0.375000 0.250000 +vt 0.375000 0.312500 +vt 0.625000 0.250000 +vt 0.625000 0.312500 +vt 0.687500 0.250000 +vt 0.687500 0.312500 +vt 0.750000 0.250000 +vt 0.750000 0.312500 +vt 0.812500 0.250000 +vt 0.812500 0.312500 +vt 0.875000 0.312500 +vt 0.875000 0.250000 +vt 0.875000 0.187500 +vt 0.812500 0.187500 +vt 0.750000 0.187500 +vt 0.687500 0.187500 +vt 0.625000 0.187500 +vt 0.375000 0.187500 +vt 0.312500 0.187500 +vt 0.250000 0.187500 +vt 0.187500 0.187500 +vt 0.125000 0.187500 +vt 0.187500 0.125000 +vt 0.125000 0.125000 +vt 0.250000 0.125000 +vt 0.312500 0.125000 +vt 0.375000 0.125000 +vt 0.687500 0.562500 +vt 0.625000 0.000000 +vt 0.687500 0.000000 +vt 0.625000 0.562500 +vt 0.375000 0.000000 +vt 0.750000 0.875000 +vt 0.750000 0.812500 +vt 0.750000 0.750000 +vt 0.312500 0.687500 +vt 0.625000 0.687500 +vt 0.687500 0.687500 +vt 0.375000 0.687500 +vt 0.625000 0.625000 +vt 0.687500 0.625000 +vt 0.750000 0.687500 +vt 0.250000 0.375000 +vt 0.187500 0.375000 +vt 0.125000 0.375000 +vt 0.312500 0.375000 +vt 0.375000 0.375000 +vt 0.625000 0.375000 +vt 0.687500 0.375000 +vt 0.750000 0.375000 +vt 0.812500 0.375000 +vt 0.875000 0.375000 +vt 0.750000 0.000000 +vt 0.125000 0.562500 +vt 0.812500 0.125000 +vt 0.875000 0.125000 +vt 0.750000 0.125000 +vt 0.687500 0.125000 +vt 0.625000 0.125000 +vt 0.812500 0.875000 +vt 0.812500 0.812500 +vt 0.875000 0.625000 +vt 0.875000 0.750000 +vt 0.875000 0.812500 +vt 0.812500 0.750000 +vt 0.875000 0.687500 +vt 0.812500 0.687500 +vt 0.125000 0.875000 +vt 0.875000 0.875000 +vt 0.625000 0.937500 +vt 0.687500 0.937500 +vt 0.312500 1.000000 +vt 0.250000 0.937500 +vt 0.312500 0.937500 +vt 0.250000 1.000000 +vt 0.375000 0.937500 +vt 0.375000 1.000000 +vt 0.687500 1.000000 +vt 0.625000 1.000000 +vt 0.750000 0.937500 +vt 0.750000 1.000000 +vt 1.000000 0.625000 +vt 1.000000 0.687500 +vt 0.937500 0.625000 +vt 0.937500 0.687500 +vt 0.000000 0.687500 +vt 0.062500 0.625000 +vt 0.062500 0.687500 +vt 0.000000 0.625000 +vt 0.062500 0.562500 +vt 0.000000 0.562500 +vt 0.062500 0.875000 +vt 0.125000 0.937500 +vt 0.937500 0.562500 +vt 1.000000 0.562500 +vt 0.062500 0.750000 +vt 0.937500 0.125000 +vt 0.875000 0.062500 +vt 0.062500 0.125000 +vt 0.125000 0.062500 +vt 1.000000 0.875000 +vt 0.937500 0.750000 +vt 0.937500 0.875000 +vt 0.000000 0.875000 +vt 0.875000 0.937500 +vn 0.000000 0.000000 1.000000 +vn 1.000000 0.000000 0.000000 +vn -1.000000 0.000000 0.000000 +vn 0.000000 0.000000 -1.000000 +vn 0.000000 -1.000000 0.000000 +vn 0.000000 1.000000 0.000000 +usemtl lava +s 1 +f 461/1/1 462/2/1 463/3/1 +f 462/2/1 461/1/1 464/4/1 +f 465/1/2 466/2/2 467/3/2 +f 466/2/2 465/1/2 468/4/2 +f 492/4/3 493/3/3 494/1/3 +f 493/3/3 492/4/3 495/2/3 +f 658/3/4 659/4/4 660/2/4 +f 659/4/4 658/3/4 661/1/4 +usemtl main +f 1/21/4 2/22/4 3/23/4 +f 2/22/4 1/21/4 4/24/4 +f 5/25/3 6/26/3 7/27/3 +f 6/26/3 5/25/3 8/28/3 +f 9/29/6 10/30/6 11/31/6 +f 10/30/6 9/29/6 12/32/6 +f 13/27/3 14/33/3 15/26/3 +f 14/33/3 13/27/3 16/34/3 +f 17/35/3 16/34/3 13/27/3 +f 16/34/3 17/35/3 18/36/3 +f 19/37/4 20/38/4 21/39/4 +f 20/38/4 19/37/4 22/23/4 +f 23/40/6 24/41/6 11/31/6 +f 24/41/6 23/40/6 25/42/6 +f 26/43/6 25/42/6 23/40/6 +f 25/42/6 26/43/6 27/44/6 +f 28/45/6 27/44/6 26/43/6 +f 27/44/6 28/45/6 29/46/6 +f 30/47/6 29/46/6 28/45/6 +f 29/46/6 30/47/6 31/48/6 +f 30/47/6 32/49/6 31/48/6 +f 32/49/6 30/47/6 33/50/6 +f 34/51/4 35/52/4 36/53/4 +f 35/52/4 34/51/4 37/54/4 +f 38/47/6 39/55/6 40/50/6 +f 39/55/6 38/47/6 41/56/6 +f 42/45/6 41/56/6 38/47/6 +f 41/56/6 42/45/6 43/57/6 +f 44/43/6 43/57/6 42/45/6 +f 43/57/6 44/43/6 45/58/6 +f 46/40/6 45/58/6 44/43/6 +f 45/58/6 46/40/6 47/59/6 +f 48/30/6 49/60/6 47/59/6 +f 49/60/6 48/30/6 50/61/6 +f 8/28/3 51/54/3 6/26/3 +f 51/54/3 8/28/3 52/52/3 +f 12/32/6 53/61/6 10/30/6 +f 53/61/6 12/32/6 54/62/6 +f 15/26/3 55/63/3 56/54/3 +f 55/63/3 15/26/3 14/33/3 +f 57/64/5 58/65/5 59/66/5 +f 58/65/5 57/64/5 60/67/5 +f 61/68/5 60/67/5 57/64/5 +f 60/67/5 61/68/5 62/69/5 +f 63/70/5 62/69/5 61/68/5 +f 62/69/5 63/70/5 64/71/5 +f 65/72/5 64/71/5 63/70/5 +f 64/71/5 65/72/5 66/73/5 +f 67/74/5 66/73/5 65/72/5 +f 66/73/5 67/74/5 68/75/5 +f 69/76/5 68/75/5 67/74/5 +f 68/75/5 69/76/5 70/77/5 +f 71/78/5 70/77/5 69/76/5 +f 70/77/5 71/78/5 72/79/5 +f 73/80/5 72/79/5 71/78/5 +f 72/79/5 73/80/5 74/81/5 +f 73/80/5 75/82/5 74/81/5 +f 75/82/5 73/80/5 76/83/5 +f 73/80/5 77/84/5 76/83/5 +f 77/84/5 73/80/5 78/85/5 +f 73/80/5 79/86/5 78/85/5 +f 79/86/5 73/80/5 71/78/5 +f 71/78/5 80/87/5 79/86/5 +f 80/87/5 71/78/5 69/76/5 +f 69/76/5 81/88/5 80/87/5 +f 81/88/5 69/76/5 67/74/5 +f 65/72/5 81/88/5 67/74/5 +f 81/88/5 65/72/5 82/89/5 +f 63/70/5 82/89/5 65/72/5 +f 82/89/5 63/70/5 83/90/5 +f 61/68/5 83/90/5 63/70/5 +f 83/90/5 61/68/5 84/91/5 +f 57/64/5 84/91/5 61/68/5 +f 84/91/5 57/64/5 85/92/5 +f 59/66/5 85/92/5 57/64/5 +f 85/92/5 59/66/5 86/93/5 +f 86/93/5 87/94/5 85/92/5 +f 87/94/5 86/93/5 88/95/5 +f 89/96/5 85/92/5 87/94/5 +f 85/92/5 89/96/5 84/91/5 +f 90/97/5 84/91/5 89/96/5 +f 84/91/5 90/97/5 83/90/5 +f 90/97/5 82/89/5 83/90/5 +f 82/89/5 90/97/5 91/98/5 +f 92/99/4 93/100/4 94/101/4 +f 93/100/4 92/99/4 95/102/4 +f 95/102/4 96/103/4 97/100/4 +f 96/103/4 95/102/4 98/53/4 +f 98/53/4 99/63/4 100/103/4 +f 99/63/4 98/53/4 101/52/4 +f 101/52/4 102/33/4 103/63/4 +f 102/33/4 101/52/4 104/28/4 +f 33/50/6 105/104/6 32/49/6 +f 105/104/6 33/50/6 106/105/6 +f 37/54/4 107/28/4 35/52/4 +f 107/28/4 37/54/4 108/26/4 +f 40/50/6 109/106/6 110/105/6 +f 109/106/6 40/50/6 39/55/6 +f 111/107/4 112/26/4 113/54/4 +f 112/26/4 111/107/4 114/60/4 +f 115/55/6 116/108/6 117/109/6 +f 116/108/6 115/55/6 118/56/6 +f 113/54/4 119/110/4 111/107/4 +f 119/110/4 113/54/4 120/51/4 +f 120/51/4 121/108/4 119/110/4 +f 121/108/4 120/51/4 122/111/4 +f 122/111/4 123/109/4 121/108/4 +f 123/109/4 122/111/4 124/112/4 +f 124/112/4 125/113/4 123/109/4 +f 125/113/4 124/112/4 126/24/4 +f 127/54/3 128/60/3 129/26/3 +f 128/60/3 127/54/3 130/107/3 +f 131/51/3 130/107/3 127/54/3 +f 130/107/3 131/51/3 132/110/3 +f 131/51/3 133/108/3 132/110/3 +f 133/108/3 131/51/3 134/111/3 +f 135/27/6 136/114/6 137/26/6 +f 136/114/6 135/27/6 138/115/6 +f 139/51/3 140/102/3 141/111/3 +f 140/102/3 139/51/3 142/53/3 +f 139/51/3 52/52/3 142/53/3 +f 52/52/3 139/51/3 51/54/3 +f 137/26/6 50/61/6 135/27/6 +f 50/61/6 137/26/6 49/60/6 +f 54/62/6 143/27/6 53/61/6 +f 143/27/6 54/62/6 144/35/6 +f 56/54/3 145/103/3 146/51/3 +f 145/103/3 56/54/3 55/63/3 +f 60/67/5 147/116/5 58/65/5 +f 147/116/5 60/67/5 148/115/5 +f 62/69/5 148/115/5 60/67/5 +f 148/115/5 62/69/5 149/114/5 +f 64/71/5 149/114/5 62/69/5 +f 149/114/5 64/71/5 150/117/5 +f 66/73/5 150/117/5 64/71/5 +f 150/117/5 66/73/5 151/118/5 +f 68/75/5 151/118/5 66/73/5 +f 151/118/5 68/75/5 152/119/5 +f 68/75/5 153/120/5 152/119/5 +f 153/120/5 68/75/5 70/77/5 +f 72/79/5 153/120/5 70/77/5 +f 153/120/5 72/79/5 154/121/5 +f 72/79/5 155/122/5 154/121/5 +f 155/122/5 72/79/5 74/81/5 +f 74/81/5 156/123/5 155/122/5 +f 156/123/5 74/81/5 75/82/5 +f 157/101/2 158/102/2 159/100/2 +f 158/102/2 157/101/2 160/99/2 +f 161/124/2 160/99/2 162/101/2 +f 160/99/2 161/124/2 163/22/2 +f 164/38/2 163/22/2 165/124/2 +f 163/22/2 164/38/2 166/23/2 +f 167/39/2 166/23/2 164/38/2 +f 166/23/2 167/39/2 168/37/2 +f 169/36/4 170/25/4 171/125/4 +f 170/25/4 169/36/4 172/34/4 +f 77/84/5 173/126/5 174/127/5 +f 173/126/5 77/84/5 78/85/5 +f 79/86/5 173/126/5 78/85/5 +f 173/126/5 79/86/5 175/128/5 +f 80/87/5 175/128/5 79/86/5 +f 175/128/5 80/87/5 176/129/5 +f 81/88/5 176/129/5 80/87/5 +f 176/129/5 81/88/5 177/130/5 +f 82/89/5 177/130/5 81/88/5 +f 177/130/5 82/89/5 91/98/5 +f 178/33/4 170/25/4 179/34/4 +f 170/25/4 178/33/4 104/28/4 +f 106/105/6 180/131/6 105/104/6 +f 180/131/6 106/105/6 181/132/6 +f 107/28/4 182/27/4 183/25/4 +f 182/27/4 107/28/4 108/26/4 +f 184/109/2 185/24/2 186/113/2 +f 185/24/2 184/109/2 187/112/2 +f 188/108/2 187/112/2 184/109/2 +f 187/112/2 188/108/2 189/111/2 +f 190/110/2 189/111/2 188/108/2 +f 189/111/2 190/110/2 191/51/2 +f 192/107/2 191/51/2 190/110/2 +f 191/51/2 192/107/2 193/54/2 +f 194/60/2 193/54/2 192/107/2 +f 193/54/2 194/60/2 195/26/2 +f 196/109/1 197/24/1 198/113/1 +f 197/24/1 196/109/1 199/112/1 +f 200/108/1 199/112/1 196/109/1 +f 199/112/1 200/108/1 201/111/1 +f 202/110/1 201/111/1 200/108/1 +f 201/111/1 202/110/1 203/51/1 +f 204/107/1 203/51/1 202/110/1 +f 203/51/1 204/107/1 205/54/1 +f 206/60/1 205/54/1 204/107/1 +f 205/54/1 206/60/1 207/26/1 +f 208/68/6 209/67/6 210/64/6 +f 209/67/6 208/68/6 211/69/6 +f 212/24/3 213/109/3 214/112/3 +f 213/109/3 212/24/3 215/113/3 +f 216/24/3 217/23/3 218/21/3 +f 217/23/3 216/24/3 219/22/3 +f 220/112/3 219/22/3 216/24/3 +f 219/22/3 220/112/3 221/99/3 +f 141/111/3 221/99/3 220/112/3 +f 221/99/3 141/111/3 140/102/3 +f 222/116/6 223/67/6 224/115/6 +f 223/67/6 222/116/6 225/65/6 +f 226/100/3 227/112/3 228/111/3 +f 227/112/3 226/100/3 229/101/3 +f 230/35/5 231/61/5 232/62/5 +f 231/61/5 230/35/5 233/27/5 +f 147/116/5 233/27/5 230/35/5 +f 233/27/5 147/116/5 148/115/5 +f 148/115/5 234/26/5 233/27/5 +f 234/26/5 148/115/5 149/114/5 +f 150/117/5 234/26/5 149/114/5 +f 234/26/5 150/117/5 235/54/5 +f 150/117/5 236/51/5 235/54/5 +f 236/51/5 150/117/5 151/118/5 +f 152/119/5 236/51/5 151/118/5 +f 236/51/5 152/119/5 237/111/5 +f 153/120/5 237/111/5 152/119/5 +f 237/111/5 153/120/5 238/112/5 +f 153/120/5 239/24/5 238/112/5 +f 239/24/5 153/120/5 154/121/5 +f 155/122/5 239/24/5 154/121/5 +f 239/24/5 155/122/5 240/21/5 +f 156/123/5 240/21/5 155/122/5 +f 240/21/5 156/123/5 241/133/5 +f 242/100/2 243/53/2 244/103/2 +f 243/53/2 242/100/2 158/102/2 +f 245/21/6 246/123/6 247/133/6 +f 246/123/6 245/21/6 248/122/6 +f 249/102/2 250/51/2 251/53/2 +f 250/51/2 249/102/2 252/111/2 +f 253/99/2 252/111/2 249/102/2 +f 252/111/2 253/99/2 254/112/2 +f 255/22/2 254/112/2 253/99/2 +f 254/112/2 255/22/2 256/24/2 +f 257/23/2 256/24/2 255/22/2 +f 256/24/2 257/23/2 258/21/2 +f 181/132/6 259/134/6 260/135/6 +f 259/134/6 181/132/6 261/136/6 +f 261/136/6 262/137/6 259/134/6 +f 262/137/6 261/136/6 263/138/6 +f 263/138/6 247/133/6 262/137/6 +f 247/133/6 263/138/6 245/21/6 +f 264/113/6 265/136/6 109/106/6 +f 265/136/6 264/113/6 266/138/6 +f 264/113/6 267/21/6 266/138/6 +f 267/21/6 264/113/6 268/24/6 +f 268/24/6 269/122/6 267/21/6 +f 269/122/6 268/24/6 270/121/6 +f 270/121/6 271/81/6 269/122/6 +f 271/81/6 270/121/6 272/79/6 +f 273/78/6 271/81/6 272/79/6 +f 271/81/6 273/78/6 274/80/6 +f 275/76/6 276/86/6 273/78/6 +f 276/86/6 275/76/6 277/87/6 +f 278/74/6 277/87/6 275/76/6 +f 277/87/6 278/74/6 279/88/6 +f 278/74/6 280/89/6 279/88/6 +f 280/89/6 278/74/6 281/72/6 +f 282/70/6 280/89/6 281/72/6 +f 280/89/6 282/70/6 283/90/6 +f 208/68/6 283/90/6 282/70/6 +f 283/90/6 208/68/6 284/91/6 +f 285/26/1 286/52/1 287/54/1 +f 286/52/1 285/26/1 288/28/1 +f 289/27/1 288/28/1 285/26/1 +f 288/28/1 289/27/1 290/25/1 +f 291/92/6 292/66/6 293/93/6 +f 292/66/6 291/92/6 294/64/6 +f 223/67/6 292/66/6 294/64/6 +f 292/66/6 223/67/6 225/65/6 +f 295/101/3 296/24/3 227/112/3 +f 296/24/3 295/101/3 297/124/3 +f 231/61/5 298/32/5 232/62/5 +f 298/32/5 231/61/5 299/30/5 +f 231/61/5 300/59/5 299/30/5 +f 300/59/5 231/61/5 301/60/5 +f 231/61/5 234/26/5 301/60/5 +f 234/26/5 231/61/5 233/27/5 +f 234/26/5 302/107/5 301/60/5 +f 302/107/5 234/26/5 235/54/5 +f 236/51/5 302/107/5 235/54/5 +f 302/107/5 236/51/5 303/110/5 +f 236/51/5 304/108/5 303/110/5 +f 304/108/5 236/51/5 237/111/5 +f 237/111/5 305/109/5 304/108/5 +f 305/109/5 237/111/5 238/112/5 +f 239/24/5 305/109/5 238/112/5 +f 305/109/5 239/24/5 306/113/5 +f 239/24/5 307/138/5 306/113/5 +f 307/138/5 239/24/5 240/21/5 +f 240/21/5 308/137/5 307/138/5 +f 308/137/5 240/21/5 241/133/5 +f 309/103/2 310/52/2 311/63/2 +f 310/52/2 309/103/2 243/53/2 +f 248/122/6 312/82/6 246/123/6 +f 312/82/6 248/122/6 313/81/6 +f 251/53/2 314/54/2 315/52/2 +f 314/54/2 251/53/2 250/51/2 +f 316/26/2 315/52/2 314/54/2 +f 315/52/2 316/26/2 317/28/2 +f 318/27/2 317/28/2 316/26/2 +f 317/28/2 318/27/2 319/25/2 +f 320/24/1 321/23/1 322/21/1 +f 321/23/1 320/24/1 323/22/1 +f 324/112/1 323/22/1 320/24/1 +f 323/22/1 324/112/1 325/99/1 +f 326/111/1 325/99/1 324/112/1 +f 325/99/1 326/111/1 327/102/1 +f 328/51/1 327/102/1 326/111/1 +f 327/102/1 328/51/1 329/53/1 +f 328/51/1 286/52/1 329/53/1 +f 286/52/1 328/51/1 287/54/1 +f 330/97/6 331/89/6 332/90/6 +f 331/89/6 330/97/6 333/98/6 +f 334/52/1 335/103/1 336/53/1 +f 335/103/1 334/52/1 337/63/1 +f 338/28/1 337/63/1 334/52/1 +f 337/63/1 338/28/1 339/33/1 +f 340/25/1 339/33/1 338/28/1 +f 339/33/1 340/25/1 341/34/1 +f 342/125/1 343/34/1 340/25/1 +f 343/34/1 342/125/1 344/36/1 +f 345/133/3 346/38/3 347/39/3 +f 346/38/3 345/133/3 348/21/3 +f 348/21/3 297/124/3 349/38/3 +f 297/124/3 348/21/3 296/24/3 +f 298/32/5 350/31/5 351/29/5 +f 350/31/5 298/32/5 299/30/5 +f 300/59/5 350/31/5 299/30/5 +f 350/31/5 300/59/5 352/40/5 +f 353/58/5 352/40/5 300/59/5 +f 352/40/5 353/58/5 354/43/5 +f 353/58/5 355/45/5 354/43/5 +f 355/45/5 353/58/5 356/57/5 +f 353/58/5 303/110/5 356/57/5 +f 303/110/5 353/58/5 302/107/5 +f 353/58/5 301/60/5 302/107/5 +f 301/60/5 353/58/5 300/59/5 +f 304/108/5 356/57/5 303/110/5 +f 356/57/5 304/108/5 357/56/5 +f 305/109/5 357/56/5 304/108/5 +f 357/56/5 305/109/5 358/55/5 +f 306/113/5 358/55/5 305/109/5 +f 358/55/5 306/113/5 359/106/5 +f 307/138/5 359/106/5 306/113/5 +f 359/106/5 307/138/5 360/136/5 +f 308/137/5 360/136/5 307/138/5 +f 360/136/5 308/137/5 361/134/5 +f 311/63/2 362/28/2 363/33/2 +f 362/28/2 311/63/2 310/52/2 +f 313/81/6 364/83/6 312/82/6 +f 364/83/6 313/81/6 365/80/6 +f 365/80/6 366/84/6 364/83/6 +f 366/84/6 365/80/6 367/85/6 +f 368/86/6 369/126/6 367/85/6 +f 369/126/6 368/86/6 370/128/6 +f 368/86/6 371/129/6 370/128/6 +f 371/129/6 368/86/6 372/87/6 +f 373/88/6 371/129/6 372/87/6 +f 371/129/6 373/88/6 374/130/6 +f 373/88/6 333/98/6 374/130/6 +f 333/98/6 373/88/6 331/89/6 +f 336/53/1 375/100/1 376/102/1 +f 375/100/1 336/53/1 377/103/1 +f 378/46/5 379/47/5 380/48/5 +f 379/47/5 378/46/5 355/45/5 +f 381/44/5 355/45/5 378/46/5 +f 355/45/5 381/44/5 354/43/5 +f 382/42/5 354/43/5 381/44/5 +f 354/43/5 382/42/5 352/40/5 +f 382/42/5 350/31/5 352/40/5 +f 350/31/5 382/42/5 383/41/5 +f 383/41/5 351/29/5 350/31/5 +f 351/29/5 383/41/5 384/139/5 +f 355/45/5 357/56/5 379/47/5 +f 357/56/5 355/45/5 356/57/5 +f 358/55/5 379/47/5 357/56/5 +f 379/47/5 358/55/5 385/50/5 +f 358/55/5 386/105/5 385/50/5 +f 386/105/5 358/55/5 359/106/5 +f 360/136/5 386/105/5 359/106/5 +f 386/105/5 360/136/5 387/132/5 +f 361/134/5 387/132/5 360/136/5 +f 387/132/5 361/134/5 388/135/5 +f 389/33/2 390/25/2 391/34/2 +f 390/25/2 389/33/2 362/28/2 +f 392/125/2 391/34/2 390/25/2 +f 391/34/2 392/125/2 393/36/2 +f 394/23/1 395/39/1 396/37/1 +f 395/39/1 394/23/1 397/38/1 +f 398/22/1 397/38/1 394/23/1 +f 397/38/1 398/22/1 399/124/1 +f 400/99/1 401/124/1 398/22/1 +f 401/124/1 400/99/1 402/101/1 +f 376/102/1 402/101/1 400/99/1 +f 402/101/1 376/102/1 403/100/1 +f 379/47/5 404/49/5 380/48/5 +f 404/49/5 379/47/5 385/50/5 +f 386/105/5 404/49/5 385/50/5 +f 404/49/5 386/105/5 405/104/5 +f 387/132/5 405/104/5 386/105/5 +f 405/104/5 387/132/5 406/131/5 +f 388/135/5 406/131/5 387/132/5 +f 406/131/5 388/135/5 407/140/5 +f 408/96/6 291/92/6 409/94/6 +f 291/92/6 408/96/6 410/91/6 +f 408/96/6 332/90/6 410/91/6 +f 332/90/6 408/96/6 330/97/6 +f 228/111/3 411/103/3 412/100/3 +f 411/103/3 228/111/3 146/51/3 +f 224/115/6 144/35/6 222/116/6 +f 144/35/6 224/115/6 143/27/6 +f 209/67/6 136/114/6 138/115/6 +f 136/114/6 209/67/6 211/69/6 +f 214/112/3 133/108/3 134/111/3 +f 133/108/3 214/112/3 213/109/3 +f 413/71/6 414/114/6 415/69/6 +f 414/114/6 413/71/6 416/117/6 +f 417/55/3 418/108/3 419/109/3 +f 418/108/3 417/55/3 420/56/3 +f 421/49/3 422/141/3 423/48/3 +f 422/141/3 421/49/3 424/142/3 +f 429/143/1 430/144/1 431/145/1 +f 430/144/1 429/143/1 432/146/1 +f 433/70/6 434/69/6 435/68/6 +f 434/69/6 433/70/6 436/71/6 +f 433/70/6 437/73/6 436/71/6 +f 437/73/6 433/70/6 438/72/6 +f 429/143/1 439/147/1 440/148/1 +f 439/147/1 429/143/1 431/145/1 +f 441/58/5 442/110/5 443/57/5 +f 442/110/5 441/58/5 444/107/5 +f 445/46/1 446/145/1 447/44/1 +f 446/145/1 445/46/1 448/147/1 +f 449/48/1 448/147/1 445/46/1 +f 448/147/1 449/48/1 450/141/1 +f 449/48/1 451/142/1 450/141/1 +f 451/142/1 449/48/1 452/49/1 +f 453/108/5 454/51/5 455/111/5 +f 454/51/5 453/108/5 456/110/5 +f 457/75/6 458/118/6 459/73/6 +f 458/118/6 457/75/6 460/119/6 +f 469/118/5 470/75/5 471/119/5 +f 470/75/5 469/118/5 472/73/5 +f 473/111/6 474/110/6 475/51/6 +f 474/110/6 473/111/6 476/108/6 +f 477/110/4 478/56/4 479/57/4 +f 478/56/4 477/110/4 480/108/4 +f 116/108/6 481/57/6 482/110/6 +f 481/57/6 116/108/6 118/56/6 +f 483/58/6 482/110/6 481/57/6 +f 482/110/6 483/58/6 484/107/6 +f 485/60/6 486/54/6 484/107/6 +f 486/54/6 485/60/6 487/26/6 +f 487/26/6 416/117/6 486/54/6 +f 416/117/6 487/26/6 414/114/6 +f 420/56/3 488/110/3 418/108/3 +f 488/110/3 420/56/3 489/57/3 +f 458/118/6 490/54/6 491/117/6 +f 490/54/6 458/118/6 475/51/6 +f 454/51/5 496/117/5 469/118/5 +f 496/117/5 454/51/5 497/54/5 +f 423/48/3 498/147/3 499/46/3 +f 498/147/3 423/48/3 422/141/3 +f 500/54/5 501/114/5 502/117/5 +f 501/114/5 500/54/5 503/26/5 +f 444/107/5 503/26/5 500/54/5 +f 503/26/5 444/107/5 504/60/5 +f 505/149/3 506/141/3 507/142/3 +f 506/141/3 505/149/3 508/150/3 +f 436/71/6 509/114/6 434/69/6 +f 509/114/6 436/71/6 510/117/6 +f 436/71/6 511/118/6 510/117/6 +f 511/118/6 436/71/6 437/73/6 +f 512/75/6 511/118/6 437/73/6 +f 511/118/6 512/75/6 513/119/6 +f 514/77/6 513/119/6 512/75/6 +f 513/119/6 514/77/6 515/120/6 +f 516/79/6 515/120/6 514/77/6 +f 515/120/6 516/79/6 517/121/6 +f 518/143/2 519/147/2 520/148/2 +f 519/147/2 518/143/2 521/145/2 +f 522/146/2 521/145/2 518/143/2 +f 521/145/2 522/146/2 523/144/2 +f 524/149/1 525/151/1 526/152/1 +f 525/151/1 524/149/1 527/142/1 +f 528/150/1 527/142/1 524/149/1 +f 527/142/1 528/150/1 529/141/1 +f 440/148/1 529/141/1 528/150/1 +f 529/141/1 440/148/1 439/147/1 +f 443/57/5 530/108/5 531/56/5 +f 530/108/5 443/57/5 442/110/5 +f 532/109/5 531/56/5 530/108/5 +f 531/56/5 532/109/5 533/55/5 +f 538/46/2 539/145/2 540/44/2 +f 539/145/2 538/46/2 541/147/2 +f 542/48/2 541/147/2 538/46/2 +f 541/147/2 542/48/2 543/141/2 +f 544/49/2 543/141/2 542/48/2 +f 543/141/2 544/49/2 545/142/2 +f 550/75/5 551/76/5 552/77/5 +f 551/76/5 550/75/5 553/74/5 +f 554/73/5 553/74/5 550/75/5 +f 553/74/5 554/73/5 555/72/5 +f 556/71/5 555/72/5 554/73/5 +f 555/72/5 556/71/5 557/70/5 +f 499/46/3 558/145/3 559/44/3 +f 558/145/3 499/46/3 498/147/3 +f 501/114/5 556/71/5 502/117/5 +f 556/71/5 501/114/5 560/69/5 +f 561/147/3 562/143/3 563/145/3 +f 562/143/3 561/147/3 564/148/3 +f 561/147/3 508/150/3 564/148/3 +f 508/150/3 561/147/3 506/141/3 +f 510/117/6 565/26/6 509/114/6 +f 565/26/6 510/117/6 566/54/6 +f 511/118/6 566/54/6 510/117/6 +f 566/54/6 511/118/6 567/51/6 +f 513/119/6 567/51/6 511/118/6 +f 567/51/6 513/119/6 568/111/6 +f 515/120/6 568/111/6 513/119/6 +f 568/111/6 515/120/6 569/112/6 +f 517/121/6 569/112/6 515/120/6 +f 569/112/6 517/121/6 570/24/6 +f 520/148/2 571/141/2 572/150/2 +f 571/141/2 520/148/2 519/147/2 +f 573/24/5 574/120/5 575/121/5 +f 574/120/5 573/24/5 576/112/5 +f 577/113/5 576/112/5 573/24/5 +f 576/112/5 577/113/5 532/109/5 +f 574/120/5 578/79/5 575/121/5 +f 578/79/5 574/120/5 552/77/5 +f 579/149/2 571/141/2 580/142/2 +f 571/141/2 579/149/2 572/150/2 +f 581/113/6 569/112/6 570/24/6 +f 569/112/6 581/113/6 582/109/6 +f 583/106/6 582/109/6 581/113/6 +f 582/109/6 583/106/6 584/55/6 +f 585/144/4 586/143/4 587/146/4 +f 586/143/4 585/144/4 588/145/4 +f 589/147/4 586/143/4 588/145/4 +f 586/143/4 589/147/4 590/148/4 +f 589/147/4 591/150/4 590/148/4 +f 591/150/4 589/147/4 592/141/4 +f 592/141/4 593/149/4 591/150/4 +f 593/149/4 592/141/4 594/142/4 +f 594/142/4 595/152/4 593/149/4 +f 595/152/4 594/142/4 596/151/4 +f 563/145/3 601/146/3 602/144/3 +f 601/146/3 563/145/3 562/143/3 +f 603/107/6 604/59/6 605/60/6 +f 604/59/6 603/107/6 606/58/6 +f 607/110/6 606/58/6 603/107/6 +f 606/58/6 607/110/6 608/57/6 +f 609/108/6 608/57/6 607/110/6 +f 608/57/6 609/108/6 610/56/6 +f 609/108/6 584/55/6 610/56/6 +f 584/55/6 609/108/6 582/109/6 +f 609/108/6 569/112/6 582/109/6 +f 569/112/6 609/108/6 568/111/6 +f 607/110/6 568/111/6 609/108/6 +f 568/111/6 607/110/6 567/51/6 +f 603/107/6 567/51/6 607/110/6 +f 567/51/6 603/107/6 566/54/6 +f 605/60/6 566/54/6 603/107/6 +f 566/54/6 605/60/6 565/26/6 +f 615/142/4 616/48/4 617/49/4 +f 616/48/4 615/142/4 618/141/4 +f 618/141/4 619/46/4 616/48/4 +f 619/46/4 618/141/4 620/147/4 +f 621/145/4 619/46/4 620/147/4 +f 619/46/4 621/145/4 622/44/4 +f 623/107/4 479/57/4 624/58/4 +f 479/57/4 623/107/4 477/110/4 +f 625/56/2 626/109/2 627/55/2 +f 626/109/2 625/56/2 628/108/2 +f 629/57/2 628/108/2 625/56/2 +f 628/108/2 629/57/2 630/110/2 +f 631/58/2 630/110/2 629/57/2 +f 630/110/2 631/58/2 632/107/2 +f 633/56/1 634/109/1 635/55/1 +f 634/109/1 633/56/1 636/108/1 +f 637/57/1 636/108/1 633/56/1 +f 636/108/1 637/57/1 638/110/1 +f 639/58/1 638/110/1 637/57/1 +f 638/110/1 639/58/1 640/107/1 +f 641/70/6 642/73/6 413/71/6 +f 642/73/6 641/70/6 643/72/6 +f 643/72/6 644/75/6 642/73/6 +f 644/75/6 643/72/6 645/74/6 +f 646/76/6 644/75/6 645/74/6 +f 644/75/6 646/76/6 647/77/6 +f 648/79/6 649/120/6 647/77/6 +f 649/120/6 648/79/6 650/121/6 +f 650/121/6 651/112/6 649/120/6 +f 651/112/6 650/121/6 652/24/6 +f 653/113/6 651/112/6 652/24/6 +f 651/112/6 653/113/6 117/109/6 +f 471/119/5 654/112/5 455/111/5 +f 654/112/5 471/119/5 655/120/5 +f 473/111/6 656/120/6 657/112/6 +f 656/120/6 473/111/6 460/119/6 +f 480/108/4 662/55/4 478/56/4 +f 662/55/4 480/108/4 663/109/4 +f 488/110/3 664/58/3 665/107/3 +f 664/58/3 488/110/3 489/57/3 +f 579/149/2 666/151/2 667/152/2 +f 666/151/2 579/149/2 580/142/2 +f 512/75/6 438/72/6 672/74/6 +f 438/72/6 512/75/6 437/73/6 +f 672/74/6 514/77/6 512/75/6 +f 514/77/6 672/74/6 673/76/6 +f 673/76/6 516/79/6 514/77/6 +f 516/79/6 673/76/6 674/78/6 +f 507/142/3 679/152/3 505/149/3 +f 679/152/3 507/142/3 680/151/3 +f 94/101/4 685/22/4 92/99/4 +f 685/22/4 94/101/4 686/124/4 +f 686/124/4 22/23/4 685/22/4 +f 22/23/4 686/124/4 20/38/4 +f 687/99/4 4/24/4 688/112/4 +f 4/24/4 687/99/4 2/22/4 +f 688/112/4 689/102/4 687/99/4 +f 689/102/4 688/112/4 690/111/4 +f 690/111/4 36/53/4 689/102/4 +f 36/53/4 690/111/4 34/51/4 +usemtl embellishment +f 425/5/5 426/6/5 427/7/5 +f 426/6/5 425/5/5 428/8/5 +f 534/9/5 535/10/5 536/11/5 +f 535/10/5 534/9/5 537/12/5 +f 546/13/5 547/14/5 548/15/5 +f 547/14/5 546/13/5 549/16/5 +f 597/17/5 598/18/5 599/19/5 +f 598/18/5 597/17/5 600/20/5 +f 611/20/5 612/19/5 613/17/5 +f 612/19/5 611/20/5 614/18/5 +f 668/15/5 669/16/5 670/14/5 +f 669/16/5 668/15/5 671/13/5 +f 675/11/5 676/12/5 677/10/5 +f 676/12/5 675/11/5 678/9/5 +f 681/7/5 682/8/5 683/6/5 +f 682/8/5 681/7/5 684/5/5 +f 1/153/4 691/154/4 4/155/4 +f 4/155/4 691/154/4 692/156/4 +f 693/31/6 694/59/6 695/40/6 +f 694/59/6 693/31/6 696/30/6 +f 697/157/3 6/158/3 698/159/3 +f 6/158/3 697/157/3 7/160/3 +f 17/161/1 699/19/1 18/17/1 +f 699/19/1 17/161/1 700/162/1 +f 701/139/6 702/7/6 703/163/6 +f 702/7/6 701/139/6 704/164/6 +f 19/165/2 705/13/2 706/166/2 +f 705/13/2 19/165/2 21/15/2 +f 707/153/4 22/165/4 19/166/4 +f 22/165/4 707/153/4 708/155/4 +f 709/139/6 710/31/6 711/41/6 +f 710/31/6 709/139/6 712/29/6 +f 713/160/3 13/161/3 714/158/3 +f 13/161/3 713/160/3 17/162/3 +f 715/162/1 7/158/1 716/160/1 +f 7/158/1 715/162/1 5/161/1 +f 1/155/2 3/165/2 717/153/2 +f 717/153/2 3/165/2 718/166/2 +f 719/154/2 126/155/2 720/153/2 +f 126/155/2 719/154/2 125/156/2 +f 128/159/1 721/160/1 129/158/1 +f 721/160/1 128/159/1 722/157/1 +f 111/159/4 723/2/4 114/157/4 +f 723/2/4 111/159/4 724/167/4 +f 725/157/3 726/167/3 727/2/3 +f 726/167/3 725/157/3 728/159/3 +f 108/158/4 729/157/4 182/160/4 +f 729/157/4 108/158/4 730/159/4 +f 731/160/3 732/159/3 733/157/3 +f 732/159/3 731/160/3 734/158/3 +f 735/155/4 736/154/4 737/156/4 +f 736/154/4 735/155/4 738/153/4 +f 739/157/2 740/158/2 741/159/2 +f 740/158/2 739/157/2 742/160/2 +f 743/157/1 285/158/1 744/159/1 +f 285/158/1 743/157/1 289/160/1 +f 745/156/3 218/153/3 746/154/3 +f 218/153/3 745/156/3 216/155/3 +f 747/166/1 748/155/1 749/165/1 +f 748/155/1 747/166/1 750/153/1 +f 168/166/2 751/155/2 166/165/2 +f 751/155/2 168/166/2 752/153/2 +f 171/162/4 753/158/4 754/160/4 +f 753/158/4 171/162/4 170/161/4 +f 755/162/3 756/158/3 757/160/3 +f 756/158/3 755/162/3 758/161/3 +f 759/135/6 760/131/6 761/132/6 +f 760/131/6 759/135/6 762/140/6 +f 258/153/2 763/156/2 256/155/2 +f 763/156/2 258/153/2 764/154/2 +f 765/105/6 766/136/6 767/132/6 +f 766/136/6 765/105/6 768/106/6 +f 769/155/1 770/154/1 771/156/1 +f 770/154/1 769/155/1 772/153/1 +f 194/159/4 773/160/4 195/158/4 +f 773/160/4 194/159/4 774/157/4 +f 775/78/6 776/85/6 777/80/6 +f 776/85/6 775/78/6 778/86/6 +f 197/155/3 779/154/3 198/156/3 +f 779/154/3 197/155/3 780/153/3 +f 781/160/2 782/161/2 783/158/2 +f 782/161/2 781/160/2 784/162/2 +f 785/160/1 340/161/1 786/158/1 +f 340/161/1 785/160/1 342/162/1 +f 787/155/3 345/166/3 788/153/3 +f 345/166/3 787/155/3 348/165/3 +f 789/153/4 790/165/4 791/166/4 +f 790/165/4 789/153/4 792/155/4 +f 793/93/6 794/94/6 795/92/6 +f 794/94/6 793/93/6 796/95/6 +f 797/15/4 798/166/4 799/165/4 +f 798/166/4 797/15/4 800/13/4 +f 801/5/5 802/6/5 384/7/5 +f 802/6/5 801/5/5 803/8/5 +f 804/17/1 805/162/1 806/19/1 +f 805/162/1 804/17/1 807/161/1 +f 808/17/2 809/162/2 810/19/2 +f 809/162/2 808/17/2 811/161/2 +f 318/158/4 812/162/4 319/161/4 +f 812/162/4 318/158/4 813/160/4 +f 814/85/6 815/127/6 816/84/6 +f 815/127/6 814/85/6 817/126/6 +f 321/165/3 818/153/3 322/155/3 +f 818/153/3 321/165/3 819/166/3 +f 392/161/4 820/19/4 821/17/4 +f 820/19/4 392/161/4 822/162/4 +f 823/127/6 824/14/6 825/168/6 +f 824/14/6 823/127/6 826/169/6 +f 827/15/3 828/166/3 396/165/3 +f 828/166/3 827/15/3 829/13/3 +f 830/9/5 831/10/5 407/11/5 +f 831/10/5 830/9/5 832/12/5 +f 833/17/2 834/162/2 835/19/2 +f 834/162/2 833/17/2 836/161/2 +f 837/165/1 838/13/1 839/166/1 +f 838/13/1 837/165/1 840/15/1 +f 396/166/1 841/155/1 394/165/1 +f 841/155/1 396/166/1 842/153/1 +f 390/161/2 843/160/2 392/162/2 +f 843/160/2 390/161/2 844/158/2 +f 845/170/6 846/171/6 847/95/6 +f 846/171/6 845/170/6 848/20/6 +f 849/15/3 850/166/3 851/165/3 +f 850/166/3 849/15/3 852/13/3 +f 322/153/1 853/156/1 320/155/1 +f 853/156/1 322/153/1 854/154/1 +f 316/158/2 855/157/2 318/160/2 +f 855/157/2 316/158/2 856/159/2 +f 421/172/3 420/173/3 417/4/3 +f 420/173/3 421/172/3 423/174/3 +f 857/174/4 858/9/4 859/11/4 +f 858/9/4 857/174/4 860/172/4 +f 431/7/1 861/175/1 862/163/1 +f 861/175/1 431/7/1 430/6/1 +f 863/6/2 864/163/2 865/7/2 +f 864/163/2 863/6/2 866/175/2 +f 449/174/1 635/4/1 452/172/1 +f 635/4/1 449/174/1 633/173/1 +f 867/172/3 461/173/3 868/4/3 +f 461/173/3 867/172/3 464/174/3 +f 869/2/2 870/163/2 871/175/2 +f 870/163/2 869/2/2 872/167/2 +f 873/163/3 874/2/3 875/167/3 +f 874/2/3 873/163/3 876/175/3 +f 661/173/2 877/172/2 659/174/2 +f 877/172/2 661/173/2 878/4/2 +f 879/4/2 663/156/2 880/154/2 +f 663/156/2 879/4/2 662/173/2 +f 881/59/6 882/107/6 883/58/6 +f 882/107/6 881/59/6 884/60/6 +f 885/2/3 130/159/3 886/167/3 +f 130/159/3 885/2/3 128/157/3 +f 887/4/4 123/156/4 125/154/4 +f 123/156/4 887/4/4 888/173/4 +f 889/157/1 664/167/1 890/2/1 +f 664/167/1 889/157/1 665/159/1 +f 891/173/4 892/172/4 893/174/4 +f 892/172/4 891/173/4 894/4/4 +f 452/174/3 895/9/3 451/11/3 +f 895/9/3 452/174/3 896/172/3 +f 897/163/2 523/6/2 898/175/2 +f 523/6/2 897/163/2 521/7/2 +f 899/175/4 539/7/4 900/6/4 +f 539/7/4 899/175/4 540/163/4 +f 901/172/1 902/11/1 903/174/1 +f 902/11/1 901/172/1 904/9/1 +f 905/172/2 580/11/2 906/174/2 +f 580/11/2 905/172/2 666/9/2 +f 907/175/4 588/7/4 585/6/4 +f 588/7/4 907/175/4 908/163/4 +f 909/7/3 910/175/3 911/163/3 +f 910/175/3 909/7/3 912/6/3 +f 615/11/2 913/172/2 914/9/2 +f 913/172/2 615/11/2 617/174/2 +f 594/11/4 915/172/4 596/9/4 +f 915/172/4 594/11/4 916/174/4 +f 558/7/1 917/175/1 559/163/1 +f 917/175/1 558/7/1 918/6/1 +f 602/6/3 919/163/3 563/7/3 +f 919/163/3 602/6/3 920/175/3 +f 601/5/1 921/6/1 602/7/1 +f 921/6/1 601/5/1 922/8/1 +f 923/20/1 922/19/1 601/17/1 +f 922/19/1 923/20/1 924/18/1 +f 925/59/6 926/31/6 927/30/6 +f 926/31/6 925/59/6 928/40/6 +f 929/14/2 930/13/2 931/16/2 +f 930/13/2 929/14/2 595/15/2 +f 595/10/2 932/9/2 930/12/2 +f 932/9/2 595/10/2 596/11/2 +f 933/5/3 934/6/3 935/7/3 +f 934/6/3 933/5/3 936/8/3 +f 933/19/3 937/20/3 936/17/3 +f 937/20/3 933/19/3 938/18/3 +f 939/16/4 940/15/4 941/13/4 +f 940/15/4 939/16/4 942/14/4 +f 943/11/4 941/12/4 940/10/4 +f 941/12/4 943/11/4 944/9/4 +f 624/2/4 619/163/4 622/175/4 +f 619/163/4 624/2/4 479/167/4 +f 945/156/4 946/4/4 947/173/4 +f 946/4/4 945/156/4 948/154/4 +f 213/156/3 949/4/3 950/173/3 +f 949/4/3 213/156/3 215/154/3 +f 204/159/1 951/2/1 206/157/1 +f 951/2/1 204/159/1 952/167/1 +f 953/159/2 954/2/2 955/157/2 +f 954/2/2 953/159/2 956/167/2 +f 957/69/6 958/70/6 959/71/6 +f 958/70/6 957/69/6 960/68/6 +f 961/4/3 634/156/3 962/154/3 +f 634/156/3 961/4/3 635/173/3 +f 963/76/6 964/79/6 965/77/6 +f 964/79/6 963/76/6 966/78/6 +f 967/173/1 198/154/1 968/4/1 +f 198/154/1 967/173/1 196/156/1 +f 192/159/2 969/2/2 194/157/2 +f 969/2/2 192/159/2 970/167/2 +f 971/157/4 631/167/4 972/2/4 +f 631/167/4 971/157/4 632/159/4 +f 973/154/1 974/173/1 975/156/1 +f 974/173/1 973/154/1 976/4/1 +f 186/154/2 977/173/2 184/156/2 +f 977/173/2 186/154/2 978/4/2 +f 979/106/6 980/109/6 981/113/6 +f 980/109/6 979/106/6 982/55/6 +f 637/167/1 447/175/1 639/2/1 +f 447/175/1 637/167/1 445/163/1 +f 629/167/2 540/175/2 631/2/2 +f 540/175/2 629/167/2 538/163/2 +f 467/167/4 983/175/4 984/2/4 +f 983/175/4 467/167/4 466/163/4 +f 985/173/1 986/172/1 987/174/1 +f 986/172/1 985/173/1 988/4/1 +f 627/4/2 542/174/2 625/173/2 +f 542/174/2 627/4/2 544/172/2 +f 989/175/1 493/167/1 495/163/1 +f 493/167/1 989/175/1 990/2/1 +f 499/163/3 664/2/3 489/167/3 +f 664/2/3 499/163/3 559/175/3 +f 617/172/4 478/173/4 662/4/4 +f 478/173/4 617/172/4 616/174/4 +f 991/5/3 992/6/3 993/7/3 +f 992/6/3 991/5/3 994/8/3 +f 995/18/3 994/17/3 991/19/3 +f 994/17/3 995/18/3 996/20/3 +f 997/136/6 998/105/6 999/106/6 +f 998/105/6 997/136/6 1000/132/6 +f 1001/14/2 1002/13/2 1003/16/2 +f 1002/13/2 1001/14/2 1004/15/2 +f 1005/14/1 1006/13/1 1007/16/1 +f 1006/13/1 1005/14/1 1008/15/1 +f 1008/10/1 1009/9/1 1006/12/1 +f 1009/9/1 1008/10/1 1010/11/1 +f 1011/7/4 1012/8/4 1013/6/4 +f 1012/8/4 1011/7/4 1014/5/4 +f 1014/17/4 1015/18/4 1012/19/4 +f 1015/18/4 1014/17/4 1016/20/4 +f 1004/10/2 1017/9/2 1002/12/2 +f 1017/9/2 1004/10/2 1018/11/2 +f 527/11/1 1019/172/1 525/9/1 +f 1019/172/1 527/11/1 1020/174/1 +f 522/5/4 1021/6/4 523/7/4 +f 1021/6/4 522/5/4 1022/8/4 +f 1023/20/4 1022/19/4 522/17/4 +f 1022/19/4 1023/20/4 1024/18/4 +f 1025/78/6 1026/85/6 1027/80/6 +f 1026/85/6 1025/78/6 1028/86/6 +f 526/13/3 1029/14/3 1030/16/3 +f 1029/14/3 526/13/3 1031/15/3 +f 525/11/3 1031/12/3 526/10/3 +f 1031/12/3 525/11/3 1032/9/3 +f 1033/7/2 1034/8/2 1035/6/2 +f 1034/8/2 1033/7/2 1036/5/2 +f 1036/17/2 1037/18/2 1034/19/2 +f 1037/18/2 1036/17/2 1038/20/2 +f 1039/14/1 1040/13/1 1041/16/1 +f 1040/13/1 1039/14/1 1042/15/1 +f 1042/10/1 1043/9/1 1040/12/1 +f 1043/9/1 1042/10/1 1044/11/1 +f 507/11/3 1045/172/3 680/9/3 +f 1045/172/3 507/11/3 1046/174/3 +f 1047/11/4 1048/12/4 1049/10/4 +f 1048/12/4 1047/11/4 1050/9/4 +f 1051/7/2 1052/8/2 1053/6/2 +f 1052/8/2 1051/7/2 1054/5/2 +f 1054/17/2 1055/18/2 1052/19/2 +f 1055/18/2 1054/17/2 1056/20/2 +f 1049/15/4 1057/16/4 1058/14/4 +f 1057/16/4 1049/15/4 1048/13/4 +f 1059/15/3 1060/16/3 1061/13/3 +f 1060/16/3 1059/15/3 1062/14/3 +f 1063/17/1 1064/18/1 1065/19/1 +f 1064/18/1 1063/17/1 1066/20/1 +f 1067/68/6 1068/92/6 1069/91/6 +f 1068/92/6 1067/68/6 1070/64/6 +f 1065/8/1 1071/7/1 1063/5/1 +f 1071/7/1 1065/8/1 1072/6/1 +f 1059/12/3 1073/11/3 1074/9/3 +f 1073/11/3 1059/12/3 1061/10/3 +f 1075/92/6 1076/68/6 1077/64/6 +f 1076/68/6 1075/92/6 1078/91/6 +f 1079/13/1 1080/165/1 1081/15/1 +f 1080/165/1 1079/13/1 1082/166/1 +f 1083/13/2 1084/165/2 1085/15/2 +f 1084/165/2 1083/13/2 1086/166/2 +f 1087/19/4 1088/161/4 1089/162/4 +f 1088/161/4 1087/19/4 1090/17/4 +f 1091/13/5 174/14/5 1092/15/5 +f 174/14/5 1091/13/5 1093/16/5 +f 1094/161/3 1095/19/3 1096/17/3 +f 1095/19/3 1094/161/3 1097/162/3 +f 1098/174/6 1099/176/6 1100/140/6 +f 1099/176/6 1098/174/6 1101/11/6 +f 1102/18/5 1103/17/5 88/20/5 +f 1103/17/5 1102/18/5 1104/19/5 +f 1105/17/3 1106/162/3 1107/19/3 +f 1106/162/3 1105/17/3 1108/161/3 +f 1109/166/4 1110/15/4 1111/13/4 +f 1110/15/4 1109/166/4 1112/165/4 diff --git a/src/main/resources/assets/graves/models/block/graveboxsection.mtl b/src/main/resources/assets/graves/models/block/graveboxsection.mtl deleted file mode 100644 index bca8b9b..0000000 --- a/src/main/resources/assets/graves/models/block/graveboxsection.mtl +++ /dev/null @@ -1,24 +0,0 @@ -# Blender MTL File: 'None' -# Material Count: 2 - -newmtl outside -Ns 96.078431 -Ka 1.000000 1.000000 1.000000 -Kd 0.800000 0.800000 0.800000 -Ks 0.164706 0.164706 0.164706 -Ke 0.000000 0.000000 0.000000 -Ni 1.000000 -d 1.000000 -illum 2 -map_Kd minecraft:blocks/stone_andesite_smooth - -newmtl inside -Ns 96.078431 -Ka 1.000000 1.000000 1.000000 -Kd 0.800000 0.800000 0.800000 -Ks 0.164706 0.164706 0.164706 -Ke 0.000000 0.000000 0.000000 -Ni 1.000000 -d 1.000000 -illum 2 -map_Kd minecraft:blocks/wool_colored_red diff --git a/src/main/resources/assets/graves/models/block/graveboxsection.obj b/src/main/resources/assets/graves/models/block/graveboxsection.obj deleted file mode 100644 index 2b3a827..0000000 --- a/src/main/resources/assets/graves/models/block/graveboxsection.obj +++ /dev/null @@ -1,176 +0,0 @@ -# Blender v2.76 (sub 0) OBJ File: '' -# www.blender.org -mtllib graveboxsection.mtl -o Group1 -v 1.000000 0.000000 0.000000 -v 1.000000 0.062500 0.062500 -v 1.000000 0.000000 0.062500 -v 1.000000 0.062500 0.000000 -v 1.000000 0.000000 0.000000 -v 0.062500 0.062500 0.000000 -v 1.000000 0.062500 0.000000 -v 0.062500 0.000000 0.000000 -v 1.000000 0.000000 0.000000 -v 0.062500 0.000000 0.062500 -v 0.062500 0.000000 0.000000 -v 1.000000 0.000000 0.062500 -v 0.062500 0.000000 0.937500 -v 1.000000 0.000000 0.937500 -v 1.000000 0.062500 0.937500 -v 1.000000 0.000000 0.937500 -v 0.062500 0.062500 0.062500 -v 1.000000 0.062500 0.937500 -v 1.000000 0.062500 0.062500 -v 0.062500 0.062500 0.937500 -v 0.062500 0.062500 0.062500 -v 0.062500 1.000000 0.937500 -v 0.062500 1.000000 0.062500 -v 0.062500 0.062500 0.062500 -v 1.000000 1.000000 0.062500 -v 0.062500 1.000000 0.062500 -v 1.000000 0.062500 0.062500 -v 1.000000 1.000000 0.062500 -v 1.000000 1.000000 0.000000 -v 0.062500 1.000000 0.000000 -v 1.000000 1.000000 0.000000 -v 0.000000 1.000000 0.000000 -v 0.000000 1.000000 0.000000 -v 0.000000 0.062500 0.000000 -v 0.000000 0.000000 0.000000 -v 0.000000 0.000000 0.062500 -v 0.000000 0.000000 0.000000 -v 0.000000 0.000000 0.937500 -v 0.000000 0.000000 1.000000 -v 0.000000 0.000000 1.000000 -v 0.000000 0.000000 1.000000 -v 0.062500 0.000000 1.000000 -v 1.000000 0.000000 1.000000 -v 1.000000 0.062500 1.000000 -v 1.000000 0.000000 1.000000 -v 1.000000 1.000000 1.000000 -v 1.000000 1.000000 0.937500 -v 0.062500 0.062500 0.937500 -v 1.000000 1.000000 0.937500 -v 1.000000 0.062500 0.937500 -v 0.062500 1.000000 0.937500 -v 0.062500 1.000000 0.937500 -v 1.000000 1.000000 1.000000 -v 1.000000 1.000000 0.937500 -v 0.062500 1.000000 1.000000 -v 0.000000 1.000000 0.937500 -v 0.000000 1.000000 1.000000 -v 0.000000 1.000000 0.937500 -v 0.000000 0.062500 1.000000 -v 0.000000 0.062500 1.000000 -v 0.000000 1.000000 1.000000 -v 0.000000 1.000000 1.000000 -v 0.000000 0.062500 0.937500 -v 0.000000 1.000000 0.062500 -v 0.000000 0.062500 0.062500 -v 0.000000 1.000000 0.000000 -v 0.000000 0.062500 0.000000 -v 0.000000 0.000000 0.062500 -v 0.000000 0.000000 0.000000 -v 0.000000 0.000000 0.937500 -v 0.062500 0.062500 1.000000 -v 0.062500 0.000000 1.000000 -v 1.000000 0.062500 1.000000 -v 1.000000 0.000000 1.000000 -v 1.000000 1.000000 1.000000 -v 0.062500 1.000000 1.000000 -v 0.062500 1.000000 0.062500 -v 0.000000 1.000000 0.062500 -v 0.062500 1.000000 0.000000 -v 1.000000 1.000000 0.062500 -vt 0.937500 1.000000 -vt 0.937500 0.062500 -vt 1.000000 0.062500 -vt 1.000000 1.000000 -vt 0.937500 0.000000 -vt 1.000000 0.000000 -vt 0.062500 1.000000 -vt 0.062500 0.062500 -vt 0.062500 0.937500 -vt 0.000000 1.000000 -vt 0.000000 0.937500 -vt 0.062500 0.000000 -vt 1.000000 0.937500 -vt 0.000000 0.062500 -vt 0.000000 0.000000 -vn -1.000000 0.000000 0.000000 -vn 0.000000 0.000000 -1.000000 -vn 0.000000 0.000000 1.000000 -vn 0.000000 1.000000 0.000000 -vn 1.000000 0.000000 0.000000 -vn 0.000000 -1.000000 0.000000 -usemtl outside -s off -f 58/1/1 63/2/1 59/3/1 -f 58/1/1 59/3/1 61/4/1 -f 8/5/2 35/6/2 34/3/2 -f 8/5/2 34/3/2 6/2/2 -f 75/4/3 76/7/3 71/8/3 -f 75/4/3 71/8/3 73/3/3 -f 77/9/4 79/7/4 32/10/4 -f 77/9/4 32/10/4 78/11/4 -f 6/2/2 34/3/2 33/4/2 -f 6/2/2 33/4/2 30/1/2 -f 4/3/5 29/4/5 28/1/5 -f 4/3/5 28/1/5 2/2/5 -f 68/12/1 70/5/1 63/2/1 -f 68/12/1 63/2/1 65/8/1 -f 52/4/4 55/13/4 53/9/4 -f 52/4/4 53/9/4 54/7/4 -f 1/6/5 4/3/5 2/2/5 -f 1/6/5 2/2/5 3/5/5 -f 62/10/3 60/14/3 71/8/3 -f 62/10/3 71/8/3 76/7/3 -f 66/10/1 67/14/1 65/8/1 -f 66/10/1 65/8/1 64/7/1 -f 15/8/5 47/7/5 46/10/5 -f 15/8/5 46/10/5 44/14/5 -f 39/6/1 59/3/1 63/2/1 -f 39/6/1 63/2/1 70/5/1 -f 3/5/5 2/2/5 15/8/5 -f 3/5/5 15/8/5 16/12/5 -f 5/15/2 8/5/2 6/2/2 -f 5/15/2 6/2/2 7/14/2 -f 9/6/6 12/3/6 10/8/6 -f 9/6/6 10/8/6 11/12/6 -f 7/14/2 6/2/2 30/1/2 -f 7/14/2 30/1/2 31/10/2 -f 16/12/5 15/8/5 44/14/5 -f 16/12/5 44/14/5 45/15/5 -f 13/9/6 42/7/6 40/10/6 -f 13/9/6 40/10/6 38/11/6 -f 77/13/4 80/9/4 29/7/4 -f 77/13/4 29/7/4 79/4/4 -f 10/8/6 13/9/6 38/11/6 -f 10/8/6 38/11/6 36/14/6 -f 11/12/6 10/8/6 36/14/6 -f 11/12/6 36/14/6 37/15/6 -f 41/15/3 72/12/3 71/8/3 -f 41/15/3 71/8/3 60/14/3 -f 64/7/1 65/8/1 63/2/1 -f 64/7/1 63/2/1 58/1/1 -f 56/14/4 57/15/4 55/12/4 -f 56/14/4 55/12/4 52/8/4 -f 14/13/6 43/4/6 42/7/6 -f 14/13/6 42/7/6 13/9/6 -f 67/14/1 69/15/1 68/12/1 -f 67/14/1 68/12/1 65/8/1 -f 78/9/4 56/13/4 52/4/4 -f 78/9/4 52/4/4 77/7/4 -f 12/3/6 14/13/6 13/9/6 -f 12/3/6 13/9/6 10/8/6 -f 72/12/3 74/6/3 73/3/3 -f 72/12/3 73/3/3 71/8/3 -usemtl inside -f 24/6/3 27/12/3 25/7/3 -f 24/6/3 25/7/3 26/4/3 -f 21/15/5 23/10/5 22/4/5 -f 21/15/5 22/4/5 20/6/5 -f 17/15/4 20/6/4 18/13/4 -f 17/15/4 18/13/4 19/11/4 -f 48/6/2 51/4/2 49/7/2 -f 48/6/2 49/7/2 50/12/2 diff --git a/src/main/resources/assets/graves/models/block/graveboxsectionfoot.mtl b/src/main/resources/assets/graves/models/block/graveboxsectionfoot.mtl deleted file mode 100644 index bca8b9b..0000000 --- a/src/main/resources/assets/graves/models/block/graveboxsectionfoot.mtl +++ /dev/null @@ -1,24 +0,0 @@ -# Blender MTL File: 'None' -# Material Count: 2 - -newmtl outside -Ns 96.078431 -Ka 1.000000 1.000000 1.000000 -Kd 0.800000 0.800000 0.800000 -Ks 0.164706 0.164706 0.164706 -Ke 0.000000 0.000000 0.000000 -Ni 1.000000 -d 1.000000 -illum 2 -map_Kd minecraft:blocks/stone_andesite_smooth - -newmtl inside -Ns 96.078431 -Ka 1.000000 1.000000 1.000000 -Kd 0.800000 0.800000 0.800000 -Ks 0.164706 0.164706 0.164706 -Ke 0.000000 0.000000 0.000000 -Ni 1.000000 -d 1.000000 -illum 2 -map_Kd minecraft:blocks/wool_colored_red diff --git a/src/main/resources/assets/graves/models/block/graveboxsectionfoot.obj b/src/main/resources/assets/graves/models/block/graveboxsectionfoot.obj deleted file mode 100644 index 246b287..0000000 --- a/src/main/resources/assets/graves/models/block/graveboxsectionfoot.obj +++ /dev/null @@ -1,176 +0,0 @@ -# Blender v2.76 (sub 0) OBJ File: '' -# www.blender.org -mtllib graveboxsectionfoot.mtl -o Group1 -v -0.000000 0.000000 1.000000 -v -0.000000 0.062500 0.937500 -v -0.000000 0.000000 0.937500 -v -0.000000 0.062500 1.000000 -v -0.000000 0.000000 1.000000 -v 0.937500 0.062500 1.000000 -v -0.000000 0.062500 1.000000 -v 0.937500 0.000000 1.000000 -v -0.000000 0.000000 1.000000 -v 0.937500 0.000000 0.937500 -v 0.937500 0.000000 1.000000 -v -0.000000 0.000000 0.937500 -v 0.937500 0.000000 0.062500 -v 0.000000 0.000000 0.062500 -v 0.000000 0.062500 0.062500 -v 0.000000 0.000000 0.062500 -v 0.937500 0.062500 0.937500 -v 0.000000 0.062500 0.062500 -v -0.000000 0.062500 0.937500 -v 0.937500 0.062500 0.062500 -v 0.937500 0.062500 0.937500 -v 0.937500 1.000000 0.062500 -v 0.937500 1.000000 0.937500 -v 0.937500 0.062500 0.937500 -v -0.000000 1.000000 0.937500 -v 0.937500 1.000000 0.937500 -v -0.000000 0.062500 0.937500 -v -0.000000 1.000000 0.937500 -v -0.000000 1.000000 1.000000 -v 0.937500 1.000000 1.000000 -v -0.000000 1.000000 1.000000 -v 1.000000 1.000000 1.000000 -v 1.000000 1.000000 1.000000 -v 1.000000 0.062500 1.000000 -v 1.000000 0.000000 1.000000 -v 1.000000 0.000000 0.937500 -v 1.000000 0.000000 1.000000 -v 1.000000 0.000000 0.062500 -v 1.000000 0.000000 0.000000 -v 1.000000 0.000000 0.000000 -v 1.000000 0.000000 0.000000 -v 0.937500 0.000000 -0.000000 -v 0.000000 0.000000 -0.000000 -v 0.000000 0.062500 -0.000000 -v 0.000000 0.000000 -0.000000 -v 0.000000 1.000000 -0.000000 -v 0.000000 1.000000 0.062500 -v 0.937500 0.062500 0.062500 -v 0.000000 1.000000 0.062500 -v 0.000000 0.062500 0.062500 -v 0.937500 1.000000 0.062500 -v 0.937500 1.000000 0.062500 -v 0.000000 1.000000 -0.000000 -v 0.000000 1.000000 0.062500 -v 0.937500 1.000000 -0.000000 -v 1.000000 1.000000 0.062500 -v 1.000000 1.000000 0.000000 -v 1.000000 1.000000 0.062500 -v 1.000000 0.062500 0.000000 -v 1.000000 0.062500 0.000000 -v 1.000000 1.000000 0.000000 -v 1.000000 1.000000 0.000000 -v 1.000000 0.062500 0.062500 -v 1.000000 1.000000 0.937500 -v 1.000000 0.062500 0.937500 -v 1.000000 1.000000 1.000000 -v 1.000000 0.062500 1.000000 -v 1.000000 0.000000 0.937500 -v 1.000000 0.000000 1.000000 -v 1.000000 0.000000 0.062500 -v 0.937500 0.062500 -0.000000 -v 0.937500 0.000000 -0.000000 -v 0.000000 0.062500 -0.000000 -v 0.000000 0.000000 -0.000000 -v 0.000000 1.000000 -0.000000 -v 0.937500 1.000000 -0.000000 -v 0.937500 1.000000 0.937500 -v 1.000000 1.000000 0.937500 -v 0.937500 1.000000 1.000000 -v -0.000000 1.000000 0.937500 -vt 0.937500 1.000000 -vt 0.937500 0.062500 -vt 1.000000 0.062500 -vt 1.000000 1.000000 -vt 0.937500 0.000000 -vt 1.000000 0.000000 -vt 0.062500 1.000000 -vt 0.062500 0.062500 -vt 0.062500 0.937500 -vt 0.000000 1.000000 -vt 0.000000 0.937500 -vt 0.062500 0.000000 -vt 1.000000 0.937500 -vt 0.000000 0.062500 -vt 0.000000 0.000000 -vn 1.000000 0.000000 0.000000 -vn 0.000000 0.000000 1.000000 -vn 0.000000 0.000000 -1.000000 -vn 0.000000 1.000000 0.000000 -vn -1.000000 0.000000 0.000000 -vn 0.000000 -1.000000 0.000000 -usemtl outside -s off -f 58/1/1 63/2/1 59/3/1 -f 58/1/1 59/3/1 61/4/1 -f 8/5/2 35/6/2 34/3/2 -f 8/5/2 34/3/2 6/2/2 -f 75/4/3 76/7/3 71/8/3 -f 75/4/3 71/8/3 73/3/3 -f 77/9/4 79/7/4 32/10/4 -f 77/9/4 32/10/4 78/11/4 -f 6/2/2 34/3/2 33/4/2 -f 6/2/2 33/4/2 30/1/2 -f 4/3/5 29/4/5 28/1/5 -f 4/3/5 28/1/5 2/2/5 -f 68/12/1 70/5/1 63/2/1 -f 68/12/1 63/2/1 65/8/1 -f 52/4/4 55/13/4 53/9/4 -f 52/4/4 53/9/4 54/7/4 -f 1/6/5 4/3/5 2/2/5 -f 1/6/5 2/2/5 3/5/5 -f 62/10/3 60/14/3 71/8/3 -f 62/10/3 71/8/3 76/7/3 -f 66/10/1 67/14/1 65/8/1 -f 66/10/1 65/8/1 64/7/1 -f 15/8/5 47/7/5 46/10/5 -f 15/8/5 46/10/5 44/14/5 -f 39/6/1 59/3/1 63/2/1 -f 39/6/1 63/2/1 70/5/1 -f 3/5/5 2/2/5 15/8/5 -f 3/5/5 15/8/5 16/12/5 -f 5/15/2 8/5/2 6/2/2 -f 5/15/2 6/2/2 7/14/2 -f 9/6/6 12/3/6 10/8/6 -f 9/6/6 10/8/6 11/12/6 -f 7/14/2 6/2/2 30/1/2 -f 7/14/2 30/1/2 31/10/2 -f 16/12/5 15/8/5 44/14/5 -f 16/12/5 44/14/5 45/15/5 -f 13/9/6 42/7/6 40/10/6 -f 13/9/6 40/10/6 38/11/6 -f 77/13/4 80/9/4 29/7/4 -f 77/13/4 29/7/4 79/4/4 -f 10/8/6 13/9/6 38/11/6 -f 10/8/6 38/11/6 36/14/6 -f 11/12/6 10/8/6 36/14/6 -f 11/12/6 36/14/6 37/15/6 -f 41/15/3 72/12/3 71/8/3 -f 41/15/3 71/8/3 60/14/3 -f 64/7/1 65/8/1 63/2/1 -f 64/7/1 63/2/1 58/1/1 -f 56/14/4 57/15/4 55/12/4 -f 56/14/4 55/12/4 52/8/4 -f 14/13/6 43/4/6 42/7/6 -f 14/13/6 42/7/6 13/9/6 -f 67/14/1 69/15/1 68/12/1 -f 67/14/1 68/12/1 65/8/1 -f 78/9/4 56/13/4 52/4/4 -f 78/9/4 52/4/4 77/7/4 -f 12/3/6 14/13/6 13/9/6 -f 12/3/6 13/9/6 10/8/6 -f 72/12/3 74/6/3 73/3/3 -f 72/12/3 73/3/3 71/8/3 -usemtl inside -f 24/6/3 27/12/3 25/7/3 -f 24/6/3 25/7/3 26/4/3 -f 21/15/5 23/10/5 22/4/5 -f 21/15/5 22/4/5 20/6/5 -f 17/15/4 20/6/4 18/13/4 -f 17/15/4 18/13/4 19/11/4 -f 48/6/2 51/4/2 49/7/2 -f 48/6/2 49/7/2 50/12/2 diff --git a/src/main/resources/assets/graves/models/block/gravelidsection.mtl b/src/main/resources/assets/graves/models/block/gravelidsection.mtl deleted file mode 100644 index 8c0d06b..0000000 --- a/src/main/resources/assets/graves/models/block/gravelidsection.mtl +++ /dev/null @@ -1,23 +0,0 @@ -# Blender MTL File: 'None' -# Material Count: 2 - -newmtl FrontColston -Ns 96.078431 -Ka 1.000000 1.000000 1.000000 -Kd 0.800000 0.800000 0.800000 -Ks 0.164706 0.164706 0.164706 -Ke 0.000000 0.000000 0.000000 -Ni 1.000000 -d 1.000000 -illum 2 -map_Kd minecraft:blocks/stone_andesite_smooth - -newmtl FrontColston_NONE -Ns 96.078431 -Ka 1.000000 1.000000 1.000000 -Kd 0.800000 0.800000 0.800000 -Ks 0.164706 0.164706 0.164706 -Ke 0.000000 0.000000 0.000000 -Ni 1.000000 -d 1.000000 -illum 2 diff --git a/src/main/resources/assets/graves/models/block/gravelidsection.obj b/src/main/resources/assets/graves/models/block/gravelidsection.obj deleted file mode 100644 index de5393f..0000000 --- a/src/main/resources/assets/graves/models/block/gravelidsection.obj +++ /dev/null @@ -1,118 +0,0 @@ -# Blender v2.76 (sub 0) OBJ File: '' -# www.blender.org -mtllib gravelidsection.mtl -o Group1 -v 0.975000 0.062500 0.000000 -v 0.975000 0.062500 0.000000 -v 1.000000 0.000000 0.000000 -v 0.975000 0.000000 0.000000 -v 0.975000 0.000000 0.000000 -v 0.975000 0.062500 0.000000 -v 1.000000 0.000000 0.950000 -v 1.000000 0.000000 0.000000 -v 0.975000 0.062500 0.950000 -v 0.975000 0.062500 0.000000 -v 0.025000 0.062500 0.950000 -v 0.975000 0.062500 0.950000 -v 0.025000 0.062500 -0.000000 -v 0.025000 0.000000 -0.000000 -v 0.025000 0.000000 -0.000000 -v 0.025000 0.062500 -0.000000 -v 0.025000 0.062500 -0.000000 -v 0.975000 0.000000 0.000000 -v 0.025000 0.000000 0.950000 -v 0.025000 0.000000 -0.000000 -v 0.975000 0.000000 0.950000 -v 1.000000 0.000000 0.950000 -v 1.000000 0.000000 0.000000 -v 1.000000 0.000000 1.000000 -v 1.000000 0.000000 0.950000 -v 0.975000 0.000000 1.000000 -v 0.975000 0.062500 0.950000 -v 0.975000 0.062500 0.950000 -v 0.975000 0.000000 1.000000 -v 1.000000 0.000000 1.000000 -v 0.025000 0.000000 1.000000 -v 0.975000 0.000000 1.000000 -v 0.025000 0.062500 0.950000 -v 0.025000 0.062500 0.950000 -v 0.000000 0.000000 1.000000 -v 0.025000 0.000000 1.000000 -v 0.000000 0.000000 0.950000 -v 0.025000 0.000000 1.000000 -v 0.000000 0.000000 1.000000 -v 0.000000 0.000000 -0.000000 -v 0.000000 0.000000 -0.000000 -v 0.000000 0.000000 -0.000000 -v 0.025000 0.062500 0.950000 -v 0.025000 0.062500 0.950000 -v 0.025000 0.062500 -0.000000 -v 0.000000 0.000000 0.950000 -v 0.000000 0.000000 0.950000 -v 0.000000 0.000000 1.000000 -v 0.975000 0.000000 1.000000 -v 0.025000 0.000000 1.000000 -v 1.000000 0.000000 1.000000 -v 1.000000 0.000000 0.950000 -vt 0.937500 0.062500 -vt 0.937500 1.000000 -vt 1.000000 1.000000 -vt 1.000000 0.062500 -vt 1.000000 0.975000 -vt 0.050000 1.000000 -vt 0.050000 0.975000 -vt 0.050000 0.000000 -vt 0.050000 0.025000 -vt 0.000000 0.025000 -vt 0.000000 0.000000 -vt 0.000000 0.975000 -vt 1.000000 0.025000 -vt 1.000000 0.000000 -vt 0.062500 0.937500 -vt 0.062500 1.000000 -vt -0.000000 1.000000 -vt -0.000000 0.062500 -vt 0.999900 0.999900 -vt 0.000100 0.999900 -vt 0.937500 0.937500 -vt 0.000000 0.937500 -vt 1.000000 0.937500 -vt 0.062500 0.062500 -vt 0.937500 -0.000000 -vn -0.928500 0.371400 -0.000000 -vn 0.000000 -1.000000 -0.000000 -vn 0.000000 0.624700 0.780900 -vn 0.000000 1.000000 0.000000 -vn 0.928500 0.371400 0.000000 -vn 0.000000 0.000000 -1.000000 -usemtl FrontColston -s off -f 42/1/1 46/2/1 43/3/1 -f 42/1/1 43/3/1 45/4/1 -f 18/5/2 22/6/2 21/7/2 -f 37/8/2 19/9/2 38/10/2 -f 37/8/2 38/10/2 39/11/2 -f 19/9/2 21/7/2 49/12/2 -f 19/9/2 49/12/2 50/10/2 -f 18/5/2 21/7/2 19/9/2 -f 18/5/2 19/9/2 20/13/2 -f 40/14/2 20/13/2 19/9/2 -f 40/14/2 19/9/2 37/8/2 -f 27/15/3 29/16/3 30/17/3 -f 10/18/4 13/4/4 11/19/4 -f 10/18/4 11/19/4 12/20/4 -f 35/3/3 36/2/3 33/21/3 -f 28/22/3 34/23/3 31/3/3 -f 28/22/3 31/3/3 32/17/3 -f 6/24/5 9/16/5 7/17/5 -f 6/24/5 7/17/5 8/18/5 -f 44/21/1 47/23/1 48/3/1 -f 9/15/5 51/17/5 52/22/5 -f 24/17/2 26/12/2 21/7/2 -f 24/17/2 21/7/2 25/6/2 -usemtl FrontColston_NONE -f 1/1/6 3/14/6 4/25/6 -f 18/5/2 23/3/2 22/6/2 -f 41/3/6 16/21/6 14/2/6 -f 2/25/6 5/14/6 15/3/6 -f 2/25/6 15/3/6 17/2/6 diff --git a/src/main/resources/assets/graves/models/block/gravelidsectionfoot.mtl b/src/main/resources/assets/graves/models/block/gravelidsectionfoot.mtl deleted file mode 100644 index 90382bd..0000000 --- a/src/main/resources/assets/graves/models/block/gravelidsectionfoot.mtl +++ /dev/null @@ -1,13 +0,0 @@ -# Blender MTL File: 'None' -# Material Count: 2 - -newmtl tex -Ns 96.078431 -Ka 1.000000 1.000000 1.000000 -Kd 0.800000 0.800000 0.800000 -Ks 0.164706 0.164706 0.164706 -Ke 0.000000 0.000000 0.000000 -Ni 1.000000 -d 1.000000 -illum 2 -map_Kd minecraft:blocks/stone_andesite_smooth diff --git a/src/main/resources/assets/graves/models/block/gravelidsectionfoot.obj b/src/main/resources/assets/graves/models/block/gravelidsectionfoot.obj deleted file mode 100644 index b9dcb30..0000000 --- a/src/main/resources/assets/graves/models/block/gravelidsectionfoot.obj +++ /dev/null @@ -1,109 +0,0 @@ -# Blender v2.76 (sub 0) OBJ File: '' -# www.blender.org -mtllib gravelidsectionfoot.mtl -o Group1.001 -v 0.000000 0.062500 0.025000 -v 0.000000 0.062500 0.025000 -v 0.000000 0.000000 0.000000 -v 0.000000 0.000000 0.025000 -v 0.000000 0.000000 0.025000 -v 0.000000 0.062500 0.025000 -v 0.950000 0.000000 0.000000 -v 0.000000 0.000000 0.000000 -v 0.950000 0.062500 0.025000 -v 0.000000 0.062500 0.025000 -v 0.950000 0.062500 0.975000 -v 0.950000 0.062500 0.025000 -v 0.000000 0.062500 0.975000 -v 0.000000 0.000000 0.975000 -v 0.000000 0.000000 0.975000 -v 0.000000 0.062500 0.975000 -v 0.000000 0.062500 0.975000 -v 0.000000 0.000000 0.025000 -v 0.950000 0.000000 0.975000 -v 0.000000 0.000000 0.975000 -v 0.950000 0.000000 0.025000 -v 0.950000 0.000000 0.000000 -v 0.000000 0.000000 0.000000 -v 1.000000 0.000000 0.000000 -v 0.950000 0.000000 0.000000 -v 1.000000 0.000000 0.025000 -v 0.950000 0.062500 0.025000 -v 0.950000 0.062500 0.025000 -v 1.000000 0.000000 0.025000 -v 1.000000 0.000000 0.000000 -v 1.000000 0.000000 0.975000 -v 1.000000 0.000000 0.025000 -v 0.950000 0.062500 0.975000 -v 0.950000 0.062500 0.975000 -v 1.000000 0.000000 1.000000 -v 1.000000 0.000000 0.975000 -v 0.950000 0.000000 1.000000 -v 1.000000 0.000000 0.975000 -v 1.000000 0.000000 1.000000 -v 0.000000 0.000000 1.000000 -v 0.000000 0.000000 1.000000 -v 0.000000 0.000000 1.000000 -v 0.950000 0.062500 0.975000 -v 0.950000 0.062500 0.975000 -v 0.000000 0.062500 0.975000 -v 0.950000 0.000000 1.000000 -v 0.950000 0.000000 1.000000 -v 1.000000 0.000000 1.000000 -v 1.000000 0.000000 0.025000 -v 1.000000 0.000000 0.975000 -v 1.000000 0.000000 0.000000 -v 0.950000 0.000000 0.000000 -vt 0.062500 0.062500 -vt 0.062500 1.000000 -vt 0.000000 1.000000 -vt 0.000000 0.062500 -vt 0.937500 1.000000 -vt 0.937500 0.000000 -vt 1.000000 0.000000 -vt 1.000000 1.000000 -vt 0.000000 0.000000 -vt 0.937500 0.937500 -vt 1.000000 0.062500 -vt 0.062500 0.937500 -vt 1.000000 0.937500 -vt 0.000000 0.937500 -vt 0.937500 0.062500 -vt 0.062500 0.000000 -vn 0.000000 0.371400 0.928500 -vn -0.000000 -1.000000 -0.000000 -vn 0.780900 0.624700 0.000000 -vn 0.000000 1.000000 0.000000 -vn -0.000000 0.371400 -0.928500 -vn -1.000000 0.000000 0.000000 -usemtl tex -s off -f 42/1/1 46/2/1 43/3/1 -f 42/1/1 43/3/1 45/4/1 -f 18/3/2 22/5/2 21/5/2 -f 37/6/2 19/6/2 38/7/2 -f 37/6/2 38/7/2 39/7/2 -f 19/6/2 21/5/2 49/8/2 -f 19/6/2 49/8/2 50/7/2 -f 18/3/2 21/5/2 19/6/2 -f 18/3/2 19/6/2 20/9/2 -f 40/9/2 20/9/2 19/6/2 -f 40/9/2 19/6/2 37/6/2 -f 27/10/3 29/5/3 30/8/3 -f 10/11/4 13/4/4 11/3/4 -f 10/11/4 11/3/4 12/8/4 -f 35/3/3 36/2/3 33/12/3 -f 28/13/3 34/14/3 31/3/3 -f 28/13/3 31/3/3 32/8/3 -f 6/15/5 9/5/5 7/8/5 -f 6/15/5 7/8/5 8/11/5 -f 44/12/1 47/14/1 48/3/1 -f 9/10/5 51/8/5 52/13/5 -f 24/8/2 26/8/2 21/5/2 -f 24/8/2 21/5/2 25/5/2 -usemtl tex -f 1/1/6 3/9/6 4/16/6 -f 18/3/2 23/3/2 22/5/2 -f 41/3/6 16/12/6 14/2/6 -f 2/16/6 5/9/6 15/3/6 -f 2/16/6 15/3/6 17/2/6 diff --git a/src/main/resources/assets/graves/models/block/gravestone.mtl b/src/main/resources/assets/graves/models/block/gravestone.mtl deleted file mode 100644 index 9825523..0000000 --- a/src/main/resources/assets/graves/models/block/gravestone.mtl +++ /dev/null @@ -1,14 +0,0 @@ -# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware -# File Created: 23.03.2016 14:46:27 - -newmtl box - Ns 96.0784 - Ni 1.5000 - d 1.0000 - Tr 0.0000 - Tf 1.0000 1.0000 1.0000 - illum 2 - Ka 1.0000 1.0000 1.0000 - Kd 0.8000 0.8000 0.8000 - Ks 0.1647 0.1647 0.1647 - Ke 0.0000 0.0000 0.0000 diff --git a/src/main/resources/assets/graves/models/block/gravestone.obj b/src/main/resources/assets/graves/models/block/gravestone.obj deleted file mode 100644 index e10e986..0000000 --- a/src/main/resources/assets/graves/models/block/gravestone.obj +++ /dev/null @@ -1,196 +0,0 @@ -# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware -# File Created: 23.03.2016 14:46:27 - -mtllib gravestone.mtl - -v 0.3840 0.0800 0.8457 -v -0.4408 0.0800 0.8457 -v -0.4801 0.0800 0.8850 -v 0.4233 0.0800 0.8850 -v -0.5284 0.0000 0.9333 -v 0.4716 0.0000 0.9333 -v 0.4233 0.0000 0.8850 -v -0.4801 0.0000 0.8850 -v 0.4233 0.0000 -1.0184 -v -0.4801 0.0000 -1.0184 -v -0.4801 0.0800 -1.0184 -v 0.4233 0.0800 -1.0184 -v 0.4716 0.0000 -1.0667 -v -0.5284 0.0000 -1.0667 -v -0.5284 -1.0100 0.9333 -v 0.4716 -1.0100 0.9333 -v -0.5284 -1.0100 -0.0667 -v 0.4716 -1.0100 -0.0667 -v 0.4233 0.0800 -0.0667 -v 0.3840 0.0800 -0.0667 -v -0.4408 0.0800 -0.9791 -v -0.4801 0.0800 -0.0667 -v -0.4408 0.0800 -0.0667 -v 0.4716 0.0000 -0.0667 -v 0.4233 0.0000 -0.0667 -v 0.4716 -1.0100 -1.0667 -v -0.5284 -1.0100 -1.0667 -v -0.4801 0.0000 -0.0667 -v -0.5284 0.0000 -0.0667 -v 0.3840 0.0800 -0.9791 -v 0.3840 -0.9798 0.8457 -v 0.3840 -0.9798 -0.0667 -v -0.4408 -0.9798 -0.0667 -v -0.4408 -0.9798 0.8457 -v -0.4408 -0.9798 -0.9791 -v 0.3840 -0.9798 -0.9791 -# 36 vertices - -vn 0.0000 1.0000 -0.0000 -vn 0.0000 0.0000 -1.0000 -vn 0.0000 0.0000 1.0000 -vn 0.0000 -1.0000 -0.0000 -vn 1.0000 0.0000 -0.0000 -vn -1.0000 0.0000 -0.0000 -# 6 vertex normals - -vt 0.8750 1.0000 0.0000 -vt 0.1250 1.0000 0.0000 -vt 0.0625 0.9375 0.0000 -vt 0.9375 0.9375 0.0000 -vt 0.0000 0.8750 0.0000 -vt 1.0000 0.8750 0.0000 -vt 0.9375 1.0000 0.0000 -vt 0.0625 1.0000 0.0000 -vt 1.0000 0.9375 0.0000 -vt 0.0000 0.9375 0.0000 -vt 0.0000 0.0000 0.0000 -vt 1.0000 0.0000 0.0000 -vt 0.9375 0.0000 0.0000 -vt 0.0000 1.0000 0.0000 -vt 0.9793 0.9565 0.0000 -vt 1.0000 1.0000 0.0000 -vt 0.5000 1.0000 0.0000 -vt 0.5000 0.9565 0.0000 -vt 0.9375 0.8750 0.0000 -vt 0.0625 0.0000 0.0000 -vt 0.9517 1.0000 0.0000 -vt 0.0483 1.0000 0.0000 -vt 0.0483 0.9375 0.0000 -vt 0.9517 0.9375 0.0000 -vt 0.0625 0.8750 0.0000 -vt 0.0207 0.9565 0.0000 -# 26 texture coords - -g default -usemtl box -s off -f 1/1/1 2/2/1 3/3/1 4/4/1 -f 5/5/1 6/6/1 7/4/1 8/3/1 -f 9/3/2 10/4/2 11/7/2 12/8/2 -f 10/4/1 9/3/1 13/5/1 14/6/1 -f 6/9/3 5/10/3 15/11/3 16/12/3 -f 15/11/4 17/13/4 18/7/4 16/14/4 -f 19/4/1 20/7/1 1/2/1 4/3/1 -f 21/15/1 11/16/1 22/17/1 23/18/1 -f 7/3/1 6/5/1 24/19/1 25/4/1 -f 26/12/5 13/9/5 24/3/5 18/20/5 -f 4/21/3 3/22/3 8/23/3 7/24/3 -f 25/4/5 19/7/5 4/8/5 7/3/5 -f 17/20/4 27/12/4 26/16/4 18/8/4 -f 26/11/2 27/12/2 14/9/2 13/10/2 -f 22/8/6 28/3/6 8/4/6 3/7/6 -f 14/10/6 27/11/6 17/13/6 29/4/6 -f 29/3/6 17/20/6 15/12/6 5/9/6 -f 29/4/1 28/19/1 10/25/1 14/10/1 -f 21/1/1 30/2/1 12/3/1 11/4/1 -f 18/13/5 24/4/5 6/10/5 16/11/5 -f 30/1/1 20/8/1 19/3/1 12/4/1 -f 2/26/1 23/18/1 22/17/1 3/14/1 -f 11/8/6 10/3/6 28/4/6 22/7/6 -f 9/4/5 12/7/5 19/8/5 25/3/5 -f 29/25/1 5/6/1 8/4/1 28/3/1 -f 24/25/1 13/6/1 9/4/1 25/3/1 -usemtl box -f 31/11/1 32/13/1 33/7/1 34/14/1 -f 35/12/5 21/16/5 23/8/5 33/20/5 -f 20/8/6 32/20/6 31/12/6 1/16/6 -f 35/11/3 36/12/3 30/16/3 21/14/3 -f 2/16/2 1/14/2 31/11/2 34/12/2 -f 30/14/6 36/11/6 32/13/6 20/7/6 -f 32/20/1 36/12/1 35/16/1 33/8/1 -f 33/13/5 23/7/5 2/14/5 34/11/5 -# 34 polygons - -# -# object default001 -# - -v 0.4200 0.1423 -0.0650 -v 0.4700 0.0823 -0.0650 -v 0.4700 0.0823 -1.0150 -v 0.4200 0.1423 -1.0150 -v -0.5300 0.0823 0.8850 -v -0.5300 0.0823 -0.0650 -v 0.4700 0.0823 0.8850 -v 0.4700 0.0823 -1.0650 -v 0.4200 0.0823 -1.0650 -v -0.4800 0.1423 -0.0650 -v -0.4800 0.1423 0.8850 -v 0.4200 0.1423 0.8850 -v -0.4800 0.1423 -1.0150 -v -0.5300 0.0823 -1.0650 -v -0.5300 0.0823 -1.0150 -v -0.4800 0.0823 -1.0650 -v -0.4800 0.0823 0.9350 -v 0.4200 0.0823 0.9350 -v 0.4700 0.0823 0.9350 -v -0.5300 0.0823 0.9350 -# 20 vertices - -vn 0.7682 0.6402 -0.0000 -vn 0.0000 -1.0000 -0.0000 -vn 0.0000 0.6402 -0.7682 -vn 0.0000 1.0000 -0.0000 -vn -0.7682 0.6402 -0.0000 -vn 0.0000 0.6402 0.7682 -# 6 vertex normals - -vt 0.0625 0.0625 0.0000 -vt 0.0625 0.0000 0.0000 -vt 1.0000 0.0000 0.0000 -vt 1.0000 0.0625 0.0000 -vt 0.9375 1.0000 0.0000 -vt 0.0625 1.0000 0.0000 -vt 0.9375 0.0000 0.0000 -vt 0.9375 0.0625 0.0000 -vt -0.0000 1.0000 0.0000 -vt 0.0000 -0.0000 0.0000 -vt 0.0000 0.9375 0.0000 -vt 0.9375 0.9375 0.0000 -vt 1.0000 1.0000 0.0000 -vt 1.0000 0.9375 0.0000 -vt 0.0000 0.0625 0.0000 -vt 0.0625 0.9375 0.0000 -# 16 texture coords - -g default001 -usemtl box -s off -f 37/27/7 38/28/7 39/29/7 40/30/7 -f 41/31/8 42/32/8 38/28/8 43/33/8 -f 40/34/9 44/29/9 45/30/9 -f 40/34/7 39/33/7 44/29/7 -f 46/31/10 47/35/10 48/36/10 37/33/10 -f 41/37/11 47/35/11 46/31/11 42/38/11 -f 49/38/11 50/39/11 51/31/11 -f 50/39/9 49/38/9 52/40/9 -f 38/33/7 37/34/7 48/41/7 43/36/7 -f 47/35/12 53/32/12 54/28/12 48/36/12 -f 48/27/7 55/36/7 43/28/7 -f 48/27/12 54/41/12 55/36/12 -f 51/32/8 50/35/8 44/36/8 39/28/8 -f 49/39/11 51/40/11 42/42/11 46/32/11 -f 42/31/8 51/32/8 39/28/8 38/33/8 -f 47/42/11 41/35/11 56/32/11 -f 56/35/12 53/37/12 47/42/12 -f 49/39/10 46/32/10 37/28/10 40/29/10 -f 45/29/9 52/39/9 49/31/9 40/33/9 -f 41/41/8 43/30/8 55/29/8 56/36/8 -# 12 polygons - 8 triangles - diff --git a/src/main/resources/assets/graves/models/block/headstone.mtl b/src/main/resources/assets/graves/models/block/headstone.mtl deleted file mode 100644 index 1c316b5..0000000 --- a/src/main/resources/assets/graves/models/block/headstone.mtl +++ /dev/null @@ -1,24 +0,0 @@ -# Blender MTL File: 'grave.blend' -# Material Count: 2 - -newmtl box -Ns 96.078431 -Ka 1.000000 1.000000 1.000000 -Kd 0.800000 0.800000 0.800000 -Ks 0.164706 0.164706 0.164706 -Ke 0.000000 0.000000 0.000000 -Ni 1.000000 -d 1.000000 -illum 2 -map_Kd minecraft:blocks/stone_andesite_smooth - -newmtl headstone -Ns 96.078431 -Ka 1.000000 1.000000 1.000000 -Kd 0.800000 0.800000 0.800000 -Ks 0.164706 0.164706 0.164706 -Ke 0.000000 0.000000 0.000000 -Ni 1.000000 -d 1.000000 -illum 2 -map_Kd minecraft:blocks/stone_diorite_smooth diff --git a/src/main/resources/assets/graves/models/block/headstone.obj b/src/main/resources/assets/graves/models/block/headstone.obj deleted file mode 100644 index 4bbd8aa..0000000 --- a/src/main/resources/assets/graves/models/block/headstone.obj +++ /dev/null @@ -1,1638 +0,0 @@ -# Blender v2.76 (sub 0) OBJ File: 'grave.blend' -# www.blender.org -mtllib headstone.mtl -o Model_Model.001 -v 0.173331 0.154838 -0.000000 -v 0.184436 0.177105 -0.000000 -v 0.208281 0.136976 -0.000000 -v 0.184436 0.177105 -0.000000 -v 0.173331 0.154838 -0.000000 -v 0.184436 0.177105 0.279375 -v 0.173331 0.154838 -0.000000 -v 0.173331 0.154838 0.279375 -v 0.173331 0.154838 -0.000000 -v 0.158576 0.134145 -0.000000 -v 0.173331 0.154838 0.279375 -v 0.158576 0.134145 -0.000000 -v 0.190202 0.111620 -0.000000 -v 0.208281 0.136976 0.009469 -v 0.190202 0.111620 -0.000000 -v 0.208281 0.136976 -0.000000 -v 0.190202 0.111620 0.009469 -v 0.190202 0.111620 0.009469 -v 0.208281 0.136976 0.009469 -v 0.212991 0.119114 0.009469 -v 0.229740 0.142606 0.009469 -v 0.221884 0.164247 0.009469 -v 0.221884 0.164247 0.009469 -v 0.208281 0.136976 0.009469 -v 0.208281 0.136976 -0.000000 -v 0.221884 0.164247 -0.000000 -v 0.221884 0.164247 -0.000000 -v 0.191796 0.200529 -0.000000 -v 0.191796 0.200529 -0.000000 -v 0.184436 0.177105 -0.000000 -v 0.191796 0.200529 0.279375 -v 0.184436 0.177105 -0.000000 -v 0.184436 0.177105 0.279375 -v 0.184436 0.177105 0.279375 -v 0.808217 0.200529 0.279375 -v 0.191796 0.200529 0.279375 -v 0.815580 0.177097 0.279375 -v 0.826688 0.154826 0.279375 -v 0.841449 0.134124 0.279375 -v 0.859767 0.115407 0.279375 -v 0.954887 0.000175 0.279375 -v 0.841449 0.134124 0.279375 -v 0.859767 0.115407 0.279375 -v 0.841449 0.134124 -0.000000 -v 0.841449 0.134124 -0.000000 -v 0.859767 0.115407 -0.000000 -v 0.859767 0.115407 -0.000000 -v 0.859767 0.115407 0.279375 -v 0.929837 0.053994 -0.000000 -v 0.929837 0.053994 0.279375 -v 0.929837 0.053994 0.279375 -v 0.929837 0.053994 0.279375 -v 0.954887 0.000175 0.279375 -v 0.929837 0.053994 -0.000000 -v 0.954887 0.000175 -0.000000 -v 0.894424 0.028900 -0.000000 -v 0.929837 0.053994 -0.000000 -v 0.954887 0.000175 -0.000000 -v 0.859767 0.115407 -0.000000 -v 0.831203 0.089750 -0.000000 -v 0.841449 0.134124 -0.000000 -v 0.809822 0.111600 -0.000000 -v 0.826688 0.154826 -0.000000 -v 0.791738 0.136960 -0.000000 -v 0.815580 0.177097 -0.000000 -v 0.778131 0.164243 -0.000000 -v 0.808217 0.200529 -0.000000 -v 0.769117 0.192935 -0.000000 -v 0.804696 0.224707 -0.000000 -v 0.764805 0.222539 -0.000000 -v 0.765311 0.252561 -0.000000 -v 0.765311 0.252561 -0.000000 -v 0.764805 0.222539 -0.000000 -v 0.764805 0.222539 0.009469 -v 0.764805 0.222539 -0.000000 -v 0.769117 0.192935 0.009469 -v 0.764805 0.222539 0.009469 -v 0.764805 0.222539 -0.000000 -v 0.769117 0.192935 -0.000000 -v 0.769117 0.192935 -0.000000 -v 0.778131 0.164243 0.009469 -v 0.769117 0.192935 0.009469 -v 0.769117 0.192935 -0.000000 -v 0.778131 0.164243 -0.000000 -v 0.778131 0.164243 -0.000000 -v 0.791738 0.136960 0.009469 -v 0.778131 0.164243 0.009469 -v 0.791738 0.136960 -0.000000 -v 0.791738 0.136960 -0.000000 -v 0.809822 0.111600 0.009469 -v 0.791738 0.136960 0.009469 -v 0.791738 0.136960 -0.000000 -v 0.809822 0.111600 -0.000000 -v 0.809822 0.111600 -0.000000 -v 0.831203 0.089750 0.009469 -v 0.809822 0.111600 0.009469 -v 0.809822 0.111600 -0.000000 -v 0.831203 0.089750 -0.000000 -v 0.831203 0.089750 -0.000000 -v 0.894424 0.028900 0.009469 -v 0.831203 0.089750 0.009469 -v 0.894424 0.028900 -0.000000 -v 0.831203 0.089750 -0.000000 -v 0.894424 0.028900 -0.000000 -v 0.105576 0.028900 0.009469 -v 0.894424 0.028900 0.009469 -v 0.105576 0.028900 -0.000000 -v 0.105576 0.028900 -0.000000 -v 0.168828 0.089779 0.009469 -v 0.105576 0.028900 0.009469 -v 0.168828 0.089779 -0.000000 -v 0.190202 0.111620 0.009469 -v 0.168828 0.089779 0.009469 -v 0.168828 0.089779 -0.000000 -v 0.168828 0.089779 0.009469 -v 0.193188 0.098882 0.009469 -v 0.212991 0.119114 0.021307 -v 0.193188 0.098882 0.009469 -v 0.212991 0.119114 0.009469 -v 0.193188 0.098882 0.021307 -v 0.193188 0.098882 0.021307 -v 0.212991 0.119114 0.021307 -v 0.749320 0.194449 0.021308 -v 0.745326 0.221872 0.021308 -v 0.229740 0.142606 0.021307 -v 0.229740 0.142606 0.021307 -v 0.212991 0.119114 0.021307 -v 0.212991 0.119114 0.009469 -v 0.229740 0.142606 0.009469 -v 0.242342 0.167873 0.021307 -v 0.229740 0.142606 0.021307 -v 0.229740 0.142606 0.009469 -v 0.242342 0.167873 0.021307 -v 0.750838 0.277422 0.021308 -v 0.250691 0.194445 0.021307 -v 0.250691 0.194445 0.021307 -v 0.242342 0.167873 0.021307 -v 0.242342 0.167873 0.009469 -v 0.242342 0.167873 0.009469 -v 0.242342 0.167873 0.009469 -v 0.230896 0.192931 0.009469 -v 0.230896 0.192931 0.009469 -v 0.221884 0.164247 0.009469 -v 0.221884 0.164247 -0.000000 -v 0.221884 0.164247 -0.000000 -v 0.230896 0.192931 -0.000000 -v 0.230896 0.192931 -0.000000 -v 0.195316 0.224699 -0.000000 -v 0.195316 0.224699 -0.000000 -v 0.191796 0.200529 -0.000000 -v 0.195316 0.224699 0.279375 -v 0.191796 0.200529 -0.000000 -v 0.191796 0.200529 0.279375 -v 0.195316 0.224699 0.279375 -v 0.194903 0.249200 0.279375 -v 0.194903 0.249200 0.279375 -v 0.195316 0.224699 -0.000000 -v 0.195316 0.224699 0.279375 -v 0.194903 0.249200 -0.000000 -v 0.195316 0.224699 -0.000000 -v 0.194903 0.249200 -0.000000 -v 0.235207 0.222527 -0.000000 -v 0.234701 0.252545 -0.000000 -v 0.229259 0.282466 -0.000000 -v 0.190462 0.273623 -0.000000 -v 0.219263 0.310403 -0.000000 -v 0.181898 0.297557 -0.000000 -v 0.191977 0.370700 -0.000000 -v 0.146986 0.374703 -0.000000 -v 0.182622 0.424009 -0.000000 -v 0.190478 0.434879 0.011983 -v 0.182622 0.424009 -0.000000 -v 0.146986 0.374703 -0.000000 -v 0.182622 0.424009 -0.000000 -v 0.190478 0.434879 0.011983 -v 0.197165 0.423362 -0.000000 -v 0.197165 0.423362 -0.000000 -v 0.190478 0.434879 0.011983 -v 0.809522 0.434879 0.011983 -v 0.190478 0.434879 0.011983 -v 0.205073 0.434879 0.026578 -v 0.809522 0.434879 0.011983 -v 0.205073 0.434879 0.252801 -v 0.190478 0.434879 0.267396 -v 0.794927 0.434879 0.252801 -v 0.809522 0.434879 0.267396 -v 0.809522 0.434879 0.267396 -v 0.853014 0.374703 -0.000000 -v 0.809522 0.434879 0.011983 -v 0.853014 0.374703 0.279375 -v 0.853014 0.374703 -0.000000 -v 0.809522 0.434879 0.267396 -v 0.817378 0.424009 0.279375 -v 0.853014 0.374703 0.279375 -v 0.809522 0.434879 0.267396 -v 0.182622 0.424009 0.279375 -v 0.817378 0.424009 0.279375 -v 0.190478 0.434879 0.267396 -v 0.190478 0.434879 0.267396 -v 0.146986 0.374703 0.279375 -v 0.182622 0.424009 0.279375 -v 0.190478 0.434879 0.267396 -v 0.146986 0.374703 -0.000000 -v 0.146986 0.374703 0.279375 -v 0.190478 0.434879 0.011983 -v 0.146986 0.374703 -0.000000 -v 0.146986 0.374703 -0.000000 -v 0.181898 0.297557 0.279375 -v 0.146986 0.374703 0.279375 -v 0.181898 0.297557 -0.000000 -v 0.181898 0.297557 -0.000000 -v 0.190462 0.273623 -0.000000 -v 0.181898 0.297557 0.279375 -v 0.190462 0.273623 0.279375 -v 0.190462 0.273623 -0.000000 -v 0.194903 0.249200 -0.000000 -v 0.190462 0.273623 0.279375 -v 0.194903 0.249200 -0.000000 -v 0.194903 0.249200 0.279375 -v 0.190462 0.273623 0.279375 -v 0.182622 0.424009 0.279375 -v 0.181898 0.297557 0.279375 -v 0.146986 0.374703 0.279375 -v 0.804696 0.224707 0.279375 -v 0.804696 0.224707 0.279375 -v 0.808217 0.200529 0.279375 -v 0.804696 0.224707 -0.000000 -v 0.808217 0.200529 -0.000000 -v 0.808217 0.200529 0.279375 -v 0.815580 0.177097 0.279375 -v 0.808217 0.200529 -0.000000 -v 0.815580 0.177097 -0.000000 -v 0.815580 0.177097 0.279375 -v 0.826688 0.154826 0.279375 -v 0.815580 0.177097 -0.000000 -v 0.815580 0.177097 -0.000000 -v 0.826688 0.154826 -0.000000 -v 0.826688 0.154826 0.279375 -v 0.841449 0.134124 0.279375 -v 0.826688 0.154826 -0.000000 -v 0.841449 0.134124 -0.000000 -v 0.805109 0.249220 -0.000000 -v 0.804696 0.224707 0.279375 -v 0.804696 0.224707 -0.000000 -v 0.805109 0.249220 0.279375 -v 0.805109 0.249220 0.279375 -v 0.817378 0.424009 0.279375 -v 0.809552 0.273651 0.279375 -v 0.809552 0.273651 0.279375 -v 0.805109 0.249220 0.279375 -v 0.809552 0.273651 -0.000000 -v 0.809552 0.273651 -0.000000 -v 0.805109 0.249220 -0.000000 -v 0.770754 0.282494 -0.000000 -v 0.809552 0.273651 -0.000000 -v 0.805109 0.249220 -0.000000 -v 0.780753 0.310440 -0.000000 -v 0.780753 0.310440 -0.000000 -v 0.770754 0.282494 -0.000000 -v 0.770754 0.282494 0.009469 -v 0.770754 0.282494 -0.000000 -v 0.765311 0.252561 0.009469 -v 0.770754 0.282494 0.009469 -v 0.770754 0.282494 -0.000000 -v 0.765311 0.252561 -0.000000 -v 0.765311 0.252561 0.009469 -v 0.745795 0.249689 0.009469 -v 0.765311 0.252561 0.009469 -v 0.764805 0.222539 0.009469 -v 0.750838 0.277422 0.009469 -v 0.750838 0.277422 0.009469 -v 0.745795 0.249689 0.009469 -v 0.745795 0.249689 0.021308 -v 0.745795 0.249689 0.009469 -v 0.745326 0.221872 0.021308 -v 0.745795 0.249689 0.021308 -v 0.745795 0.249689 0.009469 -v 0.745326 0.221872 0.009469 -v 0.745326 0.221872 0.021308 -v 0.745326 0.221872 0.009469 -v 0.749321 0.194449 0.009469 -v 0.769117 0.192935 0.009469 -v 0.757672 0.167869 0.009469 -v 0.778131 0.164243 0.009469 -v 0.770278 0.142594 0.009469 -v 0.791738 0.136960 0.009469 -v 0.787032 0.119098 0.009469 -v 0.809822 0.111600 0.009469 -v 0.806840 0.098858 0.009469 -v 0.831203 0.089750 0.009469 -v 0.865411 0.042481 0.009469 -v 0.894424 0.028900 0.009469 -v 0.134589 0.042481 0.009469 -v 0.134589 0.042481 0.009469 -v 0.134589 0.042481 0.021307 -v 0.865411 0.042481 0.009469 -v 0.134589 0.042481 0.009469 -v 0.193188 0.098882 0.021307 -v 0.134589 0.042481 0.021307 -v 0.193188 0.098882 0.009469 -v 0.105576 0.028900 0.009469 -v 0.134589 0.042481 0.021307 -v 0.757672 0.167869 0.021308 -v 0.749321 0.194449 0.009469 -v 0.757672 0.167869 0.021308 -v 0.749320 0.194449 0.021308 -v 0.749321 0.194449 0.009469 -v 0.757672 0.167869 0.009469 -v 0.757672 0.167869 0.021308 -v 0.757672 0.167869 0.009469 -v 0.770278 0.142594 0.021308 -v 0.757672 0.167869 0.021308 -v 0.757672 0.167869 0.009469 -v 0.770278 0.142594 0.009469 -v 0.770278 0.142594 0.021308 -v 0.770278 0.142594 0.009469 -v 0.787032 0.119098 0.021308 -v 0.770278 0.142594 0.021308 -v 0.770278 0.142594 0.009469 -v 0.787032 0.119098 0.009469 -v 0.787032 0.119098 0.021308 -v 0.787032 0.119098 0.009469 -v 0.806840 0.098858 0.021308 -v 0.787032 0.119098 0.021308 -v 0.787032 0.119098 0.009469 -v 0.806840 0.098858 0.009469 -v 0.806840 0.098858 0.021308 -v 0.806840 0.098858 0.009469 -v 0.865411 0.042481 0.021308 -v 0.806840 0.098858 0.021308 -v 0.865411 0.042481 0.009469 -v 0.865411 0.042481 0.021308 -v 0.806840 0.098858 0.009469 -v 0.865411 0.042481 0.021308 -v 0.806840 0.098858 0.021308 -v 0.865411 0.042481 0.021308 -v 0.787032 0.119098 0.021308 -v 0.770278 0.142594 0.021308 -v 0.745326 0.221872 0.009469 -v 0.749321 0.194449 0.009469 -v 0.749320 0.194449 0.021308 -v 0.745326 0.221872 0.021308 -v 0.745795 0.249689 0.021308 -v 0.750838 0.277422 0.021308 -v 0.760101 0.303308 0.009469 -v 0.750838 0.277422 0.009469 -v 0.750838 0.277422 0.021308 -v 0.760101 0.303308 0.009469 -v 0.770754 0.282494 0.009469 -v 0.780753 0.310440 0.009469 -v 0.785365 0.359134 0.009469 -v 0.785365 0.359134 0.009469 -v 0.760101 0.303308 0.009469 -v 0.760101 0.303308 0.021308 -v 0.760101 0.303308 0.009469 -v 0.750838 0.277422 0.021308 -v 0.760101 0.303308 0.021308 -v 0.766990 0.384558 0.021308 -v 0.760101 0.303308 0.021308 -v 0.254685 0.221864 0.021307 -v 0.254216 0.249673 0.021307 -v 0.249174 0.277394 0.021307 -v 0.233010 0.384558 0.021307 -v 0.233010 0.384558 0.009469 -v 0.766990 0.384558 0.021308 -v 0.233010 0.384558 0.021307 -v 0.766990 0.384558 0.009469 -v 0.766990 0.384558 0.009469 -v 0.785365 0.359134 0.021308 -v 0.766990 0.384558 0.021308 -v 0.766990 0.384558 0.009469 -v 0.785365 0.359134 0.009469 -v 0.785365 0.359134 0.021308 -v 0.766990 0.384558 0.009469 -v 0.788189 0.398139 0.009469 -v 0.211811 0.398139 0.009469 -v 0.211811 0.398139 -0.000000 -v 0.788189 0.398139 0.009469 -v 0.211811 0.398139 0.009469 -v 0.788189 0.398139 -0.000000 -v 0.788189 0.398139 -0.000000 -v 0.808023 0.370700 0.009469 -v 0.788189 0.398139 0.009469 -v 0.808023 0.370700 -0.000000 -v 0.788189 0.398139 -0.000000 -v 0.817378 0.424009 -0.000000 -v 0.808023 0.370700 -0.000000 -v 0.802835 0.423362 -0.000000 -v 0.211811 0.398139 -0.000000 -v 0.197165 0.423362 -0.000000 -v 0.802835 0.423362 -0.000000 -v 0.802835 0.423362 -0.000000 -v 0.809522 0.434879 0.011983 -v 0.817378 0.424009 -0.000000 -v 0.809522 0.434879 0.011983 -v 0.853014 0.374703 -0.000000 -v 0.817378 0.424009 -0.000000 -v 0.853014 0.374703 -0.000000 -v 0.818118 0.297593 -0.000000 -v 0.853014 0.374703 0.279375 -v 0.818118 0.297593 -0.000000 -v 0.853014 0.374703 -0.000000 -v 0.818118 0.297593 0.279375 -v 0.818118 0.297593 -0.000000 -v 0.818118 0.297593 0.279375 -v 0.853014 0.374703 0.279375 -v 0.818118 0.297593 0.279375 -v 0.809552 0.273651 0.279375 -v 0.818118 0.297593 -0.000000 -v 0.818118 0.297593 -0.000000 -v 0.809552 0.273651 -0.000000 -v 0.808023 0.370700 -0.000000 -v 0.780753 0.310440 -0.000000 -v 0.780753 0.310440 0.009469 -v 0.780753 0.310440 0.009469 -v 0.808023 0.370700 0.009469 -v 0.808023 0.370700 0.009469 -v 0.211811 0.398139 0.009469 -v 0.191977 0.370700 -0.000000 -v 0.211811 0.398139 -0.000000 -v 0.191977 0.370700 0.009469 -v 0.191977 0.370700 -0.000000 -v 0.191977 0.370700 0.009469 -v 0.214635 0.359134 0.009469 -v 0.233010 0.384558 0.009469 -v 0.233010 0.384558 0.021307 -v 0.214635 0.359134 0.009469 -v 0.233010 0.384558 0.009469 -v 0.214635 0.359134 0.021307 -v 0.214635 0.359134 0.021307 -v 0.239914 0.303275 0.021307 -v 0.239914 0.303275 0.021307 -v 0.249174 0.277394 0.021307 -v 0.249174 0.277394 0.009469 -v 0.249174 0.277394 0.021307 -v 0.254216 0.249673 0.009469 -v 0.249174 0.277394 0.009469 -v 0.254216 0.249673 0.021307 -v 0.254216 0.249673 0.021307 -v 0.254685 0.221864 0.009469 -v 0.254216 0.249673 0.009469 -v 0.254685 0.221864 0.021307 -v 0.254685 0.221864 0.021307 -v 0.250691 0.194445 0.009469 -v 0.254685 0.221864 0.009469 -v 0.250691 0.194445 0.021307 -v 0.250691 0.194445 0.009469 -v 0.250691 0.194445 0.009469 -v 0.235207 0.222527 0.009469 -v 0.235207 0.222527 0.009469 -v 0.230896 0.192931 0.009469 -v 0.230896 0.192931 -0.000000 -v 0.235207 0.222527 -0.000000 -v 0.234701 0.252545 0.009469 -v 0.235207 0.222527 0.009469 -v 0.235207 0.222527 -0.000000 -v 0.234701 0.252545 0.009469 -v 0.254216 0.249673 0.009469 -v 0.249174 0.277394 0.009469 -v 0.229259 0.282466 0.009469 -v 0.239914 0.303275 0.009469 -v 0.219263 0.310403 0.009469 -v 0.214635 0.359134 0.021307 -v 0.239914 0.303275 0.009469 -v 0.214635 0.359134 0.009469 -v 0.239914 0.303275 0.021307 -v 0.239914 0.303275 0.009469 -v 0.191977 0.370700 0.009469 -v 0.219263 0.310403 0.009469 -v 0.219263 0.310403 -0.000000 -v 0.219263 0.310403 0.009469 -v 0.229259 0.282466 -0.000000 -v 0.219263 0.310403 -0.000000 -v 0.229259 0.282466 0.009469 -v 0.229259 0.282466 0.009469 -v 0.234701 0.252545 -0.000000 -v 0.229259 0.282466 -0.000000 -v 0.234701 0.252545 0.009469 -v 0.234701 0.252545 -0.000000 -v 0.234701 0.252545 -0.000000 -v 0.219263 0.310403 -0.000000 -v 0.191977 0.370700 -0.000000 -v 0.254685 0.221864 0.009469 -v 0.785365 0.359134 0.021308 -v 0.785365 0.359134 0.021308 -v 0.794927 0.434879 0.026578 -v 0.783370 0.434879 0.026578 -v 0.216630 0.434879 0.026578 -v 0.205073 0.434879 0.026578 -v 0.216630 0.836310 0.026578 -v 0.216630 0.434879 0.026578 -v 0.205073 0.842742 0.026578 -v 0.249494 0.870292 0.026578 -v 0.255089 0.860163 0.026578 -v 0.296465 0.893225 0.026578 -v 0.301011 0.882584 0.026578 -v 0.345508 0.911309 0.026578 -v 0.348958 0.900264 0.026578 -v 0.396123 0.924359 0.026578 -v 0.398443 0.913022 0.026578 -v 0.447796 0.932242 0.026578 -v 0.448962 0.920730 0.026578 -v 0.500000 0.934879 0.026578 -v 0.500000 0.923308 0.026578 -v 0.551038 0.920730 0.026578 -v 0.552204 0.932242 0.026578 -v 0.601557 0.913022 0.026578 -v 0.603877 0.924359 0.026578 -v 0.651042 0.900264 0.026578 -v 0.654492 0.911309 0.026578 -v 0.698989 0.882584 0.026578 -v 0.703535 0.893225 0.026578 -v 0.744911 0.860163 0.026578 -v 0.750506 0.870292 0.026578 -v 0.783370 0.836310 0.026578 -v 0.794927 0.842742 0.026578 -v 0.783370 0.434879 0.026578 -v 0.794927 0.434879 0.026578 -v 0.794927 0.842742 0.026578 -v 0.794927 0.434879 0.252801 -v 0.794927 0.434879 0.026578 -v 0.794927 0.842742 0.252801 -v 0.794927 0.842742 0.026578 -v 0.750506 0.870292 0.252801 -v 0.794927 0.842742 0.252801 -v 0.750506 0.870292 0.026578 -v 0.750506 0.870292 0.026578 -v 0.703535 0.893225 0.252801 -v 0.750506 0.870292 0.252801 -v 0.703535 0.893225 0.026578 -v 0.703535 0.893225 0.026578 -v 0.654492 0.911309 0.252801 -v 0.703535 0.893225 0.252801 -v 0.654492 0.911309 0.026578 -v 0.654492 0.911309 0.026578 -v 0.603877 0.924359 0.252801 -v 0.654492 0.911309 0.252801 -v 0.603877 0.924359 0.026578 -v 0.603877 0.924359 0.026578 -v 0.552204 0.932242 0.252801 -v 0.603877 0.924359 0.252801 -v 0.552204 0.932242 0.026578 -v 0.552204 0.932242 0.026578 -v 0.500000 0.934879 0.252801 -v 0.552204 0.932242 0.252801 -v 0.500000 0.934879 0.026578 -v 0.500000 0.934879 0.026578 -v 0.447796 0.932242 0.252801 -v 0.500000 0.934879 0.252801 -v 0.447796 0.932242 0.026578 -v 0.447796 0.932242 0.026578 -v 0.396123 0.924359 0.252801 -v 0.447796 0.932242 0.252801 -v 0.396123 0.924359 0.026578 -v 0.396123 0.924359 0.026578 -v 0.345508 0.911309 0.252801 -v 0.396123 0.924359 0.252801 -v 0.345508 0.911309 0.026578 -v 0.345508 0.911309 0.026578 -v 0.296465 0.893225 0.252801 -v 0.345508 0.911309 0.252801 -v 0.296465 0.893225 0.026578 -v 0.296465 0.893225 0.026578 -v 0.249494 0.870292 0.252801 -v 0.296465 0.893225 0.252801 -v 0.249494 0.870292 0.026578 -v 0.249494 0.870292 0.026578 -v 0.205073 0.842742 0.252801 -v 0.249494 0.870292 0.252801 -v 0.205073 0.842742 0.026578 -v 0.205073 0.434879 0.026578 -v 0.205073 0.842742 0.252801 -v 0.205073 0.842742 0.026578 -v 0.205073 0.434879 0.252801 -v 0.205073 0.434879 0.252801 -v 0.249494 0.870292 0.252801 -v 0.205073 0.842742 0.252801 -v 0.296465 0.893225 0.252801 -v 0.345508 0.911309 0.252801 -v 0.396123 0.924359 0.252801 -v 0.447796 0.932242 0.252801 -v 0.500000 0.934879 0.252801 -v 0.552204 0.932242 0.252801 -v 0.603877 0.924359 0.252801 -v 0.654492 0.911309 0.252801 -v 0.703535 0.893225 0.252801 -v 0.750506 0.870292 0.252801 -v 0.794927 0.434879 0.252801 -v 0.794927 0.842742 0.252801 -v 0.783370 0.434879 0.026578 -v 0.783370 0.836310 0.036578 -v 0.783370 0.836310 0.026578 -v 0.783370 0.434879 0.036578 -v 0.216630 0.434879 0.036578 -v 0.783370 0.434879 0.036578 -v 0.216630 0.836310 0.026578 -v 0.216630 0.434879 0.036578 -v 0.216630 0.434879 0.026578 -v 0.216630 0.836310 0.036578 -v 0.216630 0.836310 0.026578 -v 0.255089 0.860163 0.036578 -v 0.216630 0.836310 0.036578 -v 0.255089 0.860163 0.026578 -v 0.255089 0.860163 0.026578 -v 0.301011 0.882584 0.036578 -v 0.255089 0.860163 0.036578 -v 0.301011 0.882584 0.026578 -v 0.301011 0.882584 0.026578 -v 0.348958 0.900264 0.036578 -v 0.301011 0.882584 0.036578 -v 0.348958 0.900264 0.026578 -v 0.348958 0.900264 0.026578 -v 0.398443 0.913022 0.036578 -v 0.348958 0.900264 0.036578 -v 0.398443 0.913022 0.026578 -v 0.398443 0.913022 0.026578 -v 0.448962 0.920730 0.036578 -v 0.398443 0.913022 0.036578 -v 0.448962 0.920730 0.026578 -v 0.448962 0.920730 0.026578 -v 0.500000 0.923308 0.036578 -v 0.448962 0.920730 0.036578 -v 0.500000 0.923308 0.026578 -v 0.500000 0.923308 0.026578 -v 0.551038 0.920730 0.036578 -v 0.500000 0.923308 0.036578 -v 0.551038 0.920730 0.026578 -v 0.551038 0.920730 0.026578 -v 0.601557 0.913022 0.036578 -v 0.551038 0.920730 0.036578 -v 0.601557 0.913022 0.026578 -v 0.601557 0.913022 0.026578 -v 0.651042 0.900264 0.036578 -v 0.601557 0.913022 0.036578 -v 0.651042 0.900264 0.026578 -v 0.651042 0.900264 0.026578 -v 0.698989 0.882584 0.036578 -v 0.651042 0.900264 0.036578 -v 0.698989 0.882584 0.026578 -v 0.698989 0.882584 0.026578 -v 0.744911 0.860163 0.036578 -v 0.698989 0.882584 0.036578 -v 0.744911 0.860163 0.026578 -v 0.744911 0.860163 0.026578 -v 0.783370 0.836310 0.036578 -v 0.744911 0.860163 0.036578 -v 0.783370 0.836310 0.026578 -v 0.783370 0.836310 0.036578 -v 0.216630 0.434879 0.036578 -v 0.744911 0.860163 0.036578 -v 0.783370 0.434879 0.036578 -v 0.698989 0.882584 0.036578 -v 0.651042 0.900264 0.036578 -v 0.601557 0.913022 0.036578 -v 0.551038 0.920730 0.036578 -v 0.500000 0.923308 0.036578 -v 0.448962 0.920730 0.036578 -v 0.398443 0.913022 0.036578 -v 0.348958 0.900264 0.036578 -v 0.301011 0.882584 0.036578 -v 0.255089 0.860163 0.036578 -v 0.216630 0.836310 0.036578 -v 0.168828 0.089779 -0.000000 -v 0.190202 0.111620 -0.000000 -v 0.168828 0.089779 -0.000000 -v 0.140264 0.115435 -0.000000 -v 0.158576 0.134145 -0.000000 -v 0.140264 0.115435 -0.000000 -v 0.158576 0.134145 0.279375 -v 0.140264 0.115435 0.279375 -v 0.140264 0.115435 -0.000000 -v 0.070163 0.053994 0.279375 -v 0.140264 0.115435 0.279375 -v 0.070163 0.053994 -0.000000 -v 0.140264 0.115435 -0.000000 -v 0.070163 0.053994 -0.000000 -v 0.045113 0.000175 0.279375 -v 0.070163 0.053994 0.279375 -v 0.070163 0.053994 -0.000000 -v 0.045113 0.000175 -0.000000 -v 0.045113 0.000175 -0.000000 -v 0.070163 0.053994 -0.000000 -v 0.105576 0.028900 -0.000000 -v 0.881758 0.000175 0.279375 -v 0.136462 0.000177 0.279375 -v 0.118262 0.000174 0.279375 -v 0.427804 0.000176 0.279375 -v 0.129183 0.000175 0.279375 -v 0.870833 0.000169 0.279375 -v 0.140428 0.000179 0.279375 -v 0.140264 0.115435 0.279375 -v 0.045113 0.000175 0.279375 -v 0.158576 0.134145 0.279375 -v 0.173331 0.154838 0.279375 -v 0.158576 0.134145 -0.000000 -v 0.158576 0.134145 0.279375 -v 0.070163 0.053994 0.279375 -vt 0.858015 0.421667 -vt 0.845914 0.445932 -vt 0.819928 0.402201 -vt 0.874095 0.399116 -vt 0.839630 0.374570 -vt 0.815279 0.406722 -vt 0.834653 0.379551 -vt 0.810233 0.387581 -vt 0.792284 0.412755 -vt 0.800702 0.435945 -vt 0.805105 0.431920 -vt 0.837894 0.471458 -vt 0.073589 0.302264 -vt 0.000000 0.250000 -vt 1.000000 0.250000 -vt 0.072203 0.284426 -vt 0.033612 0.311773 -vt 0.006314 0.253123 -vt 0.109971 0.378697 -vt 0.141098 0.350738 -vt 0.129933 0.399094 -vt 0.164398 0.374548 -vt 0.146019 0.421653 -vt 0.184105 0.402184 -vt 0.158124 0.445924 -vt 0.198933 0.431916 -vt 0.166147 0.471458 -vt 0.208757 0.463183 -vt 0.169985 0.497807 -vt 0.213456 0.495444 -vt 0.212904 0.528160 -vt 0.218907 0.498412 -vt 0.214286 0.466688 -vt 0.204626 0.435941 -vt 0.190045 0.406705 -vt 0.170666 0.379529 -vt 0.147754 0.356115 -vt 0.080006 0.290908 -vt 0.925339 0.290908 -vt 0.931852 0.284426 -vt 0.857558 0.356145 -vt 0.862923 0.350768 -vt 0.831453 0.365901 -vt 0.804736 0.393415 -vt 0.825524 0.372177 -vt 0.787154 0.418076 -vt 0.773925 0.444600 -vt 0.765160 0.472494 -vt 0.778779 0.439831 -vt 0.791045 0.466684 -vt 0.795284 0.463179 -vt 0.834058 0.497799 -vt 0.834508 0.524498 -vt 0.790586 0.495431 -vt 0.791138 0.528143 -vt 0.797068 0.560750 -vt 0.839348 0.551113 -vt 0.807961 0.591195 -vt 0.848680 0.577195 -vt 0.837696 0.656903 -vt 0.886726 0.661266 -vt 0.847891 0.714996 -vt 0.833064 0.725726 -vt 0.832042 0.714292 -vt 0.172615 0.725726 -vt 0.206973 0.560780 -vt 0.164693 0.551144 -vt 0.169534 0.524519 -vt 0.196076 0.591234 -vt 0.212531 0.562660 -vt 0.218364 0.530583 -vt 0.239277 0.527506 -vt 0.233874 0.557225 -vt 0.245426 0.530487 -vt 0.245919 0.501286 -vt 0.239780 0.497697 -vt 0.235499 0.468310 -vt 0.226550 0.439827 -vt 0.213041 0.412742 -vt 0.195088 0.387564 -vt 0.173861 0.365875 -vt 0.111097 0.305461 -vt 0.894248 0.305461 -vt 0.887038 0.312971 -vt 0.232958 0.444596 -vt 0.241725 0.472498 -vt 0.219725 0.418063 -vt 0.202138 0.393398 -vt 0.181344 0.372152 -vt 0.119860 0.312971 -vt 0.240133 0.559599 -vt 0.223947 0.584964 -vt 0.201816 0.592606 -vt 0.196874 0.644788 -vt 0.230408 0.586772 -vt 0.788780 0.672032 -vt 0.223177 0.672065 -vt 0.783721 0.672065 -vt 0.216565 0.672032 -vt 0.203888 0.645376 -vt 0.193848 0.686586 -vt 0.811496 0.686586 -vt 0.816082 0.686805 -vt 0.187973 0.686805 -vt 0.172594 0.657181 -vt 0.166359 0.656903 -vt 0.156164 0.714996 -vt 0.172013 0.714292 -vt 0.117329 0.661266 -vt 0.155357 0.577235 -vt 0.832751 0.657181 -vt 0.808471 0.644788 -vt 0.803010 0.645376 -vt 0.776474 0.586739 -vt 0.766752 0.559570 -vt 0.771458 0.557195 -vt 0.766055 0.527489 -vt 0.761460 0.530470 -vt 0.765553 0.497689 -vt 0.760968 0.501277 -vt 0.769832 0.468306 -vt 0.786426 0.498399 -vt 0.786968 0.530566 -vt 0.792799 0.562630 -vt 0.781382 0.584929 -vt 0.803511 0.592568 -vt 0.937500 -0.000000 -vt 1.000000 1.000000 -vt 1.000000 -0.000000 -vt 0.937500 1.000000 -vt 0.875000 1.000000 -vt 1.000000 0.937500 -vt 0.875000 0.937500 -vt 0.750000 1.000000 -vt 0.750000 0.937500 -vt 0.687500 1.000000 -vt 0.687500 0.937500 -vt 0.625000 1.000000 -vt 0.625000 0.937500 -vt 0.562500 1.000000 -vt 0.562500 0.937500 -vt 0.500000 1.000000 -vt 0.500000 0.937500 -vt 0.437500 0.937500 -vt 0.437500 1.000000 -vt 0.375000 0.937500 -vt 0.375000 1.000000 -vt 0.312500 0.937500 -vt 0.312500 1.000000 -vt 0.250000 0.937500 -vt 0.250000 1.000000 -vt 0.125000 0.937500 -vt 0.125000 1.000000 -vt 0.000000 0.937500 -vt 0.000000 1.000000 -vt 0.062500 1.000000 -vt -0.000000 0.000000 -vt 0.062500 -0.000000 -vt 0.894050 0.378728 -vt 0.997741 0.253123 -vt 0.970443 0.311773 -vt 0.380319 0.653801 -vt 0.380319 0.630314 -vt 0.674995 0.653801 -vt 0.674995 0.630314 -vt 0.380319 0.608488 -vt 0.380319 0.678508 -vt 0.674995 0.678508 -vt 0.202391 0.659216 -vt 0.794255 0.684159 -vt 0.209374 0.684159 -vt 0.801241 0.659208 -vt 0.811781 0.635492 -vt 0.825786 0.613449 -vt 0.937500 0.500000 -vt 0.062500 0.500000 -vt 0.062500 0.875000 -vt 0.937500 0.875000 -vt 0.149965 0.470813 -vt 0.177854 0.613470 -vt 0.160480 0.593547 -vt 0.139603 0.470812 -vt 0.070837 0.470625 -vt 0.139375 0.470625 -vt 0.160625 0.593750 -vt 0.843167 0.593518 -vt 0.864033 0.470813 -vt 0.933273 0.471694 -vt 0.376785 0.615258 -vt 0.376785 0.595058 -vt 0.678283 0.615258 -vt 0.678283 0.595058 -vt 0.678283 0.528783 -vt 0.376785 0.528783 -vt 0.909652 0.528122 -vt 0.376785 0.470702 -vt 0.678283 0.470702 -vt 0.862781 0.130009 -vt 0.839191 0.154109 -vt 0.200286 0.243851 -vt 0.205045 0.276520 -vt 0.819239 0.182094 -vt 0.804226 0.212194 -vt 0.198479 0.342692 -vt 0.794280 0.243848 -vt 0.380319 0.704002 -vt 0.674995 0.704002 -vt 0.212714 0.709897 -vt 0.212322 0.735986 -vt 0.674995 0.729844 -vt 0.380319 0.729844 -vt 0.289127 0.443101 -vt 0.284857 0.436427 -vt 0.289127 0.409972 -vt 0.257393 0.841471 -vt 0.251746 0.849443 -vt 0.029712 0.860514 -vt 0.278364 0.970031 -vt 0.297806 0.976161 -vt 0.018570 0.970290 -vt 0.000628 0.976161 -vt 0.617456 0.588942 -vt 0.596388 0.567874 -vt 0.965090 0.567874 -vt 0.389713 0.939828 -vt 0.678283 0.874887 -vt 0.665351 0.939828 -vt 0.376785 0.874887 -vt 0.795493 0.933707 -vt 0.802948 0.922131 -vt 0.836760 0.869629 -vt 0.200670 0.922131 -vt 0.208124 0.933707 -vt 0.166857 0.869629 -vt 0.662360 0.925694 -vt 0.380319 0.862222 -vt 0.674995 0.862222 -vt 0.392958 0.925694 -vt 0.674995 0.780850 -vt 0.380319 0.780850 -vt 0.380319 0.755606 -vt 0.674995 0.755606 -vt 0.208108 0.761994 -vt 0.199983 0.787480 -vt 0.790914 0.709906 -vt 0.376785 0.713014 -vt 0.376785 0.686920 -vt 0.678283 0.713014 -vt 0.678283 0.686920 -vt 0.376785 0.661633 -vt 0.678283 0.661633 -vt 0.376785 0.637598 -vt 0.678283 0.637598 -vt 0.678283 0.739467 -vt 0.376785 0.739467 -vt 0.791306 0.736008 -vt 0.795521 0.762024 -vt 0.376785 0.765833 -vt 0.678283 0.765833 -vt 0.932587 0.062821 -vt 0.190338 0.212187 -vt 0.131768 0.129979 -vt 0.061996 0.062821 -vt 0.155363 0.154087 -vt 0.175320 0.182077 -vt 0.204486 0.309656 -vt 0.179237 0.470318 -vt 0.187444 0.373529 -vt 0.789523 0.276511 -vt 0.790081 0.309639 -vt 0.796087 0.342661 -vt 0.815342 0.470320 -vt 0.290383 0.443101 -vt 0.290383 0.409972 -vt 0.294653 0.436427 -vt 0.678283 0.791671 -vt 0.376785 0.791671 -vt 0.803650 0.787518 -vt 0.837232 0.440034 -vt 0.807118 0.373492 -vt 0.157348 0.440032 -vt 0.033946 0.864696 -vt 0.052915 0.865866 -vt 0.124383 0.863962 -vt 0.250000 0.062500 -vt 0.750000 0.062500 -vt 0.702095 0.062575 -vt 0.365719 0.128626 -vt 0.365719 0.062575 -vt 0.702095 0.128626 -vt 0.365719 0.198468 -vt 0.702095 0.198468 -vt 0.365719 0.271390 -vt 0.702095 0.271390 -vt 0.365719 0.346651 -vt 0.702095 0.346651 -vt 0.365719 0.423484 -vt 0.702095 0.423484 -vt 0.365719 0.501108 -vt 0.702095 0.501108 -vt 0.365719 0.578731 -vt 0.702095 0.578731 -vt 0.365719 0.655564 -vt 0.702095 0.655564 -vt 0.365719 0.730825 -vt 0.702095 0.730825 -vt 0.365719 0.803747 -vt 0.702095 0.803747 -vt 0.365719 0.873589 -vt 0.702095 0.873589 -vt 0.365719 0.939640 -vt 0.702095 0.939640 -vt 0.066185 0.065470 -vt 0.131617 0.706824 -vt 0.066185 0.666244 -vt 0.200804 0.740605 -vt 0.273043 0.767242 -vt 0.347599 0.786464 -vt 0.423712 0.798077 -vt 0.500607 0.801961 -vt 0.577503 0.798077 -vt 0.653616 0.786464 -vt 0.728171 0.767242 -vt 0.800411 0.740605 -vt 0.869598 0.706824 -vt 0.935030 0.065470 -vt 0.020196 0.432006 -vt 0.000628 0.623805 -vt 0.000628 0.444142 -vt 0.261716 0.403555 -vt 0.266120 0.580387 -vt 0.261716 0.580387 -vt 0.266120 0.403555 -vt 0.106391 0.865644 -vt 0.085017 0.871722 -vt 0.271782 0.580387 -vt 0.267377 0.403555 -vt 0.271782 0.403555 -vt 0.267377 0.580387 -vt 0.315642 0.481819 -vt 0.295707 0.477414 -vt 0.315642 0.477414 -vt 0.295707 0.481819 -vt 0.355569 0.478616 -vt 0.333059 0.474211 -vt 0.355569 0.474211 -vt 0.333059 0.478616 -vt 0.315642 0.476158 -vt 0.293131 0.471753 -vt 0.315642 0.471753 -vt 0.293131 0.476158 -vt 0.315642 0.470497 -vt 0.293131 0.466092 -vt 0.315642 0.466092 -vt 0.293131 0.470497 -vt 0.315642 0.459174 -vt 0.293131 0.454770 -vt 0.315642 0.454769 -vt 0.293131 0.459174 -vt 0.355569 0.455971 -vt 0.333059 0.451563 -vt 0.355570 0.451566 -vt 0.333058 0.455968 -vt 0.315642 0.453513 -vt 0.293131 0.449106 -vt 0.315642 0.449108 -vt 0.293131 0.453510 -vt 0.355570 0.461632 -vt 0.333058 0.457227 -vt 0.355569 0.457227 -vt 0.333059 0.461632 -vt 0.355570 0.472955 -vt 0.333059 0.468550 -vt 0.355570 0.468550 -vt 0.333059 0.472955 -vt 0.315642 0.464836 -vt 0.293131 0.460431 -vt 0.315642 0.460431 -vt 0.293131 0.464836 -vt 0.355569 0.467294 -vt 0.333058 0.462889 -vt 0.355569 0.462888 -vt 0.333058 0.467294 -vt 0.294451 0.481819 -vt 0.274516 0.477414 -vt 0.294451 0.477414 -vt 0.274516 0.481819 -vt 0.062988 0.687004 -vt 0.939227 0.066351 -vt 0.122450 0.723882 -vt 0.062988 0.066351 -vt 0.193450 0.758548 -vt 0.267582 0.785883 -vt 0.344091 0.805609 -vt 0.422197 0.817525 -vt 0.501108 0.821511 -vt 0.580018 0.817525 -vt 0.658125 0.805609 -vt 0.734633 0.785883 -vt 0.808765 0.758548 -vt 0.879765 0.723882 -vt 0.939227 0.687004 -vt 0.380319 0.588754 -vt 0.674995 0.608488 -vt 0.674995 0.588754 -vt 0.674995 0.523948 -vt 0.380319 0.523948 -vt 0.674995 0.467181 -vt 0.380319 0.467181 -vt 0.853667 0.470806 -vt 0.160634 0.470817 -vt 0.191854 0.635505 -vt 0.156871 0.470815 -vt 0.433307 0.470814 -vt 0.070197 0.470813 -vt 0.093965 0.528122 -vn 0.000000 -0.000000 -1.000000 -vn 0.814200 -0.580600 0.000000 -vn 0.894900 -0.446400 0.000000 -vn -0.999900 0.016900 0.000000 -vn -0.989600 -0.144100 0.000000 -vn -0.954000 -0.299700 0.000000 -vn -0.894900 -0.446300 0.000000 -vn -0.814200 -0.580600 0.000000 -vn -0.714700 -0.699400 0.000000 -vn -0.693500 -0.720500 0.000000 -vn 0.000000 1.000000 0.000000 -vn 0.693500 -0.720500 0.000000 -vn 0.714700 -0.699400 0.000000 -vn 0.714600 -0.699500 0.000000 -vn 0.814200 -0.580500 0.000000 -vn 0.894900 -0.446300 0.000000 -vn 0.954000 -0.299800 0.000000 -vn 0.954000 -0.299700 0.000000 -vn 0.032400 0.729600 -0.683100 -vn 0.000000 0.721000 -0.693000 -vn -0.941500 0.336900 0.000000 -vn -0.983900 0.178900 0.000000 -vn -0.954000 -0.299800 -0.000000 -vn -0.714700 -0.699500 0.000000 -vn -0.989600 -0.144200 -0.000000 -vn -0.941500 0.337000 0.000000 -vn -0.911100 0.412300 -0.000000 -vn 0.000000 -1.000000 0.000000 -vn -0.810500 -0.585800 0.000000 -vn -0.810400 -0.585800 0.000000 -vn -0.032400 0.729600 -0.683100 -vn 0.810400 -0.585800 0.000000 -vn 0.810500 -0.585800 0.000000 -vn 0.941500 0.336900 0.000000 -vn 0.983900 0.178900 0.000000 -vn 0.999900 0.016900 0.000000 -vn 0.989600 -0.144100 0.000000 -vn 0.911000 0.412300 0.000000 -vn 0.911100 0.412300 0.000000 -vn -0.894900 0.446300 0.000000 -vn -0.814200 0.580600 0.000000 -vn -0.954000 0.299700 0.000000 -vn -0.000000 0.000000 1.000000 -vn 0.714700 0.699400 0.000000 -vn 0.659100 0.752000 0.000000 -vn 0.906600 0.422000 0.000000 -vn -0.989600 0.144100 0.000000 -vn -0.999900 -0.016900 0.000000 -vn -0.810500 0.585800 -0.000000 -vn 0.810500 0.585800 0.000000 -vn 0.000000 0.740500 0.672000 -vn -0.911100 -0.412300 0.000000 -vn -0.941500 -0.336900 0.000000 -vn -0.983900 -0.178900 0.000000 -vn 0.989600 0.144100 0.000000 -vn 0.954000 0.299800 0.000000 -vn 0.894900 0.446300 0.000000 -vn 0.814200 0.580600 0.000000 -vn 0.999900 -0.016900 0.000000 -vn 0.983900 -0.178900 0.000000 -vn 0.911100 -0.412300 0.000000 -vn 0.941500 -0.336900 0.000000 -vn 0.000000 1.000000 0.000400 -vn 1.000000 0.000000 0.000000 -vn 0.527100 0.849800 0.000000 -vn 0.438700 0.898600 0.000000 -vn 0.346000 0.938200 0.000000 -vn 0.249700 0.968300 0.000000 -vn 0.150800 0.988600 0.000000 -vn 0.050400 0.998700 0.000000 -vn -0.050400 0.998700 0.000000 -vn -0.150800 0.988600 0.000000 -vn -0.249700 0.968300 0.000000 -vn -0.346000 0.938200 0.000000 -vn -0.438700 0.898600 0.000000 -vn -0.527100 0.849800 0.000000 -vn -1.000000 0.000000 0.000000 -vn 0.527100 -0.849800 0.000000 -vn 0.438700 -0.898600 0.000000 -vn 0.346000 -0.938200 0.000000 -vn 0.249700 -0.968300 0.000000 -vn 0.150800 -0.988600 0.000000 -vn 0.050400 -0.998700 0.000000 -vn -0.050400 -0.998700 0.000000 -vn -0.150800 -0.988600 0.000000 -vn -0.249700 -0.968300 0.000000 -vn -0.346000 -0.938200 0.000000 -vn -0.438700 -0.898600 0.000000 -vn -0.527100 -0.849800 0.000000 -vn -0.714700 0.699500 0.000000 -vn -0.659100 0.752000 0.000000 -vn -0.906600 0.422000 0.000000 -usemtl box -s off -f 1/1/1 2/2/1 3/3/1 -f 12/4/1 1/1/1 13/5/1 -f 1/1/1 3/3/1 13/5/1 -f 14/6/2 15/5/2 16/3/2 -f 14/6/2 17/7/2 15/5/2 -f 18/7/1 19/6/1 20/8/1 -f 19/6/1 21/9/1 20/8/1 -f 19/6/1 22/10/1 21/9/1 -f 23/10/3 24/6/3 25/3/3 -f 23/10/3 25/3/3 26/11/3 -f 2/2/1 27/11/1 3/3/1 -f 2/2/1 28/12/1 27/11/1 -f 56/13/1 55/14/1 681/15/1 -f 56/16/1 57/17/1 58/18/1 -f 59/19/1 57/17/1 56/16/1 -f 60/20/1 59/19/1 56/16/1 -f 60/20/1 61/21/1 59/19/1 -f 62/22/1 61/21/1 60/20/1 -f 62/22/1 63/23/1 61/21/1 -f 64/24/1 63/23/1 62/22/1 -f 64/24/1 65/25/1 63/23/1 -f 66/26/1 65/25/1 64/24/1 -f 66/26/1 67/27/1 65/25/1 -f 68/28/1 67/27/1 66/26/1 -f 68/28/1 69/29/1 67/27/1 -f 70/30/1 69/29/1 68/28/1 -f 70/30/1 71/31/1 69/29/1 -f 72/31/4 73/30/4 74/32/4 -f 75/30/5 76/33/5 77/32/5 -f 78/30/5 79/28/5 76/33/5 -f 80/28/6 81/34/6 82/33/6 -f 83/28/6 84/26/6 81/34/6 -f 85/26/7 86/35/7 87/34/7 -f 85/26/7 88/24/7 86/35/7 -f 89/24/8 90/36/8 91/35/8 -f 92/24/8 93/22/8 90/36/8 -f 94/22/9 95/37/9 96/36/9 -f 97/22/9 98/20/9 95/37/9 -f 99/20/10 100/38/10 101/37/10 -f 102/16/10 100/38/10 103/20/10 -f 104/16/11 105/39/11 106/38/11 -f 107/40/11 105/39/11 104/16/11 -f 108/40/12 109/41/12 110/39/12 -f 111/42/12 109/41/12 108/40/12 -f 112/7/13 113/41/13 114/42/13 -f 115/41/1 18/7/1 116/43/1 -f 18/7/1 20/8/1 116/43/1 -f 117/44/14 118/43/14 119/8/14 -f 117/44/14 120/45/14 118/43/14 -f 126/46/15 127/44/15 128/8/15 -f 126/46/15 128/8/15 129/9/15 -f 130/47/16 131/46/16 132/9/16 -f 136/48/17 137/47/17 138/49/17 -f 130/47/16 132/9/16 139/49/16 -f 22/10/1 140/49/1 21/9/1 -f 22/10/1 141/50/1 140/49/1 -f 142/50/18 143/10/18 144/11/18 -f 142/50/18 145/11/18 146/51/18 -f 28/12/1 147/51/1 27/11/1 -f 28/12/1 148/52/1 147/51/1 -f 161/53/1 162/54/1 148/52/1 -f 161/53/1 163/55/1 162/54/1 -f 161/53/1 164/56/1 163/55/1 -f 165/57/1 164/56/1 161/53/1 -f 165/57/1 166/58/1 164/56/1 -f 167/59/1 166/58/1 165/57/1 -f 167/59/1 168/60/1 166/58/1 -f 169/61/1 168/60/1 167/59/1 -f 169/61/1 170/62/1 168/60/1 -f 174/62/19 175/63/19 176/64/19 -f 177/64/20 178/63/20 179/65/20 -f 254/66/1 255/67/1 256/68/1 -f 254/66/1 257/69/1 255/67/1 -f 258/69/21 259/66/21 260/70/21 -f 261/66/22 262/71/22 263/70/22 -f 264/66/22 265/31/22 262/71/22 -f 71/31/1 254/66/1 256/68/1 -f 71/31/1 256/68/1 69/29/1 -f 72/31/4 74/32/4 266/71/4 -f 267/72/1 268/71/1 269/32/1 -f 267/72/1 270/73/1 268/71/1 -f 271/73/22 272/72/22 273/74/22 -f 274/72/4 275/75/4 276/74/4 -f 277/72/4 278/76/4 279/75/4 -f 280/76/1 267/72/1 269/32/1 -f 280/76/1 269/32/1 281/77/1 -f 281/77/1 269/32/1 282/33/1 -f 281/77/1 282/33/1 283/78/1 -f 283/78/1 282/33/1 284/34/1 -f 283/78/1 284/34/1 285/79/1 -f 285/79/1 284/34/1 286/35/1 -f 285/79/1 286/35/1 287/80/1 -f 287/80/1 286/35/1 288/36/1 -f 287/80/1 288/36/1 289/81/1 -f 289/81/1 288/36/1 290/37/1 -f 289/81/1 290/37/1 291/82/1 -f 290/37/1 292/38/1 291/82/1 -f 293/83/1 291/82/1 292/38/1 -f 294/83/11 295/84/11 296/82/11 -f 297/83/12 298/45/12 299/84/12 -f 300/43/12 298/45/12 297/83/12 -f 293/83/1 115/41/1 116/43/1 -f 301/39/1 115/41/1 293/83/1 -f 301/39/1 293/83/1 292/38/1 -f 304/77/23 305/85/23 306/86/23 -f 307/77/23 308/78/23 309/85/23 -f 310/78/7 311/87/7 312/85/7 -f 313/78/7 314/79/7 315/87/7 -f 316/79/8 317/88/8 318/87/8 -f 319/79/8 320/80/8 321/88/8 -f 322/80/24 323/89/24 324/88/24 -f 325/80/24 326/81/24 327/89/24 -f 328/81/10 329/90/10 330/89/10 -f 331/82/10 332/90/10 333/81/10 -f 296/82/11 295/84/11 334/90/11 -f 339/76/25 340/77/25 341/86/25 -f 339/76/5 341/86/5 342/75/5 -f 271/73/22 273/74/22 344/91/22 -f 345/92/26 346/73/26 347/91/26 -f 270/73/1 348/92/1 349/70/1 -f 348/92/1 350/93/1 349/70/1 -f 348/92/1 351/94/1 350/93/1 -f 352/94/27 353/92/27 354/95/27 -f 355/92/21 356/91/21 357/95/21 -f 364/96/28 365/97/28 366/98/28 -f 367/99/28 365/97/28 364/96/28 -f 368/99/29 369/100/29 370/97/29 -f 371/99/29 372/94/29 373/100/29 -f 374/99/1 375/101/1 351/94/1 -f 376/102/1 375/101/1 374/99/1 -f 377/103/28 378/101/28 379/102/28 -f 380/104/28 378/101/28 377/103/28 -f 381/104/30 382/105/30 383/101/30 -f 381/104/30 384/106/30 382/105/30 -f 385/104/1 386/107/1 387/106/1 -f 385/104/1 388/108/1 386/107/1 -f 389/103/1 388/108/1 385/104/1 -f 390/64/1 388/108/1 389/103/1 -f 177/64/20 179/65/20 391/108/20 -f 392/108/31 393/65/31 394/107/31 -f 387/106/1 386/107/1 398/109/1 -f 387/106/1 398/109/1 399/110/1 -f 257/69/1 399/110/1 255/67/1 -f 257/69/1 387/106/1 399/110/1 -f 412/106/27 413/69/27 414/93/27 -f 258/69/21 260/70/21 415/93/21 -f 412/106/27 414/93/27 416/105/27 -f 350/93/1 351/94/1 417/105/1 -f 351/94/1 375/101/1 417/105/1 -f 170/62/1 390/64/1 389/103/1 -f 170/62/1 389/103/1 168/60/1 -f 418/102/32 419/60/32 420/103/32 -f 418/102/32 421/111/32 422/60/32 -f 423/111/1 376/102/1 424/112/1 -f 376/102/1 425/96/1 424/112/1 -f 376/102/1 374/99/1 425/96/1 -f 426/98/33 427/112/33 428/96/33 -f 426/98/33 429/113/33 427/112/33 -f 432/114/34 433/115/34 434/116/34 -f 435/115/35 436/117/35 437/116/35 -f 435/115/35 438/118/35 436/117/35 -f 439/118/36 440/119/36 441/117/36 -f 439/118/36 442/120/36 440/119/36 -f 443/120/37 444/121/37 445/119/37 -f 443/120/37 446/48/37 444/121/37 -f 136/48/17 138/49/17 447/121/17 -f 141/50/1 448/121/1 140/49/1 -f 141/50/1 449/122/1 448/121/1 -f 450/122/37 451/50/37 452/51/37 -f 450/122/37 452/51/37 453/54/37 -f 148/52/1 162/54/1 147/51/1 -f 454/123/36 455/122/36 456/54/36 -f 457/123/1 458/117/1 449/122/1 -f 457/123/1 459/116/1 458/117/1 -f 460/124/1 459/116/1 457/123/1 -f 460/124/1 461/125/1 459/116/1 -f 462/126/1 461/125/1 460/124/1 -f 424/112/1 461/125/1 462/126/1 -f 463/113/38 464/125/38 465/112/38 -f 463/113/38 466/114/38 464/125/38 -f 432/114/34 434/116/34 467/125/34 -f 423/111/1 424/112/1 462/126/1 -f 468/111/39 469/126/39 470/58/39 -f 471/126/34 472/56/34 473/58/34 -f 471/126/34 474/124/34 472/56/34 -f 475/124/35 476/55/35 477/56/35 -f 475/124/35 478/123/35 479/55/35 -f 454/123/36 456/54/36 480/55/36 -f 468/111/39 481/58/39 482/60/39 -f 449/122/1 458/117/1 483/119/1 -f 449/122/1 483/119/1 448/121/1 -f 352/94/27 354/95/27 484/100/27 -f 270/73/1 349/70/1 268/71/1 -f 489/127/1 490/128/1 491/129/1 -f 492/130/1 490/128/1 489/127/1 -f 493/131/1 490/132/1 492/128/1 -f 493/131/1 494/133/1 490/132/1 -f 495/134/1 494/133/1 493/131/1 -f 495/134/1 496/135/1 494/133/1 -f 497/136/1 496/135/1 495/134/1 -f 497/136/1 498/137/1 496/135/1 -f 499/138/1 498/137/1 497/136/1 -f 499/138/1 500/139/1 498/137/1 -f 501/140/1 500/139/1 499/138/1 -f 501/140/1 502/141/1 500/139/1 -f 503/142/1 502/141/1 501/140/1 -f 503/142/1 504/143/1 502/141/1 -f 503/142/1 505/144/1 504/143/1 -f 506/145/1 505/144/1 503/142/1 -f 506/145/1 507/146/1 505/144/1 -f 508/147/1 507/146/1 506/145/1 -f 508/147/1 509/148/1 507/146/1 -f 510/149/1 509/148/1 508/147/1 -f 510/149/1 511/150/1 509/148/1 -f 512/151/1 511/150/1 510/149/1 -f 512/151/1 513/152/1 511/150/1 -f 514/153/1 513/152/1 512/151/1 -f 514/153/1 515/154/1 513/152/1 -f 516/155/1 515/154/1 514/153/1 -f 516/156/1 517/157/1 515/155/1 -f 517/157/1 516/156/1 518/158/1 -f 112/7/13 663/42/13 664/5/13 -f 12/4/1 13/5/1 665/42/1 -f 666/159/1 12/4/1 665/42/1 -f 681/160/1 682/161/1 683/40/1 -f 682/161/1 666/159/1 683/40/1 -f 683/40/1 666/159/1 665/42/1 -f 681/160/1 683/40/1 56/16/1 -usemtl headstone -f 4/162/40 5/163/40 6/164/40 -f 6/164/40 7/163/40 8/165/40 -f 9/163/41 10/166/41 11/165/41 -f 29/167/42 30/162/42 31/168/42 -f 31/168/42 32/162/42 33/164/42 -f 34/169/43 35/170/43 36/171/43 -f 34/169/43 37/172/43 35/170/43 -f 34/169/43 38/173/43 37/172/43 -f 34/169/43 39/174/43 38/173/43 -f 680/175/28 55/176/28 53/177/28 677/178/28 -f 688/179/43 693/180/43 691/181/43 686/182/43 -f 677/183/43 686/184/43 670/185/43 -f 40/186/43 684/187/43 41/188/43 -f 42/189/44 43/190/44 44/191/44 -f 45/191/44 43/190/44 46/192/44 -f 47/192/45 48/190/45 49/193/45 -f 49/193/45 48/190/45 50/194/45 -f 40/186/43 41/188/43 51/195/43 -f 52/194/46 53/196/46 54/193/46 -f 54/193/46 53/196/46 55/197/46 -f 121/198/1 122/199/1 123/200/1 -f 122/199/1 124/201/1 123/200/1 -f 122/199/1 125/202/1 124/201/1 -f 125/202/1 133/203/1 134/204/1 -f 133/203/1 135/205/1 134/204/1 -f 149/206/47 150/167/47 151/207/47 -f 151/207/47 152/167/47 153/168/47 -f 36/171/43 35/170/43 154/208/43 -f 155/209/43 154/208/43 35/170/43 -f 156/210/48 157/206/48 158/207/48 -f 159/211/48 160/206/48 156/210/48 -f 171/212/49 172/213/49 173/214/49 -f 180/215/11 181/216/11 182/217/11 -f 180/215/11 183/218/11 181/216/11 -f 184/219/11 183/218/11 180/215/11 -f 183/218/11 184/219/11 185/220/11 -f 186/221/11 185/220/11 184/219/11 -f 185/222/11 186/223/11 182/224/11 -f 187/225/50 188/226/50 189/227/50 -f 187/225/50 190/228/50 191/226/50 -f 192/229/50 193/230/50 194/231/50 -f 195/229/51 196/232/51 197/230/51 -f 198/233/51 196/232/51 195/229/51 -f 199/233/49 200/234/49 201/232/49 -f 202/235/49 203/236/49 204/237/49 -f 205/238/49 206/236/49 202/235/49 -f 207/236/52 208/239/52 209/237/52 -f 207/236/52 210/240/52 208/239/52 -f 211/240/53 212/241/53 213/239/53 -f 213/239/53 212/241/53 214/242/53 -f 215/241/54 216/211/54 217/242/54 -f 217/242/54 218/211/54 219/210/54 -f 220/243/43 155/209/43 35/170/43 -f 221/232/43 220/243/43 35/170/43 -f 222/244/43 220/243/43 221/232/43 -f 223/234/43 222/244/43 221/232/43 -f 221/232/43 35/170/43 224/245/43 -f 225/246/55 226/247/55 227/248/55 -f 227/248/55 226/247/55 228/249/55 -f 229/247/56 230/250/56 231/249/56 -f 231/249/56 230/250/56 232/251/56 -f 233/250/57 234/252/57 235/251/57 -f 236/251/57 234/252/57 237/253/57 -f 238/252/58 239/189/58 240/253/58 -f 240/253/58 239/189/58 241/191/58 -f 242/254/59 243/246/59 244/248/59 -f 245/255/59 243/246/59 242/254/59 -f 221/232/43 224/245/43 246/256/43 -f 221/232/43 246/256/43 247/230/43 -f 246/256/43 248/257/43 247/230/43 -f 249/258/60 250/255/60 251/259/60 -f 252/259/60 250/255/60 253/254/60 -f 302/260/1 121/198/1 123/200/1 -f 302/260/1 123/200/1 303/261/1 -f 302/260/1 335/262/1 336/263/1 -f 302/260/1 337/264/1 335/262/1 -f 302/260/1 338/265/1 337/264/1 -f 302/260/1 303/261/1 338/265/1 -f 125/202/1 343/266/1 124/201/1 -f 125/202/1 134/204/1 343/266/1 -f 134/204/1 358/267/1 359/268/1 -f 360/269/1 358/267/1 134/204/1 -f 361/270/1 358/267/1 360/269/1 -f 362/271/1 358/267/1 361/270/1 -f 363/272/1 358/267/1 362/271/1 -f 395/273/50 396/274/50 397/275/50 -f 400/228/61 401/276/61 402/226/61 -f 400/228/61 403/277/61 404/276/61 -f 247/230/43 405/278/43 406/231/43 -f 248/257/43 405/278/43 247/230/43 -f 407/277/62 408/258/62 409/276/62 -f 410/276/62 408/258/62 411/259/62 -f 430/279/1 363/272/1 431/280/1 -f 363/272/1 362/271/1 431/280/1 -f 135/205/1 360/269/1 134/204/1 -f 359/268/1 358/267/1 485/281/1 -f 185/220/11 182/217/11 486/282/11 -f 486/282/11 182/217/11 487/283/11 -f 487/283/11 182/217/11 488/284/11 -f 488/284/63 182/217/63 181/216/63 -f 519/135/64 520/285/64 521/286/64 -f 520/285/64 519/135/64 522/150/64 -f 523/287/65 524/288/65 525/289/65 -f 524/288/65 523/287/65 526/290/65 -f 527/290/66 528/291/66 529/288/66 -f 528/291/66 527/290/66 530/292/66 -f 531/292/67 532/293/67 533/291/67 -f 532/293/67 531/292/67 534/294/67 -f 535/294/68 536/295/68 537/293/68 -f 536/295/68 535/294/68 538/296/68 -f 539/296/69 540/297/69 541/295/69 -f 540/297/69 539/296/69 542/298/69 -f 543/298/70 544/299/70 545/297/70 -f 544/299/70 543/298/70 546/300/70 -f 547/300/71 548/301/71 549/299/71 -f 548/301/71 547/300/71 550/302/71 -f 551/302/72 552/303/72 553/301/72 -f 552/303/72 551/302/72 554/304/72 -f 555/304/73 556/305/73 557/303/73 -f 556/305/73 555/304/73 558/306/73 -f 559/306/74 560/307/74 561/305/74 -f 560/307/74 559/306/74 562/308/74 -f 563/308/75 564/309/75 565/307/75 -f 564/309/75 563/308/75 566/310/75 -f 567/310/76 568/311/76 569/309/76 -f 568/311/76 567/310/76 570/312/76 -f 571/285/77 572/135/77 573/150/77 -f 572/135/77 571/285/77 574/286/77 -f 575/313/43 576/314/43 577/315/43 -f 575/313/43 578/316/43 576/314/43 -f 575/313/43 579/317/43 578/316/43 -f 575/313/43 580/318/43 579/317/43 -f 575/313/43 581/319/43 580/318/43 -f 575/313/43 582/320/43 581/319/43 -f 575/313/43 583/321/43 582/320/43 -f 575/313/43 584/322/43 583/321/43 -f 575/313/43 585/323/43 584/322/43 -f 575/313/43 586/324/43 585/323/43 -f 575/313/43 587/325/43 586/324/43 -f 588/326/43 587/325/43 575/313/43 -f 587/327/43 588/328/43 589/329/43 -f 590/330/77 591/331/77 592/332/77 -f 591/331/77 590/330/77 593/333/77 -f 487/283/11 594/334/11 595/335/11 -f 594/334/11 487/283/11 488/284/11 -f 596/336/64 597/337/64 598/338/64 -f 597/337/64 596/336/64 599/339/64 -f 600/340/78 601/341/78 602/342/78 -f 601/341/78 600/340/78 603/343/78 -f 604/344/79 605/345/79 606/346/79 -f 605/345/79 604/344/79 607/347/79 -f 608/348/80 609/349/80 610/350/80 -f 609/349/80 608/348/80 611/351/80 -f 612/352/81 613/353/81 614/354/81 -f 613/353/81 612/352/81 615/355/81 -f 616/356/82 617/357/82 618/358/82 -f 617/357/82 616/356/82 619/359/82 -f 620/360/83 621/361/83 622/362/83 -f 621/361/83 620/360/83 623/363/83 -f 624/364/84 625/365/84 626/366/84 -f 625/365/84 624/364/84 627/367/84 -f 628/368/85 629/369/85 630/370/85 -f 629/369/85 628/368/85 631/371/85 -f 632/372/86 633/373/86 634/374/86 -f 633/373/86 632/372/86 635/375/86 -f 636/376/87 637/377/87 638/378/87 -f 637/377/87 636/376/87 639/379/87 -f 640/380/88 641/381/88 642/382/88 -f 641/381/88 640/380/88 643/383/88 -f 644/384/89 645/385/89 646/386/89 -f 645/385/89 644/384/89 647/387/89 -f 648/388/1 649/389/1 650/390/1 -f 649/389/1 648/388/1 651/391/1 -f 650/390/1 649/389/1 652/392/1 -f 652/392/1 649/389/1 653/393/1 -f 653/393/1 649/389/1 654/394/1 -f 654/394/1 649/389/1 655/395/1 -f 655/395/1 649/389/1 656/396/1 -f 656/396/1 649/389/1 657/397/1 -f 657/397/1 649/389/1 658/398/1 -f 658/398/1 649/389/1 659/399/1 -f 659/399/1 649/389/1 660/400/1 -f 660/400/1 649/389/1 661/401/1 -f 661/401/1 649/389/1 662/402/1 -f 667/166/90 668/403/90 669/404/90 -f 669/404/90 668/403/90 670/405/90 -f 671/403/91 672/406/91 673/405/91 -f 674/407/91 672/406/91 675/403/91 -f 676/407/92 677/408/92 678/406/92 -f 679/407/92 680/409/92 677/408/92 -f 39/174/43 689/410/43 684/187/43 40/186/43 -f 690/411/43 34/169/43 694/412/43 685/413/43 -f 685/413/43 694/412/43 693/180/43 688/179/43 -f 34/169/43 687/414/43 689/410/43 39/174/43 -f 690/411/43 687/414/43 34/169/43 -f 11/165/41 695/166/41 696/404/41 -f 692/415/43 691/181/43 697/416/43 -f 184/219/28 180/215/28 182/224/28 186/221/28 diff --git a/src/main/resources/assets/graves/models/block/nothing.mtl b/src/main/resources/assets/graves/models/block/nothing.mtl deleted file mode 100644 index 5b165d4..0000000 --- a/src/main/resources/assets/graves/models/block/nothing.mtl +++ /dev/null @@ -1,2 +0,0 @@ -# Blender MTL File: 'None' -# Material Count: 0 diff --git a/src/main/resources/assets/graves/models/block/nothing.obj b/src/main/resources/assets/graves/models/block/nothing.obj index d5ffcf1..e69de29 100644 --- a/src/main/resources/assets/graves/models/block/nothing.obj +++ b/src/main/resources/assets/graves/models/block/nothing.obj @@ -1,3 +0,0 @@ -# Blender v2.76 (sub 0) OBJ File: '' -# www.blender.org -mtllib nothing.mtl From 69f0f8e11a11703b5eee555b3b59661acdc2eb33 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Wed, 13 Jul 2016 04:33:06 -0700 Subject: [PATCH 38/47] More work on legacy graves. --- .../graves/common/block/BlockBase.java | 43 ++++++--------- .../graves/common/block/BlockGraveLegacy.java | 45 ++++----------- .../graves/common/block/Blocks.java | 2 +- .../common/tileentity/TileEntityGrave.java | 18 +++--- .../tileentity/TileEntityGraveStone.java | 55 +++++++++++++++++++ 5 files changed, 93 insertions(+), 70 deletions(-) create mode 100644 src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockBase.java b/src/main/java/com/fireball1725/graves/common/block/BlockBase.java index c5b0013..0a0dc59 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockBase.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockBase.java @@ -1,10 +1,10 @@ package com.fireball1725.graves.common.block; +import com.fireball1725.graves.Graves; import com.fireball1725.graves.common.reference.ModInfo; import com.fireball1725.graves.common.tileentity.TileEntityBase; import com.fireball1725.graves.common.tileentity.TileEntityInventoryBase; import com.fireball1725.graves.common.util.TileTools; -import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; @@ -19,32 +19,26 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.common.registry.GameRegistry; -import net.minecraftforge.fml.relauncher.ReflectionHelper; import java.util.ArrayList; import java.util.List; public class BlockBase extends BlockContainer { protected boolean isInventory = false; - protected boolean hasSubtypes = false; private Class tileEntityType = null; protected BlockBase(Material material) { super(material); - - // setStepSound(SoundType.STONE); setHardness(2.2F); setResistance(5.0F); - //setHarvestLevel("pickaxe", 0); - - } @Override public TileEntity createNewTileEntity(World world, int meta) { - if (hasBlockTileEntity()) { - try { + if(hasTileEntity()) + { + try { return tileEntityType.newInstance(); } catch (Throwable e) { throw new RuntimeException(e); @@ -53,25 +47,20 @@ public TileEntity createNewTileEntity(World world, int meta) return null; } - private boolean hasBlockTileEntity() { - return this.tileEntityType != null; - } - - protected void setTileEntity(Class c) { - String tileName = "tileentity." + ModInfo.MOD_ID + "." + c.getSimpleName(); - - GameRegistry.registerTileEntity(this.tileEntityType = c, tileName); - this.isInventory = IInventory.class.isAssignableFrom(c); - setTileProvider(hasBlockTileEntity()); - } - - private void setTileProvider(boolean b) { - ReflectionHelper.setPrivateValue(Block.class, this, Boolean.valueOf(b), "isTileProvider"); + @Override + public boolean hasTileEntity() + { + return this.tileEntityType != null; } - public Class getTileEntityClass() { - return this.tileEntityType; - } + protected void setTileEntity(Class c) + { + String tileName = "tileentity." + ModInfo.MOD_ID + "." + c.getSimpleName(); + this.tileEntityType = c; + try { GameRegistry.registerTileEntity(c, tileName); } catch(Exception ignored) {} + this.isInventory = IInventory.class.isAssignableFrom(c); + Graves.logger.info("Added tileEntity for " + this.getClass().getName()); + } @Override public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockGraveLegacy.java b/src/main/java/com/fireball1725/graves/common/block/BlockGraveLegacy.java index 75561d7..4930a7a 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockGraveLegacy.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockGraveLegacy.java @@ -1,49 +1,26 @@ package com.fireball1725.graves.common.block; -import com.fireball1725.graves.common.tileentity.TileEntityGrave; -import net.minecraft.block.BlockHorizontal; +import com.fireball1725.graves.common.reference.ModInfo; +import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; +import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyBool; -import net.minecraft.block.properties.PropertyDirection; -import net.minecraft.block.state.BlockStateContainer; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; +import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import net.minecraftforge.fml.common.registry.GameRegistry; -public class BlockGraveLegacy extends BlockBase +public class BlockGraveLegacy extends BlockContainer { - public static final PropertyDirection FACING = BlockHorizontal.FACING; - public static final PropertyBool HASLID = PropertyBool.create("haslid"); - public BlockGraveLegacy() { - super(Material.CLOTH); - setDefaultState(this.blockState.getBaseState().withProperty(HASLID, true).withProperty(FACING, EnumFacing.NORTH)); - this.setTileEntity(TileEntityGrave.class); - } - - @Override - protected BlockStateContainer createBlockState() - { - return new BlockStateContainer(this, HASLID, FACING); - } + super(Material.ROCK); - @Override - public IBlockState getStateFromMeta(int meta) - { - return getDefaultState().withProperty(FACING, EnumFacing.values()[meta]); - } - - public int getMetaFromState(IBlockState state) - { - return state.getValue(FACING).getIndex(); + String tileName = "tileentity." + ModInfo.MOD_ID + "." + TileEntityGraveStone.class.getSimpleName(); + GameRegistry.registerTileEntity(TileEntityGraveStone.class, tileName); } @Override - public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + public TileEntity createNewTileEntity(World worldIn, int meta) { - return Blocks.BLOCK_GRAVE.block.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer); + return new TileEntityGraveStone(); } } diff --git a/src/main/java/com/fireball1725/graves/common/block/Blocks.java b/src/main/java/com/fireball1725/graves/common/block/Blocks.java index f7a4ce1..572694b 100644 --- a/src/main/java/com/fireball1725/graves/common/block/Blocks.java +++ b/src/main/java/com/fireball1725/graves/common/block/Blocks.java @@ -8,7 +8,7 @@ public enum Blocks { BLOCK_GRAVE("grave", new BlockGrave(), CreativeTabs.DECORATIONS), - BLOCK_GRAVE_LEGACY("gravestone", new BlockGraveLegacy()); + Block_GRAVE_LEGACY("gravestone", new BlockGraveLegacy()); private static boolean registered = false; public final Block block; diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGrave.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGrave.java index b011fc2..fa0e3b2 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGrave.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGrave.java @@ -1,5 +1,6 @@ package com.fireball1725.graves.common.tileentity; +import com.fireball1725.graves.Graves; import com.fireball1725.graves.common.configuration.ConfigZombie; import com.fireball1725.graves.common.entity.EntityPlayerZombie; import com.fireball1725.graves.common.helpers.ItemHelper; @@ -296,6 +297,11 @@ public NBTTagCompound writeToNBT(NBTTagCompound nbtTagCompound) public void readFromNBT(NBTTagCompound nbtTagCompound) { super.readFromNBT(nbtTagCompound); + Graves.logger.info("Loading Grave:"); + for(String key : nbtTagCompound.getKeySet()) + { + Graves.logger.info(String.format("%s: %s", key, nbtTagCompound.getTag(key).toString())); + } displayStack = null; if(nbtTagCompound.hasKey("displayStack")) { displayStack = ItemStack.loadItemStackFromNBT(nbtTagCompound.getCompoundTag("displayStack")); } @@ -324,10 +330,11 @@ public void readFromNBT(NBTTagCompound nbtTagCompound) } } } + //Legacy Support + boolean isLegacy = nbtTagCompound.hasKey("hasLid"); + if(isLegacy) + { - { //Legacy Support - if(nbtTagCompound.hasKey("hasLid")) - { ghostDefeated = nbtTagCompound.getBoolean("hasLid"); } if(nbtTagCompound.hasKey("playerProfile")) { profile = NBTUtil.readGameProfileFromNBT(nbtTagCompound.getCompoundTag("playerProfile")); } if(nbtTagCompound.hasKey("replaceableBlocks")) @@ -343,11 +350,6 @@ public void readFromNBT(NBTTagCompound nbtTagCompound) { originalBlock = block; } - else - { - worldObj.setBlockToAir(block.getPos()); - block.placeBlock(worldObj); - } } } } diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java new file mode 100644 index 0000000..4b2882c --- /dev/null +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java @@ -0,0 +1,55 @@ +package com.fireball1725.graves.common.tileentity; + +import com.fireball1725.graves.Graves; +import com.fireball1725.graves.common.structure.ReplaceableBlock; +import com.google.common.collect.Lists; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ITickable; + +import java.util.List; + +public class TileEntityGraveStone extends TileEntity implements ITickable +{ + private List blocks = Lists.newArrayList(); + private NBTTagCompound tagCompound; + + public TileEntityGraveStone() + { + } + + @Override + public void update() + { + for(ReplaceableBlock block : blocks) + { + if(block.getPos().equals(getPos())) + { continue; } + // block.placeBlock(worldObj); + Graves.logger.info(">>>: TICK! " + block.getPos()); + } + // worldObj.setBlockState(getPos(), Blocks.BLOCK_GRAVE.block.getDefaultState(), 3); + // worldObj.setTileEntity(getPos(), TileEntity.func_190200_a(worldObj, tagCompound)); + } + + @Override + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + tagCompound = compound; + Graves.logger.info("Loading Legacy Grave!"); + if(compound.hasKey("replaceableBlocks")) + { + NBTTagCompound replaceableTag = compound.getCompoundTag("replaceableBlocks"); + int size = replaceableTag.getInteger("size"); + for(int i = 0; i < size; i++) + { + ReplaceableBlock block = ReplaceableBlock.readNBT((NBTTagCompound) replaceableTag.getTag("block:" + i)); + if(block != null) + { + blocks.add(block); + } + } + } + } +} From c6620e30c971dc43403fc8770d75bbf6af01f7ea Mon Sep 17 00:00:00 2001 From: FusionLord Date: Wed, 13 Jul 2016 04:45:52 -0700 Subject: [PATCH 39/47] More work on legacy graves. --- .../assets/graves/blockstates/gravestone.json | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/main/resources/assets/graves/blockstates/gravestone.json diff --git a/src/main/resources/assets/graves/blockstates/gravestone.json b/src/main/resources/assets/graves/blockstates/gravestone.json new file mode 100644 index 0000000..89e45e7 --- /dev/null +++ b/src/main/resources/assets/graves/blockstates/gravestone.json @@ -0,0 +1,24 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "graves:nothing.obj" + }, + "variants": { + "normal": [ + {} + ], + "inventory": [ + {} + ], + "haslid": { + "false": {}, + "true": {} + }, + "facing": { + "north": {}, + "south": {}, + "west": {}, + "east": {} + } + } +} \ No newline at end of file From 00f5d7bafa4fb8dc94c3447e01cb43a5bbd169b7 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Wed, 13 Jul 2016 05:06:32 -0700 Subject: [PATCH 40/47] More work on legacy graves. --- .../graves/common/block/BlockGraveLegacy.java | 32 ++++++++++++++++--- .../tileentity/TileEntityGraveStone.java | 15 ++------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockGraveLegacy.java b/src/main/java/com/fireball1725/graves/common/block/BlockGraveLegacy.java index 4930a7a..5c149dc 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockGraveLegacy.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockGraveLegacy.java @@ -1,21 +1,28 @@ package com.fireball1725.graves.common.block; -import com.fireball1725.graves.common.reference.ModInfo; import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; import net.minecraft.block.BlockContainer; +import net.minecraft.block.BlockHorizontal; import net.minecraft.block.material.Material; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; import net.minecraft.world.World; import net.minecraftforge.fml.common.registry.GameRegistry; public class BlockGraveLegacy extends BlockContainer { + private static final PropertyDirection FACING = BlockHorizontal.FACING; + private static final PropertyBool HASLID = PropertyBool.create("haslid"); + public BlockGraveLegacy() { super(Material.ROCK); - - String tileName = "tileentity." + ModInfo.MOD_ID + "." + TileEntityGraveStone.class.getSimpleName(); - GameRegistry.registerTileEntity(TileEntityGraveStone.class, tileName); + setDefaultState(blockState.getBaseState().withProperty(HASLID, true).withProperty(FACING, EnumFacing.NORTH)); + GameRegistry.registerTileEntity(TileEntityGraveStone.class, "tileentity.graves.TileEntityGraveStone"); } @Override @@ -23,4 +30,21 @@ public TileEntity createNewTileEntity(World worldIn, int meta) { return new TileEntityGraveStone(); } + + @Override + protected BlockStateContainer createBlockState() + { + return new BlockStateContainer(this, HASLID, FACING); + } + + @Override + public IBlockState getStateFromMeta(int meta) + { + return getDefaultState(); + } + + public int getMetaFromState(IBlockState state) + { + return 0; + } } diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java index 4b2882c..e7d0aec 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java @@ -14,28 +14,17 @@ public class TileEntityGraveStone extends TileEntity implements ITickable private List blocks = Lists.newArrayList(); private NBTTagCompound tagCompound; - public TileEntityGraveStone() - { - } - @Override public void update() { - for(ReplaceableBlock block : blocks) - { - if(block.getPos().equals(getPos())) - { continue; } - // block.placeBlock(worldObj); - Graves.logger.info(">>>: TICK! " + block.getPos()); - } - // worldObj.setBlockState(getPos(), Blocks.BLOCK_GRAVE.block.getDefaultState(), 3); - // worldObj.setTileEntity(getPos(), TileEntity.func_190200_a(worldObj, tagCompound)); + Graves.logger.info(">>>: TICK!"); } @Override public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); + tagCompound = compound; Graves.logger.info("Loading Legacy Grave!"); if(compound.hasKey("replaceableBlocks")) From b7c71c29208be6d6f28010d60971ba534867417b Mon Sep 17 00:00:00 2001 From: FusionLord Date: Wed, 13 Jul 2016 21:03:29 -0700 Subject: [PATCH 41/47] More work on legacy graves. --- build.gradle | 2 +- gradle.properties | 6 +- gradle/wrapper/gradle-wrapper.jar | Bin 52271 -> 51017 bytes gradle/wrapper/gradle-wrapper.properties | 4 +- gradlew | 164 ------------------ .../graves/common/block/BlockGraveLegacy.java | 50 ------ .../graves/common/block/BlockGraveStone.java | 39 +++++ .../graves/common/block/Blocks.java | 2 +- .../tileentity/TileEntityGraveStone.java | 12 ++ 9 files changed, 58 insertions(+), 221 deletions(-) delete mode 100644 gradlew delete mode 100644 src/main/java/com/fireball1725/graves/common/block/BlockGraveLegacy.java create mode 100644 src/main/java/com/fireball1725/graves/common/block/BlockGraveStone.java diff --git a/build.gradle b/build.gradle index 4a5b912..00f96d0 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ buildscript { } } dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' + classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' classpath "gradle.plugin.com.matthewprenger:CurseGradle:1.0.7" } } diff --git a/gradle.properties b/gradle.properties index 309a92d..1bf7c3a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -minecraft_version=1.10.2 -forge_version=12.18.0.2008 -mcp_mappings=snapshot_20160518 +minecraft_version=1.7.10 +forge_version=10.13.4.1614-1.7.10 +mcp_mappings=stable_12 cibuild=0 cibasename=graves \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 30d399d8d2bf522ff5de94bf434a7cc43a9a74b5..b7612167031001b7b84baf2a959e8ea8ad03c011 100644 GIT binary patch delta 21708 zcmZ5{V~}RsvTfP6ZFbqVZQC}#F59+k+v;+4*|u%Gea^l=?tQ;%|8Ab5 z{MWuP{?{ha0PiCIXCY4KF%|;^2*?o(2uL(30SqIlzndw^7z7_MIvku%u|yGyXby|Z z>C!{$6O{}oF|aL)5a=f~%LcCmlVZB#znq$3nVo8C@)7X&|3b)*9;2A2O0QS^Ri8R2 zhkCIpX~Ys@cD2pi5VAqB?+9m$+ddTUdkmhtZWhin0vakxZwnn-(uo-_UuM&Sl9HV}O7i9GcFO{BbUsSv71oI*)*9}BsZd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dUAv<5>jN>9xUd3;OW*dS)Ygf5qzuyi9%7mdpi)x3U9RGO`&-GvS z?Fb~03Gt_$1O*T+RS+)}llqlFG>uxwTgTUH*J4Bl(n&Z~7a& eA@vCCYDS6&Y8c2x3jjcnFCt<90H@*d?0*0dt \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- -APP_HOME="`pwd -P`" -cd "$SAVED" >&- - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockGraveLegacy.java b/src/main/java/com/fireball1725/graves/common/block/BlockGraveLegacy.java deleted file mode 100644 index 5c149dc..0000000 --- a/src/main/java/com/fireball1725/graves/common/block/BlockGraveLegacy.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.fireball1725.graves.common.block; - -import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.BlockHorizontal; -import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyBool; -import net.minecraft.block.properties.PropertyDirection; -import net.minecraft.block.state.BlockStateContainer; -import net.minecraft.block.state.IBlockState; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; -import net.minecraft.world.World; -import net.minecraftforge.fml.common.registry.GameRegistry; - -public class BlockGraveLegacy extends BlockContainer -{ - private static final PropertyDirection FACING = BlockHorizontal.FACING; - private static final PropertyBool HASLID = PropertyBool.create("haslid"); - - public BlockGraveLegacy() - { - super(Material.ROCK); - setDefaultState(blockState.getBaseState().withProperty(HASLID, true).withProperty(FACING, EnumFacing.NORTH)); - GameRegistry.registerTileEntity(TileEntityGraveStone.class, "tileentity.graves.TileEntityGraveStone"); - } - - @Override - public TileEntity createNewTileEntity(World worldIn, int meta) - { - return new TileEntityGraveStone(); - } - - @Override - protected BlockStateContainer createBlockState() - { - return new BlockStateContainer(this, HASLID, FACING); - } - - @Override - public IBlockState getStateFromMeta(int meta) - { - return getDefaultState(); - } - - public int getMetaFromState(IBlockState state) - { - return 0; - } -} diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockGraveStone.java b/src/main/java/com/fireball1725/graves/common/block/BlockGraveStone.java new file mode 100644 index 0000000..b323873 --- /dev/null +++ b/src/main/java/com/fireball1725/graves/common/block/BlockGraveStone.java @@ -0,0 +1,39 @@ +package com.fireball1725.graves.common.block; + +import com.fireball1725.graves.common.tileentity.TileEntityGraveStone; +import net.minecraft.block.BlockHorizontal; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.EnumFacing; + +public class BlockGraveStone extends BlockBase +{ + public static final PropertyDirection FACING = BlockHorizontal.FACING; + public static final PropertyBool HASLID = PropertyBool.create("haslid"); + + public BlockGraveStone() + { + super(Material.CLOTH); + this.setTileEntity(TileEntityGraveStone.class); + } + + @Override + protected BlockStateContainer createBlockState() + { + return new BlockStateContainer(this, HASLID, FACING); + } + + @Override + public IBlockState getStateFromMeta(int meta) + { + return getDefaultState().withProperty(FACING, EnumFacing.values()[meta]).withProperty(HASLID, false); + } + + public int getMetaFromState(IBlockState state) + { + return state.getValue(FACING).getIndex(); + } +} diff --git a/src/main/java/com/fireball1725/graves/common/block/Blocks.java b/src/main/java/com/fireball1725/graves/common/block/Blocks.java index 572694b..b204b1c 100644 --- a/src/main/java/com/fireball1725/graves/common/block/Blocks.java +++ b/src/main/java/com/fireball1725/graves/common/block/Blocks.java @@ -8,7 +8,7 @@ public enum Blocks { BLOCK_GRAVE("grave", new BlockGrave(), CreativeTabs.DECORATIONS), - Block_GRAVE_LEGACY("gravestone", new BlockGraveLegacy()); + Block_GRAVE_LEGACY("gravestone", new BlockGraveStone()); private static boolean registered = false; public final Block block; diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java index e7d0aec..0c927da 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java @@ -1,6 +1,7 @@ package com.fireball1725.graves.common.tileentity; import com.fireball1725.graves.Graves; +import com.fireball1725.graves.common.block.Blocks; import com.fireball1725.graves.common.structure.ReplaceableBlock; import com.google.common.collect.Lists; import net.minecraft.nbt.NBTTagCompound; @@ -18,6 +19,17 @@ public class TileEntityGraveStone extends TileEntity implements ITickable public void update() { Graves.logger.info(">>>: TICK!"); + for(ReplaceableBlock block : blocks) + { + if(block.getPos().equals(getPos())) + { continue; } + block.placeBlock(worldObj); + } + worldObj.setBlockState(getPos(), Blocks.BLOCK_GRAVE.block.getDefaultState(), 3); + worldObj.removeTileEntity(getPos()); + TileEntityGrave grave = new TileEntityGrave(); + grave.readFromNBT(tagCompound); + worldObj.setTileEntity(getPos(), grave); } @Override From a5c2e6870d8fbb81851913955eb4ec531a2f2cbd Mon Sep 17 00:00:00 2001 From: FusionLord Date: Wed, 13 Jul 2016 21:17:27 -0700 Subject: [PATCH 42/47] Fixed issues with gradle wrapper. --- build.gradle | 2 +- gradle.properties | 6 +++--- gradle/wrapper/gradle-wrapper.jar | Bin 51017 -> 52271 bytes gradle/wrapper/gradle-wrapper.properties | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 00f96d0..4a5b912 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ buildscript { } } dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' + classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' classpath "gradle.plugin.com.matthewprenger:CurseGradle:1.0.7" } } diff --git a/gradle.properties b/gradle.properties index 1bf7c3a..309a92d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -minecraft_version=1.7.10 -forge_version=10.13.4.1614-1.7.10 -mcp_mappings=stable_12 +minecraft_version=1.10.2 +forge_version=12.18.0.2008 +mcp_mappings=snapshot_20160518 cibuild=0 cibasename=graves \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index b7612167031001b7b84baf2a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xi^2u2nFD!cVe){-UVjf!*?{klC#Smzdp8G3J2#g@L+cM&OdBad2^d?Z)F9B= zzg)mrICTwcYbA5Y#XkztwhqyG0B{btMGh&HUB?=>3St>;X|YO;4EtW_H$uSamSlN& z<0-yB1o$EY>8F523}8|D5J4uE1=w6+)Ix*ZZWP$phc!XK5ePt^8$01}0_)Lqz>5at z0(NBHx+al*>;fRWbc-ze!y(noy)QRvhJYP!ljYIPXZB?^fGpRO%)8;ufc0oU;ALrn zfFIsJ;1DE-`)_&~Soc2U@BIhZk^m8Gb<2TrC!kD3V`p2m$%@i$@He_ZN2!30Y93O2 z7X(-^BZCgDsviP51p^=fEU}e!-{tLA2>5p*Ho8*;tJ21`FSBZcfLD_b+@-;0wQ(MF z50DS00nd*Mo11;|U(XPmhG)kEp78^oi5)T;oegwJ0DCAV=ynJ={`o&fn%fVa%>p2Q zTmZ Date: Wed, 13 Jul 2016 21:20:45 -0700 Subject: [PATCH 43/47] Fixed issues with gradle wrapper. --- gradlew | 164 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 gradlew diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..91a7e26 --- /dev/null +++ b/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" From 3f009bc6f79c203a6b91b3ca954da5892f377b78 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Thu, 14 Jul 2016 01:04:34 -0700 Subject: [PATCH 44/47] Added cosmetic text. --- .../graves/client/render/TEGraveSR.java | 65 +++++++++++++++++-- 1 file changed, 60 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/fireball1725/graves/client/render/TEGraveSR.java b/src/main/java/com/fireball1725/graves/client/render/TEGraveSR.java index 7683296..1f06b91 100644 --- a/src/main/java/com/fireball1725/graves/client/render/TEGraveSR.java +++ b/src/main/java/com/fireball1725/graves/client/render/TEGraveSR.java @@ -3,8 +3,10 @@ import com.fireball1725.graves.client.event.EventTick; import com.fireball1725.graves.common.block.BlockGrave; import com.fireball1725.graves.common.tileentity.TileEntityGrave; +import com.google.common.collect.Maps; import com.mojang.authlib.GameProfile; import com.mojang.authlib.minecraft.MinecraftProfileTexture; +import com.mojang.realmsclient.gui.ChatFormatting; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelHumanoidHead; @@ -26,6 +28,48 @@ public class TEGraveSR extends TileEntitySpecialRenderer { + private static Map specialText = Maps.newHashMap(); + + static + { + specialText.put("4f3a8d1e-33c1-44e7-bce8-e683027c7dac", "R.I.P XyCraft!"); // Soaryn + specialText.put("eb8ef7b9-3199-4a50-99e8-76a48baa6fdf", "Now with more grass!"); // GlassPelican + specialText.put("a2987599-a85d-47e8-a241-4eb20610adf3", "He was N00B!"); // Techno + specialText.put("bbb87dbe-690f-4205-bdc5-72ffb8ebc29d", "DireDerp%n%"); // DireWolf20 + specialText.put("ed2d2e2c-654c-4e85-aa99-300f13561515", "You are dead!"); // MolecularPhylo + specialText.put("d094e16a-5b8c-4e93-9e8e-2cd6a11d2993", "NEWT"); // ScottyBug + specialText.put("1454841b-ba54-4071-80c0-5b51c2f2d25d", "Clukington"); // Wyld + specialText.put("0192723f-b3dc-495a-959f-52c53fa63bff", "#PoolParty2016\\n#TooSoon?"); // Pahimar + specialText.put("c2024e2a-dd76-4bc9-9ea3-b771f18f23b6", "Dire's wolf 20...16"); // TloveTech + specialText.put("e6b5c088-0680-44df-9e1b-9bf11792291b", "ɯnɹƃ"); // Grumm + specialText.put("0765249a-5c6b-4703-a4c6-3f9d867258d3", "RacecaR"); // racing_pro + specialText.put("48a16fc8-bc1f-4e72-84e9-7ec73b7d8ea1", "But what does it mean????"); // TTFTCUTS + specialText.put("892017ed-e9a0-4f25-9a37-b8811614707d", "Channels are Fun!"); // AlgorithmX2 + specialText.put("d3cf097a-438f-4523-b770-ec11e13ecc32", ""); // LexManos + specialText.put("9a0c55e2-635d-4b7b-aa62-b8fab574af35", ""); // Rajecent + specialText.put("92914230-9d52-4333-b3ba-e53d97393b6d", ""); // Hermyone + specialText.put("92d45906-7a50-4742-85b6-b079db9dc189", ""); // bspkrs + specialText.put("d2839efc-727a-4263-97ce-3c73cdee5013", ""); // Slowpoke101 + specialText.put("af148380-4ba5-4a3d-a47d-710f710f9265", ""); // Minalien + specialText.put("59af7399-5544-4990-81f1-c8f2263b00e5", ""); // cpw + specialText.put("95fe0728-e1bd-4989-a980-3d8976aedda9", ""); // WayOfFlowingTime + specialText.put("25d4006e-3475-4608-9c15-519b08525c11", ""); // flamegoat + specialText.put("98beecaf-555e-4064-9401-b531fb927641", ""); // Tahg + specialText.put("e28850e0-25ab-47ff-9317-bc73bbbc98e1", ""); // Vaygrim + specialText.put("64e7102f-e199-414f-90d7-ccbdaf82284a", ""); // NikkiExDee + specialText.put("0f95811a-b3b6-4dba-ba03-4adfec7cf5ab", ""); // azanor + specialText.put("5a8c3be3-2aa4-4e91-8d7f-4e7b0dc8223e", "#BlameAma"); // amadornes + specialText.put("6078f46a-bae3-496b-bbdc-dcc25aca75ba", ""); // boni + specialText.put("b43d09c7-d356-4319-8d4d-afa6974eb665", ""); // CrazyPants + specialText.put("b9a89002-b392-4545-ab4d-5b1ff60c88a6", ""); // Arkember + specialText.put("8c826f34-113b-4238-a173-44639c53b6e6", ""); // Vazkii + specialText.put("183baa71-8cd0-4acb-9a0c-ff06712430a5", ""); // NewCastleGeek + specialText.put("2efa46fa-2948-4d98-b822-fa182d254870", ""); // LordDusk + + specialText.put("e43e9766-f903-48e1-818f-d41bb48d80d5", "Everything is " + ChatFormatting.RED + "AWESOME" + ChatFormatting.RESET + "!"); // FireBall1725 + specialText.put("7ff65fdc-2837-4123-adfd-157b37527daf", ChatFormatting.GREEN + "\\☻/\\n" + ChatFormatting.GREEN + "|\\n" + ChatFormatting.GREEN + "/\\"); // FusionLord + } + private final ModelSkeletonHead humanoidHead = new ModelHumanoidHead(); private Minecraft mc = Minecraft.getMinecraft(); private Random rand = new Random(); @@ -61,6 +105,7 @@ public void renderTileEntityAt(TileEntityGrave grave, double x, double y, double { if(grave.getProfile() != null) { + GameProfile profile = grave.getProfile(); IBlockState state = getWorld().getBlockState(grave.getPos().offset(EnumFacing.UP)); if(!state.getBlock().isFullBlock(state.getActualState(getWorld(), grave.getPos().offset(EnumFacing.UP)))) { @@ -75,7 +120,7 @@ public void renderTileEntityAt(TileEntityGrave grave, double x, double y, double int dir = rand.nextBoolean() ? 1 : -1; GlStateManager.pushMatrix(); - if(grave.getProfile() != null && grave.getProfile().getId().toString().equals("4f3a8d1e-33c1-44e7-bce8-e683027c7dac")) + if(grave.getProfile().getId().toString().equals("4f3a8d1e-33c1-44e7-bce8-e683027c7dac")) { GlStateManager.rotate(EventTick.getTick() * 10, 0, dir, 0); } @@ -93,7 +138,12 @@ public void renderTileEntityAt(TileEntityGrave grave, double x, double y, double GlStateManager.popMatrix(); if(Minecraft.getMinecraft().gameSettings.fancyGraphics) { - drawText(grave.getProfile().getName()); + String text = ""; + if(specialText.containsKey(profile.getId().toString())) + { + text = "\\n" + specialText.get(profile.getId().toString()).replace("%n%", String.valueOf(rand.nextInt())); + } + drawText(profile.getName() + text); } GlStateManager.disableBlend(); GlStateManager.disableAlpha(); @@ -109,6 +159,7 @@ public void renderTileEntityAt(TileEntityGrave grave, double x, double y, double private void drawText(String text) { + String[] strings = text.split("\\\\n"); GlStateManager.pushMatrix(); for(EnumFacing facing : EnumFacing.HORIZONTALS) { @@ -116,10 +167,14 @@ private void drawText(String text) GlStateManager.disableLighting(); GlStateManager.rotate(180, 0, 0, 1); GlStateManager.rotate((facing.getHorizontalIndex() * 90), 0, 1, 0); - GlStateManager.translate(-.375, .55, -.38); + GlStateManager.translate(0, .55, -.38); GlStateManager.scale(.00625, .00625, .00625); - int strWidth = mc.fontRendererObj.getStringWidth(text); - mc.fontRendererObj.drawString(text, strWidth / 2, 0, Color.WHITE.hashCode()); + for(String s : strings) + { + GlStateManager.translate(0, mc.fontRendererObj.FONT_HEIGHT, 0); + int strWidth = mc.fontRendererObj.getStringWidth(s); + mc.fontRendererObj.drawString(s, -(int) ((float) strWidth / 2f), 0, Color.WHITE.hashCode()); + } GlStateManager.enableLighting(); GlStateManager.popMatrix(); } From 2282eff0d9410a61765c88a930876648ec3abd42 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Thu, 14 Jul 2016 07:28:09 -0700 Subject: [PATCH 45/47] Fixed server side crash. --- src/main/java/com/fireball1725/graves/Graves.java | 4 ++-- .../com/fireball1725/graves/client/render/TEGraveSR.java | 3 ++- .../com/fireball1725/graves/common/reference/ModInfo.java | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/fireball1725/graves/Graves.java b/src/main/java/com/fireball1725/graves/Graves.java index a8c9197..43a601a 100644 --- a/src/main/java/com/fireball1725/graves/Graves.java +++ b/src/main/java/com/fireball1725/graves/Graves.java @@ -18,8 +18,8 @@ public class Graves { @Mod.Instance(ModInfo.MOD_ID) public static Graves instance; - @SidedProxy(clientSide = ModInfo.CLIENT_PROXY_CLASS, serverSide = ModInfo.SERVER_PROXY_CLASS) - public static IProxy proxy; + @SidedProxy(clientSide = ModInfo.CLIENT_PROXY_CLASS, serverSide = ModInfo.COMMON_PROXY_CLASS) + public static IProxy proxy; public static Logger logger; diff --git a/src/main/java/com/fireball1725/graves/client/render/TEGraveSR.java b/src/main/java/com/fireball1725/graves/client/render/TEGraveSR.java index 1f06b91..c0f0884 100644 --- a/src/main/java/com/fireball1725/graves/client/render/TEGraveSR.java +++ b/src/main/java/com/fireball1725/graves/client/render/TEGraveSR.java @@ -58,13 +58,14 @@ public class TEGraveSR extends TileEntitySpecialRenderer specialText.put("e28850e0-25ab-47ff-9317-bc73bbbc98e1", ""); // Vaygrim specialText.put("64e7102f-e199-414f-90d7-ccbdaf82284a", ""); // NikkiExDee specialText.put("0f95811a-b3b6-4dba-ba03-4adfec7cf5ab", ""); // azanor - specialText.put("5a8c3be3-2aa4-4e91-8d7f-4e7b0dc8223e", "#BlameAma"); // amadornes + specialText.put("5a8c3be3-2aa4-4e91-8d7f-4e7b0dc8223e", "#BlameAma"); // amadornes specialText.put("6078f46a-bae3-496b-bbdc-dcc25aca75ba", ""); // boni specialText.put("b43d09c7-d356-4319-8d4d-afa6974eb665", ""); // CrazyPants specialText.put("b9a89002-b392-4545-ab4d-5b1ff60c88a6", ""); // Arkember specialText.put("8c826f34-113b-4238-a173-44639c53b6e6", ""); // Vazkii specialText.put("183baa71-8cd0-4acb-9a0c-ff06712430a5", ""); // NewCastleGeek specialText.put("2efa46fa-2948-4d98-b822-fa182d254870", ""); // LordDusk + specialText.put("2dea7072-2bfe-4c8b-a819-a9b4444134fc", "Failed so hard!\\nand got so far\\nbut in the end\\nIt doesn't even matter."); // OneOldBlockHead specialText.put("e43e9766-f903-48e1-818f-d41bb48d80d5", "Everything is " + ChatFormatting.RED + "AWESOME" + ChatFormatting.RESET + "!"); // FireBall1725 specialText.put("7ff65fdc-2837-4123-adfd-157b37527daf", ChatFormatting.GREEN + "\\☻/\\n" + ChatFormatting.GREEN + "|\\n" + ChatFormatting.GREEN + "/\\"); // FusionLord diff --git a/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java b/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java index a6bf853..38f8a86 100644 --- a/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java +++ b/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java @@ -6,8 +6,8 @@ public class ModInfo { public static final String VERSION_BUILD = "@VERSION@"; public static final String MINECRAFT_VERSION = "@MCVERSION@"; public static final String DEPENDENCIES = ""; - public static final String SERVER_PROXY_CLASS = "com.fireball1725." + MOD_ID + ".proxy.ServerProxy"; - public static final String CLIENT_PROXY_CLASS = "com.fireball1725." + MOD_ID + ".proxy.ClientProxy"; - public static final String FINGERPRINT = "@FINGERPRINT@"; + public static final String COMMON_PROXY_CLASS = "com.fireball1725." + MOD_ID + ".proxy.CommonProxy"; + public static final String CLIENT_PROXY_CLASS = "com.fireball1725." + MOD_ID + ".proxy.ClientProxy"; + public static final String FINGERPRINT = "@FINGERPRINT@"; public static final String GUI_FACTORY = "com.fireball1725." + MOD_ID + ".common.configuration.GravesConfigGuiFactory"; } From e1bfcb3f46f91299a6df86103d781b7c97734aa7 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Thu, 14 Jul 2016 09:41:21 -0700 Subject: [PATCH 46/47] Removed debug code; Moved special text to pastebin; --- .../graves/client/render/TEGraveSR.java | 44 +----- .../graves/common/helpers/PatreonHelper.java | 57 +++++++ .../graves/common/reference/ModInfo.java | 1 + .../common/tileentity/TileEntityGrave.java | 6 - .../tileentity/TileEntityGraveStone.java | 1 - webresources/PatreonText.json | 148 ++++++++++++++++++ 6 files changed, 210 insertions(+), 47 deletions(-) create mode 100644 src/main/java/com/fireball1725/graves/common/helpers/PatreonHelper.java create mode 100644 webresources/PatreonText.json diff --git a/src/main/java/com/fireball1725/graves/client/render/TEGraveSR.java b/src/main/java/com/fireball1725/graves/client/render/TEGraveSR.java index c0f0884..a5eb951 100644 --- a/src/main/java/com/fireball1725/graves/client/render/TEGraveSR.java +++ b/src/main/java/com/fireball1725/graves/client/render/TEGraveSR.java @@ -2,11 +2,11 @@ import com.fireball1725.graves.client.event.EventTick; import com.fireball1725.graves.common.block.BlockGrave; +import com.fireball1725.graves.common.helpers.PatreonHelper; import com.fireball1725.graves.common.tileentity.TileEntityGrave; import com.google.common.collect.Maps; import com.mojang.authlib.GameProfile; import com.mojang.authlib.minecraft.MinecraftProfileTexture; -import com.mojang.realmsclient.gui.ChatFormatting; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelHumanoidHead; @@ -28,47 +28,11 @@ public class TEGraveSR extends TileEntitySpecialRenderer { - private static Map specialText = Maps.newHashMap(); + private static Map> specialText = Maps.newHashMap(); static { - specialText.put("4f3a8d1e-33c1-44e7-bce8-e683027c7dac", "R.I.P XyCraft!"); // Soaryn - specialText.put("eb8ef7b9-3199-4a50-99e8-76a48baa6fdf", "Now with more grass!"); // GlassPelican - specialText.put("a2987599-a85d-47e8-a241-4eb20610adf3", "He was N00B!"); // Techno - specialText.put("bbb87dbe-690f-4205-bdc5-72ffb8ebc29d", "DireDerp%n%"); // DireWolf20 - specialText.put("ed2d2e2c-654c-4e85-aa99-300f13561515", "You are dead!"); // MolecularPhylo - specialText.put("d094e16a-5b8c-4e93-9e8e-2cd6a11d2993", "NEWT"); // ScottyBug - specialText.put("1454841b-ba54-4071-80c0-5b51c2f2d25d", "Clukington"); // Wyld - specialText.put("0192723f-b3dc-495a-959f-52c53fa63bff", "#PoolParty2016\\n#TooSoon?"); // Pahimar - specialText.put("c2024e2a-dd76-4bc9-9ea3-b771f18f23b6", "Dire's wolf 20...16"); // TloveTech - specialText.put("e6b5c088-0680-44df-9e1b-9bf11792291b", "ɯnɹƃ"); // Grumm - specialText.put("0765249a-5c6b-4703-a4c6-3f9d867258d3", "RacecaR"); // racing_pro - specialText.put("48a16fc8-bc1f-4e72-84e9-7ec73b7d8ea1", "But what does it mean????"); // TTFTCUTS - specialText.put("892017ed-e9a0-4f25-9a37-b8811614707d", "Channels are Fun!"); // AlgorithmX2 - specialText.put("d3cf097a-438f-4523-b770-ec11e13ecc32", ""); // LexManos - specialText.put("9a0c55e2-635d-4b7b-aa62-b8fab574af35", ""); // Rajecent - specialText.put("92914230-9d52-4333-b3ba-e53d97393b6d", ""); // Hermyone - specialText.put("92d45906-7a50-4742-85b6-b079db9dc189", ""); // bspkrs - specialText.put("d2839efc-727a-4263-97ce-3c73cdee5013", ""); // Slowpoke101 - specialText.put("af148380-4ba5-4a3d-a47d-710f710f9265", ""); // Minalien - specialText.put("59af7399-5544-4990-81f1-c8f2263b00e5", ""); // cpw - specialText.put("95fe0728-e1bd-4989-a980-3d8976aedda9", ""); // WayOfFlowingTime - specialText.put("25d4006e-3475-4608-9c15-519b08525c11", ""); // flamegoat - specialText.put("98beecaf-555e-4064-9401-b531fb927641", ""); // Tahg - specialText.put("e28850e0-25ab-47ff-9317-bc73bbbc98e1", ""); // Vaygrim - specialText.put("64e7102f-e199-414f-90d7-ccbdaf82284a", ""); // NikkiExDee - specialText.put("0f95811a-b3b6-4dba-ba03-4adfec7cf5ab", ""); // azanor - specialText.put("5a8c3be3-2aa4-4e91-8d7f-4e7b0dc8223e", "#BlameAma"); // amadornes - specialText.put("6078f46a-bae3-496b-bbdc-dcc25aca75ba", ""); // boni - specialText.put("b43d09c7-d356-4319-8d4d-afa6974eb665", ""); // CrazyPants - specialText.put("b9a89002-b392-4545-ab4d-5b1ff60c88a6", ""); // Arkember - specialText.put("8c826f34-113b-4238-a173-44639c53b6e6", ""); // Vazkii - specialText.put("183baa71-8cd0-4acb-9a0c-ff06712430a5", ""); // NewCastleGeek - specialText.put("2efa46fa-2948-4d98-b822-fa182d254870", ""); // LordDusk - specialText.put("2dea7072-2bfe-4c8b-a819-a9b4444134fc", "Failed so hard!\\nand got so far\\nbut in the end\\nIt doesn't even matter."); // OneOldBlockHead - - specialText.put("e43e9766-f903-48e1-818f-d41bb48d80d5", "Everything is " + ChatFormatting.RED + "AWESOME" + ChatFormatting.RESET + "!"); // FireBall1725 - specialText.put("7ff65fdc-2837-4123-adfd-157b37527daf", ChatFormatting.GREEN + "\\☻/\\n" + ChatFormatting.GREEN + "|\\n" + ChatFormatting.GREEN + "/\\"); // FusionLord + specialText = PatreonHelper.getSpecialText(); } private final ModelSkeletonHead humanoidHead = new ModelHumanoidHead(); @@ -142,7 +106,7 @@ public void renderTileEntityAt(TileEntityGrave grave, double x, double y, double String text = ""; if(specialText.containsKey(profile.getId().toString())) { - text = "\\n" + specialText.get(profile.getId().toString()).replace("%n%", String.valueOf(rand.nextInt())); + text = "\\n" + specialText.get(profile.getId().toString()).get("text").replace("%n%", String.valueOf(rand.nextInt())); } drawText(profile.getName() + text); } diff --git a/src/main/java/com/fireball1725/graves/common/helpers/PatreonHelper.java b/src/main/java/com/fireball1725/graves/common/helpers/PatreonHelper.java new file mode 100644 index 0000000..3a39927 --- /dev/null +++ b/src/main/java/com/fireball1725/graves/common/helpers/PatreonHelper.java @@ -0,0 +1,57 @@ +package com.fireball1725.graves.common.helpers; + +import com.fireball1725.graves.Graves; +import com.fireball1725.graves.common.reference.ModInfo; +import com.google.common.collect.Maps; +import com.google.common.reflect.TypeToken; +import com.google.gson.Gson; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.util.Map; + +public class PatreonHelper +{ + public static Map> getSpecialText() + { + Map> specialText = Maps.newHashMap(); + Graves.logger.info(new Gson().toJson(specialText, new TypeToken>>() + { + }.getType())); + specialText.clear(); + try + { + specialText = new Gson().fromJson(readUrl("http://pastebin.com/raw/" + ModInfo.SPECIAL_TEXT), new TypeToken>>() + { + }.getType()); + } + catch(Exception e) + { + e.printStackTrace(); + } + return specialText; + } + + private static String readUrl(String urlString) throws Exception + { + BufferedReader reader = null; + try + { + URL url = new URL(urlString); + reader = new BufferedReader(new InputStreamReader(url.openStream())); + StringBuffer buffer = new StringBuffer(); + int read; + char[] chars = new char[1024]; + while((read = reader.read(chars)) != -1) + buffer.append(chars, 0, read); + + return buffer.toString(); + } + finally + { + if(reader != null) + { reader.close(); } + } + } +} diff --git a/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java b/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java index 38f8a86..fa515ef 100644 --- a/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java +++ b/src/main/java/com/fireball1725/graves/common/reference/ModInfo.java @@ -10,4 +10,5 @@ public class ModInfo { public static final String CLIENT_PROXY_CLASS = "com.fireball1725." + MOD_ID + ".proxy.ClientProxy"; public static final String FINGERPRINT = "@FINGERPRINT@"; public static final String GUI_FACTORY = "com.fireball1725." + MOD_ID + ".common.configuration.GravesConfigGuiFactory"; + public static final String SPECIAL_TEXT = "NxRwGtpz"; } diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGrave.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGrave.java index fa0e3b2..9d6c537 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGrave.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGrave.java @@ -1,6 +1,5 @@ package com.fireball1725.graves.common.tileentity; -import com.fireball1725.graves.Graves; import com.fireball1725.graves.common.configuration.ConfigZombie; import com.fireball1725.graves.common.entity.EntityPlayerZombie; import com.fireball1725.graves.common.helpers.ItemHelper; @@ -297,11 +296,6 @@ public NBTTagCompound writeToNBT(NBTTagCompound nbtTagCompound) public void readFromNBT(NBTTagCompound nbtTagCompound) { super.readFromNBT(nbtTagCompound); - Graves.logger.info("Loading Grave:"); - for(String key : nbtTagCompound.getKeySet()) - { - Graves.logger.info(String.format("%s: %s", key, nbtTagCompound.getTag(key).toString())); - } displayStack = null; if(nbtTagCompound.hasKey("displayStack")) { displayStack = ItemStack.loadItemStackFromNBT(nbtTagCompound.getCompoundTag("displayStack")); } diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java index 0c927da..d3a6ff8 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGraveStone.java @@ -18,7 +18,6 @@ public class TileEntityGraveStone extends TileEntity implements ITickable @Override public void update() { - Graves.logger.info(">>>: TICK!"); for(ReplaceableBlock block : blocks) { if(block.getPos().equals(getPos())) diff --git a/webresources/PatreonText.json b/webresources/PatreonText.json new file mode 100644 index 0000000..65f3227 --- /dev/null +++ b/webresources/PatreonText.json @@ -0,0 +1,148 @@ +[ + { + "4f3a8d1e-33c1-44e7-bce8-e683027c7dac": { + "text": "R.I.P XyCraft!", + "name": "Soaryn" + }, + "eb8ef7b9-3199-4a50-99e8-76a48baa6fdf": { + "text": "Now with more grass!", + "name": "GlassPelican" + }, + "a2987599-a85d-47e8-a241-4eb20610adf3": { + "text": "He was N00B!", + "name": "Techno" + }, + "bbb87dbe-690f-4205-bdc5-72ffb8ebc29d": { + "text": "DireDerp%n%", + "name": "DireWolf20" + }, + "ed2d2e2c-654c-4e85-aa99-300f13561515": { + "text": "You are dead!", + "name": "MolecularPhylo" + }, + "d094e16a-5b8c-4e93-9e8e-2cd6a11d2993": { + "text": "NEWT", + "name": "ScottyBug" + }, + "1454841b-ba54-4071-80c0-5b51c2f2d25d": { + "text": "Clukington", + "name": "Wyld" + }, + "0192723f-b3dc-495a-959f-52c53fa63bff": { + "text": "#PoolParty2016\\n#TooSoon?", + "name": "Pahimar" + }, + "c2024e2a-dd76-4bc9-9ea3-b771f18f23b6": { + "text": "Dire's wolf 20...16", + "name": "TloveTech" + }, + "e6b5c088-0680-44df-9e1b-9bf11792291b": { + "text": "ɯnɹƃ", + "name": "Grumm" + }, + "0765249a-5c6b-4703-a4c6-3f9d867258d3": { + "text": "RacecaR", + "name": "racing_pro" + }, + "48a16fc8-bc1f-4e72-84e9-7ec73b7d8ea1": { + "text": "But what does it mean????", + "name": "TTFTCUTS" + }, + "892017ed-e9a0-4f25-9a37-b8811614707d": { + "text": "Channels are Fun!", + "name": "AlgorithmX2" + }, + "d3cf097a-438f-4523-b770-ec11e13ecc32": { + "text": "", + "name": "LexManos" + }, + "9a0c55e2-635d-4b7b-aa62-b8fab574af35": { + "text": "", + "name": "Rajecent" + }, + "92914230-9d52-4333-b3ba-e53d97393b6d": { + "text": "", + "name": "Hermyone" + }, + "92d45906-7a50-4742-85b6-b079db9dc189": { + "text": "", + "name": "bspkrs" + }, + "d2839efc-727a-4263-97ce-3c73cdee5013": { + "text": "", + "name": "Slowpoke101" + }, + "af148380-4ba5-4a3d-a47d-710f710f9265": { + "text": "", + "name": "Minalien" + }, + "59af7399-5544-4990-81f1-c8f2263b00e5": { + "text": "", + "name": "cpw" + }, + "95fe0728-e1bd-4989-a980-3d8976aedda9": { + "text": "", + "name": "WayOfFlowingTime" + }, + "25d4006e-3475-4608-9c15-519b08525c11": { + "text": "", + "name": "flamegoat" + }, + "98beecaf-555e-4064-9401-b531fb927641": { + "text": "", + "name": "Tahg" + }, + "e28850e0-25ab-47ff-9317-bc73bbbc98e1": { + "text": "", + "name": "Vaygrim" + }, + "64e7102f-e199-414f-90d7-ccbdaf82284a": { + "text": "", + "name": "NikkiExDee" + }, + "0f95811a-b3b6-4dba-ba03-4adfec7cf5ab": { + "text": "", + "name": "azanor" + }, + "5a8c3be3-2aa4-4e91-8d7f-4e7b0dc8223e": { + "text": "#BlameAma", + "name": "amadornes" + }, + "6078f46a-bae3-496b-bbdc-dcc25aca75ba": { + "text": "", + "name": "boni" + }, + "b43d09c7-d356-4319-8d4d-afa6974eb665": { + "text": "", + "name": "CrazyPants" + }, + "b9a89002-b392-4545-ab4d-5b1ff60c88a6": { + "text": "", + "name": "Arkember" + }, + "8c826f34-113b-4238-a173-44639c53b6e6": { + "text": "", + "name": "Vazkii" + }, + "183baa71-8cd0-4acb-9a0c-ff06712430a5": { + "text": "", + "name": "NewCastleGeek" + }, + "2efa46fa-2948-4d98-b822-fa182d254870": { + "text": "", + "name": "LordDusk" + }, + "2dea7072-2bfe-4c8b-a819-a9b4444134fc": { + "text": "Failed so hard!\\nand got so far\\nbut in the end\\nIt doesn't even matter.", + "name": "OneOldBlockHead" + }, + "e43e9766-f903-48e1-818f-d41bb48d80d5": { + "text": "Everything is §cAWESOME§r!", + "name": "FireBall1725" + }, + "7ff65fdc-2837-4123-adfd-157b37527daf": { + "text": "§a\\☻/\\n§a|\\n§a/\\", + "name": "FusionLord" + } + } +] \ No newline at end of file From 3f9374a49923579a09cc9dffc378e84199d37022 Mon Sep 17 00:00:00 2001 From: FusionLord Date: Thu, 14 Jul 2016 15:43:47 -0700 Subject: [PATCH 47/47] Updated to new version see previous changes from 1.10 branch. --- gradle.properties | 6 +- .../graves/client/render/TEGraveSR.java | 2 +- .../graves/common/block/BlockGrave.java | 2 +- .../graves/common/block/BlockGraveStone.java | 2 +- .../graves/common/block/Blocks.java | 2 +- .../graves/common/entity/EntityFlying.java | 18 ++-- .../common/entity/EntityPlayerZombie.java | 82 +++++++++---------- .../messages/MessageSetHeadstoneName.java | 7 +- .../graves/common/reference/ModInfo.java | 2 +- .../common/structure/ReplaceableBlock.java | 8 +- .../common/tileentity/TileEntityBase.java | 46 ++++++----- .../common/tileentity/TileEntityGrave.java | 5 +- .../tileentity/TileEntityInventoryBase.java | 4 +- .../graves/proxy/CommonProxy.java | 2 +- 14 files changed, 96 insertions(+), 92 deletions(-) diff --git a/gradle.properties b/gradle.properties index 309a92d..abfbcff 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -minecraft_version=1.10.2 -forge_version=12.18.0.2008 -mcp_mappings=snapshot_20160518 +minecraft_version=1.9 +forge_version=12.16.1.1907 +mcp_mappings=snapshot_20160312 cibuild=0 cibasename=graves \ No newline at end of file diff --git a/src/main/java/com/fireball1725/graves/client/render/TEGraveSR.java b/src/main/java/com/fireball1725/graves/client/render/TEGraveSR.java index a5eb951..5a76ef1 100644 --- a/src/main/java/com/fireball1725/graves/client/render/TEGraveSR.java +++ b/src/main/java/com/fireball1725/graves/client/render/TEGraveSR.java @@ -58,7 +58,7 @@ public void renderTileEntityAt(TileEntityGrave grave, double x, double y, double GlStateManager.enableBlend(); GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + bindTexture(TextureMap.locationBlocksTexture); IBakedModel model = mc.getRenderItem().getItemModelWithOverrides(stack, mc.theWorld, mc.thePlayer); mc.getRenderItem().renderItem(stack, model); GlStateManager.disableAlpha(); diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockGrave.java b/src/main/java/com/fireball1725/graves/common/block/BlockGrave.java index 5fd7225..1d5d177 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockGrave.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockGrave.java @@ -33,7 +33,7 @@ public class BlockGrave extends BlockBase protected BlockGrave() { - super(Material.ROCK); + super(Material.rock); this.setDefaultState(blockState.getBaseState().withProperty(RENDER, true)); this.setHardness(1.5F); this.setResistance(10.0F); diff --git a/src/main/java/com/fireball1725/graves/common/block/BlockGraveStone.java b/src/main/java/com/fireball1725/graves/common/block/BlockGraveStone.java index b323873..40018eb 100644 --- a/src/main/java/com/fireball1725/graves/common/block/BlockGraveStone.java +++ b/src/main/java/com/fireball1725/graves/common/block/BlockGraveStone.java @@ -16,7 +16,7 @@ public class BlockGraveStone extends BlockBase public BlockGraveStone() { - super(Material.CLOTH); + super(Material.cloth); this.setTileEntity(TileEntityGraveStone.class); } diff --git a/src/main/java/com/fireball1725/graves/common/block/Blocks.java b/src/main/java/com/fireball1725/graves/common/block/Blocks.java index b204b1c..242f534 100644 --- a/src/main/java/com/fireball1725/graves/common/block/Blocks.java +++ b/src/main/java/com/fireball1725/graves/common/block/Blocks.java @@ -7,7 +7,7 @@ import net.minecraftforge.fml.common.registry.GameRegistry; public enum Blocks { - BLOCK_GRAVE("grave", new BlockGrave(), CreativeTabs.DECORATIONS), + BLOCK_GRAVE("grave", new BlockGrave(), CreativeTabs.tabDecorations), Block_GRAVE_LEGACY("gravestone", new BlockGraveStone()); private static boolean registered = false; diff --git a/src/main/java/com/fireball1725/graves/common/entity/EntityFlying.java b/src/main/java/com/fireball1725/graves/common/entity/EntityFlying.java index 71d5ffe..5f41d6d 100644 --- a/src/main/java/com/fireball1725/graves/common/entity/EntityFlying.java +++ b/src/main/java/com/fireball1725/graves/common/entity/EntityFlying.java @@ -28,19 +28,19 @@ public void moveEntityWithHeading(float strafe, float forward) { if (this.isInWater()) { - this.moveRelative(strafe, forward, 0.02F); + this.moveFlying(strafe, forward, 0.02F); this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.800000011920929D; - this.motionY *= 0.800000011920929D; - this.motionZ *= 0.800000011920929D; + this.motionX *= 0.800000011920929D; + this.motionY *= 0.800000011920929D; + this.motionZ *= 0.800000011920929D; } else if (this.isInLava()) { - this.moveRelative(strafe, forward, 0.02F); + this.moveFlying(strafe, forward, 0.02F); this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.5D; - this.motionY *= 0.5D; - this.motionZ *= 0.5D; + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; } else { @@ -52,7 +52,7 @@ else if (this.isInLava()) } float f1 = 0.16277136F / (f * f * f); - this.moveRelative(strafe, forward, this.onGround ? 0.1F * f1 : 0.02F); + this.moveFlying(strafe, forward, this.onGround ? 0.1F * f1 : 0.02F); f = 0.91F; if (this.onGround) diff --git a/src/main/java/com/fireball1725/graves/common/entity/EntityPlayerZombie.java b/src/main/java/com/fireball1725/graves/common/entity/EntityPlayerZombie.java index cdf8618..1cb1f97 100644 --- a/src/main/java/com/fireball1725/graves/common/entity/EntityPlayerZombie.java +++ b/src/main/java/com/fireball1725/graves/common/entity/EntityPlayerZombie.java @@ -101,10 +101,10 @@ public void setPlayer(EntityPlayer player) } @Override - public NBTTagCompound writeToNBT(NBTTagCompound tagCompund) + public void writeToNBT(NBTTagCompound tagCompund) { tagCompund.setBoolean("[GoldenLassoPrevent]", true); // Make it so ExU2 cursed lassos are disabled - return super.writeToNBT(tagCompund); + super.writeToNBT(tagCompund); } @Override @@ -158,10 +158,10 @@ public void onUpdate() if(worldObj.isRemote) { - float w = dataManager.get(WIDTH); + float w = dataWatcher.get(WIDTH); if(w != width) width = w; - float h = dataManager.get(HEIGHT); + float h = dataWatcher.get(HEIGHT); if(h != height) height = h; } @@ -191,10 +191,10 @@ protected void applyEntityAttributes() protected void entityInit() { super.entityInit(); - dataManager.register(NAME, ""); - dataManager.register(CHILD, (byte) 0); - dataManager.register(WIDTH, width); - dataManager.register(HEIGHT, height); + dataWatcher.register(NAME, ""); + dataWatcher.register(CHILD, (byte) 0); + dataWatcher.register(WIDTH, width); + dataWatcher.register(HEIGHT, height); playSound(getSound("spawn"), getSoundVolume(), getSoundPitch()); } @@ -249,9 +249,9 @@ protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty) int i = rand.nextInt(3); if(i == 0) - { setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.STONE_SWORD)); } + { setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.stone_sword)); } else if(i == 1) - { setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.BOW)); } + { setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.bow)); } } } @@ -264,9 +264,9 @@ public void setItemStackToSlot(EntityEquipmentSlot slotIn, ItemStack stack) @Override public ItemStack getPickedResult(RayTraceResult target) { - ItemStack stack = new ItemStack(Items.SPAWN_EGG); + ItemStack stack = new ItemStack(Items.spawn_egg); NBTTagCompound nbt = new NBTTagCompound(); - nbt.setString("entity_name", EntityList.CLASS_TO_NAME.get(getClass())); + nbt.setString("entity_name", EntityList.classToStringMapping.get(getClass())); stack.setTagCompound(nbt); return stack; } @@ -368,39 +368,39 @@ public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLi if(rng > rngNothing + rngSword + rngLeatherKit + rngIronKit + rngGoldKit) { // Diamond Kit - slot0 = new ItemStack(Items.DIAMOND_SWORD); - slot1 = new ItemStack(Items.DIAMOND_BOOTS); - slot2 = new ItemStack(Items.DIAMOND_LEGGINGS); - slot3 = new ItemStack(Items.DIAMOND_CHESTPLATE); - slot4 = new ItemStack(Items.DIAMOND_HELMET); + slot0 = new ItemStack(Items.diamond_sword); + slot1 = new ItemStack(Items.diamond_boots); + slot2 = new ItemStack(Items.diamond_leggings); + slot3 = new ItemStack(Items.diamond_chestplate); + slot4 = new ItemStack(Items.diamond_helmet); } else if(rng > rngNothing + rngSword + rngLeatherKit + rngIronKit) { // Gold Kit - slot0 = new ItemStack(Items.GOLDEN_SWORD); - slot1 = new ItemStack(Items.GOLDEN_BOOTS); - slot2 = new ItemStack(Items.GOLDEN_LEGGINGS); - slot3 = new ItemStack(Items.GOLDEN_CHESTPLATE); - slot4 = new ItemStack(Items.GOLDEN_HELMET); + slot0 = new ItemStack(Items.golden_sword); + slot1 = new ItemStack(Items.golden_boots); + slot2 = new ItemStack(Items.golden_leggings); + slot3 = new ItemStack(Items.golden_chestplate); + slot4 = new ItemStack(Items.golden_helmet); } else if(rng > rngNothing + rngSword + rngLeatherKit) { // Iron Kit - slot0 = new ItemStack(Items.IRON_SWORD); - slot1 = new ItemStack(Items.IRON_BOOTS); - slot2 = new ItemStack(Items.IRON_LEGGINGS); - slot3 = new ItemStack(Items.IRON_CHESTPLATE); - slot4 = new ItemStack(Items.IRON_HELMET); + slot0 = new ItemStack(Items.iron_sword); + slot1 = new ItemStack(Items.iron_boots); + slot2 = new ItemStack(Items.iron_leggings); + slot3 = new ItemStack(Items.iron_chestplate); + slot4 = new ItemStack(Items.iron_helmet); } else if(rng > rngNothing + rngSword) { // Leather Kit - slot0 = new ItemStack(Items.WOODEN_SWORD); - slot1 = new ItemStack(Items.LEATHER_BOOTS); - slot2 = new ItemStack(Items.LEATHER_LEGGINGS); - slot3 = new ItemStack(Items.LEATHER_CHESTPLATE); - slot4 = new ItemStack(Items.LEATHER_HELMET); + slot0 = new ItemStack(Items.wooden_sword); + slot1 = new ItemStack(Items.leather_boots); + slot2 = new ItemStack(Items.leather_leggings); + slot3 = new ItemStack(Items.leather_chestplate); + slot4 = new ItemStack(Items.leather_helmet); } else if(rng > rngNothing) { // Wooden Sword - slot0 = new ItemStack(Items.WOODEN_SWORD); + slot0 = new ItemStack(Items.wooden_sword); } if(ConfigZombie.configZombieArmorEnabled) @@ -512,7 +512,7 @@ public ITextComponent getDisplayName() private Style style; @Override - public Style getStyle() + public Style getChatStyle() { if(style == null) { @@ -530,7 +530,7 @@ public String getFormattingCode() for(ITextComponent iTextComponent : siblings) { - iTextComponent.getStyle().setParentStyle(style); + iTextComponent.getChatStyle().setParentStyle(style); } } @@ -565,9 +565,9 @@ public void setProfile(GameProfile profile) @Override public String getUsername() { - String username = dataManager.get(NAME); + String username = dataWatcher.get(NAME); if(StringUtils.isBlank(username)) - { dataManager.set(NAME, "FireBall1725"); } + { dataWatcher.set(NAME, "FireBall1725"); } if(username.equals("Soaryn")) return "direwolf20"; if(username.equals("direwolf20")) @@ -600,7 +600,7 @@ public void setUsername(String name) { name = newName; } - dataManager.set(NAME, name); + dataWatcher.set(NAME, name); } @Override @@ -624,15 +624,15 @@ public double getInterpolatedCapeZ(float partialTickTime) @Override public boolean isChild() { - return dataManager.get(CHILD) == 1; + return dataWatcher.get(CHILD) == 1; } @Override protected void setSize(float width, float height) { super.setSize(width, height); - dataManager.set(WIDTH, this.width); - dataManager.set(HEIGHT, this.height); + dataWatcher.set(WIDTH, this.width); + dataWatcher.set(HEIGHT, this.height); } public BlockPos getGravePos() diff --git a/src/main/java/com/fireball1725/graves/common/network/messages/MessageSetHeadstoneName.java b/src/main/java/com/fireball1725/graves/common/network/messages/MessageSetHeadstoneName.java index 0942f6a..d539ea0 100644 --- a/src/main/java/com/fireball1725/graves/common/network/messages/MessageSetHeadstoneName.java +++ b/src/main/java/com/fireball1725/graves/common/network/messages/MessageSetHeadstoneName.java @@ -37,9 +37,10 @@ public static class HANDLER implements IMessageHandler getDescriptionPacket() { NBTTagCompound data = new NBTTagCompound(); - writeToNBT(data); + writeToNBT(data); return new SPacketUpdateTileEntity(this.pos, 1, data); } @@ -44,22 +43,23 @@ public void onDataPacket(NetworkManager networkManager, SPacketUpdateTileEntity } @Override - public NBTTagCompound getUpdateTag() + public NBTTagCompound getTileData() { NBTTagCompound tag = new NBTTagCompound(); tag.setInteger("x", pos.getX()); tag.setInteger("y", pos.getY()); tag.setInteger("z", pos.getZ()); - return writeToNBT(tag); - } - - @Override - public void handleUpdateTag(NBTTagCompound tag) - { - readFromNBT(tag); - worldObj.markBlockRangeForRenderUpdate(this.pos, this.pos); - markForUpdate(); + writeToNBT(tag); + return tag; } + // + // @Override + // public void handleUpdateTag(NBTTagCompound tag) + // { + // readFromNBT(tag); + // worldObj.markBlockRangeForRenderUpdate(this.pos, this.pos); + // markForUpdate(); + // } public void markForUpdate() { if (this.renderedFragment > 0) { @@ -82,12 +82,13 @@ public void markForUpdate() { } } - public void onChunkLoad() { - if (this.isInvalid()) - this.validate(); + public void onChunkLoad() + { + if(this.isInvalid()) + { this.validate(); } - markForUpdate(); - } + markForUpdate(); + } @Override public void onChunkUnload() { @@ -143,12 +144,13 @@ public void setName(String name) { } @Override - public NBTTagCompound writeToNBT(NBTTagCompound compound) + public void writeToNBT(NBTTagCompound compound) { - if (this.customName != null) { + if(this.customName != null) + { compound.setString("CustomName", this.customName); } - return super.writeToNBT(compound); + super.writeToNBT(compound); } @Override diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGrave.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGrave.java index 9d6c537..1812da3 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGrave.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityGrave.java @@ -241,7 +241,7 @@ public void dropItems(EntityPlayer player) } @Override - public SPacketUpdateTileEntity getUpdatePacket() + public SPacketUpdateTileEntity getDescriptionPacket() { return new SPacketUpdateTileEntity(getPos(), getBlockMetadata(), serializeNBT()); } @@ -253,7 +253,7 @@ public void onDataPacket(NetworkManager networkManager, SPacketUpdateTileEntity } @Override - public NBTTagCompound writeToNBT(NBTTagCompound nbtTagCompound) + public void writeToNBT(NBTTagCompound nbtTagCompound) { super.writeToNBT(nbtTagCompound); //Save Display Stack @@ -289,7 +289,6 @@ public NBTTagCompound writeToNBT(NBTTagCompound nbtTagCompound) { hotbarTag.setTag(String.valueOf(i), hotbar[i].serializeNBT()); } nbtTagCompound.setTag("hotbarTag", hotbarTag); } - return nbtTagCompound; } @Override diff --git a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityInventoryBase.java b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityInventoryBase.java index 0833011..cf04a4e 100644 --- a/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityInventoryBase.java +++ b/src/main/java/com/fireball1725/graves/common/tileentity/TileEntityInventoryBase.java @@ -36,7 +36,7 @@ public void readFromNBT(NBTTagCompound nbtTagCompound) } @Override - public NBTTagCompound writeToNBT(NBTTagCompound nbtTagCompound) + public void writeToNBT(NBTTagCompound nbtTagCompound) { if(getInternalInventory() instanceof IInventoryCustom) @@ -58,7 +58,7 @@ public NBTTagCompound writeToNBT(NBTTagCompound nbtTagCompound) } nbtTagCompound.setTag("Items", tagCompound); } - return super.writeToNBT(nbtTagCompound); + super.writeToNBT(nbtTagCompound); } @Override diff --git a/src/main/java/com/fireball1725/graves/proxy/CommonProxy.java b/src/main/java/com/fireball1725/graves/proxy/CommonProxy.java index 2208758..2ad844f 100644 --- a/src/main/java/com/fireball1725/graves/proxy/CommonProxy.java +++ b/src/main/java/com/fireball1725/graves/proxy/CommonProxy.java @@ -35,7 +35,7 @@ public void preInit(FMLPreInitializationEvent event) MinecraftForge.EVENT_BUS.register(new Events()); //Recipes GameRegistry.addRecipe(new ItemStack(Blocks.BLOCK_GRAVE.block), "x x", "xzx", "xxx", - 'x', new ItemStack(net.minecraft.init.Blocks.STONE), 'v', new ItemStack(net.minecraft.init.Blocks.OBSIDIAN)); + 'x', new ItemStack(net.minecraft.init.Blocks.stone), 'v', new ItemStack(net.minecraft.init.Blocks.obsidian)); } @Override