2021-03-29 10:15:59 +02:00
|
|
|
package appeng.block.legacy;
|
|
|
|
|
2022-12-02 17:40:47 +01:00
|
|
|
import java.util.EnumSet;
|
|
|
|
|
2021-03-29 10:15:59 +02:00
|
|
|
import appeng.block.AEBaseTileBlock;
|
2021-04-03 12:02:52 +02:00
|
|
|
import appeng.client.texture.ExtraBlockTextures;
|
2021-03-29 10:15:59 +02:00
|
|
|
import appeng.core.features.AEFeature;
|
2021-03-29 22:53:57 +02:00
|
|
|
import appeng.core.sync.GuiBridge;
|
2021-03-29 10:15:59 +02:00
|
|
|
import appeng.tile.legacy.TileLegacyController;
|
2021-03-29 22:53:57 +02:00
|
|
|
import appeng.util.Platform;
|
2021-03-29 10:15:59 +02:00
|
|
|
import net.minecraft.block.material.Material;
|
2021-03-29 22:53:57 +02:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2021-04-03 12:02:52 +02:00
|
|
|
import net.minecraft.util.IIcon;
|
2021-03-29 22:53:57 +02:00
|
|
|
import net.minecraft.world.World;
|
|
|
|
import net.minecraftforge.common.util.ForgeDirection;
|
2021-03-29 10:15:59 +02:00
|
|
|
|
|
|
|
public class BlockLegacyController extends AEBaseTileBlock {
|
|
|
|
public BlockLegacyController() {
|
|
|
|
super(Material.iron);
|
|
|
|
this.setTileEntity(TileLegacyController.class);
|
2022-12-02 17:40:47 +01:00
|
|
|
this.setFeature(EnumSet.of(AEFeature.Legacy));
|
2021-03-29 10:15:59 +02:00
|
|
|
}
|
|
|
|
|
2021-03-29 22:53:57 +02:00
|
|
|
@Override
|
2022-12-02 17:40:47 +01:00
|
|
|
public boolean onActivated(
|
|
|
|
World w,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int z,
|
|
|
|
EntityPlayer player,
|
|
|
|
int side,
|
|
|
|
float hitX,
|
|
|
|
float hitY,
|
|
|
|
float hitZ
|
|
|
|
) {
|
|
|
|
Platform.openGUI(
|
|
|
|
player,
|
|
|
|
w.getTileEntity(x, y, z),
|
|
|
|
ForgeDirection.getOrientation(side),
|
|
|
|
GuiBridge.GUI_NETWORK_STATUS_BLOCK
|
|
|
|
);
|
2021-03-29 22:53:57 +02:00
|
|
|
return true;
|
|
|
|
}
|
2021-03-29 10:15:59 +02:00
|
|
|
|
2021-04-03 12:02:52 +02:00
|
|
|
@Override
|
|
|
|
public IIcon getIcon(int direction, int metadata) {
|
|
|
|
if (direction == 3) {
|
|
|
|
switch (metadata) {
|
|
|
|
case 0:
|
|
|
|
return ExtraBlockTextures.Controller0.getIcon();
|
|
|
|
case 1:
|
|
|
|
return ExtraBlockTextures.Controller1.getIcon();
|
|
|
|
case 2:
|
|
|
|
return ExtraBlockTextures.Controller2.getIcon();
|
|
|
|
case 3:
|
|
|
|
return ExtraBlockTextures.Controller3.getIcon();
|
|
|
|
case 4:
|
|
|
|
return ExtraBlockTextures.Controller4.getIcon();
|
|
|
|
case 5:
|
|
|
|
return ExtraBlockTextures.Controller5.getIcon();
|
|
|
|
case 6:
|
|
|
|
return ExtraBlockTextures.ControllerLinked.getIcon();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return super.getIcon(direction, metadata);
|
|
|
|
}
|
2021-03-29 10:15:59 +02:00
|
|
|
}
|