Skip to content

Commit

Permalink
Fix the errors that were left, I commeneted our some code in Smeltery…
Browse files Browse the repository at this point in the history
…Logic for right now, Also changed the way ArrowEntity Sends the ChangeGameState
  • Loading branch information
Alexander committed Feb 3, 2014
1 parent 840e0ce commit fffe280
Show file tree
Hide file tree
Showing 18 changed files with 45 additions and 33 deletions.
2 changes: 1 addition & 1 deletion resources/TConstruct_at.cfg
Expand Up @@ -18,7 +18,7 @@ public net.minecraft.client.renderer.RenderGlobal field_147592_B
# Entity
public net.minecraft.entity.Entity field_145783_c
# Blocks
public net.minecraft.block.Block field_149764_J
public-f net.minecraft.block.Block field_149764_J
public net.minecraft.block.BlockLeavesBase field_150121_P
public net.minecraft.block.BlockRailBase$Rail func_150650_a()I
# GuiContainer
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/tconstruct/blocks/OreberryBush.java
Expand Up @@ -37,6 +37,8 @@ public class OreberryBush extends BlockLeavesBase implements IPlantable
public String[] oreTypes;
public int itemMeat;
private int subitems;
@SideOnly(Side.CLIENT)
protected int field_150127_b;

public OreberryBush(String[] textureNames, int meta, int sub, String[] oreTypes)
{
Expand Down Expand Up @@ -324,5 +326,12 @@ public EnumPlantType getPlantType (IBlockAccess world, int x, int y, int z)
{
return EnumPlantType.Cave;
}

@SideOnly(Side.CLIENT)
public void func_150122_b(boolean p_150122_1_)
{
this.field_150121_P = p_150122_1_;
this.field_150127_b = (p_150122_1_ ? 0 : 1);
}

}
5 changes: 3 additions & 2 deletions src/main/java/tconstruct/blocks/logic/SmelteryLogic.java
Expand Up @@ -918,10 +918,11 @@ else if (te instanceof MultiServantLogic)
if (servant.verifyMaster(this, field_145850_b, this.field_145851_c, this.field_145848_d, this.field_145849_e))
tempBricks++;
}
else if (servant.setMaster(this.field_145851_c, this.field_145848_d, this.field_145849_e))
// Temp comment out
/*else if (servant.setMaster(this.field_145851_c, this.field_145848_d, this.field_145849_e))
{
tempBricks++;
}
}*/

if (te instanceof LavaTankLogic)
{
Expand Down
Expand Up @@ -61,7 +61,7 @@ public void onInventoryChanged ()
if (this.getWorld() != null)
{
this.field_145847_g = this.getWorld().getBlockMetadata(this.field_145851_c, this.field_145848_d, this.field_145849_e);
this.getWorld().markTileEntityChunkModified(this.field_145851_c, this.field_145848_d, this.field_145849_e, this);
this.getWorld().func_147476_b(this.field_145851_c, this.field_145848_d, this.field_145849_e, this);
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/tconstruct/blocks/slime/SlimeTallGrass.java
Expand Up @@ -5,6 +5,7 @@
import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.BlockBush;
import net.minecraft.block.BlockFlower;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
Expand All @@ -19,7 +20,7 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class SlimeTallGrass extends BlockFlower implements IShearable
public class SlimeTallGrass extends BlockBush implements IShearable
{
private static final String[] grassTypes = new String[] { "slimegrass_blue_tall" };
@SideOnly(Side.CLIENT)
Expand Down Expand Up @@ -99,7 +100,7 @@ public void registerIcons (IIconRegister par1IconRegister)
}

@Override
public ArrayList<ItemStack> getBlockDropped (World world, int x, int y, int z, int meta, int fortune)
public ArrayList<ItemStack> getDrops (World world, int x, int y, int z, int meta, int fortune)
{
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
if (world.rand.nextInt(8) != 0)
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/tconstruct/entity/projectile/ArrowEntity.java
Expand Up @@ -297,7 +297,8 @@ public void onUpdate ()
if (this.shootingEntity != null && movingobjectposition.entityHit != this.shootingEntity && movingobjectposition.entityHit instanceof EntityPlayer
&& this.shootingEntity instanceof EntityPlayerMP)
{
TConstruct.packetPipeline.sendTo(new S2BPacketChangeGameState(6, 0), (EntityPlayerMP) this.shootingEntity);
((EntityPlayerMP) this.shootingEntity).playerNetServerHandler.func_147359_a(new S2BPacketChangeGameState(6, 0));
//TConstruct.packetPipeline.sendTo(new S2BPacketChangeGameState(6, 0), (EntityPlayerMP) this.shootingEntity);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/items/blocks/WoolSlab1Item.java
Expand Up @@ -27,7 +27,7 @@ public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int
Block b = world.func_147439_a(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
int trueMeta = meta % 8;
boolean flag = (id & 8) != 0;
boolean flag = (b) != null;

if ((side == 1 && flag || side == 0 && !flag) && b == this.block && trueMeta == stack.getItemDamage())
{
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/items/blocks/WoolSlab2Item.java
Expand Up @@ -27,7 +27,7 @@ public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int
Block block = world.func_147439_a(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
int trueMeta = meta % 8;
boolean flag = (id & 8) != 0;
boolean flag = (block) != null;

if ((side == 1 && flag || side == 0 && !flag) && block == this.block && trueMeta == stack.getItemDamage())
{
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/items/tools/Excavator.java
Expand Up @@ -245,7 +245,7 @@ public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPl
}

@Override
public float getStrVsBlock (ItemStack stack, Block block, int meta)
public float getDigSpeed (ItemStack stack, Block block, int meta)
{
if (!stack.hasTagCompound())
return 1.0f;
Expand Down Expand Up @@ -291,7 +291,7 @@ public float getStrVsBlock (ItemStack stack, Block block, int meta)
return 0.1f;
}
}
return super.getStrVsBlock(stack, block, meta);
return super.getDigSpeed(stack, block, meta);
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/items/tools/Hammer.java
Expand Up @@ -342,7 +342,7 @@ public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPl
}

@Override
public float getStrVsBlock (ItemStack stack, Block block, int meta)
public float getDigSpeed (ItemStack stack, Block block, int meta)
{
if (!stack.hasTagCompound())
return 1.0f;
Expand All @@ -363,7 +363,7 @@ public float getStrVsBlock (ItemStack stack, Block block, int meta)
/*if (block == Block.silverfish)
return getblockSpeed(tags, block, meta);*/

return super.getStrVsBlock(stack, block, meta);
return super.getDigSpeed(stack, block, meta);
}

float getblockSpeed (NBTTagCompound tags, Block block, int meta)
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/items/tools/LumberAxe.java
Expand Up @@ -83,7 +83,7 @@ public void onUpdate (ItemStack stack, World world, Entity entity, int par4, boo
}*/

@Override
public float getStrVsBlock (ItemStack stack, Block block, int meta)
public float getDigSpeed (ItemStack stack, Block block, int meta)
{
if (!stack.hasTagCompound())
return 1.0f;
Expand Down Expand Up @@ -129,7 +129,7 @@ public float getStrVsBlock (ItemStack stack, Block block, int meta)
return 0.1f;
}
}
return super.getStrVsBlock(stack, block, meta);
return super.getDigSpeed(stack, block, meta);
}

@Override
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/tconstruct/library/crafting/Smeltery.java
Expand Up @@ -13,9 +13,9 @@ public class Smeltery
{
public static Smeltery instance = new Smeltery();

private final HashMap<List<Item>, FluidStack> smeltingList = new HashMap<List<Item>, FluidStack>();
private final HashMap<List<Item>, Integer> temperatureList = new HashMap<List<Item>, Integer>();
private final HashMap<List<Item>, ItemStack> renderIndex = new HashMap<List<Item>, ItemStack>();
private final HashMap<List<ItemStack>, FluidStack> smeltingList = new HashMap<List<ItemStack>, FluidStack>();
private final HashMap<List<ItemStack>, Integer> temperatureList = new HashMap<List<ItemStack>, Integer>();
private final HashMap<List<ItemStack>, ItemStack> renderIndex = new HashMap<List<ItemStack>, ItemStack>();
private final ArrayList<AlloyMix> alloys = new ArrayList<AlloyMix>();

/** Adds mappings between an itemstack and an output liquid
Expand Down Expand Up @@ -67,9 +67,9 @@ public static void addMelting (Block block, int metadata, int temperature, Fluid
*/
public static void addMelting (ItemStack input, Item item, int metadata, int temperature, FluidStack liquid)
{
instance.smeltingList.put(Arrays.asList((Item)input.getItem(), input.getItemDamage()), liquid);
instance.temperatureList.put(Arrays.asList((Item)input.getItem(), input.getItemDamage()), temperature);
instance.renderIndex.put(Arrays.asList((Item)input.getItem(), input.getItemDamage()), new ItemStack(item, input.stackSize, metadata));
instance.smeltingList.put(Arrays.asList(new ItemStack(input.getItem(), input.getItemDamage())), liquid);
instance.temperatureList.put(Arrays.asList(new ItemStack(input.getItem(), input.getItemDamage())), temperature);
instance.renderIndex.put(Arrays.asList(new ItemStack(input.getItem(), input.getItemDamage())), new ItemStack(item, input.stackSize, metadata));
}

/** Adds an alloy mixing recipe.
Expand Down Expand Up @@ -161,17 +161,17 @@ public static ArrayList mixMetals (ArrayList<FluidStack> moltenMetal)
return liquids;
}

public static HashMap<List<Item>, FluidStack> getSmeltingList ()
public static HashMap<List<ItemStack>, FluidStack> getSmeltingList ()
{
return instance.smeltingList;
}

public static HashMap<List<Item>, Integer> getTemperatureList ()
public static HashMap<List<ItemStack>, Integer> getTemperatureList ()
{
return instance.temperatureList;
}

public static HashMap<List<Item>, ItemStack> getRenderIndex ()
public static HashMap<List<ItemStack>, ItemStack> getRenderIndex ()
{
return instance.renderIndex;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/library/tools/DualHarvestTool.java
Expand Up @@ -56,7 +56,7 @@ public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPl
}

@Override
public float getStrVsBlock (ItemStack stack, Block block, int meta)
public float getDigSpeed (ItemStack stack, Block block, int meta)
{

NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
Expand Down Expand Up @@ -99,7 +99,7 @@ public float getStrVsBlock (ItemStack stack, Block block, int meta)
return 0.1f;
}
}
return super.getStrVsBlock(stack, block, meta);
return super.getDigSpeed(stack, block, meta);
}

public boolean canHarvestBlock (Block block)
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/library/tools/HarvestTool.java
Expand Up @@ -58,7 +58,7 @@ public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPl
}

@Override
public float getStrVsBlock (ItemStack stack, Block block, int meta)
public float getDigSpeed (ItemStack stack, Block block, int meta)
{
if (!stack.hasTagCompound())
return 1.0f;
Expand All @@ -79,7 +79,7 @@ public float getStrVsBlock (ItemStack stack, Block block, int meta)
{
return calculateStrength(tags, block, meta); //No issue if the harvest level is too low
}
return super.getStrVsBlock(stack, block, meta);
return super.getDigSpeed(stack, block, meta);
}

float calculateStrength (NBTTagCompound tags, Block block, int meta)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/library/tools/ToolCore.java
Expand Up @@ -621,7 +621,7 @@ public boolean func_150894_a (ItemStack itemstack, World world, Block block, int
}

@Override
public float getStrVsBlock (ItemStack stack, Block block, int meta)
public float getDigSpeed (ItemStack stack, Block block, int meta)
{
NBTTagCompound tags = stack.getTagCompound();
if (tags.getCompoundTag("InfiTool").getBoolean("Broken"))
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/library/tools/Weapon.java
Expand Up @@ -30,7 +30,7 @@ protected float effectiveSpeed ()
}

@Override
public float getStrVsBlock (ItemStack stack, Block block, int meta)
public float getDigSpeed (ItemStack stack, Block block, int meta)
{
if (stack.getTagCompound().getCompoundTag("InfiTool").getBoolean("Broken"))
return 0.1f;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/worldgen/OreberryBushGen.java
Expand Up @@ -94,13 +94,13 @@ void generateBerryBlock (World world, int x, int y, int z, Random random)
}*/

Block block = world.func_147439_a(x, y, z);
if (block == null || (block != Blocks.end_portal_frame && !world.func_147439_a(x, y, z).isGenMineableReplaceable))
if (block == null || (block != Blocks.end_portal_frame && !world.func_147439_a(x, y, z).func_149730_j()))
world.func_147465_d(x, y, z, this.blockB, metadata, 2);
else
{
for (int iter = 0; iter < replaceBlocks.length; iter++)
{
if (block.isGenMineableReplaceable(world, x, y, z, replaceBlocks[iter]))
if (world.func_147439_a(x, y, z).isReplaceableOreGen(world, x, y, z, replaceBlocks[iter]))
{
world.func_147465_d(x, y, z, this.blockB, metadata, 2);
break;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/worldgen/SurfaceOreGen.java
Expand Up @@ -123,7 +123,7 @@ public boolean generate (World world, Random random, int startX, int startY, int
{
for (int iter = 0; iter < replaceBlocks.length; iter++)
{
if (block.isGenMineableReplaceable(world, k2, l2, i3, replaceBlocks[iter]))
if (world.func_147439_a(k2, l2, i3).isReplaceableOreGen(world, k2, l2, i3, replaceBlocks[iter]))
{
world.func_147465_d(k2, l2, i3, this.minableBlock, minableBlockMeta, 2);
break;
Expand Down

0 comments on commit fffe280

Please sign in to comment.