You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.8 KiB
Java

package net.brokenmoon.afloydwiremod.item;
import net.brokenmoon.afloydwiremod.WireMod;
import net.brokenmoon.afloydwiremod.mixinInterfaces.IEntityPlayer;
import net.minecraft.src.*;
import java.util.ArrayList;
import java.util.Stack;
public class ToolWiring extends Item {
public int x = 0;
public int y = 0;
public int z = 0;
public ArrayList<Integer> xadd = new ArrayList<Integer>();
public ArrayList<Integer> yadd = new ArrayList<Integer>();
public ArrayList<Integer> zadd = new ArrayList<Integer>();
public ArrayList<Integer> sideadd = new ArrayList<Integer>();
public String type = "unpaired";
public int slot;
public float red = 1;
public float green = 0;
public float blue = 0;
public float alpha = 1;
public float width = 0.5f;
public ToolWiring(int i) {
super(i);
this.maxStackSize = 1;
}
public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l, double heightPlaced) {
if(entityplayer.isSneaking()){
if (!world.isMultiplayerAndNotHost) {
this.displayWireSettings(entityplayer);
return true;
}
} else {
xadd.add(i);
yadd.add(j);
zadd.add(k);
sideadd.add(l);
return false;
}
return false;
}
private void displayWireSettings(EntityPlayer player) {
if(player instanceof EntityPlayerMP) {
//Multiplayer
((IEntityPlayer)player).displayGuiWireSettings();
return;
}
//Singleplayer
((IEntityPlayer)player).displayGuiWireSettings();
}
@Override
public boolean isFull3D() {
return true;
}
}