Decimated server side. Removed root classes.

This commit is contained in:
SirSengir 2012-08-17 19:14:53 +02:00
parent 7ee5690011
commit 2a90fffef1
14 changed files with 90 additions and 339 deletions

View file

@ -1,39 +0,0 @@
/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.builders;
import net.minecraft.src.ICrafting;
import net.minecraft.src.IInventory;
class CraftingTemplate extends CraftingTemplateRoot {
public CraftingTemplate(IInventory playerInventory, TileArchitect template) {
super(playerInventory, template);
}
@Override
public void onCraftGuiOpened(ICrafting icrafting) {
super.onCraftGuiOpened(icrafting);
icrafting.updateCraftingInventoryInfo(this, 0, template.computingTime);
}
@Override
public void updateCraftingResults() {
super.updateCraftingResults();
for (int i = 0; i < crafters.size(); i++) {
ICrafting icrafting = (ICrafting) crafters.get(i);
if (computingTime != template.computingTime)
icrafting.updateCraftingInventoryInfo(this, 0, template.computingTime);
}
computingTime = template.computingTime;
}
}

View file

@ -1,22 +0,0 @@
package buildcraft.core.network;
import buildcraft.core.DefaultProps;
import net.minecraft.src.NetworkManager;
import net.minecraft.src.Packet1Login;
import net.minecraft.src.forge.IConnectionHandler;
import net.minecraft.src.forge.MessageManager;
public class ConnectionHandler implements IConnectionHandler {
@Override
public void onConnect(NetworkManager network) {
MessageManager.getInstance().registerChannel(network, new PacketHandler(), DefaultProps.NET_CHANNEL_NAME);
}
@Override
public void onLogin(NetworkManager network, Packet1Login login) {}
@Override
public void onDisconnect(NetworkManager network, String message, Object[] args) {}
}

View file

@ -1,37 +0,0 @@
/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.energy;
import net.minecraft.src.ICrafting;
import net.minecraft.src.InventoryPlayer;
public class ContainerEngine extends ContainerEngineRoot {
public ContainerEngine(InventoryPlayer inventoryplayer, TileEngine tileEngine) {
super(inventoryplayer, tileEngine);
// TODO Auto-generated constructor stub
}
@Override
public void onCraftGuiOpened(ICrafting icrafting) {
super.onCraftGuiOpened(icrafting);
// icrafting.updateCraftingInventoryInfo(this, 0,
// engine.scaledBurnTime);
}
@Override
public void updateCraftingResults() {
super.updateCraftingResults();
for (int i = 0; i < crafters.size(); i++)
engine.engine.sendGUINetworkData(this, (ICrafting) crafters.get(i));
}
}

View file

@ -1,22 +0,0 @@
/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.factory;
import net.minecraft.src.BlockContainer;
import net.minecraft.src.Material;
public abstract class BlockMachineRoot extends BlockContainer {
protected BlockMachineRoot(int i, Material material) {
super(i, material);
// TODO Auto-generated constructor stub
}
}

View file

@ -1,22 +0,0 @@
package buildcraft.factory.network;
import buildcraft.core.DefaultProps;
import net.minecraft.src.NetworkManager;
import net.minecraft.src.Packet1Login;
import net.minecraft.src.forge.IConnectionHandler;
import net.minecraft.src.forge.MessageManager;
public class ConnectionHandler implements IConnectionHandler {
@Override
public void onConnect(NetworkManager network) {
MessageManager.getInstance().registerChannel(network, new PacketHandler(), DefaultProps.NET_CHANNEL_NAME);
}
@Override
public void onLogin(NetworkManager network, Packet1Login login) {}
@Override
public void onDisconnect(NetworkManager network, String message, Object[] args) {}
}

View file

@ -1,28 +0,0 @@
package buildcraft.silicon.network;
import buildcraft.core.DefaultProps;
import net.minecraft.src.NetworkManager;
import net.minecraft.src.Packet1Login;
import net.minecraft.src.forge.IConnectionHandler;
import net.minecraft.src.forge.MessageManager;
public class ConnectionHandler implements IConnectionHandler {
@Override
public void onConnect(NetworkManager network) {
MessageManager.getInstance().registerChannel(network, new PacketHandler(), DefaultProps.NET_CHANNEL_NAME);
}
@Override
public void onLogin(NetworkManager network, Packet1Login login) {
// TODO Auto-generated method stub
}
@Override
public void onDisconnect(NetworkManager network, String message, Object[] args) {
// TODO Auto-generated method stub
}
}

View file

@ -1,28 +0,0 @@
package buildcraft.transport.network;
import buildcraft.core.DefaultProps;
import net.minecraft.src.NetworkManager;
import net.minecraft.src.Packet1Login;
import net.minecraft.src.forge.IConnectionHandler;
import net.minecraft.src.forge.MessageManager;
public class ConnectionHandler implements IConnectionHandler {
@Override
public void onConnect(NetworkManager network) {
MessageManager.getInstance().registerChannel(network, new PacketHandler(), DefaultProps.NET_CHANNEL_NAME);
}
@Override
public void onLogin(NetworkManager network, Packet1Login login) {
// TODO Auto-generated method stub
}
@Override
public void onDisconnect(NetworkManager network, String message, Object[] args) {
// TODO Auto-generated method stub
}
}

View file

@ -1,8 +1,8 @@
/**
/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
@ -10,15 +10,47 @@
package buildcraft.builders.gui;
import buildcraft.builders.TileArchitect;
import buildcraft.core.gui.BuildCraftContainer;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.ICrafting;
import net.minecraft.src.IInventory;
import net.minecraft.src.Slot;
class CraftingTemplate extends CraftingTemplateRoot {
public class CraftingTemplate extends BuildCraftContainer {
protected IInventory playerIInventory;
protected TileArchitect template;
protected int computingTime = 0;
public CraftingTemplate(IInventory playerInventory, TileArchitect template) {
super(playerInventory, template);
super(template.getSizeInventory());
this.playerIInventory = playerInventory;
this.template = template;
addSlotToContainer(new Slot(template, 0, 55, 35));
addSlotToContainer(new Slot(template, 1, 114, 35));
for (int l = 0; l < 3; l++) {
for (int k1 = 0; k1 < 9; k1++) {
addSlotToContainer(new Slot(playerInventory, k1 + l * 9 + 9, 8 + k1 * 18, 84 + l * 18));
}
}
for (int i1 = 0; i1 < 9; i1++) {
addSlotToContainer(new Slot(playerInventory, i1, 8 + i1 * 18, 142));
}
}
// FIXME: This is not called anymore
/*
@Override
public void onCraftGuiOpened(ICrafting icrafting) {
super.onCraftGuiOpened(icrafting);
icrafting.updateCraftingInventoryInfo(this, 0, template.computingTime);
}
*/
@Override
public void updateCraftingResults() {
super.updateCraftingResults();
@ -36,4 +68,10 @@ class CraftingTemplate extends CraftingTemplateRoot {
if (i == 0)
template.computingTime = j;
}
@Override
public boolean canInteractWith(EntityPlayer entityplayer) {
return template.isUseableByPlayer(entityplayer);
}
}

View file

@ -1,49 +0,0 @@
/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.builders.gui;
import buildcraft.builders.TileArchitect;
import buildcraft.core.gui.BuildCraftContainer;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.IInventory;
import net.minecraft.src.Slot;
public class CraftingTemplateRoot extends BuildCraftContainer {
protected IInventory playerIInventory;
protected TileArchitect template;
protected int computingTime = 0;
public CraftingTemplateRoot(IInventory playerInventory, TileArchitect template) {
super(template.getSizeInventory());
this.playerIInventory = playerInventory;
this.template = template;
addSlotToContainer(new Slot(template, 0, 55, 35));
addSlotToContainer(new Slot(template, 1, 114, 35));
for (int l = 0; l < 3; l++) {
for (int k1 = 0; k1 < 9; k1++) {
addSlotToContainer(new Slot(playerInventory, k1 + l * 9 + 9, 8 + k1 * 18, 84 + l * 18));
}
}
for (int i1 = 0; i1 < 9; i1++) {
addSlotToContainer(new Slot(playerInventory, i1, 8 + i1 * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer entityplayer) {
return template.isUseableByPlayer(entityplayer);
}
}

View file

@ -1,46 +1,68 @@
/**
/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.energy.gui;
import buildcraft.core.gui.BuildCraftContainer;
import buildcraft.energy.EngineStone;
import buildcraft.energy.TileEngine;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.ICrafting;
import net.minecraft.src.InventoryPlayer;
import net.minecraft.src.Slot;
public class ContainerEngine extends ContainerEngineRoot {
public class ContainerEngine extends BuildCraftContainer {
protected TileEngine engine;
public ContainerEngine(InventoryPlayer inventoryplayer, TileEngine tileEngine) {
super(inventoryplayer, tileEngine);
// TODO Auto-generated constructor stub
super(tileEngine.getSizeInventory());
engine = tileEngine;
if (tileEngine.engine instanceof EngineStone) {
addSlotToContainer(new Slot(tileEngine, 0, 80, 41));
} else {
addSlotToContainer(new Slot(tileEngine, 0, 52, 41));
}
for (int i = 0; i < 3; i++) {
for (int k = 0; k < 9; k++) {
addSlotToContainer(new Slot(inventoryplayer, k + i * 9 + 9, 8 + k * 18, 84 + i * 18));
}
}
for (int j = 0; j < 9; j++) {
addSlotToContainer(new Slot(inventoryplayer, j, 8 + j * 18, 142));
}
}
// @Override
// public void updateCraftingResults() {
// super.updateCraftingResults();
//
// System.out.println ("UPDATE CRAFTING RESULTS");
//
// // for (int i = 0; i < crafters.size(); i++) {
// // ICrafting icrafting = (ICrafting) crafters.get(i);
// //
// //
// //
// // if (scaledBurnTime != engine.scaledBurnTime) {
// // icrafting.updateCraftingInventoryInfo(this, 0,
// // engine.scaledBurnTime);
// // }
// // }
// //
// // scaledBurnTime = engine.scaledBurnTime;
// }
@Override
public void updateCraftingResults() {
super.updateCraftingResults();
for (int i = 0; i < crafters.size(); i++)
engine.engine.sendGUINetworkData(this, (ICrafting) crafters.get(i));
}
@Override
public void updateProgressBar(int i, int j) {
engine.engine.getGUINetworkData(i, j);
}
public boolean isUsableByPlayer(EntityPlayer entityplayer) {
return engine.isUseableByPlayer(entityplayer);
}
@Override
public boolean canInteractWith(EntityPlayer entityplayer) {
return engine.isUseableByPlayer(entityplayer);
}
}

View file

@ -1,54 +0,0 @@
/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.energy.gui;
import buildcraft.core.gui.BuildCraftContainer;
import buildcraft.energy.EngineStone;
import buildcraft.energy.TileEngine;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.InventoryPlayer;
import net.minecraft.src.Slot;
public class ContainerEngineRoot extends BuildCraftContainer {
public ContainerEngineRoot(InventoryPlayer inventoryplayer, TileEngine tileEngine) {
super(tileEngine.getSizeInventory());
engine = tileEngine;
if (tileEngine.engine instanceof EngineStone) {
addSlotToContainer(new Slot(tileEngine, 0, 80, 41));
} else {
addSlotToContainer(new Slot(tileEngine, 0, 52, 41));
}
for (int i = 0; i < 3; i++) {
for (int k = 0; k < 9; k++) {
addSlotToContainer(new Slot(inventoryplayer, k + i * 9 + 9, 8 + k * 18, 84 + i * 18));
}
}
for (int j = 0; j < 9; j++) {
addSlotToContainer(new Slot(inventoryplayer, j, 8 + j * 18, 142));
}
}
public boolean isUsableByPlayer(EntityPlayer entityplayer) {
return engine.isUseableByPlayer(entityplayer);
}
protected TileEngine engine;
@Override
public boolean canInteractWith(EntityPlayer entityplayer) {
return engine.isUseableByPlayer(entityplayer);
}
}

View file

@ -12,19 +12,13 @@ package buildcraft.factory;
import java.util.ArrayList;
import buildcraft.BuildCraftFactory;
import buildcraft.mod_BuildCraftEnergy;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.Position;
import buildcraft.api.tools.IToolWrench;
import buildcraft.core.Box;
import buildcraft.core.CoreProxy;
import buildcraft.core.DefaultProps;
import buildcraft.core.GuiIds;
import buildcraft.core.IItemPipe;
import buildcraft.core.Utils;
import buildcraft.energy.EngineIron;
import buildcraft.energy.EngineStone;
import buildcraft.energy.TileEngine;
import buildcraft.factory.BlockMachineRoot;
import net.minecraft.src.EntityLiving;

View file

@ -13,7 +13,6 @@ import java.util.ArrayList;
import buildcraft.BuildCraftCore;
import buildcraft.mod_BuildCraftFactory;
import buildcraft.api.core.BuildCraftAPI;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.Position;
import buildcraft.api.liquids.LiquidManager;

View file

@ -12,7 +12,6 @@ package buildcraft.factory;
import java.util.ArrayList;
import buildcraft.BuildCraftCore;
import buildcraft.api.core.BuildCraftAPI;
import buildcraft.api.core.Orientations;
import buildcraft.api.liquids.LiquidManager;
import buildcraft.api.liquids.LiquidStack;