parent
918f1a0ed5
commit
02357ce1a4
4 changed files with 39 additions and 13 deletions
|
@ -1,8 +1,5 @@
|
||||||
package techreborn.client.gui;
|
package techreborn.client.gui;
|
||||||
|
|
||||||
import java.awt.*;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
|
@ -15,6 +12,9 @@ import techreborn.client.container.ContainerIDSU;
|
||||||
import techreborn.packets.PacketIdsu;
|
import techreborn.packets.PacketIdsu;
|
||||||
import techreborn.tiles.idsu.TileIDSU;
|
import techreborn.tiles.idsu.TileIDSU;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
public class GuiIDSU extends GuiContainer
|
public class GuiIDSU extends GuiContainer
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -64,10 +64,10 @@ public class GuiIDSU extends GuiContainer
|
||||||
this.buttonList.clear();
|
this.buttonList.clear();
|
||||||
int k = (this.width - this.xSize) / 2;
|
int k = (this.width - this.xSize) / 2;
|
||||||
int l = (this.height - this.ySize) / 2;
|
int l = (this.height - this.ySize) / 2;
|
||||||
this.buttonList.add(new GuiButton(0, k + 128, l + 5, 15, 15, "++"));
|
this.buttonList.add(new GuiButton(0, k + 115, l + 5, 15, 20, "++"));
|
||||||
this.buttonList.add(new GuiButton(1, k + 128, l + 5 + 20, 15, 15, "+"));
|
this.buttonList.add(new GuiButton(1, k + 115, l + 5 + 20, 15, 20, "+"));
|
||||||
this.buttonList.add(new GuiButton(2, k + 128, l + 5 + (20 * 2), 15, 15, "-"));
|
this.buttonList.add(new GuiButton(2, k + 115, l + 5 + (20 * 2), 15, 20, "-"));
|
||||||
this.buttonList.add(new GuiButton(3, k + 128, l + 5 + (20 * 3), 15, 15, "--"));
|
this.buttonList.add(new GuiButton(3, k + 115, l + 5 + (20 * 3), 15, 20, "--"));
|
||||||
this.buttonList.add(new GuiButton(4, k + 40, l + 10, 10, 10, "+"));
|
this.buttonList.add(new GuiButton(4, k + 40, l + 10, 10, 10, "+"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,11 +60,18 @@ public class ItemWrench extends ItemTR implements ITexturedItem
|
||||||
|
|
||||||
if (!player.isSneaking())
|
if (!player.isSneaking())
|
||||||
{
|
{
|
||||||
if (tile instanceof TileEnergyStorage)
|
if (tile instanceof TileEnergyStorage || tile instanceof IWrenchable)
|
||||||
{
|
{
|
||||||
|
if(((IWrenchable)tile).wrenchCanSetFacing(player, side.getOpposite())){
|
||||||
|
|
||||||
tile.getWorld().setBlockState(tile.getPos(),
|
tile.getWorld().setBlockState(tile.getPos(),
|
||||||
tile.getWorld().getBlockState(pos).withProperty(BlockBatBox.FACING, side.getOpposite()));
|
tile.getWorld().getBlockState(pos).withProperty(BlockBatBox.FACING, side.getOpposite()));
|
||||||
return EnumActionResult.SUCCESS;
|
|
||||||
|
return EnumActionResult.SUCCESS;
|
||||||
|
}else{
|
||||||
|
|
||||||
|
return EnumActionResult.FAIL;
|
||||||
|
}
|
||||||
} else if (tile instanceof TileMachineBase)
|
} else if (tile instanceof TileMachineBase)
|
||||||
{
|
{
|
||||||
if (side != EnumFacing.DOWN && side != EnumFacing.UP)
|
if (side != EnumFacing.DOWN && side != EnumFacing.UP)
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class TileAesu extends TilePowerAcceptor implements IWrenchable
|
||||||
@Override
|
@Override
|
||||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side)
|
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side)
|
||||||
{
|
{
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,18 +1,17 @@
|
||||||
package techreborn.tiles.idsu;
|
package techreborn.tiles.idsu;
|
||||||
|
|
||||||
|
import ic2.api.tile.IWrenchable;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import reborncore.api.power.EnumPowerTier;
|
import reborncore.api.power.EnumPowerTier;
|
||||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||||
import techreborn.config.ConfigTechReborn;
|
import techreborn.config.ConfigTechReborn;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
|
|
||||||
public class TileIDSU extends TilePowerAcceptor
|
public class TileIDSU extends TilePowerAcceptor implements IWrenchable
|
||||||
{
|
{
|
||||||
|
|
||||||
public String ownerUdid;
|
public String ownerUdid;
|
||||||
|
@ -166,6 +165,26 @@ public class TileIDSU extends TilePowerAcceptor
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override public boolean wrenchCanSetFacing(EntityPlayer p0, EnumFacing p1)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public EnumFacing getFacing()
|
||||||
|
{
|
||||||
|
return getFacingEnum();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public boolean wrenchCanRemove(EntityPlayer p0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public float getWrenchDropRate()
|
||||||
|
{
|
||||||
|
return 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer)
|
public ItemStack getWrenchDrop(EntityPlayer entityPlayer)
|
||||||
{
|
{
|
||||||
NBTTagCompound tileEntity = new NBTTagCompound();
|
NBTTagCompound tileEntity = new NBTTagCompound();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue