Skip to content

Commit

Permalink
Initial multi-block detection in AdaptiveInventoryLogic
Browse files Browse the repository at this point in the history
  • Loading branch information
mDiyo committed Sep 23, 2013
1 parent 10f04a6 commit 8ac30c5
Show file tree
Hide file tree
Showing 12 changed files with 425 additions and 779 deletions.
14 changes: 10 additions & 4 deletions src/tconstruct/blocks/logic/MultiServantLogic.java
@@ -1,13 +1,13 @@
package tconstruct.blocks.logic;

import tconstruct.library.util.CoordTuple;
import tconstruct.library.util.IMasterLogic;
import tconstruct.library.util.IServantLogic;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.Packet132TileEntityData;
import net.minecraft.tileentity.TileEntity;
import tconstruct.library.util.CoordTuple;
import tconstruct.library.util.IMasterLogic;
import tconstruct.library.util.IServantLogic;

public class MultiServantLogic extends TileEntity implements IServantLogic
{
Expand Down Expand Up @@ -36,6 +36,12 @@ public boolean hasValidMaster ()
}
}

@Override
public boolean canBeMaster (IMasterLogic logic, int x, int y, int z)
{
return true;
}

public CoordTuple getMasterPosition ()
{
return master;
Expand All @@ -57,7 +63,7 @@ public void removeMaster ()
masterMeat = 0;
}

public boolean verifyMaster (int x, int y, int z)
public boolean verifyMaster (IMasterLogic logic, int x, int y, int z)
{
if (master.equalCoords(x, y, z) && worldObj.getBlockId(x, y, z) == masterID && worldObj.getBlockMetadata(x, y, z) == masterMeat)
return true;
Expand Down
4 changes: 2 additions & 2 deletions src/tconstruct/blocks/logic/SmelteryLogic.java
Expand Up @@ -532,7 +532,7 @@ public void updateFuelDisplay ()
}
}

void updateFuelGague ()
void updateFuelGague () //TODO: Call this method when the GUI is opened
{
if (activeLavaTank == null || useTime > 0)
return;
Expand Down Expand Up @@ -900,7 +900,7 @@ else if (te instanceof MultiServantLogic)
MultiServantLogic servant = (MultiServantLogic) te;
if (servant.hasValidMaster())
{
if (servant.verifyMaster(this.xCoord, this.yCoord, this.zCoord))
if (servant.verifyMaster(this, this.xCoord, this.yCoord, this.zCoord))
tempBricks++;
}
else if (servant.setMaster(this.xCoord, this.yCoord, this.zCoord))
Expand Down
82 changes: 82 additions & 0 deletions src/tconstruct/blocks/logic/TowerFurnaceLogic.java
@@ -0,0 +1,82 @@
package tconstruct.blocks.logic;

import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import tconstruct.library.blocks.AdaptiveInventoryLogic;
import tconstruct.library.util.IActiveLogic;
import tconstruct.library.util.IFacingLogic;
import tconstruct.library.util.IMasterLogic;

public class TowerFurnaceLogic extends AdaptiveInventoryLogic implements IActiveLogic, IFacingLogic, IMasterLogic
{

public TowerFurnaceLogic()
{
super();
}

@Override
public void notifyChange (int x, int y, int z)
{
// TODO Auto-generated method stub

}

@Override
public byte getRenderDirection ()
{
// TODO Auto-generated method stub
return 0;
}

@Override
public ForgeDirection getForgeDirection ()
{
// TODO Auto-generated method stub
return null;
}

@Override
public void setDirection (int side)
{
// TODO Auto-generated method stub

}

@Override
public void setDirection (float yaw, float pitch, EntityLivingBase player)
{
// TODO Auto-generated method stub

}

@Override
public boolean getActive ()
{
// TODO Auto-generated method stub
return false;
}

@Override
public void setActive (boolean flag)
{
// TODO Auto-generated method stub

}

@Override
public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z)
{
return null;
}

@Override
protected String getDefaultName ()
{
return null;
}

}
1 change: 1 addition & 0 deletions src/tconstruct/client/gui/ToolStationGui.java
Expand Up @@ -216,6 +216,7 @@ void drawModularToolStats (ItemStack stack, ToolCore tool, NBTTagCompound tags)
int attack = (int) (tags.getInteger("Attack"));
float stoneboundDamage = (float) Math.log(durability / 72f + 1) * -2 * stonebound;
attack += stoneboundDamage;
attack *= tool.getDamageModifier();
if (attack < 1)
attack = 1;

Expand Down
117 changes: 0 additions & 117 deletions src/tconstruct/dimension/TinkerChunkManager.java

This file was deleted.

0 comments on commit 8ac30c5

Please sign in to comment.