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.
44 lines
1.4 KiB
Java
44 lines
1.4 KiB
Java
package net.brokenmoon.afloydtubemod.block;
|
|
|
|
import net.brokenmoon.afloydtubemod.mixinInterface.IEntityPlayer;
|
|
import net.brokenmoon.afloydtubemod.tileEntity.TileEntityTransposer;
|
|
import net.minecraft.src.*;
|
|
|
|
public class BlockTransposer extends BlockContainerRotatable {
|
|
|
|
private boolean isActive;
|
|
public BlockTransposer(int i, Material material) {
|
|
super(i, material);
|
|
this.isActive = isActive;
|
|
}
|
|
|
|
public void onBlockAdded(World world, int i, int j, int k) {
|
|
super.onBlockAdded(world, i, j, k);
|
|
this.setDefaultDirection(world, i, j, k);
|
|
}
|
|
|
|
@Override
|
|
public boolean blockActivated(World world, int x, int y, int z, EntityPlayer entityplayer) {
|
|
IInventory inventory = (TileEntityTransposer)world.getBlockTileEntity(x, y, z);
|
|
if (!world.isMultiplayerAndNotHost)
|
|
this.displayGui(entityplayer, inventory);
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
protected TileEntity getBlockEntity() {
|
|
return new TileEntityTransposer();
|
|
}
|
|
|
|
public static void displayGui(EntityPlayer player, IInventory inventory){
|
|
if(player instanceof EntityPlayerMP) {
|
|
//Multiplayer
|
|
((IEntityPlayer)player).displayGUITransposer(inventory);
|
|
return;
|
|
}
|
|
//Singleplayer
|
|
System.out.println("One");
|
|
((IEntityPlayer)player).displayGUITransposer(inventory);
|
|
}
|
|
}
|