mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-21 20:42:35 +00:00
Reformed Forestry!
* Updated for BC 6.0.x compatibility * Re-implemented the Pipes plugin * Converted to vanilla assets lang system * Converted to standard gradle file structure * General warnings cleanup
This commit is contained in:
1 parent
36248c02f1
commit
8f2d802f11
1602 files changed
+724
-736
No files matched your search
+65
@@ -0,0 +1,65 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 by SirSengir
|
||||
*
|
||||
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
|
||||
*
|
||||
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/3.0/.
|
||||
******************************************************************************/
|
||||
package forestry.pipes;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import buildcraft.transport.Pipe;
|
||||
import buildcraft.transport.TileGenericPipe;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.pipes.gui.ContainerPropolisPipe;
|
||||
import forestry.pipes.gui.GuiPropolisPipe;
|
||||
import forestry.plugins.PluginApiculture;
|
||||
|
||||
public class GuiHandlerPipes implements IGuiHandler {
|
||||
|
||||
private Pipe getPipe(World world, int x, int y, int z) {
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (tile == null)
|
||||
return null;
|
||||
|
||||
if (!(tile instanceof TileGenericPipe))
|
||||
return null;
|
||||
|
||||
return ((TileGenericPipe) tile).pipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
|
||||
|
||||
if (id >= GuiId.values().length)
|
||||
return null;
|
||||
|
||||
switch (GuiId.values()[id]) {
|
||||
case PropolisPipeGUI:
|
||||
return new GuiPropolisPipe(player, (PipeItemsPropolis)getPipe(world, x, y, z));
|
||||
default:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
|
||||
|
||||
if (id >= GuiId.values().length)
|
||||
return null;
|
||||
|
||||
switch (GuiId.values()[id]) {
|
||||
case PropolisPipeGUI:
|
||||
PluginApiculture.beeInterface.getBreedingTracker(world, player.getGameProfile()).synchToPlayer(player);
|
||||
return new ContainerPropolisPipe(player.inventory, (PipeItemsPropolis)getPipe(world, x, y, z));
|
||||
default:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user