Attempt to remove MekanismAll, I really have no idea what I’m doing though

Also kill copied ItemMultiPart
This commit is contained in:
Aidan Brady 2014-01-04 18:50:13 -05:00
parent ce6321affd
commit 05bbcd4a48
3 changed files with 3 additions and 75 deletions

View file

@ -26,7 +26,7 @@ dependencies {
} }
version = "6.0.0." + "$System.env.BUILD_NUMBER" version = "6.0.0." + "$System.env.BUILD_NUMBER"
archivesBaseName = "MekanismAll"
libsDirName = "../output" libsDirName = "../output"
distsDirName = "../output" distsDirName = "../output"

View file

@ -21,11 +21,12 @@ import org.lwjgl.input.Keyboard;
import codechicken.lib.vec.BlockCoord; import codechicken.lib.vec.BlockCoord;
import codechicken.lib.vec.Vector3; import codechicken.lib.vec.Vector3;
import codechicken.multipart.JItemMultiPart;
import codechicken.multipart.TMultiPart; import codechicken.multipart.TMultiPart;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
public class ItemPartTransmitter extends MItemMultiPart public class ItemPartTransmitter extends JItemMultiPart
{ {
public ItemPartTransmitter(int id) public ItemPartTransmitter(int id)
{ {

View file

@ -1,73 +0,0 @@
package mekanism.common.multipart;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import codechicken.lib.vec.BlockCoord;
import codechicken.lib.vec.Rotation;
import codechicken.lib.vec.Vector3;
import codechicken.multipart.TMultiPart;
import codechicken.multipart.TileMultipart;
/**
* Taken from FMP to prevent compile issues
* @author aidancbrady
*
*/
public abstract class MItemMultiPart extends Item
{
public MItemMultiPart(int id)
{
super(id);
}
private double getHitDepth(Vector3 vhit, int side)
{
return vhit.copy().scalarProject(Rotation.axes[side]) + (side%2^1);
}
@Override
public boolean onItemUse(ItemStack item, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
{
BlockCoord pos = new BlockCoord(x, y, z);
Vector3 vhit = new Vector3(hitX, hitY, hitZ);
double d = getHitDepth(vhit, side);
if(d < 1 && place(item, player, world, x, y, z, side, hitX, hitY, hitZ, pos, vhit))
{
return true;
}
pos.offset(side);
return place(item, player, world, x, y, z, side, hitX, hitY, hitZ, pos, vhit);
}
private boolean place(ItemStack item, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, BlockCoord pos, Vector3 vhit)
{
TMultiPart part = newPart(item, player, world, pos, side, vhit);
if(part == null || !TileMultipart.canPlacePart(world, pos, part))
{
return false;
}
if(!world.isRemote)
{
TileMultipart.addPart(world, pos, part);
}
if(!player.capabilities.isCreativeMode)
{
item.stackSize -= 1;
}
return true;
}
/**
* Create a new part based on the placement information parameters.
*/
public abstract TMultiPart newPart(ItemStack item, EntityPlayer player, World world, BlockCoord pos, int side, Vector3 vhit);
}