add in a new helper, fix some update derps

This commit is contained in:
Progwml6 committed 2014-01-16 00:23:38 -05:00
1 parent 8ba3faab10
commit e8e096bdcf
4 files changed
+45 -4

No files matched your search

@@ -66,7 +66,7 @@ public class MultiServantLogic extends TileEntity implements IServantLogic, IDeb
}
@Override
public boolean setPotentialMaster (IMasterLogic master, int x, int y, int z)
public boolean setPotentialMaster (IMasterLogic master, World w, int x, int y, int z)
{
return !hasMaster;
}
+2 -1
View File
@@ -13,13 +13,14 @@ public interface IServantLogic
/** Checks if this block can be tied to this master
*
* @param master
* @param world the world of master
* @param x xCoord of master
* @param y yCoord of master
* @param z zCoord of master
* @return whether the servant can be tied to this master
*/
public boolean setPotentialMaster (IMasterLogic master, int xMaster, int yMaster, int zMaster);
public boolean setPotentialMaster (IMasterLogic master, World world, int xMaster, int yMaster, int zMaster);
/** Used to set and verify that this is the block's master
*
+17 -2
View File
@@ -2,13 +2,28 @@ package mantle.common;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class ComparisonHelper
{
public static boolean areEquivalent (Item item, Block block)
{
//TODO figure this out!!!
return true;
return item.equals(block);
}
public static boolean areEquivalent (Block block1, Block block2)
{
//TODO figure this out!!!
return block1.equals(block2);
}
public static boolean areEquivalent (Item item1, Item item2)
{
//TODO figure this out!!!
return item1.equals(item2);
}
public static boolean areEquivalent (ItemStack is1, ItemStack is2)
{
//TODO figure this out!!!
return is1.getItem().equals(is2.getItem());
}
}
+25
View File
@@ -0,0 +1,25 @@
package mantle.world;
import mantle.common.ComparisonHelper;
import net.minecraft.init.Blocks;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class WorldHelper
{
public static void setBlockToAir (World w, int x, int y, int z)
{
w.func_147465_d(x, y, z, Blocks.air, 0, 0);
}
public static boolean setBlockToAirBool (World w, int x, int y, int z)
{
return w.func_147465_d(x, y, z, Blocks.air, 0, 0);
}
public static boolean isAirBlock (IBlockAccess access, int x, int y, int z)
{
return ComparisonHelper.areEquivalent(access.func_147439_a(x, y, z), Blocks.air);
}
}