diff --git a/resources/assets/tinker/textures/blocks/greencurrent.png b/resources/assets/tinker/textures/blocks/greencurrent.png new file mode 100644 index 00000000..e97c7ed6 Binary files /dev/null and b/resources/assets/tinker/textures/blocks/greencurrent.png differ diff --git a/resources/assets/tinker/textures/blocks/greencurrent.png.mcmeta b/resources/assets/tinker/textures/blocks/greencurrent.png.mcmeta new file mode 100644 index 00000000..4f0718ac --- /dev/null +++ b/resources/assets/tinker/textures/blocks/greencurrent.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/resources/assets/tinker/textures/blocks/greencurrent_flow.png b/resources/assets/tinker/textures/blocks/greencurrent_flow.png new file mode 100644 index 00000000..8af1eb60 Binary files /dev/null and b/resources/assets/tinker/textures/blocks/greencurrent_flow.png differ diff --git a/resources/assets/tinker/textures/blocks/greencurrent_flow.png.mcmeta b/resources/assets/tinker/textures/blocks/greencurrent_flow.png.mcmeta new file mode 100644 index 00000000..0645f48c --- /dev/null +++ b/resources/assets/tinker/textures/blocks/greencurrent_flow.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/resources/assets/tinker/textures/blocks/greencurrent_whirl.png b/resources/assets/tinker/textures/blocks/greencurrent_whirl.png new file mode 100644 index 00000000..1631cd63 Binary files /dev/null and b/resources/assets/tinker/textures/blocks/greencurrent_whirl.png differ diff --git a/src/tconstruct/TConstruct.java b/src/tconstruct/TConstruct.java index af034f5f..180c311e 100644 --- a/src/tconstruct/TConstruct.java +++ b/src/tconstruct/TConstruct.java @@ -4,8 +4,6 @@ import net.minecraftforge.common.MinecraftForge; import tconstruct.client.event.EventCloakRender; import tconstruct.common.TContent; import tconstruct.common.TProxyCommon; -import tconstruct.landmine.logic.behavior.Behavior; -import tconstruct.landmine.logic.behavior.stackCombo.SpecialStackHandler; import tconstruct.library.TConstructRegistry; import tconstruct.library.crafting.Detailing; import tconstruct.library.crafting.LiquidCasting; @@ -13,6 +11,8 @@ import tconstruct.library.util.TabTools; import tconstruct.util.PHConstruct; import tconstruct.util.TCraftingHandler; import tconstruct.util.TEventHandler; +import tconstruct.util.landmine.behavior.Behavior; +import tconstruct.util.landmine.behavior.stackCombo.SpecialStackHandler; import tconstruct.util.player.TPlayerHandler; import tconstruct.worldgen.SlimeIslandGen; import tconstruct.worldgen.TBaseWorldGenerator; @@ -40,7 +40,7 @@ import cpw.mods.fml.relauncher.Side; * @dependencies: IC2 API, MFR API */ -@Mod(modid = "TConstruct", name = "TConstruct", version = "1.6.2_1.4.4", dependencies = "required-after:Forge@[7.7.1.687,)") +@Mod(modid = "TConstruct", name = "TConstruct", version = "1.6.2_1.4.5d1", dependencies = "required-after:Forge@[7.7.1.687,)") @NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = tconstruct.util.network.TPacketHandler.class) public class TConstruct { diff --git a/src/tconstruct/landmine/block/BlockLandmine.java b/src/tconstruct/blocks/BlockLandmine.java similarity index 98% rename from src/tconstruct/landmine/block/BlockLandmine.java rename to src/tconstruct/blocks/BlockLandmine.java index 34e2701f..2e72fbf7 100644 --- a/src/tconstruct/landmine/block/BlockLandmine.java +++ b/src/tconstruct/blocks/BlockLandmine.java @@ -1,4 +1,4 @@ -package tconstruct.landmine.block; +package tconstruct.blocks; import static net.minecraftforge.common.ForgeDirection.DOWN; import static net.minecraftforge.common.ForgeDirection.EAST; @@ -33,11 +33,11 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; import tconstruct.TConstruct; +import tconstruct.blocks.logic.LandmineExplodeLogic; +import tconstruct.blocks.logic.TileEntityLandmine; +import tconstruct.client.block.RenderLandmine; import tconstruct.common.TProxyCommon; -import tconstruct.landmine.Helper; -import tconstruct.landmine.client.render.RenderLandmine; -import tconstruct.landmine.logic.LandmineExplodeLogic; -import tconstruct.landmine.tileentity.TileEntityLandmine; +import tconstruct.util.landmine.Helper; /** * diff --git a/src/tconstruct/blocks/ConveyorBase.java b/src/tconstruct/blocks/ConveyorBase.java index 2d5fbdd6..29dc44a2 100644 --- a/src/tconstruct/blocks/ConveyorBase.java +++ b/src/tconstruct/blocks/ConveyorBase.java @@ -1,10 +1,21 @@ package tconstruct.blocks; -import tconstruct.library.TConstructRegistry; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Icon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import tconstruct.client.block.SlimeChannelRender; +import tconstruct.library.TConstructRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ConveyorBase extends Block { @@ -14,30 +25,125 @@ public class ConveyorBase extends Block this.setCreativeTab(TConstructRegistry.blockTab); setBlockBounds(0f, 0f, 0f, 1f, 0.5f, 1f); } + + public boolean isBlockReplaceable(World world, int x, int y, int z) + { + return false; + } @Override - public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) + public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { - double moveX = 0; - double moveZ = 0; - - int meta = world.getBlockMetadata(x, y, z); - switch (meta % 4) + return null; + } + + @Override + public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) + { + if (!world.isBlockIndirectlyGettingPowered(x, y, z)) { - case 0: - moveX += 0.1; - break; - case 1: - moveZ += 0.1; - break; - case 2: - moveX -= 0.1; - break; - case 3: - moveZ -= 0.1; - break; + double moveX = 0; + double moveZ = 0; + + double speed = 0.01; + + int meta = world.getBlockMetadata(x, y, z); + switch (meta % 8) + { + case 6: + moveX += speed; + break; + case 7: + moveX += speed; + moveZ += speed; + break; + case 0: + moveZ += speed; + break; + case 1: + moveZ += speed; + moveX -= speed; + break; + case 2: + moveX -= speed; + break; + case 3: + moveX -= speed; + moveZ -= speed; + break; + case 4: + moveZ -= speed; + break; + case 5: + moveZ -= speed; + moveX += speed; + break; + } + + entity.addVelocity(moveX, 0, moveZ); } - - entity.addVelocity(moveX, 0, moveZ); + } + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) + { + int face = MathHelper.floor_double((double) (entity.rotationYaw * 8.0F / 360.0F) + 0.5D) + (entity.isSneaking() ? 4 : 0) & 7; + int meta = world.getBlockMetadata(x, y, z) & 8; + world.setBlockMetadataWithNotify(x, y, z, face | meta, 2); + } + + public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) + { + if (side == 1) + return false; + return super.shouldSideBeRendered(world, x, y, z, side); + } + + public Icon[] icons; + + /* Rendering */ + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderBlockPass() + { + return 1; + } + + @Override + public int getRenderType() + { + return SlimeChannelRender.model; + } + + @Override + public void registerIcons(IconRegister iconRegister) + { + String[] textureNames = new String[] { "greencurrent", "greencurrent_flow" }; + this.icons = new Icon[textureNames.length]; + + for (int i = 0; i < this.icons.length; ++i) + { + this.icons[i] = iconRegister.registerIcon("tinker:" + textureNames[i]); + } + } + + @Override + @SideOnly(Side.CLIENT) + public Icon getIcon(int side, int meta) + { + if (meta >= 8) + return icons[0]; + return side == 1 ? icons[1] : icons[0]; } } diff --git a/src/tconstruct/blocks/LightCrystalBase.java b/src/tconstruct/blocks/LightCrystalBase.java deleted file mode 100644 index 9396d42b..00000000 --- a/src/tconstruct/blocks/LightCrystalBase.java +++ /dev/null @@ -1,75 +0,0 @@ -package tconstruct.blocks; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; -import net.minecraft.world.World; -import tconstruct.client.block.CrystalBlockRender; -import tconstruct.common.TContent; -import tconstruct.crystal.TheftValueTracker; -import tconstruct.library.TConstructRegistry; - -public class LightCrystalBase extends Block -{ - String[] textureNames = { "amber_crystal" }; - Icon[] icons; - - public LightCrystalBase(int id) - { - super(id, Material.glass); - this.setCreativeTab(TConstructRegistry.blockTab); - } - - @Override - public Icon getIcon (int side, int meta) - { - if (meta < 5) - return Block.glowStone.getIcon(side, meta); - if (meta < 10) - return Block.blockNetherQuartz.getIcon(side, 1); - return icons[0]; - } - - @Override - public boolean renderAsNormalBlock () - { - return false; - } - - @Override - public boolean isOpaqueCube () - { - return false; - } - - @Override - public int getRenderType () - { - return CrystalBlockRender.model; - } - - @Override - public void getSubBlocks (int id, CreativeTabs tab, List list) - { - for (int iter = 0; iter < 15; iter++) - { - list.add(new ItemStack(id, 1, iter)); - } - } - - @Override - public void registerIcons (IconRegister iconRegister) - { - this.icons = new Icon[textureNames.length]; - - for (int i = 0; i < this.icons.length; ++i) - { - this.icons[i] = iconRegister.registerIcon("tinker:" + textureNames[i]); - } - } -} diff --git a/src/tconstruct/blocks/RedstoneBallRepeater.java b/src/tconstruct/blocks/RedstoneBallRepeater.java deleted file mode 100644 index 4da274b6..00000000 --- a/src/tconstruct/blocks/RedstoneBallRepeater.java +++ /dev/null @@ -1,217 +0,0 @@ -package tconstruct.blocks; - -import java.util.Random; - -import tconstruct.client.block.BallRepeaterRender; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockRedstoneLogic; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.Direction; -import net.minecraft.util.Icon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class RedstoneBallRepeater extends BlockRedstoneLogic -{ - /** The offsets for the two torches in redstone repeater blocks. */ - public static final double[] repeaterTorchOffset = new double[] { -0.0625D, 0.0625D, 0.1875D, 0.3125D }; - - /** The states in which the redstone repeater blocks can be. */ - public static final int[] repeaterState = new int[] { 1, 2, 3, 4 }; - - @SideOnly(Side.CLIENT) - public static Icon field_94413_c; - @SideOnly(Side.CLIENT) - public static Icon field_94410_cO; - @SideOnly(Side.CLIENT) - public static Icon field_94411_cP; - @SideOnly(Side.CLIENT) - public static Icon field_94412_cQ; - - public RedstoneBallRepeater(int par1, boolean par2) - { - super(par1, par2); - //this.setCreativeTab(CreativeTabs.tabRedstone); - } - - /** - * Called upon block activation (right click on the block.) - */ - public boolean onBlockActivated (World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) - { - int i1 = par1World.getBlockMetadata(par2, par3, par4); - int j1 = (i1 & 12) >> 2; - j1 = j1 + 1 << 2 & 12; - par1World.setBlockMetadataWithNotify(par2, par3, par4, j1 | i1 & 3, 3); - return true; - } - - public int func_94481_j_ (int par1) - { - return repeaterState[(par1 & 12) >> 2] * 2; - } - - public BlockRedstoneLogic func_94485_e () - { - return Block.redstoneRepeaterActive; - } - - public BlockRedstoneLogic func_94484_i () - { - return Block.redstoneRepeaterIdle; - } - - /** - * Returns the ID of the items to drop on destruction. - */ - public int idDropped (int par1, Random par2Random, int par3) - { - return this.blockID; - } - - @SideOnly(Side.CLIENT) - /** - * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) - */ - /*public int idPicked(World par1World, int par2, int par3, int par4) - { - return Item.redstoneRepeater.itemID; - }*/ - /** - * The type of render function that is called for this block - */ - public int getRenderType () - { - return BallRepeaterRender.model; - } - - public boolean func_94476_e (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) - { - return this.func_94482_f(par1IBlockAccess, par2, par3, par4, par5) > 0; - } - - public boolean func_94477_d (int par1) - { - return isRedstoneRepeaterBlockID(par1); - } - - public static boolean isPowerProviderOrWire (IBlockAccess par0IBlockAccess, int par1, int par2, int par3, int par4) - { - int i1 = par0IBlockAccess.getBlockId(par1, par2, par3); - - if (i1 == Block.redstoneWire.blockID) - { - return true; - } - else if (i1 == 0) - { - return false; - } - else if (!Block.redstoneRepeaterIdle.func_94487_f(i1)) - { - return (Block.blocksList[i1] != null && Block.blocksList[i1].canConnectRedstone(par0IBlockAccess, par1, par2, par3, par4)); - } - else - { - int j1 = par0IBlockAccess.getBlockMetadata(par1, par2, par3); - return par4 == (j1 & 3) || par4 == Direction.rotateOpposite[j1 & 3]; - } - } - - @SideOnly(Side.CLIENT) - /** - * A randomly called display update to be able to add particles or other items for display - */ - public void randomDisplayTick (World par1World, int par2, int par3, int par4, Random par5Random) - { - if (this.isRepeaterPowered) - { - int l = par1World.getBlockMetadata(par2, par3, par4); - int i1 = getDirection(l); - double d0 = (double) ((float) par2 + 0.5F) + (double) (par5Random.nextFloat() - 0.5F) * 0.2D; - double d1 = (double) ((float) par3 + 0.4F) + (double) (par5Random.nextFloat() - 0.5F) * 0.2D; - double d2 = (double) ((float) par4 + 0.5F) + (double) (par5Random.nextFloat() - 0.5F) * 0.2D; - double d3 = 0.0D; - double d4 = 0.0D; - - if (par5Random.nextInt(2) == 0) - { - switch (i1) - { - case 0: - d4 = -0.3125D; - break; - case 1: - d3 = 0.3125D; - break; - case 2: - d4 = 0.3125D; - break; - case 3: - d3 = -0.3125D; - } - } - else - { - int j1 = (l & 12) >> 2; - - switch (i1) - { - case 0: - d4 = repeaterTorchOffset[j1]; - break; - case 1: - d3 = -repeaterTorchOffset[j1]; - break; - case 2: - d4 = -repeaterTorchOffset[j1]; - break; - case 3: - d3 = repeaterTorchOffset[j1]; - } - } - - par1World.spawnParticle("reddust", d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D); - } - } - - public boolean canPlaceBlockAt (World par1World, int par2, int par3, int par4) - { - return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) || par1World.getBlockId(par2, par3 - 1, par4) == Block.glowStone.blockID; - } - - /** - * ejects contained items into the world, and notifies neighbours of an update, as appropriate - */ - public void breakBlock (World par1World, int par2, int par3, int par4, int par5, int par6) - { - super.breakBlock(par1World, par2, par3, par4, par5, par6); - this.func_94483_i_(par1World, par2, par3, par4); - } - - @Override - public int colorMultiplier (IBlockAccess par1IBlockAccess, int par2, int par3, int par4) - { - return 8388608; - } - - public void registerIcons (IconRegister par1IconRegister) - { - this.field_94413_c = par1IconRegister.registerIcon("tinker:repeaterDust_cross"); - this.field_94410_cO = par1IconRegister.registerIcon("tinker:repeaterDust_line"); - this.field_94411_cP = par1IconRegister.registerIcon("tinker:repeaterDust_cross_overlay"); - this.field_94412_cQ = par1IconRegister.registerIcon("tinker:repeaterDust_line_overlay"); - this.blockIcon = this.field_94413_c; - } - - @SideOnly(Side.CLIENT) - public static Icon func_94409_b (String par0Str) - { - return par0Str == "repeaterDust_cross" ? field_94413_c : (par0Str == "repeaterDust_line" ? field_94410_cO : (par0Str == "repeaterDust_cross_overlay" ? field_94411_cP - : (par0Str == "repeaterDust_line_overlay" ? field_94412_cQ : null))); - } -} diff --git a/src/tconstruct/blocks/SlimePad.java b/src/tconstruct/blocks/SlimePad.java new file mode 100644 index 00000000..b4acb31b --- /dev/null +++ b/src/tconstruct/blocks/SlimePad.java @@ -0,0 +1,144 @@ +package tconstruct.blocks; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Icon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import tconstruct.client.block.SlimePadRender; +import tconstruct.common.TContent; +import tconstruct.library.TConstructRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class SlimePad extends Block +{ + + public SlimePad(int par1, Material par2Material) + { + super(par1, par2Material); + setBlockBounds(0.125F, 0.0F, 0.125F, 0.875F, 0.625F, 0.875F); + this.setCreativeTab(TConstructRegistry.blockTab); + } + + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) + { + return null; + } + + @Override + public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) + { + if (!world.isBlockIndirectlyGettingPowered(x, y, z)) + { + double moveX = 0; + double moveZ = 0; + + double speed = 0.25; + + int meta = world.getBlockMetadata(x, y, z); + switch (meta % 8) + { + case 6: + moveX += speed; + break; + case 7: + moveX += speed; + moveZ += speed; + break; + case 0: + moveZ += speed; + break; + case 1: + moveZ += speed; + moveX -= speed; + break; + case 2: + moveX -= speed; + break; + case 3: + moveX -= speed; + moveZ -= speed; + break; + case 4: + moveZ -= speed; + break; + case 5: + moveZ -= speed; + moveX += speed; + break; + } + + if (entity instanceof EntityItem) + { + entity.posY += 1; + } + entity.addVelocity(moveX, speed*2, moveZ); + world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, this.stepSound.getStepSound(), (this.stepSound.getVolume()) / 2.0F, this.stepSound.getPitch() * 0.65F); + } + } + + public boolean isBlockReplaceable(World world, int x, int y, int z) + { + return false; + } + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) + { + int face = MathHelper.floor_double((double) (entity.rotationYaw * 8.0F / 360.0F) + 0.5D) + (entity.isSneaking() ? 4 : 0) & 7; + int meta = world.getBlockMetadata(x, y, z) & 8; + world.setBlockMetadataWithNotify(x, y, z, face | meta, 2); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderBlockPass() + { + return 1; + } + + @Override + public int getRenderType() + { + return SlimePadRender.model; + } + + @Override + public void registerIcons(IconRegister iconRegister) {} + + @Override + @SideOnly(Side.CLIENT) + public Icon getIcon(int side, int meta) + { + return TContent.slimeGel.getIcon(side, 1); + } + + public Icon getFluidIcon(int meta) + { + return TContent.slimeChannel.getIcon(2, 0); + } + + public Icon getNubIcon(int meta) + { + return TContent.slimeGel.getIcon(0, 0); + } +} diff --git a/src/tconstruct/landmine/logic/LandmineExplodeLogic.java b/src/tconstruct/blocks/logic/LandmineExplodeLogic.java similarity index 97% rename from src/tconstruct/landmine/logic/LandmineExplodeLogic.java rename to src/tconstruct/blocks/logic/LandmineExplodeLogic.java index 5b9a2a9c..ba4b55bf 100644 --- a/src/tconstruct/landmine/logic/LandmineExplodeLogic.java +++ b/src/tconstruct/blocks/logic/LandmineExplodeLogic.java @@ -1,11 +1,10 @@ -package tconstruct.landmine.logic; +package tconstruct.blocks.logic; import java.util.ArrayList; import java.util.Iterator; -import tconstruct.landmine.logic.behavior.Behavior; -import tconstruct.landmine.logic.behavior.stackCombo.SpecialStackHandler; -import tconstruct.landmine.tileentity.TileEntityLandmine; +import tconstruct.util.landmine.behavior.Behavior; +import tconstruct.util.landmine.behavior.stackCombo.SpecialStackHandler; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; diff --git a/src/tconstruct/landmine/logic/LandmineSpecialStackLogic.java b/src/tconstruct/blocks/logic/LandmineSpecialStackLogic.java similarity index 88% rename from src/tconstruct/landmine/logic/LandmineSpecialStackLogic.java rename to src/tconstruct/blocks/logic/LandmineSpecialStackLogic.java index 8acdf923..85894884 100644 --- a/src/tconstruct/landmine/logic/LandmineSpecialStackLogic.java +++ b/src/tconstruct/blocks/logic/LandmineSpecialStackLogic.java @@ -1,10 +1,9 @@ -package tconstruct.landmine.logic; +package tconstruct.blocks.logic; import java.util.ArrayList; import java.util.Iterator; -import tconstruct.landmine.logic.behavior.stackCombo.SpecialStackHandler; -import tconstruct.landmine.tileentity.TileEntityLandmine; +import tconstruct.util.landmine.behavior.stackCombo.SpecialStackHandler; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; diff --git a/src/tconstruct/landmine/tileentity/TileEntityLandmine.java b/src/tconstruct/blocks/logic/TileEntityLandmine.java similarity index 99% rename from src/tconstruct/landmine/tileentity/TileEntityLandmine.java rename to src/tconstruct/blocks/logic/TileEntityLandmine.java index 6eab63d5..42ed2361 100644 --- a/src/tconstruct/landmine/tileentity/TileEntityLandmine.java +++ b/src/tconstruct/blocks/logic/TileEntityLandmine.java @@ -1,4 +1,4 @@ -package tconstruct.landmine.tileentity; +package tconstruct.blocks.logic; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; diff --git a/src/tconstruct/client/TProxyClient.java b/src/tconstruct/client/TProxyClient.java index 101c6dbd..2d3880b5 100644 --- a/src/tconstruct/client/TProxyClient.java +++ b/src/tconstruct/client/TProxyClient.java @@ -67,13 +67,13 @@ import tconstruct.blocks.logic.PartBuilderLogic; import tconstruct.blocks.logic.PatternChestLogic; import tconstruct.blocks.logic.SmelteryLogic; import tconstruct.blocks.logic.StencilTableLogic; +import tconstruct.blocks.logic.TileEntityLandmine; import tconstruct.blocks.logic.ToolForgeLogic; import tconstruct.blocks.logic.ToolStationLogic; import tconstruct.client.block.BarricadeRender; import tconstruct.client.block.BlockRenderCastingChannel; import tconstruct.client.block.CastingBasinSpecialRender; import tconstruct.client.block.CastingTableSpecialRenderer; -import tconstruct.client.block.CrystalBlockRender; import tconstruct.client.block.DryingRackRender; import tconstruct.client.block.DryingRackSpecialRender; import tconstruct.client.block.FrypanRender; @@ -82,7 +82,10 @@ import tconstruct.client.block.OreberryRender; import tconstruct.client.block.PaneConnectedRender; import tconstruct.client.block.PaneRender; import tconstruct.client.block.PunjiRender; +import tconstruct.client.block.RenderLandmine; import tconstruct.client.block.SearedRender; +import tconstruct.client.block.SlimeChannelRender; +import tconstruct.client.block.SlimePadRender; import tconstruct.client.block.SmallFontRenderer; import tconstruct.client.block.SmelteryRender; import tconstruct.client.block.TableForgeRender; @@ -103,6 +106,7 @@ import tconstruct.client.gui.ArmorExtendedGui; import tconstruct.client.gui.CraftingStationGui; import tconstruct.client.gui.DrawbridgeGui; import tconstruct.client.gui.FrypanGui; +import tconstruct.client.gui.GuiLandmine; import tconstruct.client.gui.GuiManual; import tconstruct.client.gui.KnapsackGui; import tconstruct.client.gui.MiniGardyGui; @@ -142,10 +146,7 @@ import tconstruct.entity.SlimeClone; import tconstruct.entity.projectile.ArrowEntity; import tconstruct.entity.projectile.DaggerEntity; import tconstruct.entity.projectile.LaunchedPotion; -import tconstruct.landmine.client.gui.GuiLandmine; -import tconstruct.landmine.client.render.RenderLandmine; -import tconstruct.landmine.inventory.ContainerLandmine; -import tconstruct.landmine.tileentity.TileEntityLandmine; +import tconstruct.inventory.ContainerLandmine; import tconstruct.library.TConstructRegistry; import tconstruct.library.client.TConstructClientRegistry; import tconstruct.library.client.ToolGuiElement; @@ -322,7 +323,7 @@ public class TProxyClient extends TProxyCommon { Minecraft mc = Minecraft.getMinecraft(); MinecraftForge.EVENT_BUS.register(new TClientEvents()); - smallFontRenderer = new SmallFontRenderer(mc.gameSettings, new ResourceLocation("font/default.png"), mc.renderEngine, false); + smallFontRenderer = new SmallFontRenderer(mc.gameSettings, new ResourceLocation("assets/textures/font/ascii.png"), mc.renderEngine, false); RenderingRegistry.registerBlockHandler(new TableRender()); RenderingRegistry.registerBlockHandler(new TableForgeRender()); RenderingRegistry.registerBlockHandler(new FrypanRender()); @@ -331,7 +332,6 @@ public class TProxyClient extends TProxyCommon RenderingRegistry.registerBlockHandler(new SearedRender()); RenderingRegistry.registerBlockHandler(new OreberryRender()); RenderingRegistry.registerBlockHandler(new BarricadeRender()); - RenderingRegistry.registerBlockHandler(new CrystalBlockRender()); RenderingRegistry.registerBlockHandler(new MachineRender()); RenderingRegistry.registerBlockHandler(new DryingRackRender()); RenderingRegistry.registerBlockHandler(new PaneRender()); @@ -340,6 +340,8 @@ public class TProxyClient extends TProxyCommon RenderingRegistry.registerBlockHandler(new PunjiRender()); RenderingRegistry.registerBlockHandler(new RenderBlockFluid()); RenderingRegistry.registerBlockHandler(new BlockRenderCastingChannel()); + RenderingRegistry.registerBlockHandler(new SlimeChannelRender()); + RenderingRegistry.registerBlockHandler(new SlimePadRender()); // Special Renderers ClientRegistry.bindTileEntitySpecialRenderer(CastingTableLogic.class, new CastingTableSpecialRenderer()); diff --git a/src/tconstruct/client/block/BallRepeaterRender.java b/src/tconstruct/client/block/BallRepeaterRender.java deleted file mode 100644 index 4bc049bc..00000000 --- a/src/tconstruct/client/block/BallRepeaterRender.java +++ /dev/null @@ -1,263 +0,0 @@ -package tconstruct.client.block; - -import tconstruct.blocks.RedstoneBallRepeater; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.Icon; -import net.minecraft.world.IBlockAccess; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; -import cpw.mods.fml.client.registry.RenderingRegistry; - -public class BallRepeaterRender implements ISimpleBlockRenderingHandler -{ - public static int model = RenderingRegistry.getNextAvailableRenderId(); - - @Override - public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer) - { - //Inventory should be an item. This is not here! - } - - @Override - public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) - { - return renderRedstoneBallRepeater(block, x, y, z, world); - } - - @Override - public boolean shouldRender3DInInventory () - { - return false; - } - - @Override - public int getRenderId () - { - return model; - } - - public boolean renderRedstoneBallRepeater (Block par1Block, int par2, int par3, int par4, IBlockAccess world) - { - Tessellator tessellator = Tessellator.instance; - int l = world.getBlockMetadata(par2, par3, par4); - Icon icon = RedstoneBallRepeater.func_94409_b("repeaterDust_cross"); - Icon icon1 = RedstoneBallRepeater.func_94409_b("repeaterDust_line"); - Icon icon2 = RedstoneBallRepeater.func_94409_b("repeaterDust_cross_overlay"); - Icon icon3 = RedstoneBallRepeater.func_94409_b("repeaterDust_line_overlay"); - tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(world, par2, par3, par4)); - float f = 1.0F; - float f1 = (float) l / 15.0F; - float f2 = f1 * 0.6F + 0.4F; - - if (l == 0) - { - f2 = 0.3F; - } - - float f3 = f1 * f1 * 0.7F - 0.5F; - float f4 = f1 * f1 * 0.6F - 0.7F; - - if (f3 < 0.0F) - { - f3 = 0.0F; - } - - if (f4 < 0.0F) - { - f4 = 0.0F; - } - - tessellator.setColorOpaque_F(f2, f3, f4); - boolean flag = RedstoneBallRepeater.isPowerProviderOrWire(world, par2 - 1, par3, par4, 1) || !world.isBlockNormalCube(par2 - 1, par3, par4) - && RedstoneBallRepeater.isPowerProviderOrWire(world, par2 - 1, par3 - 1, par4, -1); - boolean flag1 = RedstoneBallRepeater.isPowerProviderOrWire(world, par2 + 1, par3, par4, 3) || !world.isBlockNormalCube(par2 + 1, par3, par4) - && RedstoneBallRepeater.isPowerProviderOrWire(world, par2 + 1, par3 - 1, par4, -1); - boolean flag2 = RedstoneBallRepeater.isPowerProviderOrWire(world, par2, par3, par4 - 1, 2) || !world.isBlockNormalCube(par2, par3, par4 - 1) - && RedstoneBallRepeater.isPowerProviderOrWire(world, par2, par3 - 1, par4 - 1, -1); - boolean flag3 = RedstoneBallRepeater.isPowerProviderOrWire(world, par2, par3, par4 + 1, 0) || !world.isBlockNormalCube(par2, par3, par4 + 1) - && RedstoneBallRepeater.isPowerProviderOrWire(world, par2, par3 - 1, par4 + 1, -1); - - if (!world.isBlockNormalCube(par2, par3 + 1, par4)) - { - if (world.isBlockNormalCube(par2 - 1, par3, par4) && RedstoneBallRepeater.isPowerProviderOrWire(world, par2 - 1, par3 + 1, par4, -1)) - { - flag = true; - } - - if (world.isBlockNormalCube(par2 + 1, par3, par4) && RedstoneBallRepeater.isPowerProviderOrWire(world, par2 + 1, par3 + 1, par4, -1)) - { - flag1 = true; - } - - if (world.isBlockNormalCube(par2, par3, par4 - 1) && RedstoneBallRepeater.isPowerProviderOrWire(world, par2, par3 + 1, par4 - 1, -1)) - { - flag2 = true; - } - - if (world.isBlockNormalCube(par2, par3, par4 + 1) && RedstoneBallRepeater.isPowerProviderOrWire(world, par2, par3 + 1, par4 + 1, -1)) - { - flag3 = true; - } - } - - float f5 = (float) (par2 + 0); - float f6 = (float) (par2 + 1); - float f7 = (float) (par4 + 0); - float f8 = (float) (par4 + 1); - int i1 = 0; - - if ((flag || flag1) && !flag2 && !flag3) - { - i1 = 1; - } - - if ((flag2 || flag3) && !flag1 && !flag) - { - i1 = 2; - } - - if (i1 == 0) - { - int j1 = 0; - int k1 = 0; - int l1 = 16; - int i2 = 16; - - if (!flag) - { - f5 += 0.3125F; - } - - if (!flag) - { - j1 += 5; - } - - if (!flag1) - { - f6 -= 0.3125F; - } - - if (!flag1) - { - l1 -= 5; - } - - if (!flag2) - { - f7 += 0.3125F; - } - - if (!flag2) - { - k1 += 5; - } - - if (!flag3) - { - f8 -= 0.3125F; - } - - if (!flag3) - { - i2 -= 5; - } - - tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f8, (double) icon.getInterpolatedU((double) l1), (double) icon.getInterpolatedV((double) i2)); - tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f7, (double) icon.getInterpolatedU((double) l1), (double) icon.getInterpolatedV((double) k1)); - tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f7, (double) icon.getInterpolatedU((double) j1), (double) icon.getInterpolatedV((double) k1)); - tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f8, (double) icon.getInterpolatedU((double) j1), (double) icon.getInterpolatedV((double) i2)); - tessellator.setColorOpaque_F(f, f, f); - tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f8, (double) icon2.getInterpolatedU((double) l1), (double) icon2.getInterpolatedV((double) i2)); - tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f7, (double) icon2.getInterpolatedU((double) l1), (double) icon2.getInterpolatedV((double) k1)); - tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f7, (double) icon2.getInterpolatedU((double) j1), (double) icon2.getInterpolatedV((double) k1)); - tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f8, (double) icon2.getInterpolatedU((double) j1), (double) icon2.getInterpolatedV((double) i2)); - } - else if (i1 == 1) - { - tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f8, (double) icon1.getMaxU(), (double) icon1.getMaxV()); - tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f7, (double) icon1.getMaxU(), (double) icon1.getMinV()); - tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f7, (double) icon1.getMinU(), (double) icon1.getMinV()); - tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f8, (double) icon1.getMinU(), (double) icon1.getMaxV()); - tessellator.setColorOpaque_F(f, f, f); - tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f8, (double) icon3.getMaxU(), (double) icon3.getMaxV()); - tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f7, (double) icon3.getMaxU(), (double) icon3.getMinV()); - tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f7, (double) icon3.getMinU(), (double) icon3.getMinV()); - tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f8, (double) icon3.getMinU(), (double) icon3.getMaxV()); - } - else - { - tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f8, (double) icon1.getMaxU(), (double) icon1.getMaxV()); - tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f7, (double) icon1.getMinU(), (double) icon1.getMaxV()); - tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f7, (double) icon1.getMinU(), (double) icon1.getMinV()); - tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f8, (double) icon1.getMaxU(), (double) icon1.getMinV()); - tessellator.setColorOpaque_F(f, f, f); - tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f8, (double) icon3.getMaxU(), (double) icon3.getMaxV()); - tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f7, (double) icon3.getMinU(), (double) icon3.getMaxV()); - tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f7, (double) icon3.getMinU(), (double) icon3.getMinV()); - tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f8, (double) icon3.getMaxU(), (double) icon3.getMinV()); - } - - if (!world.isBlockNormalCube(par2, par3 + 1, par4)) - { - if (world.isBlockNormalCube(par2 - 1, par3, par4) && world.getBlockId(par2 - 1, par3 + 1, par4) == Block.redstoneWire.blockID) - { - tessellator.setColorOpaque_F(f * f2, f * f3, f * f4); - tessellator.addVertexWithUV((double) par2 + 0.015625D, (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 1), (double) icon1.getMaxU(), (double) icon1.getMinV()); - tessellator.addVertexWithUV((double) par2 + 0.015625D, (double) (par3 + 0), (double) (par4 + 1), (double) icon1.getMinU(), (double) icon1.getMinV()); - tessellator.addVertexWithUV((double) par2 + 0.015625D, (double) (par3 + 0), (double) (par4 + 0), (double) icon1.getMinU(), (double) icon1.getMaxV()); - tessellator.addVertexWithUV((double) par2 + 0.015625D, (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 0), (double) icon1.getMaxU(), (double) icon1.getMaxV()); - tessellator.setColorOpaque_F(f, f, f); - tessellator.addVertexWithUV((double) par2 + 0.015625D, (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 1), (double) icon3.getMaxU(), (double) icon3.getMinV()); - tessellator.addVertexWithUV((double) par2 + 0.015625D, (double) (par3 + 0), (double) (par4 + 1), (double) icon3.getMinU(), (double) icon3.getMinV()); - tessellator.addVertexWithUV((double) par2 + 0.015625D, (double) (par3 + 0), (double) (par4 + 0), (double) icon3.getMinU(), (double) icon3.getMaxV()); - tessellator.addVertexWithUV((double) par2 + 0.015625D, (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 0), (double) icon3.getMaxU(), (double) icon3.getMaxV()); - } - - if (world.isBlockNormalCube(par2 + 1, par3, par4) && world.getBlockId(par2 + 1, par3 + 1, par4) == Block.redstoneWire.blockID) - { - tessellator.setColorOpaque_F(f * f2, f * f3, f * f4); - tessellator.addVertexWithUV((double) (par2 + 1) - 0.015625D, (double) (par3 + 0), (double) (par4 + 1), (double) icon1.getMinU(), (double) icon1.getMaxV()); - tessellator.addVertexWithUV((double) (par2 + 1) - 0.015625D, (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 1), (double) icon1.getMaxU(), (double) icon1.getMaxV()); - tessellator.addVertexWithUV((double) (par2 + 1) - 0.015625D, (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 0), (double) icon1.getMaxU(), (double) icon1.getMinV()); - tessellator.addVertexWithUV((double) (par2 + 1) - 0.015625D, (double) (par3 + 0), (double) (par4 + 0), (double) icon1.getMinU(), (double) icon1.getMinV()); - tessellator.setColorOpaque_F(f, f, f); - tessellator.addVertexWithUV((double) (par2 + 1) - 0.015625D, (double) (par3 + 0), (double) (par4 + 1), (double) icon3.getMinU(), (double) icon3.getMaxV()); - tessellator.addVertexWithUV((double) (par2 + 1) - 0.015625D, (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 1), (double) icon3.getMaxU(), (double) icon3.getMaxV()); - tessellator.addVertexWithUV((double) (par2 + 1) - 0.015625D, (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 0), (double) icon3.getMaxU(), (double) icon3.getMinV()); - tessellator.addVertexWithUV((double) (par2 + 1) - 0.015625D, (double) (par3 + 0), (double) (par4 + 0), (double) icon3.getMinU(), (double) icon3.getMinV()); - } - - if (world.isBlockNormalCube(par2, par3, par4 - 1) && world.getBlockId(par2, par3 + 1, par4 - 1) == Block.redstoneWire.blockID) - { - tessellator.setColorOpaque_F(f * f2, f * f3, f * f4); - tessellator.addVertexWithUV((double) (par2 + 1), (double) (par3 + 0), (double) par4 + 0.015625D, (double) icon1.getMinU(), (double) icon1.getMaxV()); - tessellator.addVertexWithUV((double) (par2 + 1), (double) ((float) (par3 + 1) + 0.021875F), (double) par4 + 0.015625D, (double) icon1.getMaxU(), (double) icon1.getMaxV()); - tessellator.addVertexWithUV((double) (par2 + 0), (double) ((float) (par3 + 1) + 0.021875F), (double) par4 + 0.015625D, (double) icon1.getMaxU(), (double) icon1.getMinV()); - tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + 0), (double) par4 + 0.015625D, (double) icon1.getMinU(), (double) icon1.getMinV()); - tessellator.setColorOpaque_F(f, f, f); - tessellator.addVertexWithUV((double) (par2 + 1), (double) (par3 + 0), (double) par4 + 0.015625D, (double) icon3.getMinU(), (double) icon3.getMaxV()); - tessellator.addVertexWithUV((double) (par2 + 1), (double) ((float) (par3 + 1) + 0.021875F), (double) par4 + 0.015625D, (double) icon3.getMaxU(), (double) icon3.getMaxV()); - tessellator.addVertexWithUV((double) (par2 + 0), (double) ((float) (par3 + 1) + 0.021875F), (double) par4 + 0.015625D, (double) icon3.getMaxU(), (double) icon3.getMinV()); - tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + 0), (double) par4 + 0.015625D, (double) icon3.getMinU(), (double) icon3.getMinV()); - } - - if (world.isBlockNormalCube(par2, par3, par4 + 1) && world.getBlockId(par2, par3 + 1, par4 + 1) == Block.redstoneWire.blockID) - { - tessellator.setColorOpaque_F(f * f2, f * f3, f * f4); - tessellator.addVertexWithUV((double) (par2 + 1), (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 1) - 0.015625D, (double) icon1.getMaxU(), (double) icon1.getMinV()); - tessellator.addVertexWithUV((double) (par2 + 1), (double) (par3 + 0), (double) (par4 + 1) - 0.015625D, (double) icon1.getMinU(), (double) icon1.getMinV()); - tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + 0), (double) (par4 + 1) - 0.015625D, (double) icon1.getMinU(), (double) icon1.getMaxV()); - tessellator.addVertexWithUV((double) (par2 + 0), (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 1) - 0.015625D, (double) icon1.getMaxU(), (double) icon1.getMaxV()); - tessellator.setColorOpaque_F(f, f, f); - tessellator.addVertexWithUV((double) (par2 + 1), (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 1) - 0.015625D, (double) icon3.getMaxU(), (double) icon3.getMinV()); - tessellator.addVertexWithUV((double) (par2 + 1), (double) (par3 + 0), (double) (par4 + 1) - 0.015625D, (double) icon3.getMinU(), (double) icon3.getMinV()); - tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + 0), (double) (par4 + 1) - 0.015625D, (double) icon3.getMinU(), (double) icon3.getMaxV()); - tessellator.addVertexWithUV((double) (par2 + 0), (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 1) - 0.015625D, (double) icon3.getMaxU(), (double) icon3.getMaxV()); - } - } - - return true; - } -} diff --git a/src/tconstruct/client/block/CrystalBlockRender.java b/src/tconstruct/client/block/CrystalBlockRender.java deleted file mode 100644 index 00f0aedb..00000000 --- a/src/tconstruct/client/block/CrystalBlockRender.java +++ /dev/null @@ -1,277 +0,0 @@ -package tconstruct.client.block; - -import tconstruct.client.TProxyClient; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.world.IBlockAccess; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; -import cpw.mods.fml.client.registry.RenderingRegistry; - -public class CrystalBlockRender implements ISimpleBlockRenderingHandler -{ - public static int model = RenderingRegistry.getNextAvailableRenderId(); - - @Override - public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer) - { - if (modelID == model) - { - renderer.setRenderBounds(0.375F, 0.0F, 0.375F, 0.625F, 0.125F, 0.625F); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - renderer.setRenderBounds(0.3125F, 0.125F, 0.3125F, 0.6875F, 0.25F, 0.6875F); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - renderer.setRenderBounds(0.25F, 0.25F, 0.25F, 0.75F, 0.75F, 0.75F); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - renderer.setRenderBounds(0.3125F, 0.75F, 0.3125F, 0.6875F, 0.875F, 0.6875F); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - renderer.setRenderBounds(0.375F, 0.875F, 0.375F, 0.625F, 1.0F, 0.625F); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - } - } - - @Override - public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) - { - if (modelID == model) - { - int metadata = world.getBlockMetadata(x, y, z); - - if (metadata < 3) //Bits - { - renderer.setRenderBounds(0.0625F, 0.0F, 0.0625F, 0.25F, 0.0625F, 0.375F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.5F, 0.0F, 0.75F, 0.625F, 0.125F, 0.8125F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.5F, 0.0F, 0.8125F, 0.5625F, 0.0625F, 0.875F); - renderer.renderStandardBlock(block, x, y, z); - } - - //Base - if (metadata == 0) - { - renderer.setRenderBounds(0.375F, 0.0F, 0.375F, 0.625F, 0.125F, 0.625F); - renderer.renderStandardBlock(block, x, y, z); - } - else if (metadata == 1) - { - renderer.setRenderBounds(0.3125F, 0.0F, 0.3125F, 0.6875F, 0.25, 0.6875F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.375F, 0.25, 0.375F, 0.625F, 0.375, 0.625F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.1875, 0.0F, 0.5F, 0.3125F, 0.1875, 0.75F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.4325F, 0.0F, 0.1875, 0.625, 0.125, 0.3125F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.625F, 0.0F, 0.5F, 0.8125f, 0.125, 0.75F); - renderer.renderStandardBlock(block, x, y, z); - } - else if (metadata == 2) - { - renderer.setRenderBounds(0.3125F, 0.0F, 0.3125F, 0.6875F, 0.5F, 0.6875F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.375F, 0.5F, 0.375F, 0.625F, 0.625F, 0.625F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.125F, 0.0F, 0.5F, 0.3125F, 0.25F, 0.75F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.4325F, 0.0F, 0.125F, 0.6875F, 0.375F, 0.3125F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.625F, 0.0F, 0.5F, 0.8125f, 0.375F, 0.75F); - renderer.renderStandardBlock(block, x, y, z); - } - else if (metadata == 3) - { - renderer.setRenderBounds(0.3125F, 0.75F, 0.3125F, 0.6875F, 0.875F, 0.6875F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.375F, 0.875F, 0.375F, 0.625F, 0.9325F, 0.625F); - renderer.renderStandardBlock(block, x, y, z); - - renderer.setRenderBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.75F, 0.75F); - renderer.renderStandardBlock(block, x, y, z); - - renderer.setRenderBounds(0.125F, 0.0F, 0.5F, 0.375F, 0.375, 0.875F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.4325F, 0.0F, 0.0625, 0.625, 0.5, 0.3125F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.625F, 0.0F, 0.5F, 0.875F, 0.625, 0.875F); - renderer.renderStandardBlock(block, x, y, z); - } - else if (metadata == 4) //Transition - { - renderer.setRenderBounds(0.25F, 0.0F, 0.25F, 0.75F, 1.0F, 0.75F); - renderer.renderStandardBlock(block, x, y, z); - - renderer.setRenderBounds(0.125F, 0.0F, 0.5F, 0.375F, 0.5, 0.875F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.4325F, 0.0F, 0.0625, 0.625, 1.0, 0.3125F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.625F, 0.0F, 0.5F, 0.875F, 0.75, 0.875F); - renderer.renderStandardBlock(block, x, y, z); - } - - else if (metadata == 5) //Transition - { - renderer.setRenderBounds(0.25F, 0.0F, 0.25F, 0.75F, 1.0F, 0.75F); - renderer.renderStandardBlock(block, x, y, z); - - renderer.setRenderBounds(0.125F, 0.0F, 0.5F, 0.375F, 0.75F, 0.875F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.4325F, 0.0F, 0.0625, 0.625, 1.0, 0.3125F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.625F, 0.0F, 0.5F, 0.875F, 1.0, 0.875F); - renderer.renderStandardBlock(block, x, y, z); - } - - //2nd Layer - else if (metadata == 6) - { - renderer.setRenderBounds(0.3125F, 0.0F, 0.3125F, 0.6875F, 0.25, 0.6875F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.375F, 0.25, 0.375F, 0.625F, 0.375, 0.625F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.25, 0.0F, 0.5F, 0.375, 0.1875, 0.75F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.4325F, 0.0F, 0.1875, 0.625, 0.125, 0.3125F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.5625F, 0.0F, 0.5F, 0.75, 0.125, 0.75F); - renderer.renderStandardBlock(block, x, y, z); - } - else if (metadata == 7) - { - renderer.setRenderBounds(0.3125F, 0.0F, 0.3125F, 0.6875F, 0.5F, 0.6875F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.375F, 0.5F, 0.375F, 0.625F, 0.625F, 0.625F); - renderer.renderStandardBlock(block, x, y, z); - - renderer.setRenderBounds(0.25F, 0.0F, 0.5F, 0.4325F, 0.25F, 0.75F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.4325F, 0.0F, 0.125F, 0.625F, 0.375F, 0.3125F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.625F, 0.0F, 0.5F, 0.8125f, 0.375F, 0.75F); - renderer.renderStandardBlock(block, x, y, z); - } - else if (metadata == 8) - { - renderer.setRenderBounds(0.3125F, 0.75F, 0.3125F, 0.6875F, 0.875F, 0.6875F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.375F, 0.875F, 0.375F, 0.625F, 0.9325F, 0.625F); - renderer.renderStandardBlock(block, x, y, z); - - renderer.setRenderBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.75F, 0.75F); - renderer.renderStandardBlock(block, x, y, z); - - renderer.setRenderBounds(0.4325F, 0.0F, 0.0625, 0.625, 0.6875F, 0.3125F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.625F, 0.0F, 0.5F, 0.8125F, 0.625, 0.8125F); - renderer.renderStandardBlock(block, x, y, z); - } - else if (metadata == 9) //Transition - { - renderer.setRenderBounds(0.3125F, 0.75F, 0.3125F, 0.6875F, 1.0F, 0.6875F); - renderer.renderStandardBlock(block, x, y, z); - - renderer.setRenderBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.75F, 0.75F); - renderer.renderStandardBlock(block, x, y, z); - - renderer.setRenderBounds(0.4325F, 0.0F, 0.0625, 0.625, 0.75F, 0.3125F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.4325F, 0.75F, 0.125F, 0.625, 1.0F, 0.3125F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.625F, 0.0F, 0.5F, 0.8125F, 0.625, 0.8125F); - renderer.renderStandardBlock(block, x, y, z); - } - - //3rd Layer - else if (metadata == 10) - { - renderer.setRenderBounds(0.375F, 0F, 0.3125F, 0.625F, 0.1875F, 0.625F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.4325F, 0.1875F, 0.4375F, 0.5625F, 0.25F, 0.5625F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.4325F, 0F, 0.1875F, 0.5625F, 0.125F, 0.3125F); - renderer.renderStandardBlock(block, x, y, z); - } - else if (metadata == 11) - { - renderer.setRenderBounds(0.375F, 0F, 0.3125F, 0.625F, 0.4325F, 0.625F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.4325F, 0.4325F, 0.375F, 0.5625F, 0.5F, 0.5625F); - renderer.renderStandardBlock(block, x, y, z); - - renderer.setRenderBounds(0.4325F, 0F, 0.1875F, 0.625F, 0.3125F, 0.3125F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.4325F, 0F, 0.4325F, 0.6875F, 0.3125, 0.6875); - renderer.renderStandardBlock(block, x, y, z); - } - else if (metadata == 12) - { - renderer.setRenderBounds(0.3125F, 0F, 0.3125F, 0.625F, 0.75F, 0.625F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.375F, 0.75F, 0.375F, 0.5625F, 0.875F, 0.5625F); - renderer.renderStandardBlock(block, x, y, z); - - renderer.setRenderBounds(0.4325F, 0F, 0.1875F, 0.625F, 0.675F, 0.3125F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.4325F, 0F, 0.4325F, 0.6875F, 0.5625F, 0.6875); - renderer.renderStandardBlock(block, x, y, z); - } - else if (metadata == 13)//Transition - { - renderer.setRenderBounds(0.3125F, 0F, 0.3125F, 0.625F, 1.0, 0.625F); - renderer.renderStandardBlock(block, x, y, z); - /*renderer.setRenderBounds(0.375F, 0.75F, 0.375F, 0.5625F, 0.875F, 0.5625F); - renderer.renderStandardBlock(block, x, y, z);*/ - - renderer.setRenderBounds(0.4325F, 0F, 0.1875F, 0.625F, 0.875F, 0.3125F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.4325F, 0F, 0.4325F, 0.6875F, 0.75, 0.6875); - renderer.renderStandardBlock(block, x, y, z); - } - - //4th Layer - else if (metadata == 14) - { - renderer.setRenderBounds(0.3125F, 0F, 0.3125F, 0.625F, 0.1875F, 0.625F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.4375F, 0.1875F, 0.3125F, 0.625F, 0.3125F, 0.5F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.375F, 0.1875F, 0.375F, 0.5625F, 0.375F, 0.5625F); - renderer.renderStandardBlock(block, x, y, z); - } - else if (metadata == 15) - { - renderer.setRenderBounds(0.3125F, 0F, 0.3125F, 0.625F, 0.25F, 0.625F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.4375F, 0.25F, 0.3125F, 0.625F, 0.5F, 0.5F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.375F, 0.1875F, 0.375F, 0.5625F, 0.6875F, 0.5625F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.4375F, 0.6875F, 0.4375F, 0.5625F, 0.75F, 0.5625F); - renderer.renderStandardBlock(block, x, y, z); - } - - //Unused - /*else if (metadata == 4) //Leftover fragments - { - renderer.setRenderBounds(0.125F, 0.0F, 0.5F, 0.375F, 0.125F, 0.75F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.4325F, 0.0F, 0.0625, 0.625, 0.25F, 0.3125F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.625F, 0.0F, 0.5F, 0.75F, 0.1875F, 0.75F); - renderer.renderStandardBlock(block, x, y, z); - }*/ - } - return true; - } - - @Override - public boolean shouldRender3DInInventory () - { - return true; - } - - @Override - public int getRenderId () - { - return model; - } -} diff --git a/src/tconstruct/landmine/client/render/RenderLandmine.java b/src/tconstruct/client/block/RenderLandmine.java similarity index 96% rename from src/tconstruct/landmine/client/render/RenderLandmine.java rename to src/tconstruct/client/block/RenderLandmine.java index 1a8e60f4..6a06627a 100644 --- a/src/tconstruct/landmine/client/render/RenderLandmine.java +++ b/src/tconstruct/client/block/RenderLandmine.java @@ -1,4 +1,4 @@ -package tconstruct.landmine.client.render; +package tconstruct.client.block; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; @@ -7,7 +7,7 @@ import net.minecraftforge.common.ForgeDirection; import org.lwjgl.opengl.GL11; -import tconstruct.landmine.Helper; +import tconstruct.util.landmine.Helper; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; @@ -47,6 +47,7 @@ public class RenderLandmine implements ISimpleBlockRenderingHandler } } + @SuppressWarnings("incomplete-switch") public void renderBasedOnSide (IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { int l = world.getBlockMetadata(x, y, z); diff --git a/src/tconstruct/client/block/SlimeChannelRender.java b/src/tconstruct/client/block/SlimeChannelRender.java new file mode 100644 index 00000000..4e670586 --- /dev/null +++ b/src/tconstruct/client/block/SlimeChannelRender.java @@ -0,0 +1,119 @@ +package tconstruct.client.block; + +import tconstruct.client.TProxyClient; +import tconstruct.library.util.IFacingLogic; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.Icon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.fluids.BlockFluidBase; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import cpw.mods.fml.client.registry.RenderingRegistry; + +public class SlimeChannelRender implements ISimpleBlockRenderingHandler +{ + public static int model = RenderingRegistry.getNextAvailableRenderId(); + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) + { + if (modelID == model) + { + TProxyClient.renderStandardInvBlock(renderer, block, metadata); + } + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) + { + if (modelID == model) + { + + renderRotatedBlock(block, x, y, z, world, renderer); + } + return true; + } + + static final float LIGHT_Y_NEG = 0.5F; + static final float LIGHT_Y_POS = 1.0F; + static final float LIGHT_XZ_NEG = 0.8F; + static final float LIGHT_XZ_POS = 0.6F; + + public boolean renderRotatedBlock(Block block, int x, int y, int z, IBlockAccess world, RenderBlocks renderer) + { + if (true) + { + Tessellator tessellator = Tessellator.instance; + int bMeta = world.getBlockMetadata(x, y, z); + Icon iconStill = block.getIcon(1, bMeta); + float flowDir = (float) (bMeta / 8f * 2*Math.PI); //Tau, radians + + double u1, u2, u3, u4, v1, v2, v3, v4; + + if (flowDir < -999.0F) + { + u2 = iconStill.getInterpolatedU(0.0D); + v2 = iconStill.getInterpolatedV(0.0D); + u1 = u2; + v1 = iconStill.getInterpolatedV(16.0D); + u4 = iconStill.getInterpolatedU(16.0D); + v4 = v1; + u3 = u4; + v3 = v2; + } + else + { + float xFlow = MathHelper.sin(flowDir) * 0.25F; + float zFlow = MathHelper.cos(flowDir) * 0.25F; + u2 = iconStill.getInterpolatedU(8.0F + (-zFlow - xFlow) * 16.0F); + v2 = iconStill.getInterpolatedV(8.0F + (-zFlow + xFlow) * 16.0F); + u1 = iconStill.getInterpolatedU(8.0F + (-zFlow + xFlow) * 16.0F); + v1 = iconStill.getInterpolatedV(8.0F + (zFlow + xFlow) * 16.0F); + u4 = iconStill.getInterpolatedU(8.0F + (zFlow + xFlow) * 16.0F); + v4 = iconStill.getInterpolatedV(8.0F + (zFlow - xFlow) * 16.0F); + u3 = iconStill.getInterpolatedU(8.0F + (zFlow - xFlow) * 16.0F); + v3 = iconStill.getInterpolatedV(8.0F + (-zFlow - xFlow) * 16.0F); + } + int color = block.colorMultiplier(world, x, y, z); + float red = (color >> 16 & 255) / 255.0F; + float green = (color >> 8 & 255) / 255.0F; + float blue = (color & 255) / 255.0F; + tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); + tessellator.setColorOpaque_F(LIGHT_Y_POS * red, LIGHT_Y_POS * green, LIGHT_Y_POS * blue); + + tessellator.addVertexWithUV(x + 0, y + 0.5, z + 0, u2, v2); + tessellator.addVertexWithUV(x + 0, y + 0.5, z + 1, u1, v1); + tessellator.addVertexWithUV(x + 1, y + 0.5, z + 1, u4, v4); + tessellator.addVertexWithUV(x + 1, y + 0.5, z + 0, u3, v3); + } + renderer.renderStandardBlock(block, x, y, z); + /*int direction = world.getBlockMetadata(x, y, z) % 4; + if (direction == 0) + renderer.uvRotateTop = 2; + if (direction == 1) + renderer.uvRotateTop = 1; + if (direction == 2) + renderer.uvRotateTop = 0; + if (direction == 3) + renderer.uvRotateTop = 3; + + boolean flag = renderer.renderStandardBlock(block, x, y, z); + renderer.uvRotateTop = 0; + return flag;*/ + return true; + } + + @Override + public boolean shouldRender3DInInventory() + { + return true; + } + + @Override + public int getRenderId() + { + return model; + } +} diff --git a/src/tconstruct/client/block/SlimePadRender.java b/src/tconstruct/client/block/SlimePadRender.java new file mode 100644 index 00000000..d24d2a06 --- /dev/null +++ b/src/tconstruct/client/block/SlimePadRender.java @@ -0,0 +1,70 @@ +package tconstruct.client.block; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.world.IBlockAccess; +import tconstruct.blocks.SlimePad; +import tconstruct.client.TProxyClient; +import tconstruct.common.TContent; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import cpw.mods.fml.client.registry.RenderingRegistry; + +public class SlimePadRender implements ISimpleBlockRenderingHandler +{ + public static int model = RenderingRegistry.getNextAvailableRenderId(); + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) + { + if (modelID == model) + { + TProxyClient.renderStandardInvBlock(renderer, TContent.slimeGel, metadata); + } + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) + { + if (modelID == model) + { + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0f, 0f, 0f, 1f, 0.5f, 1f); + int metadata = world.getBlockMetadata(x, y, z); + BlockSkinRenderHelper.renderLiquidBlock(((SlimePad) block).getFluidIcon(metadata), ((SlimePad) block).getFluidIcon(metadata), x, y, z, renderer, world); + + float[] size = size(metadata % 8); + renderer.setRenderBounds(size[0], 0.5f, size[1], size[2], 0.6875f, size[3]); + BlockSkinRenderHelper.renderLiquidBlock(((SlimePad) block).getNubIcon(metadata), ((SlimePad) block).getNubIcon(metadata), x, y, z, renderer, world); + } + return true; + } + + float[] size(int meta) + { + //xMin, zMin, xMax, zMax + switch (meta) + { + case 0: return new float[] {0.375f, 0.6875f, 0.625f, 0.9375f}; + case 1: return new float[] {0.0625f, 0.6875f, 0.3125f, 0.9375f}; + case 2: return new float[] {0.0625f, 0.375f, 0.3125f, 0.625f}; + case 3: return new float[] {0.0625f, 0.0625f, 0.3125f, 0.3125f}; + case 4: return new float[] {0.375f, 0.0625f, 0.625f, 0.3125f}; + case 5: return new float[] {0.6875f, 0.0625f, 0.9375f, 0.3125f}; + case 6: return new float[] {0.6875f, 0.375f, 0.9375f, 0.625f}; + case 7: return new float[] {0.6875f, 0.6875f, 0.9375f, 0.9375f}; + } + return new float[] { 0.375f, 0.375f, 0.625f, 0.625f}; + } + + @Override + public boolean shouldRender3DInInventory() + { + return true; + } + + @Override + public int getRenderId() + { + return model; + } +} diff --git a/src/tconstruct/landmine/client/gui/GuiLandmine.java b/src/tconstruct/client/gui/GuiLandmine.java similarity index 94% rename from src/tconstruct/landmine/client/gui/GuiLandmine.java rename to src/tconstruct/client/gui/GuiLandmine.java index fd65fc63..f5c927bf 100644 --- a/src/tconstruct/landmine/client/gui/GuiLandmine.java +++ b/src/tconstruct/client/gui/GuiLandmine.java @@ -1,4 +1,4 @@ -package tconstruct.landmine.client.gui; +package tconstruct.client.gui; import java.util.List; @@ -11,8 +11,8 @@ import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; -import tconstruct.landmine.inventory.ContainerLandmine; -import tconstruct.landmine.logic.behavior.Behavior; +import tconstruct.inventory.ContainerLandmine; +import tconstruct.util.landmine.behavior.Behavior; /** * diff --git a/src/tconstruct/common/TContent.java b/src/tconstruct/common/TContent.java index bf32ffa0..f0f81e34 100644 --- a/src/tconstruct/common/TContent.java +++ b/src/tconstruct/common/TContent.java @@ -30,7 +30,9 @@ import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; import tconstruct.TConstruct; +import tconstruct.blocks.BlockLandmine; import tconstruct.blocks.CastingChannelBlock; +import tconstruct.blocks.ConveyorBase; import tconstruct.blocks.CraftingSlab; import tconstruct.blocks.CraftingStationBlock; import tconstruct.blocks.DryingRack; @@ -53,6 +55,7 @@ import tconstruct.blocks.RedstoneMachine; import tconstruct.blocks.SearedBlock; import tconstruct.blocks.SearedSlab; import tconstruct.blocks.SlabBase; +import tconstruct.blocks.SlimePad; import tconstruct.blocks.SmelteryBlock; import tconstruct.blocks.SoilBlock; import tconstruct.blocks.SpeedBlock; @@ -78,6 +81,7 @@ import tconstruct.blocks.logic.PatternChestLogic; import tconstruct.blocks.logic.SmelteryDrainLogic; import tconstruct.blocks.logic.SmelteryLogic; import tconstruct.blocks.logic.StencilTableLogic; +import tconstruct.blocks.logic.TileEntityLandmine; import tconstruct.blocks.logic.ToolForgeLogic; import tconstruct.blocks.logic.ToolStationLogic; import tconstruct.blocks.slime.SlimeFluid; @@ -124,6 +128,7 @@ import tconstruct.items.blocks.CraftingSlabItemBlock; import tconstruct.items.blocks.GlassBlockItem; import tconstruct.items.blocks.GlassPaneItem; import tconstruct.items.blocks.GravelOreItem; +import tconstruct.items.blocks.ItemBlockLandmine; import tconstruct.items.blocks.LavaTankItemBlock; import tconstruct.items.blocks.MetalItemBlock; import tconstruct.items.blocks.MetalOreItemBlock; @@ -169,9 +174,6 @@ import tconstruct.items.tools.Rapier; import tconstruct.items.tools.Scythe; import tconstruct.items.tools.Shortbow; import tconstruct.items.tools.Shovel; -import tconstruct.landmine.block.BlockLandmine; -import tconstruct.landmine.item.ItemBlockLandmine; -import tconstruct.landmine.tileentity.TileEntityLandmine; import tconstruct.library.TConstructRegistry; import tconstruct.library.client.TConstructClientRegistry; import tconstruct.library.crafting.Detailing; @@ -403,6 +405,7 @@ public class TContent implements IFuelHandler public static SlimeSapling slimeSapling; public static Block slimeChannel; + public static Block slimePad; //Ores public static Block oreSlag; @@ -848,8 +851,11 @@ public class TContent implements IFuelHandler slimeSapling = (SlimeSapling) new SlimeSapling(PHConstruct.slimeSapling).setStepSound(slimeStep).setUnlocalizedName("slime.sapling"); GameRegistry.registerBlock(slimeSapling, SlimeSaplingItemBlock.class, "slime.sapling"); - /*slimeChannel = new ConveyorBase(PHConstruct.slimeChannel, Material.water).setStepSound(slimeStep).setUnlocalizedName("slime.channel"); - GameRegistry.registerBlock(slimeChannel, "slime.channel");*/ + slimeChannel = new ConveyorBase(PHConstruct.slimeChannel, Material.water).setStepSound(slimeStep).setUnlocalizedName("slime.channel"); + GameRegistry.registerBlock(slimeChannel, "slime.channel"); + + slimePad = new SlimePad(PHConstruct.slimePad, Material.cloth).setStepSound(slimeStep).setUnlocalizedName("slime.pad"); + GameRegistry.registerBlock(slimePad, "slime.pad"); //Decoration stoneTorch = new StoneTorch(PHConstruct.stoneTorch).setUnlocalizedName("decoration.stonetorch"); @@ -1081,7 +1087,7 @@ public class TContent implements IFuelHandler TConstructRegistry.addToolMaterial(5, "Bone", 1, 200, 400, 1, 1.0F, 0, 0f, "\u00A7e", ""); TConstructRegistry.addToolMaterial(6, "Obsidian", 3, 89, 700, 2, 0.8F, 3, 0f, "\u00A7d", ""); TConstructRegistry.addToolMaterial(7, "Netherrack", 2, 131, 400, 1, 1.2F, 0, 1f, "\u00A74", "Stonebound"); - TConstructRegistry.addToolMaterial(8, "Slime", PHConstruct.miningLevelIncrease ? 3 : 0, 1500, 150, 0, 2.0F, 0, 0f, "\u00A7a", ""); + TConstructRegistry.addToolMaterial(8, "Slime", 0, 500, 150, 0, 1.5F, 0, 0f, "\u00A7a", ""); TConstructRegistry.addToolMaterial(9, "Paper", 0, 30, 200, 0, 0.3F, 0, 0f, "\u00A7f", "Writable"); TConstructRegistry.addToolMaterial(10, "Cobalt", 4, 800, 1100, 3, 1.75F, 2, 0f, "\u00A73", ""); TConstructRegistry.addToolMaterial(11, "Ardite", 4, 600, 800, 3, 2.0F, 0, 2f, "\u00A74", "Stonebound"); @@ -1090,7 +1096,7 @@ public class TContent implements IFuelHandler TConstructRegistry.addToolMaterial(14, "Bronze", 2, 350, 700, 2, 1.3F, 1, 0f, "\u00A76", ""); TConstructRegistry.addToolMaterial(15, "Alumite", 4, 550, 800, 3, 1.3F, 2, 0f, "\u00A7d", ""); TConstructRegistry.addToolMaterial(16, "Steel", 4, 750, 800, 3, 1.3F, 2, 0f, "", ""); - TConstructRegistry.addToolMaterial(17, "BlueSlime", "Slime ", PHConstruct.miningLevelIncrease ? 1 : 0, 500, 150, 0, 1.5F, 0, 0f, "\u00A7b", ""); + TConstructRegistry.addToolMaterial(17, "BlueSlime", "Slime ", 0, 1200, 150, 0, 2.0F, 0, 0f, "\u00A7b", ""); TConstructRegistry.addBowMaterial(0, 384, 20, 1.0f); //Wood TConstructRegistry.addBowMaterial(1, 10, 80, 0.2f); //Stone @@ -1862,6 +1868,9 @@ public class TContent implements IFuelHandler GameRegistry.addRecipe(new ItemStack(strangeFood, 4, 0), "#", '#', new ItemStack(slimeGel, 1, 0)); GameRegistry.addRecipe(new ItemStack(slimeGel, 1, 1), "##", "##", '#', Item.slimeBall); GameRegistry.addRecipe(new ItemStack(Item.slimeBall, 4, 0), "#", '#', new ItemStack(slimeGel, 1, 1)); + + GameRegistry.addShapelessRecipe(new ItemStack(slimeChannel, 1, 0), new ItemStack(slimeGel, 1, Short.MAX_VALUE), new ItemStack(Item.redstone)); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(slimePad, 1, 0), slimeChannel, new ItemStack(slimeGel, 1, Short.MAX_VALUE), "slimeBall")); //Slab crafters GameRegistry.addRecipe(new ItemStack(craftingSlabWood, 6, 0), "bbb", 'b', new ItemStack(Block.workbench)); diff --git a/src/tconstruct/common/TProxyCommon.java b/src/tconstruct/common/TProxyCommon.java index b8e1ebbf..5d67f253 100644 --- a/src/tconstruct/common/TProxyCommon.java +++ b/src/tconstruct/common/TProxyCommon.java @@ -5,12 +5,12 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import tconstruct.TConstruct; +import tconstruct.blocks.logic.TileEntityLandmine; import tconstruct.entity.MiniGardy; import tconstruct.inventory.ArmorExtendedContainer; +import tconstruct.inventory.ContainerLandmine; import tconstruct.inventory.KnapsackContainer; import tconstruct.inventory.MiniGardyContainer; -import tconstruct.landmine.inventory.ContainerLandmine; -import tconstruct.landmine.tileentity.TileEntityLandmine; import tconstruct.library.blocks.InventoryLogic; import tconstruct.util.player.TPlayerStats; import cpw.mods.fml.common.network.IGuiHandler; diff --git a/src/tconstruct/crystal/CrystalValues.java b/src/tconstruct/crystal/CrystalValues.java deleted file mode 100644 index eae47d24..00000000 --- a/src/tconstruct/crystal/CrystalValues.java +++ /dev/null @@ -1,92 +0,0 @@ -package tconstruct.crystal; - -import tconstruct.crystal.Crystallinity.CrystalType; -import net.minecraft.nbt.NBTTagCompound; - -public class CrystalValues -{ - int light; - int time; - int life; - int stone; - int fire; - int water; - - final String valueType; - - public CrystalValues(String type) - { - valueType = type; - } - - public void addValue (int value, CrystalType type) - { - /*light = 0; - time = 0; - life = 0; - stone = 0; - fire = 0; - water = 0;*/ - switch (type) - { - case Light: - light += value; - case Time: - time += value; - case Life: - life += value; - case Stone: - stone += value; - case Fire: - fire += value; - case Water: - water += value; - } - } - - public int getValue (CrystalType type) - { - switch (type) - { - case Light: - return light; - case Time: - return time; - case Life: - return life; - case Stone: - return stone; - case Fire: - return fire; - case Water: - return water; - } - return 0; - } - - protected void setValue (int[] array) - { - light = array[0]; - time = array[1]; - life = array[2]; - stone = array[3]; - fire = array[4]; - water = array[5]; - } - - public CrystalValues loadFromNBT (NBTTagCompound tags) - { - int[] crystalArray = tags.getIntArray("TConstruct.Crystal." + valueType); - if (crystalArray != null && crystalArray.length >= 6) - { - this.setValue(crystalArray); - } - return this; - } - - public void saveToNBT (NBTTagCompound tags) - { - int[] crystalArray = new int[] { light, time, life, stone, fire, water }; - tags.setIntArray("TConstruct.Crystal.", crystalArray); - } -} \ No newline at end of file diff --git a/src/tconstruct/crystal/Crystallinity.java b/src/tconstruct/crystal/Crystallinity.java deleted file mode 100644 index ef0d8476..00000000 --- a/src/tconstruct/crystal/Crystallinity.java +++ /dev/null @@ -1,36 +0,0 @@ -package tconstruct.crystal; - -import java.util.HashMap; - -import tconstruct.library.util.ValueCoordTuple; - -public class Crystallinity -{ - public enum CrystalType - { - Light, Life, Time, Stone, Fire, Water - } - - public static HashMap theftValue = new HashMap(); //Value of materials - public static HashMap charge = new HashMap(); //Balance of crystal - - public static void updateTheft (int dim, int posX, int posZ, int value, CrystalType type) - { - ValueCoordTuple coord = new ValueCoordTuple(dim, (int) Math.floor(posX / 16D), (int) Math.floor(posZ / 16D)); - CrystalValues crystal = theftValue.get(coord); - if (crystal == null) - crystal = new CrystalValues("Theft"); - crystal.addValue(value, type); - theftValue.put(coord, crystal); - } - - public static void updateCharge (int dim, int posX, int posZ, int value, CrystalType type) - { - ValueCoordTuple coord = new ValueCoordTuple(dim, (int) Math.floor(posX / 16D), (int) Math.floor(posZ / 16D)); - CrystalValues crystal = charge.get(coord); - if (crystal == null) - crystal = new CrystalValues("Charge"); - crystal.addValue(value, type); - charge.put(coord, crystal); - } -} diff --git a/src/tconstruct/crystal/TheftValueTracker.java b/src/tconstruct/crystal/TheftValueTracker.java deleted file mode 100644 index f0d08f55..00000000 --- a/src/tconstruct/crystal/TheftValueTracker.java +++ /dev/null @@ -1,41 +0,0 @@ -package tconstruct.crystal; - -import java.util.HashMap; - -import tconstruct.library.util.ValueCoordTuple; - -public class TheftValueTracker -{ - public static HashMap crystallinity = new HashMap(); - - //public static HashMap> crystallinity = new HashMap>(); - - public static void updateCrystallinity (int dim, int posX, int posZ, int value) - { - ValueCoordTuple coord = new ValueCoordTuple(dim, posX / 16, posZ / 16); - int crystal = crystallinity.get(coord); - crystal += value; - crystallinity.put(coord, crystal); - /*ChunkCoordTuple tuple = new ChunkCoordTuple(posX / 16, posZ / 16); - HashMap dimensionMap = crystallinity.get(world); - if (dimensionMap.containsKey(tuple)) - { - int level = dimensionMap.get(tuple); - level += value; - dimensionMap.put(tuple, level); - } - else - { - System.out.println("[TConstruct] Missing Theft value data at "+tuple); - - HashMap crystalMap = TheftValueTracker.crystallinity.get(world); - if (crystalMap == null) - { - crystalMap = new HashMap(); - TheftValueTracker.crystallinity.put(world, crystalMap); - } - crystalMap.put(tuple, value); - - }*/ - } -} diff --git a/src/tconstruct/landmine/inventory/ContainerLandmine.java b/src/tconstruct/inventory/ContainerLandmine.java similarity index 99% rename from src/tconstruct/landmine/inventory/ContainerLandmine.java rename to src/tconstruct/inventory/ContainerLandmine.java index 8c26d862..7cf0f8bb 100644 --- a/src/tconstruct/landmine/inventory/ContainerLandmine.java +++ b/src/tconstruct/inventory/ContainerLandmine.java @@ -1,10 +1,10 @@ -package tconstruct.landmine.inventory; +package tconstruct.inventory; import java.util.HashSet; import java.util.Iterator; import java.util.Set; -import tconstruct.landmine.tileentity.TileEntityLandmine; +import tconstruct.blocks.logic.TileEntityLandmine; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; diff --git a/src/tconstruct/inventory/DrawbridgeContainer.java b/src/tconstruct/inventory/DrawbridgeContainer.java index 14e7afe9..4bd7a9c9 100644 --- a/src/tconstruct/inventory/DrawbridgeContainer.java +++ b/src/tconstruct/inventory/DrawbridgeContainer.java @@ -1,7 +1,6 @@ package tconstruct.inventory; import tconstruct.blocks.logic.DrawbridgeLogic; -import tconstruct.landmine.inventory.SlotOpaqueBlocksOnly; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; diff --git a/src/tconstruct/inventory/DrawbridgeSlot.java b/src/tconstruct/inventory/DrawbridgeSlot.java index 214f6182..ec65b16c 100644 --- a/src/tconstruct/inventory/DrawbridgeSlot.java +++ b/src/tconstruct/inventory/DrawbridgeSlot.java @@ -1,7 +1,6 @@ package tconstruct.inventory; import tconstruct.blocks.logic.DrawbridgeLogic; -import tconstruct.landmine.inventory.SlotBlocksOnly; import tconstruct.library.TConstructRegistry; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; diff --git a/src/tconstruct/landmine/inventory/SlotBehavedOnly.java b/src/tconstruct/inventory/SlotBehavedOnly.java similarity index 93% rename from src/tconstruct/landmine/inventory/SlotBehavedOnly.java rename to src/tconstruct/inventory/SlotBehavedOnly.java index aa46bd2d..95463657 100644 --- a/src/tconstruct/landmine/inventory/SlotBehavedOnly.java +++ b/src/tconstruct/inventory/SlotBehavedOnly.java @@ -1,6 +1,6 @@ -package tconstruct.landmine.inventory; +package tconstruct.inventory; -import tconstruct.landmine.logic.behavior.Behavior; +import tconstruct.util.landmine.behavior.Behavior; import net.minecraft.block.Block; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; diff --git a/src/tconstruct/landmine/inventory/SlotBlocksOnly.java b/src/tconstruct/inventory/SlotBlocksOnly.java similarity index 93% rename from src/tconstruct/landmine/inventory/SlotBlocksOnly.java rename to src/tconstruct/inventory/SlotBlocksOnly.java index c1d46393..5ed9bef5 100644 --- a/src/tconstruct/landmine/inventory/SlotBlocksOnly.java +++ b/src/tconstruct/inventory/SlotBlocksOnly.java @@ -1,4 +1,4 @@ -package tconstruct.landmine.inventory; +package tconstruct.inventory; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; diff --git a/src/tconstruct/landmine/inventory/SlotOpaqueBlocksOnly.java b/src/tconstruct/inventory/SlotOpaqueBlocksOnly.java similarity index 94% rename from src/tconstruct/landmine/inventory/SlotOpaqueBlocksOnly.java rename to src/tconstruct/inventory/SlotOpaqueBlocksOnly.java index 5547618f..85805a95 100644 --- a/src/tconstruct/landmine/inventory/SlotOpaqueBlocksOnly.java +++ b/src/tconstruct/inventory/SlotOpaqueBlocksOnly.java @@ -1,4 +1,4 @@ -package tconstruct.landmine.inventory; +package tconstruct.inventory; import net.minecraft.block.Block; import net.minecraft.inventory.IInventory; diff --git a/src/tconstruct/landmine/item/ItemBlockLandmine.java b/src/tconstruct/items/blocks/ItemBlockLandmine.java similarity index 95% rename from src/tconstruct/landmine/item/ItemBlockLandmine.java rename to src/tconstruct/items/blocks/ItemBlockLandmine.java index 37bcffa4..d6542c3f 100644 --- a/src/tconstruct/landmine/item/ItemBlockLandmine.java +++ b/src/tconstruct/items/blocks/ItemBlockLandmine.java @@ -1,4 +1,4 @@ -package tconstruct.landmine.item; +package tconstruct.items.blocks; import java.util.List; import java.util.Random; @@ -7,8 +7,8 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import tconstruct.blocks.logic.TileEntityLandmine; import tconstruct.common.TContent; -import tconstruct.landmine.tileentity.TileEntityLandmine; /** * diff --git a/src/tconstruct/util/PHConstruct.java b/src/tconstruct/util/PHConstruct.java index f62b0435..5469b40b 100644 --- a/src/tconstruct/util/PHConstruct.java +++ b/src/tconstruct/util/PHConstruct.java @@ -69,7 +69,6 @@ public class PHConstruct denyMattock = config.get("Difficulty Changes", "Deny creation of non-metal mattocks", false).getBoolean(false); harderBronze = config.get("Difficulty Changes", "Lower bronze output to 2 ingots", false).getBoolean(false); stencilTableCrafting = config.get("Difficulty Changes", "Craft Stencil Tables", true).getBoolean(true); - miningLevelIncrease = config.get("Difficulty Changes", "Modifiers increase Mining Level", true).getBoolean(true); denyMattock = config.get("Difficulty Changes", "Deny creation of non-metal mattocks", false).getBoolean(false); //1467-1489 @@ -102,7 +101,8 @@ public class PHConstruct barricadeBirch = config.getBlock("Birch Barricade", 1483).getInt(1483); barricadeJungle = config.getBlock("Jungle Barricade", 1487).getInt(1487); - slimeChannel = config.getBlock("Slime Channel", 3190).getInt(3190); + slimeChannel = config.getBlock("Slime Channel", 3190).getInt(3190); + slimePad = config.getBlock("Slime Pad", 3191).getInt(3191); //Thermal Expansion moltenSilver = config.getBlock("Molten Silver", 3195).getInt(3195); @@ -452,6 +452,7 @@ public class PHConstruct public static int slimeSapling; public static int slimeChannel; + public static int slimePad; //Decoration public static int stoneTorch; diff --git a/src/tconstruct/util/TEventHandler.java b/src/tconstruct/util/TEventHandler.java index beb4bbd1..e58586c0 100644 --- a/src/tconstruct/util/TEventHandler.java +++ b/src/tconstruct/util/TEventHandler.java @@ -4,9 +4,12 @@ import java.util.ArrayList; import java.util.Random; import net.minecraft.block.Block; -import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EntityLivingData; import net.minecraft.entity.boss.EntityWither; import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityXPOrb; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntityGhast; import net.minecraft.entity.monster.EntitySkeleton; @@ -22,7 +25,6 @@ import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.EnumMovingObjectType; import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; import net.minecraftforge.event.Event; import net.minecraftforge.event.Event.Result; import net.minecraftforge.event.ForgeSubscribe; @@ -32,15 +34,12 @@ import net.minecraftforge.event.entity.living.LivingHurtEvent; import net.minecraftforge.event.entity.living.LivingSpawnEvent; import net.minecraftforge.event.entity.player.BonemealEvent; import net.minecraftforge.event.entity.player.FillBucketEvent; -import net.minecraftforge.event.world.ChunkDataEvent; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary.OreRegisterEvent; import tconstruct.TConstruct; import tconstruct.blocks.LiquidMetalFinite; import tconstruct.common.TContent; -import tconstruct.crystal.CrystalValues; -import tconstruct.crystal.Crystallinity; import tconstruct.library.TConstructRegistry; import tconstruct.library.crafting.PatternBuilder; import tconstruct.library.crafting.Smeltery; @@ -52,7 +51,6 @@ import tconstruct.library.tools.BowMaterial; import tconstruct.library.tools.BowstringMaterial; import tconstruct.library.tools.FletchingMaterial; import tconstruct.library.tools.ToolCore; -import tconstruct.library.util.ValueCoordTuple; import tconstruct.modifiers.ModAttack; import tconstruct.util.player.TPlayerStats; @@ -63,7 +61,7 @@ public class TEventHandler /* Crafting */ @ForgeSubscribe - public void craftTool (ToolCraftEvent.NormalTool event) + public void craftTool(ToolCraftEvent.NormalTool event) { NBTTagCompound toolTag = event.toolTag.getCompoundTag("InfiTool"); if (PHConstruct.denyMattock && event.tool == TContent.mattock) @@ -154,7 +152,7 @@ public class TEventHandler } } - private boolean allowCrafting (int head, int handle, int accessory) + private boolean allowCrafting(int head, int handle, int accessory) { int[] nonMetals = { 0, 1, 3, 4, 5, 6, 7, 8, 9, 17 }; for (int i = 0; i < nonMetals.length; i++) @@ -166,7 +164,7 @@ public class TEventHandler } @ForgeSubscribe - public void craftPart (PartBuilderEvent.NormalPart event) + public void craftPart(PartBuilderEvent.NormalPart event) { if (event.pattern.getItem() == TContent.woodPattern && event.pattern.getItemDamage() == 23) { @@ -187,7 +185,7 @@ public class TEventHandler } } - public static ItemStack craftBowString (ItemStack stack) + public static ItemStack craftBowString(ItemStack stack) { if (stack.stackSize < 3) return null; @@ -198,7 +196,7 @@ public class TEventHandler return null; } - public static ItemStack craftFletching (ItemStack stack) + public static ItemStack craftFletching(ItemStack stack) { if (matchesLeaves(stack)) { @@ -212,7 +210,7 @@ public class TEventHandler return null; } - public static boolean matchesLeaves (ItemStack stack) + public static boolean matchesLeaves(ItemStack stack) { if (stack.itemID >= 4096) return false; @@ -228,7 +226,7 @@ public class TEventHandler /* Damage */ @ForgeSubscribe - public void onHurt (LivingHurtEvent event) + public void onHurt(LivingHurtEvent event) { if (event.entityLiving instanceof EntityPlayer) { @@ -244,7 +242,7 @@ public class TEventHandler /* Drops */ @ForgeSubscribe - public void onLivingDrop (LivingDropsEvent event) + public void onLivingDrop(LivingDropsEvent event) { if (random.nextInt(500) == 0 && event.entityLiving instanceof IMob && event.entityLiving.dimension == 0) { @@ -422,7 +420,7 @@ public class TEventHandler } @ForgeSubscribe - public void onLivingDeath (LivingDeathEvent event) + public void onLivingDeath(LivingDeathEvent event) { if (event.entityLiving instanceof EntityPlayer) { @@ -436,7 +434,7 @@ public class TEventHandler } } - void addDrops (LivingDropsEvent event, ItemStack dropStack) + void addDrops(LivingDropsEvent event, ItemStack dropStack) { EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, dropStack); entityitem.delayBeforeCanPickup = 10; @@ -453,70 +451,37 @@ public class TEventHandler }*/ @ForgeSubscribe - public void onLivingSpawn (LivingSpawnEvent.SpecialSpawn event) + public void onLivingSpawn(LivingSpawnEvent.SpecialSpawn event) { - if (event.entityLiving.getClass() == EntitySpider.class && random.nextInt(100) == 0) + EntityLivingBase living = (EntityLivingBase) event.entityLiving; + if (living.getClass() == EntitySpider.class && random.nextInt(100) == 0) { - EntityCreeper creeper = new EntityCreeper(event.entityLiving.worldObj); - spawnEntity(event.entityLiving.posX, event.entityLiving.posY + 1, event.entityLiving.posZ, creeper, event.entityLiving.worldObj); - creeper.mountEntity(event.entityLiving); + EntityCreeper creeper = new EntityCreeper(living.worldObj); + spawnEntityLiving(living.posX, living.posY + 1, living.posZ, creeper, living.worldObj); + if (living.riddenByEntity != null) + creeper.mountEntity(living.riddenByEntity); + else + creeper.mountEntity(living); + + EntityXPOrb orb = new EntityXPOrb(living.worldObj, living.posX, living.posY, living.posZ, random.nextInt(20) + 20); + orb.mountEntity(creeper); } } - public static void spawnEntity (double x, double y, double z, Entity entity, World world) + public static void spawnEntityLiving(double x, double y, double z, EntityLiving entity, World world) { - /*if (!world.isRemote) + if (!world.isRemote) { entity.setPosition(x, y, z); - ((EntityLiving) entity).initCreature(); + entity.func_110161_a((EntityLivingData) null); world.spawnEntityInWorld(entity); - }*/ - } - - /* Chunks */ - @ForgeSubscribe - public void chunkDataLoad (ChunkDataEvent.Load event) - { - Chunk chunk = event.getChunk(); - int worldID = chunk.worldObj.provider.dimensionId; - ValueCoordTuple coord = new ValueCoordTuple(worldID, chunk.xPosition, chunk.zPosition); - CrystalValues theft = new CrystalValues("Theft"); - Crystallinity.theftValue.put(coord, theft.loadFromNBT(event.getData())); - CrystalValues charge = new CrystalValues("Charge"); - Crystallinity.theftValue.put(coord, charge.loadFromNBT(event.getData())); - } - - @ForgeSubscribe - public void chunkDataSave (ChunkDataEvent.Save event) - { - Chunk chunk = event.getChunk(); - int worldID = chunk.worldObj.provider.dimensionId; - ValueCoordTuple coord = new ValueCoordTuple(worldID, chunk.xPosition, chunk.zPosition); - if (Crystallinity.theftValue.containsKey(coord)) - { - CrystalValues crystal = Crystallinity.theftValue.get(coord); - crystal.saveToNBT(event.getData()); - if (!event.getChunk().isChunkLoaded) - { - Crystallinity.theftValue.remove(coord); - } - } - - if (Crystallinity.charge.containsKey(coord)) - { - CrystalValues crystal = Crystallinity.charge.get(coord); - crystal.saveToNBT(event.getData()); - if (!event.getChunk().isChunkLoaded) - { - Crystallinity.charge.remove(coord); - } } } /* Bonemeal */ @ForgeSubscribe - public void bonemealEvent (BonemealEvent event) + public void bonemealEvent(BonemealEvent event) { if (!event.world.isRemote) { @@ -530,7 +495,7 @@ public class TEventHandler /* Ore Dictionary */ @ForgeSubscribe - public void registerOre (OreRegisterEvent evt) + public void registerOre(OreRegisterEvent evt) { String ingot = evt.Name.toLowerCase(); if (ingot.contains("ingot")) @@ -966,7 +931,7 @@ public class TEventHandler }*/ } - public void unfuxOreDictionary () + public void unfuxOreDictionary() { ArrayList ores = OreDictionary.getOres("plankWood"); for (ItemStack ore : ores) @@ -1511,7 +1476,7 @@ public class TEventHandler } @ForgeSubscribe - public void bucketFill (FillBucketEvent evt) + public void bucketFill(FillBucketEvent evt) { if (evt.current.getItem() == Item.bucketEmpty && evt.target.typeOfHit == EnumMovingObjectType.TILE) { diff --git a/src/tconstruct/landmine/Helper.java b/src/tconstruct/util/landmine/Helper.java similarity index 98% rename from src/tconstruct/landmine/Helper.java rename to src/tconstruct/util/landmine/Helper.java index 72ee0958..fce9048b 100644 --- a/src/tconstruct/landmine/Helper.java +++ b/src/tconstruct/util/landmine/Helper.java @@ -1,4 +1,4 @@ -package tconstruct.landmine; +package tconstruct.util.landmine; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; diff --git a/src/tconstruct/landmine/logic/behavior/Behavior.java b/src/tconstruct/util/landmine/behavior/Behavior.java similarity index 98% rename from src/tconstruct/landmine/logic/behavior/Behavior.java rename to src/tconstruct/util/landmine/behavior/Behavior.java index 1839087b..4ef3bcdc 100644 --- a/src/tconstruct/landmine/logic/behavior/Behavior.java +++ b/src/tconstruct/util/landmine/behavior/Behavior.java @@ -1,11 +1,11 @@ -package tconstruct.landmine.logic.behavior; +package tconstruct.util.landmine.behavior; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; -import tconstruct.landmine.Helper; +import tconstruct.util.landmine.Helper; import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; diff --git a/src/tconstruct/landmine/logic/behavior/BehaviorBlockThrow.java b/src/tconstruct/util/landmine/behavior/BehaviorBlockThrow.java similarity index 98% rename from src/tconstruct/landmine/logic/behavior/BehaviorBlockThrow.java rename to src/tconstruct/util/landmine/behavior/BehaviorBlockThrow.java index 3f059919..78f3126d 100644 --- a/src/tconstruct/landmine/logic/behavior/BehaviorBlockThrow.java +++ b/src/tconstruct/util/landmine/behavior/BehaviorBlockThrow.java @@ -1,4 +1,4 @@ -package tconstruct.landmine.logic.behavior; +package tconstruct.util.landmine.behavior; import java.util.List; diff --git a/src/tconstruct/landmine/logic/behavior/BehaviorDefault.java b/src/tconstruct/util/landmine/behavior/BehaviorDefault.java similarity index 81% rename from src/tconstruct/landmine/logic/behavior/BehaviorDefault.java rename to src/tconstruct/util/landmine/behavior/BehaviorDefault.java index fa841b53..dfae8852 100644 --- a/src/tconstruct/landmine/logic/behavior/BehaviorDefault.java +++ b/src/tconstruct/util/landmine/behavior/BehaviorDefault.java @@ -1,9 +1,9 @@ -package tconstruct.landmine.logic.behavior; +package tconstruct.util.landmine.behavior; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import tconstruct.landmine.damageSource.DamageSourceLandmine; +import tconstruct.util.network.DamageSourceLandmine; public class BehaviorDefault extends Behavior { diff --git a/src/tconstruct/landmine/logic/behavior/BehaviorDummy.java b/src/tconstruct/util/landmine/behavior/BehaviorDummy.java similarity index 89% rename from src/tconstruct/landmine/logic/behavior/BehaviorDummy.java rename to src/tconstruct/util/landmine/behavior/BehaviorDummy.java index 883e015a..e003cf0f 100644 --- a/src/tconstruct/landmine/logic/behavior/BehaviorDummy.java +++ b/src/tconstruct/util/landmine/behavior/BehaviorDummy.java @@ -1,4 +1,4 @@ -package tconstruct.landmine.logic.behavior; +package tconstruct.util.landmine.behavior; import java.util.List; diff --git a/src/tconstruct/landmine/logic/behavior/BehaviorExplosive.java b/src/tconstruct/util/landmine/behavior/BehaviorExplosive.java similarity index 97% rename from src/tconstruct/landmine/logic/behavior/BehaviorExplosive.java rename to src/tconstruct/util/landmine/behavior/BehaviorExplosive.java index 03502eb6..51c92f11 100644 --- a/src/tconstruct/landmine/logic/behavior/BehaviorExplosive.java +++ b/src/tconstruct/util/landmine/behavior/BehaviorExplosive.java @@ -1,4 +1,4 @@ -package tconstruct.landmine.logic.behavior; +package tconstruct.util.landmine.behavior; import java.util.List; diff --git a/src/tconstruct/landmine/logic/behavior/BehaviorFirecharge.java b/src/tconstruct/util/landmine/behavior/BehaviorFirecharge.java similarity index 95% rename from src/tconstruct/landmine/logic/behavior/BehaviorFirecharge.java rename to src/tconstruct/util/landmine/behavior/BehaviorFirecharge.java index 40948bfc..e78c9390 100644 --- a/src/tconstruct/landmine/logic/behavior/BehaviorFirecharge.java +++ b/src/tconstruct/util/landmine/behavior/BehaviorFirecharge.java @@ -1,9 +1,9 @@ -package tconstruct.landmine.logic.behavior; +package tconstruct.util.landmine.behavior; import java.util.List; import java.util.Random; -import tconstruct.landmine.item.ItemBlockLandmine; +import tconstruct.items.blocks.ItemBlockLandmine; import net.minecraft.block.Block; import net.minecraft.entity.Entity; diff --git a/src/tconstruct/landmine/logic/behavior/BehaviorFirework.java b/src/tconstruct/util/landmine/behavior/BehaviorFirework.java similarity index 97% rename from src/tconstruct/landmine/logic/behavior/BehaviorFirework.java rename to src/tconstruct/util/landmine/behavior/BehaviorFirework.java index d2715230..9c60fc4e 100644 --- a/src/tconstruct/landmine/logic/behavior/BehaviorFirework.java +++ b/src/tconstruct/util/landmine/behavior/BehaviorFirework.java @@ -1,4 +1,4 @@ -package tconstruct.landmine.logic.behavior; +package tconstruct.util.landmine.behavior; import java.util.List; diff --git a/src/tconstruct/landmine/logic/behavior/BehaviorPotion.java b/src/tconstruct/util/landmine/behavior/BehaviorPotion.java similarity index 96% rename from src/tconstruct/landmine/logic/behavior/BehaviorPotion.java rename to src/tconstruct/util/landmine/behavior/BehaviorPotion.java index 97bb9fd6..d265c707 100644 --- a/src/tconstruct/landmine/logic/behavior/BehaviorPotion.java +++ b/src/tconstruct/util/landmine/behavior/BehaviorPotion.java @@ -1,9 +1,9 @@ -package tconstruct.landmine.logic.behavior; +package tconstruct.util.landmine.behavior; import java.util.Iterator; import java.util.List; -import tconstruct.landmine.item.ItemBlockLandmine; +import tconstruct.items.blocks.ItemBlockLandmine; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; diff --git a/src/tconstruct/landmine/logic/behavior/BehaviorPreventExplode.java b/src/tconstruct/util/landmine/behavior/BehaviorPreventExplode.java similarity index 95% rename from src/tconstruct/landmine/logic/behavior/BehaviorPreventExplode.java rename to src/tconstruct/util/landmine/behavior/BehaviorPreventExplode.java index f7c3fa7c..0d68840d 100644 --- a/src/tconstruct/landmine/logic/behavior/BehaviorPreventExplode.java +++ b/src/tconstruct/util/landmine/behavior/BehaviorPreventExplode.java @@ -1,4 +1,4 @@ -package tconstruct.landmine.logic.behavior; +package tconstruct.util.landmine.behavior; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; diff --git a/src/tconstruct/landmine/logic/behavior/BehaviorProjectile.java b/src/tconstruct/util/landmine/behavior/BehaviorProjectile.java similarity index 97% rename from src/tconstruct/landmine/logic/behavior/BehaviorProjectile.java rename to src/tconstruct/util/landmine/behavior/BehaviorProjectile.java index 97c48354..da613fbd 100644 --- a/src/tconstruct/landmine/logic/behavior/BehaviorProjectile.java +++ b/src/tconstruct/util/landmine/behavior/BehaviorProjectile.java @@ -1,4 +1,4 @@ -package tconstruct.landmine.logic.behavior; +package tconstruct.util.landmine.behavior; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; diff --git a/src/tconstruct/landmine/logic/behavior/BehaviorShears.java b/src/tconstruct/util/landmine/behavior/BehaviorShears.java similarity index 97% rename from src/tconstruct/landmine/logic/behavior/BehaviorShears.java rename to src/tconstruct/util/landmine/behavior/BehaviorShears.java index 24670a25..ef402864 100644 --- a/src/tconstruct/landmine/logic/behavior/BehaviorShears.java +++ b/src/tconstruct/util/landmine/behavior/BehaviorShears.java @@ -1,11 +1,11 @@ -package tconstruct.landmine.logic.behavior; +package tconstruct.util.landmine.behavior; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Random; -import tconstruct.landmine.item.ItemBlockLandmine; +import tconstruct.items.blocks.ItemBlockLandmine; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; diff --git a/src/tconstruct/landmine/logic/behavior/BehaviorSpawnEgg.java b/src/tconstruct/util/landmine/behavior/BehaviorSpawnEgg.java similarity index 96% rename from src/tconstruct/landmine/logic/behavior/BehaviorSpawnEgg.java rename to src/tconstruct/util/landmine/behavior/BehaviorSpawnEgg.java index e33822fa..f858e66b 100644 --- a/src/tconstruct/landmine/logic/behavior/BehaviorSpawnEgg.java +++ b/src/tconstruct/util/landmine/behavior/BehaviorSpawnEgg.java @@ -1,4 +1,4 @@ -package tconstruct.landmine.logic.behavior; +package tconstruct.util.landmine.behavior; import net.minecraft.block.BlockDispenser; import net.minecraft.entity.Entity; diff --git a/src/tconstruct/landmine/logic/behavior/stackCombo/SpecialStackHandler.java b/src/tconstruct/util/landmine/behavior/stackCombo/SpecialStackHandler.java similarity index 93% rename from src/tconstruct/landmine/logic/behavior/stackCombo/SpecialStackHandler.java rename to src/tconstruct/util/landmine/behavior/stackCombo/SpecialStackHandler.java index a7230047..f24ffb4f 100644 --- a/src/tconstruct/landmine/logic/behavior/stackCombo/SpecialStackHandler.java +++ b/src/tconstruct/util/landmine/behavior/stackCombo/SpecialStackHandler.java @@ -1,11 +1,11 @@ -package tconstruct.landmine.logic.behavior.stackCombo; +package tconstruct.util.landmine.behavior.stackCombo; import java.util.ArrayList; import java.util.List; -import tconstruct.landmine.Helper; -import tconstruct.landmine.logic.behavior.Behavior; -import tconstruct.landmine.tileentity.TileEntityLandmine; +import tconstruct.blocks.logic.TileEntityLandmine; +import tconstruct.util.landmine.Helper; +import tconstruct.util.landmine.behavior.Behavior; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; diff --git a/src/tconstruct/landmine/logic/behavior/stackCombo/SpecialStackHandlerRocketFireball.java b/src/tconstruct/util/landmine/behavior/stackCombo/SpecialStackHandlerRocketFireball.java similarity index 98% rename from src/tconstruct/landmine/logic/behavior/stackCombo/SpecialStackHandlerRocketFireball.java rename to src/tconstruct/util/landmine/behavior/stackCombo/SpecialStackHandlerRocketFireball.java index 6935f27b..3e6c5109 100644 --- a/src/tconstruct/landmine/logic/behavior/stackCombo/SpecialStackHandlerRocketFireball.java +++ b/src/tconstruct/util/landmine/behavior/stackCombo/SpecialStackHandlerRocketFireball.java @@ -1,4 +1,4 @@ -package tconstruct.landmine.logic.behavior.stackCombo; +package tconstruct.util.landmine.behavior.stackCombo; import java.util.ArrayList; import java.util.Random; diff --git a/src/tconstruct/landmine/damageSource/DamageSourceLandmine.java b/src/tconstruct/util/network/DamageSourceLandmine.java similarity index 92% rename from src/tconstruct/landmine/damageSource/DamageSourceLandmine.java rename to src/tconstruct/util/network/DamageSourceLandmine.java index bc8bdeef..2d20557d 100644 --- a/src/tconstruct/landmine/damageSource/DamageSourceLandmine.java +++ b/src/tconstruct/util/network/DamageSourceLandmine.java @@ -1,4 +1,4 @@ -package tconstruct.landmine.damageSource; +package tconstruct.util.network; import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.ChatMessageComponent; diff --git a/src/tconstruct/worldgen/TBaseWorldGenerator.java b/src/tconstruct/worldgen/TBaseWorldGenerator.java index e5851b39..15892b03 100644 --- a/src/tconstruct/worldgen/TBaseWorldGenerator.java +++ b/src/tconstruct/worldgen/TBaseWorldGenerator.java @@ -9,9 +9,6 @@ import net.minecraft.world.WorldType; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import tconstruct.common.TContent; -import tconstruct.crystal.CrystalValues; -import tconstruct.crystal.Crystallinity; -import tconstruct.library.util.ValueCoordTuple; import tconstruct.util.PHConstruct; import cpw.mods.fml.common.IWorldGenerator; @@ -37,8 +34,6 @@ public class TBaseWorldGenerator implements IWorldGenerator @Override public void generate (Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { - initializeChunkData(chunkX, chunkZ, world.provider.dimensionId); - if (world.provider.isHellWorld) { generateNether(random, chunkX * 16, chunkZ * 16, world); @@ -61,13 +56,6 @@ public class TBaseWorldGenerator implements IWorldGenerator } } - void initializeChunkData (int chunkX, int chunkZ, int worldID) - { - ValueCoordTuple coord = new ValueCoordTuple(worldID, chunkX, chunkZ); - Crystallinity.theftValue.put(coord, new CrystalValues("Theft")); - Crystallinity.charge.put(coord, new CrystalValues("Charge")); - } - void generateSurface (Random random, int xChunk, int zChunk, World world) { String biomeName = world.getWorldChunkManager().getBiomeGenAt(xChunk, zChunk).biomeName;