fixed a crash on dedicated servers because for some reason AABB(Vec3d, Vec3d) is client-only

fixed copyright comments
This commit is contained in:
malte0811 2017-04-10 16:20:39 +02:00
parent 838e9c2af4
commit 4bda8d458c
31 changed files with 408 additions and 50 deletions

View file

@ -18,7 +18,11 @@
package malte0811.industrialWires; package malte0811.industrialWires;
import malte0811.industrialWires.blocks.TileEntityJacobsLadder; import malte0811.industrialWires.blocks.TileEntityJacobsLadder;
import malte0811.industrialWires.blocks.controlpanel.TileEntityPanelCreator;
import malte0811.industrialWires.containers.ContainerPanelCreator;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler; import net.minecraftforge.fml.common.network.IGuiHandler;
@ -31,7 +35,11 @@ public class CommonProxy implements IGuiHandler {
@Override @Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
return null;//TODO implement TileEntity te = world.getTileEntity(new BlockPos(x, y, z));
if (te instanceof TileEntityPanelCreator) {
return new ContainerPanelCreator(player.inventory, (TileEntityPanelCreator)te);
}
return null;
} }
@Override @Override

View file

@ -1,6 +1,6 @@
/******************************************************************************* /*
* This file is part of Industrial Wires. * This file is part of Industrial Wires.
* Copyright (C) 2016 malte0811 * Copyright (C) 2016-2017 malte0811
* *
* Industrial Wires is free software: you can redistribute it and/or modify * Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -14,7 +14,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>. * along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/ */
package malte0811.industrialWires; package malte0811.industrialWires;
public interface IIC2Connector { public interface IIC2Connector {

View file

@ -29,6 +29,7 @@ import malte0811.industrialWires.blocks.BlockJacobsLadder;
import malte0811.industrialWires.blocks.TileEntityJacobsLadder; import malte0811.industrialWires.blocks.TileEntityJacobsLadder;
import malte0811.industrialWires.blocks.controlpanel.BlockPanel; import malte0811.industrialWires.blocks.controlpanel.BlockPanel;
import malte0811.industrialWires.blocks.controlpanel.TileEntityPanel; import malte0811.industrialWires.blocks.controlpanel.TileEntityPanel;
import malte0811.industrialWires.blocks.controlpanel.TileEntityPanelCreator;
import malte0811.industrialWires.blocks.controlpanel.TileEntityRSPanelConn; import malte0811.industrialWires.blocks.controlpanel.TileEntityRSPanelConn;
import malte0811.industrialWires.blocks.converter.BlockMechanicalConverter; import malte0811.industrialWires.blocks.converter.BlockMechanicalConverter;
import malte0811.industrialWires.blocks.converter.TileEntityIEMotor; import malte0811.industrialWires.blocks.converter.TileEntityIEMotor;
@ -105,6 +106,7 @@ public class IndustrialWires {
GameRegistry.registerTileEntity(TileEntityJacobsLadder.class, MODID+":jacobsLadder"); GameRegistry.registerTileEntity(TileEntityJacobsLadder.class, MODID+":jacobsLadder");
GameRegistry.registerTileEntity(TileEntityPanel.class, MODID+":control_panel"); GameRegistry.registerTileEntity(TileEntityPanel.class, MODID+":control_panel");
GameRegistry.registerTileEntity(TileEntityRSPanelConn.class, MODID+":control_panel_rs"); GameRegistry.registerTileEntity(TileEntityRSPanelConn.class, MODID+":control_panel_rs");
GameRegistry.registerTileEntity(TileEntityPanelCreator.class, MODID+":panel_creator");
if (mechConv!=null) { if (mechConv!=null) {
GameRegistry.registerTileEntity(TileEntityIEMotor.class, MODID+":ieMotor"); GameRegistry.registerTileEntity(TileEntityIEMotor.class, MODID+":ieMotor");
GameRegistry.registerTileEntity(TileEntityMechICtoIE.class, MODID+":mechIcToIe"); GameRegistry.registerTileEntity(TileEntityMechICtoIE.class, MODID+":mechIcToIe");

View file

@ -1,6 +1,6 @@
/******************************************************************************* /*
* This file is part of Industrial Wires. * This file is part of Industrial Wires.
* Copyright (C) 2016 malte0811 * Copyright (C) 2016-2017 malte0811
* *
* Industrial Wires is free software: you can redistribute it and/or modify * Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -14,7 +14,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>. * along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/ */
package malte0811.industrialWires.blocks; package malte0811.industrialWires.blocks;
import blusunrize.immersiveengineering.api.energy.immersiveflux.IFluxConnection; import blusunrize.immersiveengineering.api.energy.immersiveflux.IFluxConnection;

View file

@ -1,3 +1,21 @@
/*
* This file is part of Industrial Wires.
* Copyright (C) 2016-2017 malte0811
*
* Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Industrial Wires is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*/
package malte0811.industrialWires.blocks; package malte0811.industrialWires.blocks;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;

View file

@ -1,6 +1,6 @@
/******************************************************************************* /*
* This file is part of Industrial Wires. * This file is part of Industrial Wires.
* Copyright (C) 2016 malte0811 * Copyright (C) 2016-2017 malte0811
* *
* Industrial Wires is free software: you can redistribute it and/or modify * Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -14,7 +14,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>. * along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/ */
package malte0811.industrialWires.blocks; package malte0811.industrialWires.blocks;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;

View file

@ -69,6 +69,8 @@ public class BlockPanel extends BlockIWBase implements IMetaEnum {
return new TileEntityPanel(); return new TileEntityPanel();
case RS_WIRE: case RS_WIRE:
return new TileEntityRSPanelConn(); return new TileEntityRSPanelConn();
case CREATOR:
return new TileEntityPanelCreator();
} }
return null; return null;
} }
@ -136,6 +138,7 @@ public class BlockPanel extends BlockIWBase implements IMetaEnum {
list.add(new ItemStack(itemIn, 1, 0)); list.add(new ItemStack(itemIn, 1, 0));
list.add(new ItemStack(itemIn, 1, 1)); list.add(new ItemStack(itemIn, 1, 1));
list.add(new ItemStack(itemIn, 1, 2)); list.add(new ItemStack(itemIn, 1, 2));
list.add(new ItemStack(itemIn, 1, 3));
} }
@Override @Override
public boolean isFullBlock(IBlockState state) { public boolean isFullBlock(IBlockState state) {
@ -160,16 +163,22 @@ public class BlockPanel extends BlockIWBase implements IMetaEnum {
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
if (!super.onBlockActivated(world, pos, state, player, hand, heldItem, side, hitX, hitY, hitZ)) { if (!super.onBlockActivated(world, pos, state, player, hand, heldItem, side, hitX, hitY, hitZ)&&hand==EnumHand.MAIN_HAND) {
TileEntity te = world.getTileEntity(pos); TileEntity te = world.getTileEntity(pos);
if (te instanceof TileEntityRSPanelConn){ if (te instanceof TileEntityRSPanelConn){
if (world.isRemote) { if (!world.isRemote) {
player.openGui(IndustrialWires.instance, 0, te.getWorld(), te.getPos().getX(), te.getPos().getY(), te.getPos().getZ()); player.openGui(IndustrialWires.instance, 0, te.getWorld(), te.getPos().getX(), te.getPos().getY(), te.getPos().getZ());
} }
return true; return true;
} }
if (te instanceof TileEntityPanelCreator) {
if (!world.isRemote) {
player.openGui(IndustrialWires.instance, 1, te.getWorld(), te.getPos().getX(), te.getPos().getY(), te.getPos().getZ());
}
return true;
}
return false; return false;
} }
return true; return state.getValue(type)==BlockTypes_Panel.TOP;
} }
} }

View file

@ -1,3 +1,21 @@
/*
* This file is part of Industrial Wires.
* Copyright (C) 2016-2017 malte0811
*
* Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Industrial Wires is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*/
package malte0811.industrialWires.blocks.controlpanel; package malte0811.industrialWires.blocks.controlpanel;
import net.minecraft.util.IStringSerializable; import net.minecraft.util.IStringSerializable;
@ -7,7 +25,8 @@ import java.util.Locale;
public enum BlockTypes_Panel implements IStringSerializable { public enum BlockTypes_Panel implements IStringSerializable {
TOP, TOP,
RS_WIRE, RS_WIRE,
DUMMY; DUMMY,
CREATOR;
@Override @Override
public String getName() { public String getName() {

View file

@ -1,3 +1,21 @@
/*
* This file is part of Industrial Wires.
* Copyright (C) 2016-2017 malte0811
*
* Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Industrial Wires is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*/
package malte0811.industrialWires.blocks.controlpanel; package malte0811.industrialWires.blocks.controlpanel;
import malte0811.industrialWires.client.RawQuad; import malte0811.industrialWires.client.RawQuad;

View file

@ -1,3 +1,21 @@
/*
* This file is part of Industrial Wires.
* Copyright (C) 2016-2017 malte0811
*
* Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Industrial Wires is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*/
package malte0811.industrialWires.blocks.controlpanel; package malte0811.industrialWires.blocks.controlpanel;
import malte0811.industrialWires.client.RawQuad; import malte0811.industrialWires.client.RawQuad;

View file

@ -1,3 +1,21 @@
/*
* This file is part of Industrial Wires.
* Copyright (C) 2016-2017 malte0811
*
* Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Industrial Wires is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*/
package malte0811.industrialWires.blocks.controlpanel; package malte0811.industrialWires.blocks.controlpanel;
import malte0811.industrialWires.client.RawQuad; import malte0811.industrialWires.client.RawQuad;

View file

@ -80,7 +80,7 @@ public class TileEntityPanel extends TileEntityIWBase implements IDirectionalTil
slid.setX(.4F); slid.setX(.4F);
slid.setY(.25F); slid.setY(.25F);
slid.setPanelHeight(components.height); slid.setPanelHeight(components.height);
components.add(slid); //components.add(slid);
} }
@Override @Override
@ -224,7 +224,7 @@ public class TileEntityPanel extends TileEntityIWBase implements IDirectionalTil
Vec3d max = new Vec3d(in.maxX, in.maxY, in.maxZ); Vec3d max = new Vec3d(in.maxX, in.maxY, in.maxZ);
min = mat.apply(min); min = mat.apply(min);
max = mat.apply(max); max = mat.apply(max);
return new AxisAlignedBB(min, max); return new AxisAlignedBB(min.xCoord, min.yCoord, min.zCoord, max.xCoord, max.yCoord, max.zCoord);
} }
@Nullable @Nullable

View file

@ -0,0 +1,56 @@
/*
* This file is part of Industrial Wires.
* Copyright (C) 2016-2017 malte0811
*
* Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Industrial Wires is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*/
package malte0811.industrialWires.blocks.controlpanel;
import blusunrize.immersiveengineering.common.util.inventory.IIEInventory;
import malte0811.industrialWires.blocks.TileEntityIWBase;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public class TileEntityPanelCreator extends TileEntityIWBase implements IIEInventory {
@Override
public void writeNBT(NBTTagCompound out, boolean updatePacket) {
}
@Override
public void readNBT(NBTTagCompound in, boolean updatePacket) {
}
@Override
public ItemStack[] getInventory() {
return new ItemStack[0];
}
@Override
public boolean isStackValid(int slot, ItemStack stack) {
return false;
}
@Override
public int getSlotLimit(int slot) {
return 0;
}
@Override
public void doGraphicalUpdates(int slot) {
}
}

View file

@ -1,3 +1,21 @@
/*
* This file is part of Industrial Wires.
* Copyright (C) 2016-2017 malte0811
*
* Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Industrial Wires is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*/
package malte0811.industrialWires.blocks.controlpanel; package malte0811.industrialWires.blocks.controlpanel;
import blusunrize.immersiveengineering.api.TargetingInfo; import blusunrize.immersiveengineering.api.TargetingInfo;

View file

@ -1,6 +1,6 @@
/******************************************************************************* /*
* This file is part of Industrial Wires. * This file is part of Industrial Wires.
* Copyright (C) 2016 malte0811 * Copyright (C) 2016-2017 malte0811
* *
* Industrial Wires is free software: you can redistribute it and/or modify * Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -14,7 +14,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>. * along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/ */
package malte0811.industrialWires.blocks.converter; package malte0811.industrialWires.blocks.converter;
import net.minecraft.util.IStringSerializable; import net.minecraft.util.IStringSerializable;

View file

@ -1,6 +1,6 @@
/******************************************************************************* /*
* This file is part of Industrial Wires. * This file is part of Industrial Wires.
* Copyright (C) 2016 malte0811 * Copyright (C) 2016-2017 malte0811
* *
* Industrial Wires is free software: you can redistribute it and/or modify * Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -14,7 +14,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>. * along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/ */
package malte0811.industrialWires.blocks.wire; package malte0811.industrialWires.blocks.wire;
import blusunrize.immersiveengineering.common.blocks.BlockIEBase.IBlockEnum; import blusunrize.immersiveengineering.common.blocks.BlockIEBase.IBlockEnum;

View file

@ -1,6 +1,6 @@
/******************************************************************************* /*
* This file is part of Industrial Wires. * This file is part of Industrial Wires.
* Copyright (C) 2016 malte0811 * Copyright (C) 2016-2017 malte0811
* *
* Industrial Wires is free software: you can redistribute it and/or modify * Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -14,7 +14,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>. * along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/ */
package malte0811.industrialWires.blocks.wire; package malte0811.industrialWires.blocks.wire;
import blusunrize.immersiveengineering.api.energy.wires.WireType; import blusunrize.immersiveengineering.api.energy.wires.WireType;

View file

@ -1,6 +1,6 @@
/******************************************************************************* /*
* This file is part of Industrial Wires. * This file is part of Industrial Wires.
* Copyright (C) 2016 malte0811 * Copyright (C) 2016-2017 malte0811
* *
* Industrial Wires is free software: you can redistribute it and/or modify * Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -14,7 +14,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>. * along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/ */
package malte0811.industrialWires.blocks.wire; package malte0811.industrialWires.blocks.wire;
import blusunrize.immersiveengineering.api.energy.wires.WireType; import blusunrize.immersiveengineering.api.energy.wires.WireType;

View file

@ -1,6 +1,6 @@
/******************************************************************************* /*
* This file is part of Industrial Wires. * This file is part of Industrial Wires.
* Copyright (C) 2016 malte0811 * Copyright (C) 2016-2017 malte0811
* *
* Industrial Wires is free software: you can redistribute it and/or modify * Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -14,7 +14,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>. * along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/ */
package malte0811.industrialWires.blocks.wire; package malte0811.industrialWires.blocks.wire;
import blusunrize.immersiveengineering.api.energy.wires.IImmersiveConnectable; import blusunrize.immersiveengineering.api.energy.wires.IImmersiveConnectable;

View file

@ -1,6 +1,6 @@
/******************************************************************************* /*
* This file is part of Industrial Wires. * This file is part of Industrial Wires.
* Copyright (C) 2016 malte0811 * Copyright (C) 2016-2017 malte0811
* *
* Industrial Wires is free software: you can redistribute it and/or modify * Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -14,7 +14,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>. * along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/ */
package malte0811.industrialWires.blocks.wire; package malte0811.industrialWires.blocks.wire;
import blusunrize.immersiveengineering.api.energy.wires.IImmersiveConnectable; import blusunrize.immersiveengineering.api.energy.wires.IImmersiveConnectable;

View file

@ -1,6 +1,6 @@
/******************************************************************************* /*
* This file is part of Industrial Wires. * This file is part of Industrial Wires.
* Copyright (C) 2016 malte0811 * Copyright (C) 2016-2017 malte0811
* *
* Industrial Wires is free software: you can redistribute it and/or modify * Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -14,7 +14,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>. * along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/ */
package malte0811.industrialWires.client; package malte0811.industrialWires.client;
import blusunrize.immersiveengineering.api.Lib; import blusunrize.immersiveengineering.api.Lib;

View file

@ -31,7 +31,9 @@ import malte0811.industrialWires.IWConfig;
import malte0811.industrialWires.IndustrialWires; import malte0811.industrialWires.IndustrialWires;
import malte0811.industrialWires.blocks.IMetaEnum; import malte0811.industrialWires.blocks.IMetaEnum;
import malte0811.industrialWires.blocks.TileEntityJacobsLadder; import malte0811.industrialWires.blocks.TileEntityJacobsLadder;
import malte0811.industrialWires.blocks.controlpanel.TileEntityPanelCreator;
import malte0811.industrialWires.blocks.controlpanel.TileEntityRSPanelConn; import malte0811.industrialWires.blocks.controlpanel.TileEntityRSPanelConn;
import malte0811.industrialWires.client.gui.GuiPanelCreator;
import malte0811.industrialWires.client.gui.RSPanelConn; import malte0811.industrialWires.client.gui.RSPanelConn;
import malte0811.industrialWires.client.panelmodel.PanelModelLoader; import malte0811.industrialWires.client.panelmodel.PanelModelLoader;
import malte0811.industrialWires.client.render.TileRenderJacobsLadder; import malte0811.industrialWires.client.render.TileRenderJacobsLadder;
@ -40,6 +42,7 @@ import net.minecraft.block.Block;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.ISound; import net.minecraft.client.audio.ISound;
import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.renderer.block.model.ModelBakery; import net.minecraft.client.renderer.block.model.ModelBakery;
import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -219,11 +222,14 @@ public class ClientProxy extends CommonProxy {
} }
@Override @Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { public Gui getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
TileEntity te = world.getTileEntity(new BlockPos(x, y, z)); TileEntity te = world.getTileEntity(new BlockPos(x, y, z));
if (te instanceof TileEntityRSPanelConn) { if (te instanceof TileEntityRSPanelConn) {
return new RSPanelConn((TileEntityRSPanelConn)te); return new RSPanelConn((TileEntityRSPanelConn)te);
} }
if (te instanceof TileEntityPanelCreator) {
return new GuiPanelCreator(player.inventory, (TileEntityPanelCreator) te);
}
return null; return null;
} }
} }

View file

@ -0,0 +1,46 @@
/*
* This file is part of Industrial Wires.
* Copyright (C) 2016-2017 malte0811
*
* Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Industrial Wires is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*/
package malte0811.industrialWires.client.gui;
import malte0811.industrialWires.blocks.controlpanel.TileEntityPanelCreator;
import malte0811.industrialWires.containers.ContainerPanelCreator;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
public class GuiPanelCreator extends GuiContainer {
public GuiPanelCreator(InventoryPlayer ip, TileEntityPanelCreator te) {
super(new ContainerPanelCreator(ip, te));
ySize=207;
}
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
}
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
super.drawScreen(mouseX, mouseY, partialTicks);
}
@Override
public void initGui() {
super.initGui();
}
}

View file

@ -1,3 +1,21 @@
/*
* This file is part of Industrial Wires.
* Copyright (C) 2016-2017 malte0811
*
* Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Industrial Wires is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*/
package malte0811.industrialWires.client.gui; package malte0811.industrialWires.client.gui;
import malte0811.industrialWires.IndustrialWires; import malte0811.industrialWires.IndustrialWires;

View file

@ -1,3 +1,21 @@
/*
* This file is part of Industrial Wires.
* Copyright (C) 2016-2017 malte0811
*
* Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Industrial Wires is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*/
package malte0811.industrialWires.client.panelmodel; package malte0811.industrialWires.client.panelmodel;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;

View file

@ -0,0 +1,37 @@
/*
* This file is part of Industrial Wires.
* Copyright (C) 2016-2017 malte0811
*
* Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Industrial Wires is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*/
package malte0811.industrialWires.containers;
import blusunrize.immersiveengineering.common.gui.ContainerIEBase;
import malte0811.industrialWires.blocks.controlpanel.TileEntityPanelCreator;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
//TODO remove dependency on core IE
public class ContainerPanelCreator extends ContainerIEBase<TileEntityPanelCreator> {
public ContainerPanelCreator(InventoryPlayer inventoryPlayer, TileEntityPanelCreator tile) {
super(inventoryPlayer, tile);
slotCount = 4*9;
for (int i = 0; i < 3; i++)
for (int j = 0; j < 9; j++)
addSlotToContainer(new Slot(inventoryPlayer, j+i*9+9, 8+j*18, 126+i*18));
for (int i = 0; i < 9; i++)
addSlotToContainer(new Slot(inventoryPlayer, i, 8+i*18, 184));
}
}

View file

@ -0,0 +1,29 @@
/*
* This file is part of Industrial Wires.
* Copyright (C) 2016-2017 malte0811
*
* Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Industrial Wires is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*/
package malte0811.industrialWires.containers;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
public class ContainerRSPanelConn extends Container {
@Override
public boolean canInteractWith(EntityPlayer playerIn) {
return false;
}
}

View file

@ -1,6 +1,6 @@
/******************************************************************************* /*
* This file is part of Industrial Wires. * This file is part of Industrial Wires.
* Copyright (C) 2016 malte0811 * Copyright (C) 2016-2017 malte0811
* *
* Industrial Wires is free software: you can redistribute it and/or modify * Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -14,7 +14,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>. * along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/ */
package malte0811.industrialWires.crafting; package malte0811.industrialWires.crafting;
import malte0811.industrialWires.IndustrialWires; import malte0811.industrialWires.IndustrialWires;

View file

@ -1,6 +1,6 @@
/******************************************************************************* /*
* This file is part of Industrial Wires. * This file is part of Industrial Wires.
* Copyright (C) 2016 malte0811 * Copyright (C) 2016-2017 malte0811
* *
* Industrial Wires is free software: you can redistribute it and/or modify * Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -14,7 +14,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>. * along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/ */
package malte0811.industrialWires.util; package malte0811.industrialWires.util;
import blusunrize.immersiveengineering.common.Config; import blusunrize.immersiveengineering.common.Config;

View file

@ -1,3 +1,21 @@
/*
* This file is part of Industrial Wires.
* Copyright (C) 2016-2017 malte0811
*
* Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Industrial Wires is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*/
package malte0811.industrialWires.util; package malte0811.industrialWires.util;
import blusunrize.immersiveengineering.api.ApiUtils; import blusunrize.immersiveengineering.api.ApiUtils;
@ -12,9 +30,11 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import java.util.*; import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.function.BiPredicate; import java.util.function.BiPredicate;
import java.util.function.Predicate;
public final class MiscUtils { public final class MiscUtils {
private MiscUtils() {} private MiscUtils() {}
@ -58,7 +78,7 @@ public final class MiscUtils {
return false; return false;
} }
IBlockState state = w.getBlockState(pos); IBlockState state = w.getBlockState(pos);
return state.getBlock()== IndustrialWires.panel; return state.getBlock() == IndustrialWires.panel && state.getValue(BlockPanel.type) != BlockTypes_Panel.CREATOR;
}; };
List<BlockPos> all = discoverLocal(w, here, isValid); List<BlockPos> all = discoverLocal(w, here, isValid);
List<BlockPos> ret = new ArrayList<>(); List<BlockPos> ret = new ArrayList<>();

View file

@ -1,6 +1,6 @@
/******************************************************************************* /*
* This file is part of Industrial Wires. * This file is part of Industrial Wires.
* Copyright (C) 2016 malte0811 * Copyright (C) 2016-2017 malte0811
* *
* Industrial Wires is free software: you can redistribute it and/or modify * Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -14,7 +14,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>. * along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/ */
package malte0811.industrialWires.wires; package malte0811.industrialWires.wires;
import blusunrize.immersiveengineering.api.energy.wires.ImmersiveNetHandler; import blusunrize.immersiveengineering.api.energy.wires.ImmersiveNetHandler;