Code cleanup attempt #2

This commit is contained in:
Kyprus 2012-06-07 20:13:31 -04:00
parent 76ea5f4b91
commit e78fcf297c
285 changed files with 2441 additions and 4439 deletions

View file

@ -35,8 +35,7 @@ public class APIProxy {
entity.setDead();
if (entity.worldObj instanceof WorldClient)
((WorldClient) entity.worldObj)
.removeEntityFromWorld(entity.entityId);
((WorldClient) entity.worldObj).removeEntityFromWorld(entity.entityId);
}
public static Random createNewRandom(World world) {

View file

@ -12,17 +12,12 @@ import net.minecraft.src.buildcraft.core.CoreProxy;
public class ClientBuilderHook implements IBuilderHook {
@Override
public void rootIndexInitialized(BptRootIndex rootBptIndex)
throws IOException {
if (!APIProxy.isServerSide()
&& !APIProxy
.isClient(ModLoader.getMinecraftInstance().theWorld)) {
public void rootIndexInitialized(BptRootIndex rootBptIndex) throws IOException {
if (!APIProxy.isServerSide() && !APIProxy.isClient(ModLoader.getMinecraftInstance().theWorld)) {
// If we're on a SSP game, then pre-load the player list
BptPlayerIndex playerIndex = new BptPlayerIndex(
CoreProxy.playerName() + ".list", rootBptIndex);
BuildCraftBuilders.playerLibrary.put(CoreProxy.playerName(),
playerIndex);
BptPlayerIndex playerIndex = new BptPlayerIndex(CoreProxy.playerName() + ".list", rootBptIndex);
BuildCraftBuilders.playerLibrary.put(CoreProxy.playerName(), playerIndex);
}
}

View file

@ -24,8 +24,7 @@ class CraftingTemplate extends CraftingTemplateRoot {
for (int i = 0; i < crafters.size(); i++) {
ICrafting icrafting = (ICrafting) crafters.get(i);
if (computingTime != template.computingTime)
icrafting.updateCraftingInventoryInfo(this, 0,
template.computingTime);
icrafting.updateCraftingInventoryInfo(this, 0, template.computingTime);
}
computingTime = template.computingTime;

View file

@ -65,12 +65,10 @@ public class GuiBlueprintLibrary extends GuiBuildCraft {
controlList.add(nextPageButton);
// if (library.owner.equals(player.username)) {
deleteButton = new GuiButton(2, j + 100, k + 114, 25, 20,
StringUtil.localize("gui.del"));
deleteButton = new GuiButton(2, j + 100, k + 114, 25, 20, StringUtil.localize("gui.del"));
controlList.add(deleteButton);
lockButton = new GuiButton(3, j + 127, k + 114, 40, 20,
StringUtil.localize("gui.lock"));
lockButton = new GuiButton(3, j + 127, k + 114, 40, 20, StringUtil.localize("gui.lock"));
controlList.add(lockButton);
if (library.locked)
@ -91,8 +89,7 @@ public class GuiBlueprintLibrary extends GuiBuildCraft {
if (bpt == library.selected) {
int l1 = 8;
int i2 = 24;
drawGradientRect(l1, i2 + 9 * c, l1 + 88, i2 + 9 * (c + 1),
0x80ffffff, 0x80ffffff);
drawGradientRect(l1, i2 + 9 * c, l1 + 88, i2 + 9 * (c + 1), 0x80ffffff, 0x80ffffff);
}
String name = bpt.getName();
@ -108,8 +105,7 @@ public class GuiBlueprintLibrary extends GuiBuildCraft {
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
int i = 0;
// if (library.owner.equals(player.username)) {
i = mc.renderEngine
.getTexture("/net/minecraft/src/buildcraft/builders/gui/library_rw.png");
i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/builders/gui/library_rw.png");
// } else {
// i = mc.renderEngine
// .getTexture("/net/minecraft/src/buildcraft/builders/gui/library_r.png");
@ -131,14 +127,12 @@ public class GuiBlueprintLibrary extends GuiBuildCraft {
if (container.contents.size() == 0)
container.contents = library.getNextPage(null);
else
container.contents = library.getNextPage(index
.prevBpt(container.contents.getFirst().file.getName()));
container.contents = library.getNextPage(index.prevBpt(container.contents.getFirst().file.getName()));
computeInput = false;
}
drawTexturedModalRect(j + 128 + 22 - inP, k + 61, 176 + 22 - inP, 16,
inP, 16);
drawTexturedModalRect(j + 128 + 22 - inP, k + 61, 176 + 22 - inP, 16, inP, 16);
drawTexturedModalRect(j + 128, k + 78, 176, 0, outP, 16);
}
@ -158,38 +152,28 @@ public class GuiBlueprintLibrary extends GuiBuildCraft {
if (ySlot >= 0 && ySlot <= 11)
if (ySlot < container.contents.size())
library.selected = container.contents.get(ySlot);
} else if (nextPageButton.mousePressed(
ModLoader.getMinecraftInstance(), i, j)) {
} else if (nextPageButton.mousePressed(ModLoader.getMinecraftInstance(), i, j)) {
if (container.contents.size() > 0)
container.contents = library.getNextPage(container.contents
.getLast().file.getName());
container.contents = library.getNextPage(container.contents.getLast().file.getName());
else
container.contents = library.getNextPage(null);
} else if (prevPageButton.mousePressed(
ModLoader.getMinecraftInstance(), i, j)) {
} else if (prevPageButton.mousePressed(ModLoader.getMinecraftInstance(), i, j)) {
if (container.contents.size() > 0)
container.contents = library.getPrevPage(container.contents
.getFirst().file.getName());
container.contents = library.getPrevPage(container.contents.getFirst().file.getName());
else
container.contents = library.getNextPage(null);
} else if (lockButton != null
&& lockButton.mousePressed(ModLoader.getMinecraftInstance(), i,
j)) {
} else if (lockButton != null && lockButton.mousePressed(ModLoader.getMinecraftInstance(), i, j)) {
library.locked = !library.locked;
if (library.locked)
lockButton.displayString = StringUtil.localize("gui.unlock");
else
lockButton.displayString = StringUtil.localize("gui.lock");
} else if (deleteButton != null
&& deleteButton.mousePressed(ModLoader.getMinecraftInstance(),
i, j))
} else if (deleteButton != null && deleteButton.mousePressed(ModLoader.getMinecraftInstance(), i, j))
if (library.selected != null) {
index.deleteBluePrint(library.selected.file.getName());
if (container.contents.size() > 0)
container.contents = library.getNextPage(index
.prevBpt(container.contents.getFirst().file
.getName()));
container.contents = library.getNextPage(index.prevBpt(container.contents.getFirst().file.getName()));
else
container.contents = library.getNextPage(null);

View file

@ -43,14 +43,11 @@ public class GuiBuilder extends GuiAdvancedInterface {
String title = StringUtil.localize("tile.builderBlock");
fontRenderer.drawString(title, getCenteredOffset(title), 12, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.building.resources"),
8, 60, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8,
ySize - 97, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.building.resources"), 8, 60, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, ySize - 97, 0x404040);
if (builder.isBuildingBlueprint())
fontRenderer.drawString(StringUtil.localize("gui.needed"), 185, 7,
0x404040);
fontRenderer.drawString(StringUtil.localize("gui.needed"), 185, 7, 0x404040);
drawForegroundSelection();
}
@ -63,12 +60,10 @@ public class GuiBuilder extends GuiAdvancedInterface {
int realXSize = 0;
if (builder.isBuildingBlueprint()) {
i = mc.renderEngine
.getTexture("/net/minecraft/src/buildcraft/builders/gui/builder_blueprint.png");
i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/builders/gui/builder_blueprint.png");
realXSize = 256;
} else {
i = mc.renderEngine
.getTexture("/net/minecraft/src/buildcraft/builders/gui/builder.png");
i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/builders/gui/builder.png");
realXSize = 176;
}

View file

@ -32,10 +32,8 @@ public class GuiFiller extends GuiBuildCraft {
protected void drawGuiContainerForegroundLayer() {
String title = StringUtil.localize("tile.fillerBlock");
fontRenderer.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.filling.resources"),
8, 74, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, 142,
0x404040);
fontRenderer.drawString(StringUtil.localize("gui.filling.resources"), 8, 74, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, 142, 0x404040);
if (filler.currentPattern != null)
drawForegroundSelection(filler.currentPattern.getName());
@ -44,33 +42,28 @@ public class GuiFiller extends GuiBuildCraft {
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
int i = mc.renderEngine
.getTexture("/net/minecraft/src/buildcraft/builders/gui/filler.png");
int i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/builders/gui/filler.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(i);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if (filler.currentPattern != null) {
i = mc.renderEngine.getTexture(filler.currentPattern
.getTextureFile());
i = mc.renderEngine.getTexture(filler.currentPattern.getTextureFile());
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(i);
int textureI = filler.currentPattern.getTextureIndex() >> 4;
int textureJ = filler.currentPattern.getTextureIndex() - textureI
* 16;
int textureJ = filler.currentPattern.getTextureIndex() - textureI * 16;
drawTexturedModalRect(guiLeft + patternSymbolX, guiTop
+ patternSymbolY, 16 * textureJ, 16 * textureI, 16, 16);
drawTexturedModalRect(guiLeft + patternSymbolX, guiTop + patternSymbolY, 16 * textureJ, 16 * textureI, 16, 16);
}
}
public boolean intersectsWith(int i, int j) {
if (i >= patternSymbolX && i <= patternSymbolX + 16
&& j >= patternSymbolY && j <= patternSymbolY + 16)
if (i >= patternSymbolX && i <= patternSymbolX + 16 && j >= patternSymbolY && j <= patternSymbolY + 16)
return true;
return false;
@ -85,8 +78,7 @@ public class GuiFiller extends GuiBuildCraft {
int i2 = (lastX - guiLeft) + 12;
int k2 = lastY - guiTop - 12;
int l2 = fontRenderer.getStringWidth(tag);
drawGradientRect(i2 - 3, k2 - 3, i2 + l2 + 3, k2 + 8 + 3,
0xc0000000, 0xc0000000);
drawGradientRect(i2 - 3, k2 - 3, i2 + l2 + 3, k2 + 8 + 3, 0xc0000000, 0xc0000000);
fontRenderer.drawStringWithShadow(tag, i2, k2, -1);
}
}

View file

@ -9,8 +9,7 @@ import net.minecraft.src.forge.IGuiHandler;
public class GuiHandler implements IGuiHandler {
@Override
public Object getGuiElement(int ID, EntityPlayer player, World world,
int x, int y, int z) {
public Object getGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
if (!world.blockExists(x, y, z))
return null;

View file

@ -35,10 +35,8 @@ public class GuiTemplate extends GuiBuildCraft {
@Override
protected void drawGuiContainerForegroundLayer() {
fontRenderer.drawString(template.getInvName(),
getCenteredOffset(template.getInvName()), 6, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8,
ySize - 152, 0x404040);
fontRenderer.drawString(template.getInvName(), getCenteredOffset(template.getInvName()), 6, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, ySize - 152, 0x404040);
if (editMode && ((new Date()).getTime() / 100) % 8 >= 4)
fontRenderer.drawString(template.name + "|", 51, 62, 0x404040);
@ -48,8 +46,7 @@ public class GuiTemplate extends GuiBuildCraft {
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
int i = mc.renderEngine
.getTexture("/net/minecraft/src/buildcraft/builders/gui/template_gui.png");
int i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/builders/gui/template_gui.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(i);
int j = (width - xSize) / 2;
@ -84,8 +81,7 @@ public class GuiTemplate extends GuiBuildCraft {
return;
} else if (c == 8) {
if (template.name.length() > 0)
template.name = template.name.substring(0,
template.name.length() - 1);
template.name = template.name.substring(0, template.name.length() - 1);
return;
} else if (Character.isLetterOrDigit(c) || c == ' ') {

View file

@ -31,6 +31,7 @@ import net.minecraft.src.forge.NetworkMod;
import cpw.mods.fml.client.SpriteHelper;
public class CoreProxy {
private static boolean registeredOverrideTextureMap = false;
public static String getCurrentLanguage() {
@ -44,12 +45,10 @@ public class CoreProxy {
public static void registerBlock(Block block) {
Item.itemsList[block.blockID] = null;
Item.itemsList[block.blockID] = new ItemBlockBuildCraft(
block.blockID - 256, block.getBlockName());
Item.itemsList[block.blockID] = new ItemBlockBuildCraft(block.blockID - 256, block.getBlockName());
}
public static void registerTileEntity(
@SuppressWarnings("rawtypes") Class clas, String ident) {
public static void registerTileEntity(@SuppressWarnings("rawtypes") Class clas, String ident) {
ModLoader.registerTileEntity(clas, ident);
}
@ -57,8 +56,7 @@ public class CoreProxy {
* public static void registerGUI(BaseModMp basemod, int id) {
* ModLoaderMp.registerGUI(basemod, id); }
*/
public static void onCraftingPickup(World world, EntityPlayer player,
ItemStack stack) {
public static void onCraftingPickup(World world, EntityPlayer player, ItemStack stack) {
stack.onCrafting(world, player, stack.stackSize);
}
@ -74,13 +72,9 @@ public class CoreProxy {
return new File(Minecraft.getMinecraftDir(), "/buildcraft/");
}
public static void sendToPlayers(Packet packet, World w, int x, int y,
int z, int maxDistance, NetworkMod mod) {
}
public static void sendToPlayers(Packet packet, World w, int x, int y, int z, int maxDistance, NetworkMod mod) {}
public static void sendToPlayer(EntityPlayer entityplayer,
BuildCraftPacket packet) {
}
public static void sendToPlayer(EntityPlayer entityplayer, BuildCraftPacket packet) {}
public static void sendToServer(Packet packet) {
// ModLoaderMp.sendPacket(mod, packet);
@ -105,12 +99,10 @@ public class CoreProxy {
char[] map = new char[256];
// every slot is free!
Arrays.fill(map, '1');
SpriteHelper.registerSpriteMapForFile(
BuildCraftCore.externalBuildCraftTexture, new String(map));
SpriteHelper.registerSpriteMapForFile(BuildCraftCore.externalBuildCraftTexture, new String(map));
registeredOverrideTextureMap = true;
}
return ModLoader.addOverride(BuildCraftCore.externalBuildCraftTexture,
pathToTexture) + 256;
return ModLoader.addOverride(BuildCraftCore.externalBuildCraftTexture, pathToTexture) + 256;
}
public static long getHash(IBlockAccess iBlockAccess) {
@ -118,8 +110,7 @@ public class CoreProxy {
return 0;
}
public static void TakenFromCrafting(EntityPlayer entityplayer,
ItemStack itemstack, IInventory iinventory) {
public static void TakenFromCrafting(EntityPlayer entityplayer, ItemStack itemstack, IInventory iinventory) {
ModLoader.takenFromCrafting(entityplayer, itemstack, iinventory);
}

View file

@ -10,6 +10,7 @@ import org.lwjgl.opengl.GL11;
public abstract class GuiAdvancedInterface extends GuiBuildCraft {
public abstract class AdvancedSlot {
final public int x, y;
public AdvancedSlot(int x, int y) {
@ -19,8 +20,7 @@ public abstract class GuiAdvancedInterface extends GuiBuildCraft {
public String getDescription() {
if (getItemStack() != null)
return getItemStack().getItem().getItemDisplayName(
getItemStack());
return getItemStack().getItem().getItemDisplayName(getItemStack());
else
return "";
}
@ -52,8 +52,7 @@ public abstract class GuiAdvancedInterface extends GuiBuildCraft {
int textureI = getTextureIndex() >> 4;
int textureJ = getTextureIndex() - textureI * 16;
drawTexturedModalRect(cornerX + x, cornerY + y,
16 * textureJ, 16 * textureI, 16, 16);
drawTexturedModalRect(cornerX + x, cornerY + y, 16 * textureJ, 16 * textureI, 16, 16);
}
}
@ -63,16 +62,15 @@ public abstract class GuiAdvancedInterface extends GuiBuildCraft {
int cornerY = (height - ySize) / 2;
itemRenderer.zLevel = 200F;
itemRenderer.renderItemIntoGUI(fontRenderer, mc.renderEngine,
item, cornerX + x, cornerY + y);
itemRenderer.renderItemOverlayIntoGUI(fontRenderer,
mc.renderEngine, item, cornerX + x, cornerY + y);
itemRenderer.renderItemIntoGUI(fontRenderer, mc.renderEngine, item, cornerX + x, cornerY + y);
itemRenderer.renderItemOverlayIntoGUI(fontRenderer, mc.renderEngine, item, cornerX + x, cornerY + y);
itemRenderer.zLevel = 0.0F;
}
}
}
public class ItemSlot extends AdvancedSlot {
public ItemStack stack;
public ItemSlot(int x, int y) {
@ -132,8 +130,7 @@ public abstract class GuiAdvancedInterface extends GuiBuildCraft {
GL11.glEnable(32826 /* GL_RESCALE_NORMAL_EXT */);
int i1 = 240;
int k1 = 240;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit,
i1 / 1.0F, k1 / 1.0F);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, i1 / 1.0F, k1 / 1.0F);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
for (int s = 0; s < slots.length; ++s) {
@ -165,8 +162,7 @@ public abstract class GuiAdvancedInterface extends GuiBuildCraft {
int i2 = (lastX - cornerX) + 12;
int k2 = lastY - cornerY - 12;
int l2 = fontRenderer.getStringWidth(s);
drawGradientRect(i2 - 3, k2 - 3, i2 + l2 + 3, k2 + 8 + 3,
0xc0000000, 0xc0000000);
drawGradientRect(i2 - 3, k2 - 3, i2 + l2 + 3, k2 + 8 + 3, 0xc0000000, 0xc0000000);
fontRenderer.drawStringWithShadow(s, i2, k2, -1);
}
}

View file

@ -25,8 +25,7 @@ public abstract class GuiBuildCraft extends GuiContainer {
public void add(Ledger ledger) {
this.ledgers.add(ledger);
if (SessionVars.getOpenedLedger() != null
&& ledger.getClass().equals(SessionVars.getOpenedLedger()))
if (SessionVars.getOpenedLedger() != null && ledger.getClass().equals(SessionVars.getOpenedLedger()))
ledger.setFullyOpen();
}
@ -80,9 +79,7 @@ public abstract class GuiBuildCraft extends GuiContainer {
String tooltip = ledger.getTooltip();
int textWidth = fontRenderer.getStringWidth(tooltip);
drawGradientRect(startX - 3, startY - 3,
startX + textWidth + 3, startY + 8 + 3, 0xc0000000,
0xc0000000);
drawGradientRect(startX - 3, startY - 3, startX + textWidth + 3, startY + 8 + 3, 0xc0000000, 0xc0000000);
fontRenderer.drawStringWithShadow(tooltip, startX, startY, -1);
}
}
@ -95,8 +92,7 @@ public abstract class GuiBuildCraft extends GuiContainer {
// Default action only if the mouse click was not handled by the
// ledger itself.
if (ledger != null
&& !ledger.handleMouseClicked(x, y, mouseButton)) {
if (ledger != null && !ledger.handleMouseClicked(x, y, mouseButton)) {
for (Ledger other : ledgers)
if (other != ledger && other.isOpen())
@ -113,6 +109,7 @@ public abstract class GuiBuildCraft extends GuiContainer {
* Side ledger for guis
*/
protected abstract class Ledger {
private boolean open;
protected int overlayColor = 0xffffff;
@ -155,11 +152,9 @@ public abstract class GuiBuildCraft extends GuiContainer {
return false;
}
public boolean intersectsWith(int mouseX, int mouseY, int shiftX,
int shiftY) {
public boolean intersectsWith(int mouseX, int mouseY, int shiftX, int shiftY) {
if (mouseX >= shiftX && mouseX <= shiftX + currentWidth
&& mouseY >= shiftY && mouseY <= shiftY + getHeight())
if (mouseX >= shiftX && mouseX <= shiftX + currentWidth && mouseY >= shiftY && mouseY <= shiftY + getHeight())
return true;
return false;
@ -203,15 +198,12 @@ public abstract class GuiBuildCraft extends GuiContainer {
GL11.glColor4f(colorR, colorG, colorB, 1.0F);
mc.renderEngine.bindTexture(texture);
drawTexturedModalRect(x, y, 0, 256 - currentHeight, 4,
currentHeight);
drawTexturedModalRect(x + 4, y, 256 - currentWidth + 4, 0,
currentWidth - 4, 4);
drawTexturedModalRect(x, y, 0, 256 - currentHeight, 4, currentHeight);
drawTexturedModalRect(x + 4, y, 256 - currentWidth + 4, 0, currentWidth - 4, 4);
// Add in top left corner again
drawTexturedModalRect(x, y, 0, 0, 4, 4);
drawTexturedModalRect(x + 4, y + 4, 256 - currentWidth + 4,
256 - currentHeight + 4, currentWidth - 4,
drawTexturedModalRect(x + 4, y + 4, 256 - currentWidth + 4, 256 - currentHeight + 4, currentWidth - 4,
currentHeight - 4);
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0F);
@ -224,8 +216,7 @@ public abstract class GuiBuildCraft extends GuiContainer {
mc.renderEngine.bindTexture(tex);
int textureRow = iconIndex >> 4;
int textureColumn = iconIndex - 16 * textureRow;
drawTexturedModalRect(x, y, 16 * textureColumn, 16 * textureRow,
16, 16);
drawTexturedModalRect(x, y, 16 * textureColumn, 16 * textureRow, 16, 16);
}
}
@ -241,8 +232,7 @@ public abstract class GuiBuildCraft extends GuiContainer {
initLedgers(container.inventory);
}
protected void initLedgers(IInventory inventory) {
}
protected void initLedgers(IInventory inventory) {}
@Override
protected void drawGuiContainerForegroundLayer() {

View file

@ -23,6 +23,7 @@ import org.lwjgl.opengl.GL11;
public class RenderEntityBlock extends Render {
public static class BlockInterface {
public double minX;
public double minY;
public double minZ;
@ -41,18 +42,15 @@ public class RenderEntityBlock extends Render {
return texture;
}
public float getBlockBrightness(IBlockAccess iblockaccess, int i,
int j, int k) {
public float getBlockBrightness(IBlockAccess iblockaccess, int i, int j, int k) {
return baseBlock.getBlockBrightness(iblockaccess, i, j, k);
}
}
public RenderEntityBlock() {
}
public RenderEntityBlock() {}
@Override
public void doRender(Entity entity, double i, double j, double k, float f,
float f1) {
public void doRender(Entity entity, double i, double j, double k, float f, float f1) {
doRenderBlock((EntityBlock) entity, i, j, k);
}
@ -82,15 +80,13 @@ public class RenderEntityBlock extends Render {
util.maxZ = (remainZ > 1.0 ? 1.0 : remainZ);
GL11.glPushMatrix();
GL11.glTranslatef((float) i + 0.5F, (float) j + 0.5F,
(float) k + 0.5F);
GL11.glTranslatef((float) i + 0.5F, (float) j + 0.5F, (float) k + 0.5F);
GL11.glRotatef(entity.rotationX, 1, 0, 0);
GL11.glRotatef(entity.rotationY, 0, 1, 0);
GL11.glRotatef(entity.rotationZ, 0, 0, 1);
GL11.glTranslatef(iBase, jBase, kBase);
MinecraftForgeClient
.bindTexture(BuildCraftCore.customBuildCraftTexture);
MinecraftForgeClient.bindTexture(BuildCraftCore.customBuildCraftTexture);
int lightX, lightY, lightZ;
@ -99,16 +95,14 @@ public class RenderEntityBlock extends Render {
lightZ = (int) (Math.floor(entity.posZ) + kBase);
GL11.glDisable(2896 /* GL_LIGHTING */);
renderBlock(util, world, lightX, lightY, lightZ, false,
true);
renderBlock(util, world, lightX, lightY, lightZ, false, true);
GL11.glEnable(2896 /* GL_LIGHTING */);
GL11.glPopMatrix();
}
}
public static void renderBlock(BlockInterface block,
IBlockAccess blockAccess, int i, int j, int k, boolean doLight,
public static void renderBlock(BlockInterface block, IBlockAccess blockAccess, int i, int j, int k, boolean doLight,
boolean doTessellating) {
float f = 0.5F;
float f1 = 1.0F;
@ -130,8 +124,7 @@ public class RenderEntityBlock extends Render {
tessellator.setColorOpaque_F(f * f5, f * f5, f * f5);
}
renderBottomFace(block, -0.5D, -0.5D, -0.5D,
block.getBlockTextureFromSide(0));
renderBottomFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(0));
if (doLight) {
f5 = block.getBlockBrightness(blockAccess, i, j, k);
@ -140,8 +133,7 @@ public class RenderEntityBlock extends Render {
tessellator.setColorOpaque_F(f1 * f5, f1 * f5, f1 * f5);
}
renderTopFace(block, -0.5D, -0.5D, -0.5D,
block.getBlockTextureFromSide(1));
renderTopFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(1));
if (doLight) {
f5 = block.getBlockBrightness(blockAccess, i, j, k);
@ -150,8 +142,7 @@ public class RenderEntityBlock extends Render {
tessellator.setColorOpaque_F(f2 * f5, f2 * f5, f2 * f5);
}
renderEastFace(block, -0.5D, -0.5D, -0.5D,
block.getBlockTextureFromSide(2));
renderEastFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(2));
if (doLight) {
f5 = block.getBlockBrightness(blockAccess, i, j, k);
@ -160,8 +151,7 @@ public class RenderEntityBlock extends Render {
tessellator.setColorOpaque_F(f2 * f5, f2 * f5, f2 * f5);
}
renderWestFace(block, -0.5D, -0.5D, -0.5D,
block.getBlockTextureFromSide(3));
renderWestFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(3));
if (doLight) {
f5 = block.getBlockBrightness(blockAccess, i, j, k);
@ -170,8 +160,7 @@ public class RenderEntityBlock extends Render {
tessellator.setColorOpaque_F(f3 * f5, f3 * f5, f3 * f5);
}
renderNorthFace(block, -0.5D, -0.5D, -0.5D,
block.getBlockTextureFromSide(4));
renderNorthFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(4));
if (doLight) {
f5 = block.getBlockBrightness(blockAccess, i, j, k);
@ -180,15 +169,13 @@ public class RenderEntityBlock extends Render {
tessellator.setColorOpaque_F(f3 * f5, f3 * f5, f3 * f5);
}
renderSouthFace(block, -0.5D, -0.5D, -0.5D,
block.getBlockTextureFromSide(5));
renderSouthFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(5));
if (doTessellating)
tessellator.draw();
}
public static void renderBottomFace(BlockInterface block, double d,
double d1, double d2, int i) {
public static void renderBottomFace(BlockInterface block, double d, double d1, double d2, int i) {
Tessellator tessellator = Tessellator.instance;
int j = (i & 0xf) << 4;
@ -217,8 +204,7 @@ public class RenderEntityBlock extends Render {
tessellator.addVertexWithUV(d8, d9, d11, d4, d6);
}
public static void renderTopFace(BlockInterface block, double d, double d1,
double d2, int i) {
public static void renderTopFace(BlockInterface block, double d, double d1, double d2, int i) {
Tessellator tessellator = Tessellator.instance;
int j = (i & 0xf) << 4;
@ -247,8 +233,7 @@ public class RenderEntityBlock extends Render {
tessellator.addVertexWithUV(d7, d9, d11, d3, d6);
}
public static void renderEastFace(BlockInterface block, double d,
double d1, double d2, int i) {
public static void renderEastFace(BlockInterface block, double d, double d1, double d2, int i) {
Tessellator tessellator = Tessellator.instance;
int j = (i & 0xf) << 4;
@ -278,8 +263,7 @@ public class RenderEntityBlock extends Render {
tessellator.addVertexWithUV(d8, d10, d12, d4, d6);
}
public static void renderWestFace(BlockInterface block, double d,
double d1, double d2, int i) {
public static void renderWestFace(BlockInterface block, double d, double d1, double d2, int i) {
Tessellator tessellator = Tessellator.instance;
int j = (i & 0xf) << 4;
@ -309,8 +293,7 @@ public class RenderEntityBlock extends Render {
tessellator.addVertexWithUV(d9, d11, d12, d4, d5);
}
public static void renderNorthFace(BlockInterface block, double d,
double d1, double d2, int i) {
public static void renderNorthFace(BlockInterface block, double d, double d1, double d2, int i) {
Tessellator tessellator = Tessellator.instance;
int j = (i & 0xf) << 4;
@ -340,8 +323,7 @@ public class RenderEntityBlock extends Render {
tessellator.addVertexWithUV(d8, d9, d12, d4, d6);
}
public static void renderSouthFace(BlockInterface block, double d,
double d1, double d2, int i) {
public static void renderSouthFace(BlockInterface block, double d, double d1, double d2, int i) {
Tessellator tessellator = Tessellator.instance;
int j = (i & 0xf) << 4;

View file

@ -10,8 +10,7 @@ import org.lwjgl.opengl.GL11;
public class RenderLaser extends Render {
protected ModelBase model = new ModelBase() {
};
protected ModelBase model = new ModelBase() {};
private ModelRenderer box;
public RenderLaser() {
@ -23,15 +22,13 @@ public class RenderLaser extends Render {
}
@Override
public void doRender(Entity entity, double x, double y, double z, float f,
float f1) {
public void doRender(Entity entity, double x, double y, double z, float f, float f1) {
doRender((EntityLaser) entity, x, y, z, f, f1);
entity.setAngles(45, 180);
}
private void doRender(EntityLaser laser, double x, double y, double z,
float f, float f1) {
private void doRender(EntityLaser laser, double x, double y, double z, float f, float f1) {
if (laser.hidden)
return;

View file

@ -10,8 +10,7 @@ import org.lwjgl.opengl.GL11;
public class RenderRobot extends Render {
protected ModelBase model = new ModelBase() {
};
protected ModelBase model = new ModelBase() {};
private ModelRenderer box;
public RenderRobot() {
@ -23,20 +22,17 @@ public class RenderRobot extends Render {
}
@Override
public void doRender(Entity entity, double x, double y, double z, float f,
float f1) {
public void doRender(Entity entity, double x, double y, double z, float f, float f1) {
doRender((EntityRobot) entity, x, y, z, f, f1);
}
private void doRender(EntityRobot laser, double x, double y, double z,
float f, float f1) {
private void doRender(EntityRobot laser, double x, double y, double z, float f, float f1) {
GL11.glPushMatrix();
GL11.glDisable(2896 /* GL_LIGHTING */);
GL11.glTranslated(x, y, z);
MinecraftForgeClient
.bindTexture("/net/minecraft/src/buildcraft/core/gui/robot.png");
MinecraftForgeClient.bindTexture("/net/minecraft/src/buildcraft/core/gui/robot.png");
float factor = (float) (1.0 / 16.0);

View file

@ -15,8 +15,7 @@ import net.minecraft.src.Render;
public class RenderVoid extends Render {
@Override
public void doRender(Entity entity, double d, double d1, double d2,
float f, float f1) {
public void doRender(Entity entity, double d, double d1, double d2, float f, float f1) {
// TODO Auto-generated method stub
}

View file

@ -14,11 +14,12 @@ import net.minecraft.src.forge.MinecraftForgeClient;
import cpw.mods.fml.client.FMLTextureFX;
public class TextureLiquidsFX extends FMLTextureFX {
private final int redMin, redMax, greenMin, greenMax, blueMin, blueMax;
private final String texture;
public TextureLiquidsFX(int redMin, int redMax, int greenMin, int greenMax,
int blueMin, int blueMax, int spriteIndex, String texture) {
public TextureLiquidsFX(int redMin, int redMax, int greenMin, int greenMax, int blueMin, int blueMax, int spriteIndex,
String texture) {
super(spriteIndex);
this.redMin = redMin;
@ -59,15 +60,13 @@ public class TextureLiquidsFX extends FMLTextureFX {
var3 += this.red[r + g * tileSizeBase];
}
this.green[i + j * tileSizeBase] = var3 / 3.3F
+ this.blue[i + j * tileSizeBase] * 0.8F;
this.green[i + j * tileSizeBase] = var3 / 3.3F + this.blue[i + j * tileSizeBase] * 0.8F;
}
}
for (int i = 0; i < tileSizeBase; ++i) {
for (int j = 0; j < tileSizeBase; ++j) {
this.blue[i + j * tileSizeBase] += this.alpha[i + j
* tileSizeBase] * 0.05F;
this.blue[i + j * tileSizeBase] += this.alpha[i + j * tileSizeBase] * 0.05F;
if (this.blue[i + j * tileSizeBase] < 0.0F)
this.blue[i + j * tileSizeBase] = 0.0F;

View file

@ -10,17 +10,13 @@ public class ConnectionHandler implements IConnectionHandler {
@Override
public void onConnect(NetworkManager network) {
MessageManager.getInstance().registerChannel(network,
new PacketHandler(), DefaultProps.NET_CHANNEL_NAME);
MessageManager.getInstance().registerChannel(network, new PacketHandler(), DefaultProps.NET_CHANNEL_NAME);
}
@Override
public void onLogin(NetworkManager network, Packet1Login login) {
}
public void onLogin(NetworkManager network, Packet1Login login) {}
@Override
public void onDisconnect(NetworkManager network, String message,
Object[] args) {
}
public void onDisconnect(NetworkManager network, String message, Object[] args) {}
}

View file

@ -13,11 +13,9 @@ import net.minecraft.src.forge.IPacketHandler;
public class PacketHandler implements IPacketHandler {
@Override
public void onPacketData(NetworkManager network, String channel,
byte[] bytes) {
public void onPacketData(NetworkManager network, String channel, byte[] bytes) {
DataInputStream data = new DataInputStream(new ByteArrayInputStream(
bytes));
DataInputStream data = new DataInputStream(new ByteArrayInputStream(bytes));
try {
NetClientHandler net = (NetClientHandler) network.getNetHandler();

View file

@ -13,8 +13,7 @@ import net.minecraft.src.InventoryPlayer;
public class ContainerEngine extends ContainerEngineRoot {
public ContainerEngine(InventoryPlayer inventoryplayer,
TileEngine tileEngine) {
public ContainerEngine(InventoryPlayer inventoryplayer, TileEngine tileEngine) {
super(inventoryplayer, tileEngine);
// TODO Auto-generated constructor stub
}

View file

@ -20,8 +20,7 @@ import org.lwjgl.opengl.GL11;
public class GuiCombustionEngine extends GuiEngine {
public GuiCombustionEngine(InventoryPlayer inventoryplayer,
TileEngine tileEngine) {
public GuiCombustionEngine(InventoryPlayer inventoryplayer, TileEngine tileEngine) {
super(new ContainerEngine(inventoryplayer, tileEngine));
}
@ -30,14 +29,12 @@ public class GuiCombustionEngine extends GuiEngine {
super.drawGuiContainerForegroundLayer();
String title = StringUtil.localize("tile.engineIron");
fontRenderer.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8,
(ySize - 96) + 2, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040);
}
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
int i = mc.renderEngine
.getTexture("/net/minecraft/src/buildcraft/energy/gui/combustion_engine_gui.png");
int i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/energy/gui/combustion_engine_gui.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(i);
int j = (width - xSize) / 2;
@ -48,21 +45,17 @@ public class GuiCombustionEngine extends GuiEngine {
EngineIron engineIron = ((EngineIron) engine.engine);
if (engine.getScaledBurnTime(58) > 0)
displayGauge(j, k, 19, 104, engine.getScaledBurnTime(58),
engineIron.liquidId);
displayGauge(j, k, 19, 104, engine.getScaledBurnTime(58), engineIron.liquidId);
if (engineIron.getScaledCoolant(58) > 0)
displayGauge(j, k, 19, 122, engineIron.getScaledCoolant(58),
engineIron.coolantId);
displayGauge(j, k, 19, 122, engineIron.getScaledCoolant(58), engineIron.coolantId);
}
private void displayGauge(int j, int k, int line, int col, int squaled,
int liquidId) {
private void displayGauge(int j, int k, int line, int col, int squaled, int liquidId) {
Object o = null;
int liquidImgIndex = 0;
if (liquidId < Block.blocksList.length
&& Block.blocksList[liquidId] != null) {
if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null) {
o = Block.blocksList[liquidId];
liquidImgIndex = Block.blocksList[liquidId].blockIndexInTexture;
} else if (Item.itemsList[liquidId] != null) {
@ -74,8 +67,7 @@ public class GuiCombustionEngine extends GuiEngine {
return;
if (o instanceof ITextureProvider)
MinecraftForgeClient.bindTexture(((ITextureProvider) o)
.getTextureFile());
MinecraftForgeClient.bindTexture(((ITextureProvider) o).getTextureFile());
else
MinecraftForgeClient.bindTexture("/terrain.png");
@ -95,16 +87,14 @@ public class GuiCombustionEngine extends GuiEngine {
squaled = 0;
}
drawTexturedModalRect(j + col, k + line + 58 - x - start,
imgColumn * 16, imgLine * 16, 16, 16 - (16 - x));
drawTexturedModalRect(j + col, k + line + 58 - x - start, imgColumn * 16, imgLine * 16, 16, 16 - (16 - x));
start = start + 16;
if (x == 0 || squaled == 0)
break;
}
int i = mc.renderEngine
.getTexture("/net/minecraft/src/buildcraft/energy/gui/combustion_engine_gui.png");
int i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/energy/gui/combustion_engine_gui.png");
mc.renderEngine.bindTexture(i);
drawTexturedModalRect(j + col, k + line, 176, 0, 16, 60);

View file

@ -33,22 +33,13 @@ public abstract class GuiEngine extends GuiBuildCraft {
if (!isFullyOpened())
return;
fontRenderer.drawStringWithShadow(
StringUtil.localize("gui.energy"), x + 22, y + 8,
headerColour);
fontRenderer.drawStringWithShadow(
StringUtil.localize("gui.currentOutput") + ":", x + 22,
y + 20, subheaderColour);
fontRenderer.drawString(engine.getCurrentOutput() + " MJ/t",
x + 22, y + 32, textColour);
fontRenderer.drawStringWithShadow(StringUtil.localize("gui.stored")
+ ":", x + 22, y + 44, subheaderColour);
fontRenderer.drawString(engine.getEnergyStored() + " MJ", x + 22,
y + 56, textColour);
fontRenderer.drawStringWithShadow(StringUtil.localize("gui.heat")
+ ":", x + 22, y + 68, subheaderColour);
fontRenderer.drawString(((double) engine.getHeat() / (double) 10)
+ " °C", x + 22, y + 80, textColour);
fontRenderer.drawStringWithShadow(StringUtil.localize("gui.energy"), x + 22, y + 8, headerColour);
fontRenderer.drawStringWithShadow(StringUtil.localize("gui.currentOutput") + ":", x + 22, y + 20, subheaderColour);
fontRenderer.drawString(engine.getCurrentOutput() + " MJ/t", x + 22, y + 32, textColour);
fontRenderer.drawStringWithShadow(StringUtil.localize("gui.stored") + ":", x + 22, y + 44, subheaderColour);
fontRenderer.drawString(engine.getEnergyStored() + " MJ", x + 22, y + 56, textColour);
fontRenderer.drawStringWithShadow(StringUtil.localize("gui.heat") + ":", x + 22, y + 68, subheaderColour);
fontRenderer.drawString(((double) engine.getHeat() / (double) 10) + " °C", x + 22, y + 80, textColour);
}

View file

@ -9,8 +9,7 @@ import net.minecraft.src.forge.IGuiHandler;
public class GuiHandler implements IGuiHandler {
@Override
public Object getGuiElement(int ID, EntityPlayer player, World world,
int x, int y, int z) {
public Object getGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
if (!world.blockExists(x, y, z))
return null;

View file

@ -25,14 +25,12 @@ public class GuiSteamEngine extends GuiEngine {
super.drawGuiContainerForegroundLayer();
String title = StringUtil.localize("tile.engineStone");
fontRenderer.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8,
(ySize - 96) + 2, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040);
}
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
int i = mc.renderEngine
.getTexture("/net/minecraft/src/buildcraft/energy/gui/steam_engine_gui.png");
int i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/energy/gui/steam_engine_gui.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(i);
int j = (width - xSize) / 2;
@ -43,8 +41,7 @@ public class GuiSteamEngine extends GuiEngine {
if (engine.getScaledBurnTime(12) > 0) {
int l = engine.getScaledBurnTime(12);
drawTexturedModalRect(j + 80, (k + 24 + 12) - l, 176, 12 - l, 14,
l + 2);
drawTexturedModalRect(j + 80, (k + 24 + 12) - l, 176, 12 - l, 14, l + 2);
}
}
}

View file

@ -22,11 +22,9 @@ import net.minecraft.src.forge.MinecraftForgeClient;
import org.lwjgl.opengl.GL11;
public class RenderEngine extends TileEntitySpecialRenderer implements
IInventoryRenderer {
public class RenderEngine extends TileEntitySpecialRenderer implements IInventoryRenderer {
private ModelBase model = new ModelBase() {
};
private ModelBase model = new ModelBase() {};
private ModelRenderer box;
private ModelRenderer trunk;
@ -73,18 +71,15 @@ public class RenderEngine extends TileEntitySpecialRenderer implements
}
@Override
public void renderTileEntityAt(TileEntity tileentity, double x, double y,
double z, float f) {
public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) {
Engine engine = ((IEngineProvider) tileentity).getEngine();
if (engine != null)
render(engine.getEnergyStage(), engine.progress,
engine.orientation, engine.getTextureFile(), x, y, z);
render(engine.getEnergyStage(), engine.progress, engine.orientation, engine.getTextureFile(), x, y, z);
}
private void render(EnergyStage energy, float progress,
Orientations orientation, String baseTexture, double x, double y,
private void render(EnergyStage energy, float progress, Orientations orientation, String baseTexture, double x, double y,
double z) {
if (BuildCraftCore.render == RenderMode.NoDynamic)
@ -154,26 +149,21 @@ public class RenderEngine extends TileEntitySpecialRenderer implements
box.render(factor);
GL11.glTranslatef(translate[0] * translatefact, translate[1]
* translatefact, translate[2] * translatefact);
GL11.glTranslatef(translate[0] * translatefact, translate[1] * translatefact, translate[2] * translatefact);
movingBox.render(factor);
GL11.glTranslatef(-translate[0] * translatefact, -translate[1]
* translatefact, -translate[2] * translatefact);
GL11.glTranslatef(-translate[0] * translatefact, -translate[1] * translatefact, -translate[2] * translatefact);
MinecraftForgeClient
.bindTexture("/net/minecraft/src/buildcraft/energy/gui/chamber.png");
MinecraftForgeClient.bindTexture("/net/minecraft/src/buildcraft/energy/gui/chamber.png");
float chamberf = 2F / 16F;
for (int i = 0; i <= step + 2; i += 2) {
chamber.render(factor);
GL11.glTranslatef(translate[0] * chamberf, translate[1] * chamberf,
translate[2] * chamberf);
GL11.glTranslatef(translate[0] * chamberf, translate[1] * chamberf, translate[2] * chamberf);
}
for (int i = 0; i <= step + 2; i += 2)
GL11.glTranslatef(-translate[0] * chamberf, -translate[1]
* chamberf, -translate[2] * chamberf);
GL11.glTranslatef(-translate[0] * chamberf, -translate[1] * chamberf, -translate[2] * chamberf);
String texture = "";

View file

@ -16,8 +16,7 @@ import net.minecraft.src.forge.ITextureProvider;
public class TextureFuelFX extends TextureLiquidsFX {
public TextureFuelFX() {
super(150, 250, 150, 250, 0, 10, BuildCraftEnergy.fuel
.getIconFromDamage(0),
((ITextureProvider) BuildCraftEnergy.fuel).getTextureFile());
super(150, 250, 150, 250, 0, 10, BuildCraftEnergy.fuel.getIconFromDamage(0), ((ITextureProvider) BuildCraftEnergy.fuel)
.getTextureFile());
}
}

View file

@ -16,8 +16,7 @@ import net.minecraft.src.forge.ITextureProvider;
public class TextureOilFX extends TextureLiquidsFX {
public TextureOilFX() {
super(10, 31, 10, 31, 10, 31,
BuildCraftEnergy.oilStill.blockIndexInTexture,
super(10, 31, 10, 31, 10, 31, BuildCraftEnergy.oilStill.blockIndexInTexture,
((ITextureProvider) BuildCraftEnergy.oilStill).getTextureFile());
}
}

View file

@ -18,6 +18,7 @@ import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLTextureFX;
public class TextureOilFlowFX extends FMLTextureFX {
public TextureOilFlowFX() {
super(BuildCraftEnergy.oilMoving.blockIndexInTexture + 1);
@ -37,8 +38,7 @@ public class TextureOilFlowFX extends FMLTextureFX {
@Override
public void bindImage(RenderEngine renderengine) {
GL11.glBindTexture(3553,
renderengine.getTexture(BuildCraftCore.customBuildCraftTexture));
GL11.glBindTexture(3553, renderengine.getTexture(BuildCraftCore.customBuildCraftTexture));
}
@Override
@ -53,14 +53,12 @@ public class TextureOilFlowFX extends FMLTextureFX {
f += field_1138_g[k1 + i2 * tileSizeBase];
}
field_1137_h[i + k * tileSizeBase] = f / 3.2F
+ field_1136_i[i + k * tileSizeBase] * 0.8F;
field_1137_h[i + k * tileSizeBase] = f / 3.2F + field_1136_i[i + k * tileSizeBase] * 0.8F;
}
for (int j = 0; j < tileSizeBase; j++)
for (int l = 0; l < tileSizeBase; l++) {
field_1136_i[j + l * tileSizeBase] += field_1135_j[j + l
* tileSizeBase] * 0.05F;
field_1136_i[j + l * tileSizeBase] += field_1135_j[j + l * tileSizeBase] * 0.05F;
if (field_1136_i[j + l * tileSizeBase] < 0.0F)
field_1136_i[j + l * tileSizeBase] = 0.0F;
field_1135_j[j + l * tileSizeBase] -= 0.3F;
@ -72,8 +70,7 @@ public class TextureOilFlowFX extends FMLTextureFX {
field_1137_h = field_1138_g;
field_1138_g = af;
for (int i1 = 0; i1 < tileSizeSquare; i1++) {
float f1 = field_1138_g[i1 - field_1134_k * tileSizeBase
& tileSizeSquareMask];
float f1 = field_1138_g[i1 - field_1134_k * tileSizeBase & tileSizeSquareMask];
if (f1 > 1.0F)
f1 = 1.0F;
if (f1 < 0.0F)

View file

@ -23,15 +23,13 @@ public abstract class BlockMachineRoot extends BlockContainer {
}
@Override
public float getBlockBrightness(IBlockAccess iblockaccess, int i, int j,
int k) {
public float getBlockBrightness(IBlockAccess iblockaccess, int i, int j, int k) {
for (int x = i - 1; x <= i + 1; ++x)
for (int y = j - 1; y <= j + 1; ++y)
for (int z = k - 1; z <= k + 1; ++z) {
TileEntity tile = iblockaccess.getBlockTileEntity(x, y, z);
if (tile instanceof IMachine
&& ((IMachine) tile).isActive())
if (tile instanceof IMachine && ((IMachine) tile).isActive())
return super.getBlockBrightness(iblockaccess, i, j, k) + 0.5F;
}

View file

@ -18,8 +18,7 @@ import org.lwjgl.opengl.GL11;
public class GuiAutoCrafting extends GuiBuildCraft {
public GuiAutoCrafting(InventoryPlayer inventoryplayer, World world,
TileAutoWorkbench tile) {
public GuiAutoCrafting(InventoryPlayer inventoryplayer, World world, TileAutoWorkbench tile) {
super(new ContainerAutoWorkbench(inventoryplayer, tile));
}
@ -33,8 +32,7 @@ public class GuiAutoCrafting extends GuiBuildCraft {
protected void drawGuiContainerForegroundLayer() {
String title = StringUtil.localize("tile.autoWorkbenchBlock");
fontRenderer.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8,
(ySize - 96) + 2, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040);
}
@Override

View file

@ -9,8 +9,7 @@ import net.minecraft.src.forge.IGuiHandler;
public class GuiHandler implements IGuiHandler {
@Override
public Object getGuiElement(int ID, EntityPlayer player, World world,
int x, int y, int z) {
public Object getGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
if (!world.blockExists(x, y, z))
return null;
@ -22,8 +21,7 @@ public class GuiHandler implements IGuiHandler {
case GuiIds.AUTO_CRAFTING_TABLE:
if (!(tile instanceof TileAutoWorkbench))
return null;
return new GuiAutoCrafting(player.inventory, world,
(TileAutoWorkbench) tile);
return new GuiAutoCrafting(player.inventory, world, (TileAutoWorkbench) tile);
case GuiIds.REFINERY:
if (!(tile instanceof TileRefinery))

View file

@ -14,8 +14,7 @@ public class GuiHopper extends GuiContainer {
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
int i = mc.renderEngine
.getTexture("/net/minecraft/src/buildcraft/factory/gui/hopper_gui.png");
int i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/factory/gui/hopper_gui.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(i);
int j = (width - xSize) / 2;

View file

@ -43,16 +43,14 @@ public class GuiRefinery extends GuiAdvancedInterface {
fontRenderer.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRenderer.drawString("->", 63, 59, 0x404040);
fontRenderer.drawString("<-", 106, 59, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8,
(ySize - 96) + 2, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040);
drawForegroundSelection();
}
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
int i = mc.renderEngine
.getTexture("/net/minecraft/src/buildcraft/factory/gui/refinery_filter.png");
int i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/factory/gui/refinery_filter.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(i);
int j = (width - xSize) / 2;
@ -78,9 +76,7 @@ public class GuiRefinery extends GuiAdvancedInterface {
slot = slots[position];
if (slot != null) {
int liquidId = BuildCraftAPI
.getLiquidForFilledItem(mc.thePlayer.inventory
.getItemStack());
int liquidId = BuildCraftAPI.getLiquidForFilledItem(mc.thePlayer.inventory.getItemStack());
container.setFilter(position, liquidId, 0);
}
@ -102,8 +98,7 @@ public class GuiRefinery extends GuiAdvancedInterface {
if (filter1 != null)
liquid1Id = filter1.itemID;
RefineryRecipe recipe = BuildCraftAPI.findRefineryRecipe(liquid0Id,
BuildCraftAPI.BUCKET_VOLUME, liquid1Id,
RefineryRecipe recipe = BuildCraftAPI.findRefineryRecipe(liquid0Id, BuildCraftAPI.BUCKET_VOLUME, liquid1Id,
BuildCraftAPI.BUCKET_VOLUME);
if (recipe != null)

View file

@ -6,6 +6,7 @@ import net.minecraft.src.Tessellator;
import net.minecraft.src.TexturedQuad;
public class ModelFrustum {
/**
* The (x,y,z) vertex positions and (u,v) texture coordinates for each of
* the 8 points on a cube
@ -34,10 +35,8 @@ public class ModelFrustum {
public final float posZ2;
public String field_40673_g;
public ModelFrustum(ModelRenderer par1ModelRenderer, int textureOffsetX,
int textureOffsetY, float originX, float originY, float originZ,
int bottomWidth, int bottomDepth, int topWidth, int topDepth,
int height, float scaleFactor) {
public ModelFrustum(ModelRenderer par1ModelRenderer, int textureOffsetX, int textureOffsetY, float originX, float originY,
float originZ, int bottomWidth, int bottomDepth, int topWidth, int topDepth, int height, float scaleFactor) {
this.posX1 = originX;
this.posY1 = originY;
this.posZ1 = originZ;
@ -45,21 +44,15 @@ public class ModelFrustum {
this.vertexPositions = new PositionTextureVertex[8];
this.quadList = new TexturedQuad[6];
float bottomDeltaX = bottomWidth > topWidth ? 0
: (topWidth - bottomWidth) / 2f;
float topDeltaX = bottomWidth > topWidth ? (bottomWidth - topWidth) / 2f
: 0;
float bottomDeltaX = bottomWidth > topWidth ? 0 : (topWidth - bottomWidth) / 2f;
float topDeltaX = bottomWidth > topWidth ? (bottomWidth - topWidth) / 2f : 0;
float bottomDeltaZ = bottomDepth > topDepth ? 0
: (topDepth - bottomDepth) / 2f;
float topDeltaZ = bottomDepth > topDepth ? (bottomDepth - topDepth) / 2f
: 0;
float bottomDeltaZ = bottomDepth > topDepth ? 0 : (topDepth - bottomDepth) / 2f;
float topDeltaZ = bottomDepth > topDepth ? (bottomDepth - topDepth) / 2f : 0;
float targetX = originX
+ Math.max((float) bottomWidth, (float) topWidth);
float targetX = originX + Math.max((float) bottomWidth, (float) topWidth);
float targetY = originY + height;
float targetZ = originZ
+ Math.max((float) bottomDepth, (float) topDepth);
float targetZ = originZ + Math.max((float) bottomDepth, (float) topDepth);
this.posX2 = targetX;
this.posY2 = targetY;
@ -78,23 +71,19 @@ public class ModelFrustum {
originX = var14;
}
PositionTextureVertex var23 = new PositionTextureVertex(originX
+ bottomDeltaX, originY, originZ + bottomDeltaZ, 0.0F, 0.0F);
PositionTextureVertex var15 = new PositionTextureVertex(targetX
- bottomDeltaX, originY, originZ + bottomDeltaZ, 0.0F, 8.0F);
PositionTextureVertex var16 = new PositionTextureVertex(targetX
- topDeltaX, targetY, originZ + topDeltaZ, 8.0F, 8.0F);
PositionTextureVertex var17 = new PositionTextureVertex(originX
+ topDeltaX, targetY, originZ + topDeltaZ, 8.0F, 0.0F);
PositionTextureVertex var23 = new PositionTextureVertex(originX + bottomDeltaX, originY, originZ + bottomDeltaZ, 0.0F,
0.0F);
PositionTextureVertex var15 = new PositionTextureVertex(targetX - bottomDeltaX, originY, originZ + bottomDeltaZ, 0.0F,
8.0F);
PositionTextureVertex var16 = new PositionTextureVertex(targetX - topDeltaX, targetY, originZ + topDeltaZ, 8.0F, 8.0F);
PositionTextureVertex var17 = new PositionTextureVertex(originX + topDeltaX, targetY, originZ + topDeltaZ, 8.0F, 0.0F);
PositionTextureVertex var18 = new PositionTextureVertex(originX
+ bottomDeltaX, originY, targetZ - bottomDeltaZ, 0.0F, 0.0F);
PositionTextureVertex var19 = new PositionTextureVertex(targetX
- bottomDeltaX, originY, targetZ - bottomDeltaZ, 0.0F, 8.0F);
PositionTextureVertex var20 = new PositionTextureVertex(targetX
- topDeltaX, targetY, targetZ - topDeltaZ, 8.0F, 8.0F);
PositionTextureVertex var21 = new PositionTextureVertex(originX
+ topDeltaX, targetY, targetZ - topDeltaZ, 8.0F, 0.0F);
PositionTextureVertex var18 = new PositionTextureVertex(originX + bottomDeltaX, originY, targetZ - bottomDeltaZ, 0.0F,
0.0F);
PositionTextureVertex var19 = new PositionTextureVertex(targetX - bottomDeltaX, originY, targetZ - bottomDeltaZ, 0.0F,
8.0F);
PositionTextureVertex var20 = new PositionTextureVertex(targetX - topDeltaX, targetY, targetZ - topDeltaZ, 8.0F, 8.0F);
PositionTextureVertex var21 = new PositionTextureVertex(originX + topDeltaX, targetY, targetZ - topDeltaZ, 8.0F, 0.0F);
this.vertexPositions[0] = var23;
this.vertexPositions[1] = var15;
this.vertexPositions[2] = var16;
@ -107,36 +96,24 @@ public class ModelFrustum {
int depth = Math.max(bottomDepth, topDepth);
int width = Math.max(bottomWidth, topWidth);
this.quadList[0] = new TexturedQuad(new PositionTextureVertex[] {
var19, var15, var16, var20 }, textureOffsetX + depth + width,
textureOffsetY + depth, textureOffsetX + depth + width + depth,
textureOffsetY + depth + height,
this.quadList[0] = new TexturedQuad(new PositionTextureVertex[] { var19, var15, var16, var20 }, textureOffsetX + depth
+ width, textureOffsetY + depth, textureOffsetX + depth + width + depth, textureOffsetY + depth + height,
par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
this.quadList[1] = new TexturedQuad(new PositionTextureVertex[] {
var23, var18, var21, var17 }, textureOffsetX, textureOffsetY
+ depth, textureOffsetX + depth, textureOffsetY + depth
+ height, par1ModelRenderer.textureWidth,
this.quadList[1] = new TexturedQuad(new PositionTextureVertex[] { var23, var18, var21, var17 }, textureOffsetX,
textureOffsetY + depth, textureOffsetX + depth, textureOffsetY + depth + height, par1ModelRenderer.textureWidth,
par1ModelRenderer.textureHeight);
this.quadList[2] = new TexturedQuad(new PositionTextureVertex[] {
var19, var18, var23, var15 }, textureOffsetX + depth,
textureOffsetY, textureOffsetX + depth + width, textureOffsetY
+ depth, par1ModelRenderer.textureWidth,
this.quadList[2] = new TexturedQuad(new PositionTextureVertex[] { var19, var18, var23, var15 }, textureOffsetX + depth,
textureOffsetY, textureOffsetX + depth + width, textureOffsetY + depth, par1ModelRenderer.textureWidth,
par1ModelRenderer.textureHeight);
this.quadList[3] = new TexturedQuad(new PositionTextureVertex[] {
var16, var17, var21, var20 }, textureOffsetX + depth + width,
textureOffsetY + depth, textureOffsetX + depth + width + width,
textureOffsetY, par1ModelRenderer.textureWidth,
par1ModelRenderer.textureHeight);
this.quadList[4] = new TexturedQuad(new PositionTextureVertex[] {
var15, var23, var17, var16 }, textureOffsetX + depth,
textureOffsetY + depth, textureOffsetX + depth + width,
textureOffsetY + depth + height,
this.quadList[3] = new TexturedQuad(new PositionTextureVertex[] { var16, var17, var21, var20 }, textureOffsetX + depth
+ width, textureOffsetY + depth, textureOffsetX + depth + width + width, textureOffsetY,
par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
this.quadList[5] = new TexturedQuad(new PositionTextureVertex[] {
var18, var19, var20, var21 }, textureOffsetX + depth + width
+ depth, textureOffsetY + depth, textureOffsetX + depth + width
+ depth + width, textureOffsetY + depth + height,
this.quadList[4] = new TexturedQuad(new PositionTextureVertex[] { var15, var23, var17, var16 }, textureOffsetX + depth,
textureOffsetY + depth, textureOffsetX + depth + width, textureOffsetY + depth + height,
par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
this.quadList[5] = new TexturedQuad(new PositionTextureVertex[] { var18, var19, var20, var21 }, textureOffsetX + depth
+ width + depth, textureOffsetY + depth, textureOffsetX + depth + width + depth + width, textureOffsetY + depth
+ height, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
if (par1ModelRenderer.mirror) {
for (int var22 = 0; var22 < this.quadList.length; ++var22) {

View file

@ -12,11 +12,9 @@ import net.minecraft.src.forge.MinecraftForgeClient;
import org.lwjgl.opengl.GL11;
public class RenderHopper extends TileEntitySpecialRenderer implements
IInventoryRenderer {
public class RenderHopper extends TileEntitySpecialRenderer implements IInventoryRenderer {
private ModelBase model = new ModelBase() {
};
private ModelBase model = new ModelBase() {};
private final ModelRenderer top;
private final ModelFrustum middle;
@ -28,8 +26,7 @@ public class RenderHopper extends TileEntitySpecialRenderer implements
top.rotationPointX = 8F;
top.rotationPointY = 8F;
top.rotationPointZ = 8F;
middle = new ModelFrustum(top, 32, 0, 0, 3, 0, 8, 8, 16, 16, 7,
1F / 16F);
middle = new ModelFrustum(top, 32, 0, 0, 3, 0, 8, 8, 16, 16, 7, 1F / 16F);
bottom = new ModelRenderer(model, 0, 23);
bottom.addBox(-3F, -8F, -3F, 6, 3, 6);
bottom.rotationPointX = 8F;
@ -43,8 +40,7 @@ public class RenderHopper extends TileEntitySpecialRenderer implements
}
@Override
public void renderTileEntityAt(TileEntity var1, double x, double y,
double z, float f) {
public void renderTileEntityAt(TileEntity var1, double x, double y, double z, float f) {
render(x, y, z);
}
@ -56,12 +52,10 @@ public class RenderHopper extends TileEntitySpecialRenderer implements
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glTranslated(x, y, z);
MinecraftForgeClient
.bindTexture("/net/minecraft/src/buildcraft/factory/gui/hopper.png");
MinecraftForgeClient.bindTexture("/net/minecraft/src/buildcraft/factory/gui/hopper.png");
top.render((float) (1.0 / 16.0));
bottom.render((float) (1.0 / 16.0));
MinecraftForgeClient
.bindTexture("/net/minecraft/src/buildcraft/factory/gui/hopper_middle.png");
MinecraftForgeClient.bindTexture("/net/minecraft/src/buildcraft/factory/gui/hopper_middle.png");
middle.render(Tessellator.instance, 1F / 16F);
GL11.glEnable(GL11.GL_LIGHTING);

View file

@ -27,16 +27,14 @@ import net.minecraft.src.forge.MinecraftForgeClient;
import org.lwjgl.opengl.GL11;
public class RenderRefinery extends TileEntitySpecialRenderer implements
IInventoryRenderer {
public class RenderRefinery extends TileEntitySpecialRenderer implements IInventoryRenderer {
static final float factor = (float) (1.0 / 16.0);
private ModelRenderer tank;
private ModelRenderer magnet[] = new ModelRenderer[4];
private ModelBase model = new ModelBase() {
};
private ModelBase model = new ModelBase() {};
public RenderRefinery() {
@ -75,8 +73,7 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements
BlockInterface block = new BlockInterface();
// Retrieve the texture depending on type of item.
if (liquidId < Block.blocksList.length
&& Block.blocksList[liquidId] != null)
if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null)
block.texture = Block.blocksList[liquidId].blockIndexInTexture;
else if (Item.itemsList[liquidId] != null)
@ -115,8 +112,7 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements
}
@Override
public void renderTileEntityAt(TileEntity tileentity, double x, double y,
double z, float f) {
public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) {
render((TileRefinery) tileentity, x, y, z);
}
@ -141,8 +137,7 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements
anim = tile.getAnimationStage();
switch (tile.worldObj.getBlockMetadata(tile.xCoord, tile.yCoord,
tile.zCoord)) {
switch (tile.worldObj.getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord)) {
case 2:
angle = 90;
break;
@ -177,8 +172,7 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements
GL11.glRotatef(angle, 0, 1, 0);
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
MinecraftForgeClient
.bindTexture("/net/minecraft/src/buildcraft/factory/gui/refinery.png");
MinecraftForgeClient.bindTexture("/net/minecraft/src/buildcraft/factory/gui/refinery.png");
GL11.glTranslatef(-4F * factor, 0, -4F * factor);
tank.render(factor);
GL11.glTranslatef(4F * factor, 0, 4F * factor);
@ -220,8 +214,7 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements
if (list1 != null) {
setTextureFor(liquid1);
GL11.glCallList(list1[(int) ((float) qty1
/ (float) TileRefinery.LIQUID_PER_SLOT * (displayStages - 1))]);
GL11.glCallList(list1[(int) ((float) qty1 / (float) TileRefinery.LIQUID_PER_SLOT * (displayStages - 1))]);
}
}
GL11.glTranslatef(4F * factor, 0, 4F * factor);
@ -232,8 +225,7 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements
if (list2 != null) {
setTextureFor(liquid2);
GL11.glCallList(list2[(int) ((float) qty2
/ (float) TileRefinery.LIQUID_PER_SLOT * (displayStages - 1))]);
GL11.glCallList(list2[(int) ((float) qty2 / (float) TileRefinery.LIQUID_PER_SLOT * (displayStages - 1))]);
}
}
GL11.glTranslatef(4F * factor, 0, -4F * factor);
@ -257,15 +249,13 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements
public void setTextureFor(int liquidId) {
Object o = null;
if (liquidId < Block.blocksList.length
&& Block.blocksList[liquidId] != null)
if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null)
o = Block.blocksList[liquidId];
else
o = Item.itemsList[liquidId];
if (o instanceof ITextureProvider)
MinecraftForgeClient.bindTexture(((ITextureProvider) o)
.getTextureFile());
MinecraftForgeClient.bindTexture(((ITextureProvider) o).getTextureFile());
else
MinecraftForgeClient.bindTexture("/terrain.png");
}

View file

@ -39,8 +39,7 @@ public class RenderTank extends TileEntitySpecialRenderer {
stage.put(liquidId, d);
BlockInterface block = new BlockInterface();
if (liquidId < Block.blocksList.length
&& Block.blocksList[liquidId] != null)
if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null)
block.texture = Block.blocksList[liquidId].blockIndexInTexture;
else
block.texture = Item.itemsList[liquidId].getIconFromDamage(0);
@ -66,8 +65,7 @@ public class RenderTank extends TileEntitySpecialRenderer {
}
@Override
public void renderTileEntityAt(TileEntity tileentity, double x, double y,
double z, float f) {
public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) {
TileTank tank = ((TileTank) tileentity);
@ -83,22 +81,19 @@ public class RenderTank extends TileEntitySpecialRenderer {
Object o = null;
if (liquidId < Block.blocksList.length
&& Block.blocksList[liquidId] != null)
if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null)
o = Block.blocksList[liquidId];
else
o = Item.itemsList[liquidId];
if (o instanceof ITextureProvider)
MinecraftForgeClient.bindTexture(((ITextureProvider) o)
.getTextureFile());
MinecraftForgeClient.bindTexture(((ITextureProvider) o).getTextureFile());
else
MinecraftForgeClient.bindTexture("/terrain.png");
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F);
GL11.glCallList(d[(int) ((float) tank.getLiquidQuantity()
/ (float) (tank.getTankCapacity()) * (displayStages - 1))]);
GL11.glCallList(d[(int) ((float) tank.getLiquidQuantity() / (float) (tank.getTankCapacity()) * (displayStages - 1))]);
GL11.glEnable(2896 /* GL_LIGHTING */);
GL11.glPopMatrix();

View file

@ -10,17 +10,13 @@ public class ConnectionHandler implements IConnectionHandler {
@Override
public void onConnect(NetworkManager network) {
MessageManager.getInstance().registerChannel(network,
new PacketHandler(), DefaultProps.NET_CHANNEL_NAME);
MessageManager.getInstance().registerChannel(network, new PacketHandler(), DefaultProps.NET_CHANNEL_NAME);
}
@Override
public void onLogin(NetworkManager network, Packet1Login login) {
}
public void onLogin(NetworkManager network, Packet1Login login) {}
@Override
public void onDisconnect(NetworkManager network, String message,
Object[] args) {
}
public void onDisconnect(NetworkManager network, String message, Object[] args) {}
}

View file

@ -6,7 +6,6 @@ import net.minecraft.src.forge.IPacketHandler;
public class PacketHandler implements IPacketHandler {
@Override
public void onPacketData(NetworkManager network, String channel, byte[] data) {
}
public void onPacketData(NetworkManager network, String channel, byte[] data) {}
}

View file

@ -50,8 +50,7 @@ public class GuiAssemblyTable extends GuiAdvancedInterface {
}
}
public GuiAssemblyTable(IInventory playerInventory,
TileAssemblyTable assemblyTable) {
public GuiAssemblyTable(IInventory playerInventory, TileAssemblyTable assemblyTable) {
super(new ContainerAssemblyTable(playerInventory, assemblyTable));
this.playerInventory = playerInventory;
@ -72,14 +71,12 @@ public class GuiAssemblyTable extends GuiAdvancedInterface {
updateRecipes();
// Request current selection from server
CoreProxy.sendToServer(new PacketCoordinates(
PacketIds.SELECTION_ASSEMBLY_GET, assemblyTable.xCoord,
CoreProxy.sendToServer(new PacketCoordinates(PacketIds.SELECTION_ASSEMBLY_GET, assemblyTable.xCoord,
assemblyTable.yCoord, assemblyTable.zCoord).getPacket());
}
public void updateRecipes() {
LinkedList<AssemblyRecipe> potentialRecipes = assemblyTable
.getPotentialOutputs();
LinkedList<AssemblyRecipe> potentialRecipes = assemblyTable.getPotentialOutputs();
Iterator<AssemblyRecipe> cur = potentialRecipes.iterator();
for (int p = 0; p < 8; ++p)
@ -93,16 +90,14 @@ public class GuiAssemblyTable extends GuiAdvancedInterface {
protected void drawGuiContainerForegroundLayer() {
String title = StringUtil.localize("tile.assemblyTableBlock");
fontRenderer.drawString(title, getCenteredOffset(title), 15, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8,
ySize - 97, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, ySize - 97, 0x404040);
drawForegroundSelection();
}
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
int i = mc.renderEngine
.getTexture("/net/minecraft/src/buildcraft/factory/gui/assembly_table.png");
int i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/factory/gui/assembly_table.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(i);
int cornerX = (width - xSize) / 2;
@ -115,17 +110,14 @@ public class GuiAssemblyTable extends GuiAdvancedInterface {
RecipeSlot slot = (RecipeSlot) slots[s];
if (assemblyTable.isAssembling(slot.recipe))
drawTexturedModalRect(cornerX + slot.x, cornerY + slot.y, 196,
1, 16, 16);
drawTexturedModalRect(cornerX + slot.x, cornerY + slot.y, 196, 1, 16, 16);
else if (assemblyTable.isPlanned(slot.recipe))
drawTexturedModalRect(cornerX + slot.x, cornerY + slot.y, 177,
1, 16, 16);
drawTexturedModalRect(cornerX + slot.x, cornerY + slot.y, 177, 1, 16, 16);
}
int height = (int) assemblyTable.getCompletionRatio(70);
drawTexturedModalRect(cornerX + 95, cornerY + 36 + 70 - height, 176,
18, 4, height);
drawTexturedModalRect(cornerX + 95, cornerY + 36 + 70 - height, 176, 18, 4, height);
drawBackgroundSlots();
}
@ -158,12 +150,10 @@ public class GuiAssemblyTable extends GuiAdvancedInterface {
ContainerAssemblyTable container = (ContainerAssemblyTable) inventorySlots;
if (APIProxy.isRemote()) {
PacketPayload payload = TileAssemblyTable.selectionMessageWrapper
.toPayload(container.x, container.y, container.z,
message);
PacketPayload payload = TileAssemblyTable.selectionMessageWrapper.toPayload(container.x, container.y,
container.z, message);
PacketUpdate packet = new PacketUpdate(
PacketIds.SELECTION_ASSEMBLY, payload);
PacketUpdate packet = new PacketUpdate(PacketIds.SELECTION_ASSEMBLY, payload);
packet.posX = assemblyTable.xCoord;
packet.posY = assemblyTable.yCoord;
packet.posZ = assemblyTable.zCoord;

View file

@ -10,8 +10,7 @@ import net.minecraft.src.forge.IGuiHandler;
public class GuiHandler implements IGuiHandler {
@Override
public Object getGuiElement(int ID, EntityPlayer player, World world,
int x, int y, int z) {
public Object getGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
if (!world.blockExists(x, y, z))
return null;
@ -23,8 +22,7 @@ public class GuiHandler implements IGuiHandler {
case GuiIds.ASSEMBLY_TABLE:
if (!(tile instanceof TileAssemblyTable))
return null;
return new GuiAssemblyTable(player.inventory,
(TileAssemblyTable) tile);
return new GuiAssemblyTable(player.inventory, (TileAssemblyTable) tile);
default:
return null;

View file

@ -10,17 +10,13 @@ public class ConnectionHandler implements IConnectionHandler {
@Override
public void onConnect(NetworkManager network) {
MessageManager.getInstance().registerChannel(network,
new PacketHandler(), DefaultProps.NET_CHANNEL_NAME);
MessageManager.getInstance().registerChannel(network, new PacketHandler(), DefaultProps.NET_CHANNEL_NAME);
}
@Override
public void onLogin(NetworkManager network, Packet1Login login) {
}
public void onLogin(NetworkManager network, Packet1Login login) {}
@Override
public void onDisconnect(NetworkManager network, String message,
Object[] args) {
}
public void onDisconnect(NetworkManager network, String message, Object[] args) {}
}

View file

@ -17,11 +17,9 @@ import net.minecraft.src.forge.IPacketHandler;
public class PacketHandler implements IPacketHandler {
@Override
public void onPacketData(NetworkManager network, String channel,
byte[] bytes) {
public void onPacketData(NetworkManager network, String channel, byte[] bytes) {
DataInputStream data = new DataInputStream(new ByteArrayInputStream(
bytes));
DataInputStream data = new DataInputStream(new ByteArrayInputStream(bytes));
try {
NetClientHandler net = (NetClientHandler) network.getNetHandler();
@ -47,8 +45,7 @@ public class PacketHandler implements IPacketHandler {
GuiAssemblyTable gui = (GuiAssemblyTable) screen;
SelectionMessage message = new SelectionMessage();
TileAssemblyTable.selectionMessageWrapper.fromPayload(message,
packet.payload);
TileAssemblyTable.selectionMessageWrapper.fromPayload(message, packet.payload);
gui.handleSelectionMessage(message);
}
}

View file

@ -25,8 +25,7 @@ public class GuiDiamondPipe extends GuiAdvancedInterface {
IInventory playerInventory;
TileGenericPipe filterInventory;
public GuiDiamondPipe(IInventory playerInventory,
TileGenericPipe filterInventory) {
public GuiDiamondPipe(IInventory playerInventory, TileGenericPipe filterInventory) {
super(new CraftingDiamondPipe(playerInventory, filterInventory));
this.playerInventory = playerInventory;
this.filterInventory = filterInventory;
@ -38,25 +37,21 @@ public class GuiDiamondPipe extends GuiAdvancedInterface {
for (int k = 0; k < 6; k++)
for (int j1 = 0; j1 < 9; j1++) {
int id = k * 9 + j1;
slots[id] = new IInventorySlot(8 + j1 * 18, 18 + k * 18,
filterInventory, j1 + k * 9);
slots[id] = new IInventorySlot(8 + j1 * 18, 18 + k * 18, filterInventory, j1 + k * 9);
}
}
@Override
protected void drawGuiContainerForegroundLayer() {
fontRenderer.drawString(filterInventory.getInvName(),
getCenteredOffset(filterInventory.getInvName()), 6, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8,
ySize - 97, 0x404040);
fontRenderer.drawString(filterInventory.getInvName(), getCenteredOffset(filterInventory.getInvName()), 6, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, ySize - 97, 0x404040);
drawForegroundSelection();
}
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
int i = mc.renderEngine
.getTexture("/net/minecraft/src/buildcraft/transport/gui/filter.png");
int i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/transport/gui/filter.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(i);
int j = (width - xSize) / 2;
@ -87,18 +82,15 @@ public class GuiDiamondPipe extends GuiAdvancedInterface {
ItemStack newStack;
if (playerStack != null)
newStack = new ItemStack(playerStack.itemID, 1,
playerStack.getItemDamage());
newStack = new ItemStack(playerStack.itemID, 1, playerStack.getItemDamage());
else
newStack = null;
filterInventory.setInventorySlotContents(position, newStack);
if (APIProxy.isRemote()) {
PacketSlotChange packet = new PacketSlotChange(
PacketIds.DIAMOND_PIPE_SELECT, filterInventory.xCoord,
filterInventory.yCoord, filterInventory.zCoord,
position, newStack);
PacketSlotChange packet = new PacketSlotChange(PacketIds.DIAMOND_PIPE_SELECT, filterInventory.xCoord,
filterInventory.yCoord, filterInventory.zCoord, position, newStack);
CoreProxy.sendToServer(packet.getPacket());
}
}

View file

@ -176,8 +176,7 @@ public class GuiGateInterface extends GuiAdvancedInterface {
slots = new AdvancedSlot[2];
slots[0] = new TriggerSlot(65, 54, pipe, 0);
slots[1] = new ActionSlot(99, 54, pipe, 0);
} else if (pipe.gate.kind == GateKind.AND_2
|| pipe.gate.kind == GateKind.OR_2) {
} else if (pipe.gate.kind == GateKind.AND_2 || pipe.gate.kind == GateKind.OR_2) {
nbEntries = 2;
slots = new AdvancedSlot[4];
@ -186,60 +185,49 @@ public class GuiGateInterface extends GuiAdvancedInterface {
slots[1] = new TriggerSlot(65, 64, pipe, 1);
slots[2] = new ActionSlot(99, 46, pipe, 0);
slots[3] = new ActionSlot(99, 64, pipe, 1);
} else if (pipe.gate.kind == GateKind.AND_3
|| pipe.gate.kind == GateKind.OR_3) {
} else if (pipe.gate.kind == GateKind.AND_3 || pipe.gate.kind == GateKind.OR_3) {
nbEntries = 4;
slots = new AdvancedSlot[12];
for (int k = 0; k < 4; ++k) {
slots[position] = new TriggerSlot(60, 36 + 18 * k, pipe,
position);
slots[position] = new TriggerSlot(60, 36 + 18 * k, pipe, position);
position++;
}
for (int k = 0; k < 4; ++k) {
slots[position] = new ActionSlot(112, 36 + 18 * k, pipe,
position - 4);
slots[position] = new ActionSlot(112, 36 + 18 * k, pipe, position - 4);
position++;
}
for (int k = 0; k < 4; ++k) {
slots[position] = new TriggerParameterSlot(78, 36 + 18 * k,
pipe, position - 8);
slots[position] = new TriggerParameterSlot(78, 36 + 18 * k, pipe, position - 8);
position++;
}
} else if (pipe.gate.kind == GateKind.AND_4
|| pipe.gate.kind == GateKind.OR_4) {
} else if (pipe.gate.kind == GateKind.AND_4 || pipe.gate.kind == GateKind.OR_4) {
nbEntries = 8;
slots = new AdvancedSlot[24];
for (int k = 0; k < 4; ++k) {
slots[position] = new TriggerSlot(8, 36 + 18 * k, pipe,
position);
slots[position] = new TriggerSlot(8, 36 + 18 * k, pipe, position);
position++;
slots[position] = new TriggerSlot(100, 36 + 18 * k, pipe,
position);
slots[position] = new TriggerSlot(100, 36 + 18 * k, pipe, position);
position++;
}
for (int k = 0; k < 4; ++k) {
slots[position] = new ActionSlot(60, 36 + 18 * k, pipe,
position - 8);
slots[position] = new ActionSlot(60, 36 + 18 * k, pipe, position - 8);
position++;
slots[position] = new ActionSlot(152, 36 + 18 * k, pipe,
position - 8);
slots[position] = new ActionSlot(152, 36 + 18 * k, pipe, position - 8);
position++;
}
for (int k = 0; k < 4; ++k) {
slots[position] = new TriggerParameterSlot(26, 36 + 18 * k,
pipe, position - 16);
slots[position] = new TriggerParameterSlot(26, 36 + 18 * k, pipe, position - 16);
position++;
slots[position] = new TriggerParameterSlot(118, 36 + 18 * k,
pipe, position - 16);
slots[position] = new TriggerParameterSlot(118, 36 + 18 * k, pipe, position - 16);
position++;
}
}
@ -251,8 +239,7 @@ public class GuiGateInterface extends GuiAdvancedInterface {
String name = _container.getGateName();
fontRenderer.drawString(name, getCenteredOffset(name), 15, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8,
ySize - 97, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, ySize - 97, 0x404040);
drawForegroundSelection();
}
@ -280,29 +267,24 @@ public class GuiGateInterface extends GuiAdvancedInterface {
if (_container.getGateOrdinal() >= GateKind.AND_3.ordinal()) {
TriggerParameter parameter = null;
if (slots[s + nbEntries * 2] != null
&& slots[s + nbEntries * 2].isDefined())
parameter = ((TriggerParameterSlot) slots[s + nbEntries
* 2]).getTriggerParameter();
if (slots[s + nbEntries * 2] != null && slots[s + nbEntries * 2].isDefined())
parameter = ((TriggerParameterSlot) slots[s + nbEntries * 2]).getTriggerParameter();
if (_container.isNearbyTriggerActive(trigger, parameter)) {
mc.renderEngine.bindTexture(texture);
drawTexturedModalRect(cornerX + slot.x + 35, cornerY
+ slot.y + 6, 176, 18, 18, 4);
drawTexturedModalRect(cornerX + slot.x + 35, cornerY + slot.y + 6, 176, 18, 18, 4);
}
if (trigger == null || !trigger.hasParameter()) {
mc.renderEngine.bindTexture(texture);
drawTexturedModalRect(cornerX + slot.x + 17, cornerY
+ slot.y - 1, 176, 0, 18, 18);
drawTexturedModalRect(cornerX + slot.x + 17, cornerY + slot.y - 1, 176, 0, 18, 18);
}
} else if (_container.isNearbyTriggerActive(trigger, null)) {
mc.renderEngine.bindTexture(texture);
drawTexturedModalRect(cornerX + slot.x + 17, cornerY
+ slot.y + 6, 176, 18, 18, 4);
drawTexturedModalRect(cornerX + slot.x + 17, cornerY + slot.y + 6, 176, 18, 18, 4);
}
}
}
@ -398,8 +380,7 @@ public class GuiGateInterface extends GuiAdvancedInterface {
if (param != null) {
param.set(mc.thePlayer.inventory.getItemStack());
_container.setTriggerParameter(position - nbEntries * 2,
param, true);
_container.setTriggerParameter(position - nbEntries * 2, param, true);
}
}
}

View file

@ -9,8 +9,7 @@ import net.minecraft.src.forge.IGuiHandler;
public class GuiHandler implements IGuiHandler {
@Override
public Object getGuiElement(int ID, EntityPlayer player, World world,
int x, int y, int z) {
public Object getGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
if (!world.blockExists(x, y, z))
return null;

View file

@ -49,6 +49,7 @@ public class RenderPipe extends TileEntitySpecialRenderer {
private final static EntityItem dummyEntityItem = new EntityItem(null);
private class DisplayLiquidList {
public int[] sideHorizontal = new int[displayLiquidStages];
public int[] sideVertical = new int[displayLiquidStages];
public int[] centerHorizontal = new int[displayLiquidStages];
@ -79,8 +80,7 @@ public class RenderPipe extends TileEntitySpecialRenderer {
displayLiquidLists.put(liquidId, d);
BlockInterface block = new BlockInterface();
if (liquidId < Block.blocksList.length
&& Block.blocksList[liquidId] != null)
if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null)
block.texture = Block.blocksList[liquidId].blockIndexInTexture;
else
block.texture = Item.itemsList[liquidId].getIconFromDamage(0);
@ -205,13 +205,11 @@ public class RenderPipe extends TileEntitySpecialRenderer {
for (int i = 0; i < displayPowerStages; ++i)
displayPowerLimits[displayPowerStages - i - 1] = maxPower
- Math.sqrt(maxPower * maxPower / (displayPowerStages - 1)
* i);
- Math.sqrt(maxPower * maxPower / (displayPowerStages - 1) * i);
}
@Override
public void renderTileEntityAt(TileEntity tileentity, double x, double y,
double z, float f) {
public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) {
if (BuildCraftCore.render == RenderMode.NoDynamic)
return;
@ -239,8 +237,7 @@ public class RenderPipe extends TileEntitySpecialRenderer {
GL11.glPushMatrix();
GL11.glDisable(2896 /* GL_LIGHTING */);
MinecraftForgeClient
.bindTexture(BuildCraftCore.customBuildCraftTexture);
MinecraftForgeClient.bindTexture(BuildCraftCore.customBuildCraftTexture);
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F);
@ -284,14 +281,12 @@ public class RenderPipe extends TileEntitySpecialRenderer {
for (int i = 0; i < 6; ++i)
if (liq.getSide(i) > 0) {
DisplayLiquidList d = getListFromBuffer(liq.side[i],
pipe.worldObj);
DisplayLiquidList d = getListFromBuffer(liq.side[i], pipe.worldObj);
if (d == null)
continue;
int stage = (int) ((float) liq.getSide(i)
/ (float) (PipeTransportLiquids.LIQUID_IN_PIPE) * (displayLiquidStages - 1));
int stage = (int) ((float) liq.getSide(i) / (float) (PipeTransportLiquids.LIQUID_IN_PIPE) * (displayLiquidStages - 1));
GL11.glPushMatrix();
int list = 0;
@ -326,8 +321,7 @@ public class RenderPipe extends TileEntitySpecialRenderer {
DisplayLiquidList d = getListFromBuffer(liq.center, pipe.worldObj);
if (d != null) {
int stage = (int) ((float) liq.getCenter()
/ (float) (PipeTransportLiquids.LIQUID_IN_PIPE) * (displayLiquidStages - 1));
int stage = (int) ((float) liq.getCenter() / (float) (PipeTransportLiquids.LIQUID_IN_PIPE) * (displayLiquidStages - 1));
if (above)
GL11.glCallList(d.centerVertical[stage]);
@ -351,15 +345,13 @@ public class RenderPipe extends TileEntitySpecialRenderer {
Object o = null;
if (liquidId < Block.blocksList.length
&& Block.blocksList[liquidId] != null)
if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null)
o = Block.blocksList[liquidId];
else
o = Item.itemsList[liquidId];
if (o instanceof ITextureProvider)
MinecraftForgeClient.bindTexture(((ITextureProvider) o)
.getTextureFile());
MinecraftForgeClient.bindTexture(((ITextureProvider) o).getTextureFile());
else
MinecraftForgeClient.bindTexture("/terrain.png");
@ -370,12 +362,9 @@ public class RenderPipe extends TileEntitySpecialRenderer {
GL11.glPushMatrix();
GL11.glDisable(2896 /* GL_LIGHTING */);
for (EntityData data : ((PipeTransportItems) pipe.transport).travelingEntities
.values())
doRenderItem(data.item, x + data.item.posX - pipe.xCoord, y
+ data.item.posY - pipe.yCoord, z + data.item.posZ
- pipe.zCoord, pipe.worldObj.getLightBrightness(
pipe.xCoord, pipe.yCoord, pipe.zCoord));
for (EntityData data : ((PipeTransportItems) pipe.transport).travelingEntities.values())
doRenderItem(data.item, x + data.item.posX - pipe.xCoord, y + data.item.posY - pipe.yCoord, z + data.item.posZ
- pipe.zCoord, pipe.worldObj.getLightBrightness(pipe.xCoord, pipe.yCoord, pipe.zCoord));
GL11.glEnable(2896 /* GL_LIGHTING */);
GL11.glPopMatrix();
@ -383,8 +372,7 @@ public class RenderPipe extends TileEntitySpecialRenderer {
private Random random = new Random();
public void doRenderItem(EntityPassiveItem entityitem, double d, double d1,
double d2, float f1) {
public void doRenderItem(EntityPassiveItem entityitem, double d, double d1, double d2, float f1) {
if (entityitem == null || entityitem.item == null)
return;
@ -405,8 +393,7 @@ public class RenderPipe extends TileEntitySpecialRenderer {
GL11.glTranslatef((float) d, (float) d1, (float) d2);
GL11.glEnable(32826 /* GL_RESCALE_NORMAL_EXT */);
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(
itemstack, ItemRenderType.ENTITY);
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, ItemRenderType.ENTITY);
if (customRenderer != null) {
@ -430,21 +417,16 @@ public class RenderPipe extends TileEntitySpecialRenderer {
RenderPipe.dummyEntityItem.item = itemstack;
customRenderer.renderItem(ItemRenderType.ENTITY, itemstack,
renderBlocks, RenderPipe.dummyEntityItem);
customRenderer.renderItem(ItemRenderType.ENTITY, itemstack, renderBlocks, RenderPipe.dummyEntityItem);
GL11.glPopMatrix();
}
} else if (itemstack.itemID < Block.blocksList.length
&& Block.blocksList[itemstack.itemID] != null
&& RenderBlocks
.renderItemIn3d(Block.blocksList[itemstack.itemID]
.getRenderType())) {
} else if (itemstack.itemID < Block.blocksList.length && Block.blocksList[itemstack.itemID] != null
&& RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType())) {
GL11.glTranslatef(0, 0.25F, 0); // BC SPECIFIC
loadTexture("/terrain.png");
ForgeHooksClient
.overrideTexture(Block.blocksList[itemstack.itemID]);
ForgeHooksClient.overrideTexture(Block.blocksList[itemstack.itemID]);
float f4 = 0.25F;
int j = Block.blocksList[itemstack.itemID].getRenderType();
if (j == 1 || j == 19 || j == 12 || j == 2)
@ -457,15 +439,12 @@ public class RenderPipe extends TileEntitySpecialRenderer {
if (k > 0) {
float f6 = ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / f4;
float f9 = ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / f4;
float f11 = ((random.nextFloat() * 2.0F - 1.0F) * 0.2F)
/ f4;
float f11 = ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / f4;
GL11.glTranslatef(f6, f9, f11);
}
float f7 = 1.0F;
renderBlocks.renderBlockAsItem(
Block.blocksList[itemstack.itemID],
itemstack.getItemDamage(), f7);
renderBlocks.renderBlockAsItem(Block.blocksList[itemstack.itemID], itemstack.getItemDamage(), f7);
GL11.glPopMatrix();
}
@ -474,23 +453,18 @@ public class RenderPipe extends TileEntitySpecialRenderer {
if (itemstack.getItem().requiresMultipleRenderPasses()) {
GL11.glScalef(0.5F, 0.5F, 0.5F);
this.loadTexture(ForgeHooksClient.getTexture("/gui/items.png",
Item.itemsList[itemstack.itemID]));
this.loadTexture(ForgeHooksClient.getTexture("/gui/items.png", Item.itemsList[itemstack.itemID]));
for (int i = 0; i <= 1; ++i) {
int iconIndex = itemstack.getItem().func_46057_a(
itemstack.getItemDamage(), i);
int iconIndex = itemstack.getItem().func_46057_a(itemstack.getItemDamage(), i);
float scale = 1.0F;
if (true) {
int var17 = Item.itemsList[itemstack.itemID]
.getColorFromDamage(itemstack.getItemDamage(),
i);
int var17 = Item.itemsList[itemstack.itemID].getColorFromDamage(itemstack.getItemDamage(), i);
float var18 = (var17 >> 16 & 255) / 255.0F;
float var19 = (var17 >> 8 & 255) / 255.0F;
float var20 = (var17 & 255) / 255.0F;
GL11.glColor4f(var18 * scale, var19 * scale, var20
* scale, 1.0F);
GL11.glColor4f(var18 * scale, var19 * scale, var20 * scale, 1.0F);
}
this.drawItem(iconIndex, quantity);
@ -499,15 +473,12 @@ public class RenderPipe extends TileEntitySpecialRenderer {
GL11.glScalef(0.5F, 0.5F, 0.5F);
int i = itemstack.getIconIndex();
if (itemstack.itemID < Block.blocksList.length
&& Block.blocksList[itemstack.itemID] != null) {
if (itemstack.itemID < Block.blocksList.length && Block.blocksList[itemstack.itemID] != null) {
loadTexture("/terrain.png");
ForgeHooksClient
.overrideTexture(Block.blocksList[itemstack.itemID]);
ForgeHooksClient.overrideTexture(Block.blocksList[itemstack.itemID]);
} else {
loadTexture("/gui/items.png");
ForgeHooksClient
.overrideTexture(Item.itemsList[itemstack.itemID]);
ForgeHooksClient.overrideTexture(Item.itemsList[itemstack.itemID]);
}
drawItem(i, quantity);
@ -538,18 +509,13 @@ public class RenderPipe extends TileEntitySpecialRenderer {
GL11.glTranslatef(var12, var13, var14);
}
GL11.glRotatef(180.0F - RenderManager.instance.playerViewY, 0.0F,
1.0F, 0.0F);
GL11.glRotatef(180.0F - RenderManager.instance.playerViewY, 0.0F, 1.0F, 0.0F);
tesselator.startDrawingQuads();
tesselator.setNormal(0.0F, 1.0F, 0.0F);
tesselator.addVertexWithUV((0.0F - var9), (0.0F - var10), 0.0D,
var4, var7);
tesselator.addVertexWithUV((var8 - var9), (0.0F - var10), 0.0D,
var5, var7);
tesselator.addVertexWithUV((var8 - var9), (1.0F - var10), 0.0D,
var5, var6);
tesselator.addVertexWithUV((0.0F - var9), (1.0F - var10), 0.0D,
var4, var6);
tesselator.addVertexWithUV((0.0F - var9), (0.0F - var10), 0.0D, var4, var7);
tesselator.addVertexWithUV((var8 - var9), (0.0F - var10), 0.0D, var5, var7);
tesselator.addVertexWithUV((var8 - var9), (1.0F - var10), 0.0D, var5, var6);
tesselator.addVertexWithUV((0.0F - var9), (1.0F - var10), 0.0D, var4, var6);
tesselator.draw();
GL11.glPopMatrix();
}

View file

@ -26,8 +26,7 @@ public class TileEntityPickupFX extends EntityFX {
private double yDestination;
public TileEntityPickupFX(World world, EntityItem entity, TileEntity entity1) {
super(world, entity.posX, entity.posY, entity.posZ, entity.motionX,
entity.motionY, entity.motionZ);
super(world, entity.posX, entity.posY, entity.posZ, entity.motionX, entity.motionY, entity.motionZ);
field_678_p = 0;
field_677_q = 0;
field_675_a = entity;
@ -38,8 +37,7 @@ public class TileEntityPickupFX extends EntityFX {
}
@Override
public void renderParticle(Tessellator tessellator, float f, float f1,
float f2, float f3, float f4, float f5) {
public void renderParticle(Tessellator tessellator, float f, float f1, float f2, float f3, float f4, float f5) {
float f6 = (field_678_p + f) / field_677_q;
f6 *= f6;
double d = field_675_a.posX;
@ -61,8 +59,7 @@ public class TileEntityPickupFX extends EntityFX {
GL11.glColor4f(f7, f7, f7, 1.0F);
if (RenderManager.instance.renderEngine != null)
RenderManager.instance.renderEntityWithPosYaw(field_675_a,
(float) d6, (float) d7, (float) d8,
RenderManager.instance.renderEntityWithPosYaw(field_675_a, (float) d6, (float) d7, (float) d8,
field_675_a.rotationYaw, f);
}

View file

@ -16,10 +16,8 @@ import net.minecraft.src.World;
public class TransportProxy {
static public void obsidianPipePickup(World world, EntityItem item,
TileEntity tile) {
ModLoader.getMinecraftInstance().effectRenderer
.addEffect(new TileEntityPickupFX(world, item, tile));
static public void obsidianPipePickup(World world, EntityItem item, TileEntity tile) {
ModLoader.getMinecraftInstance().effectRenderer.addEffect(new TileEntityPickupFX(world, item, tile));
}
}

View file

@ -10,17 +10,13 @@ public class ConnectionHandler implements IConnectionHandler {
@Override
public void onConnect(NetworkManager network) {
MessageManager.getInstance().registerChannel(network,
new PacketHandler(), DefaultProps.NET_CHANNEL_NAME);
MessageManager.getInstance().registerChannel(network, new PacketHandler(), DefaultProps.NET_CHANNEL_NAME);
}
@Override
public void onLogin(NetworkManager network, Packet1Login login) {
}
public void onLogin(NetworkManager network, Packet1Login login) {}
@Override
public void onDisconnect(NetworkManager network, String message,
Object[] args) {
}
public void onDisconnect(NetworkManager network, String message, Object[] args) {}
}

View file

@ -25,11 +25,9 @@ import net.minecraft.src.forge.IPacketHandler;
public class PacketHandler implements IPacketHandler {
@Override
public void onPacketData(NetworkManager network, String channel,
byte[] bytes) {
public void onPacketData(NetworkManager network, String channel, byte[] bytes) {
DataInputStream data = new DataInputStream(new ByteArrayInputStream(
bytes));
DataInputStream data = new DataInputStream(new ByteArrayInputStream(bytes));
try {
NetClientHandler net = (NetClientHandler) network.getNetHandler();
@ -125,8 +123,7 @@ public class PacketHandler implements IPacketHandler {
if (!world.blockExists(packet.posX, packet.posY, packet.posZ))
return;
TileEntity entity = world.getBlockTileEntity(packet.posX, packet.posY,
packet.posZ);
TileEntity entity = world.getBlockTileEntity(packet.posX, packet.posY, packet.posZ);
if (!(entity instanceof ISynchronizedTile))
return;
@ -145,8 +142,7 @@ public class PacketHandler implements IPacketHandler {
if (!world.blockExists(packet.posX, packet.posY, packet.posZ))
return;
TileEntity entity = world.getBlockTileEntity(packet.posX, packet.posY,
packet.posZ);
TileEntity entity = world.getBlockTileEntity(packet.posX, packet.posY, packet.posZ);
if (!(entity instanceof TileGenericPipe))
return;
@ -172,8 +168,7 @@ public class PacketHandler implements IPacketHandler {
if (!world.blockExists(packet.posX, packet.posY, packet.posZ))
return;
TileEntity entity = world.getBlockTileEntity(packet.posX, packet.posY,
packet.posZ);
TileEntity entity = world.getBlockTileEntity(packet.posX, packet.posY, packet.posZ);
if (!(entity instanceof TileGenericPipe))
return;

View file

@ -46,6 +46,7 @@ public class mod_BuildCraftCore extends NetworkMod {
BuildCraftCore proxy = new BuildCraftCore();
public static class EntityRenderIndex {
public EntityRenderIndex(Block block, int damage) {
this.block = block;
this.damage = damage;
@ -84,12 +85,9 @@ public class mod_BuildCraftCore extends NetworkMod {
if (!initialized) {
initializeMarkerMatrix();
MinecraftForgeClient
.preloadTexture(BuildCraftCore.customBuildCraftTexture);
MinecraftForgeClient
.preloadTexture(BuildCraftCore.customBuildCraftSprites);
MinecraftForgeClient
.preloadTexture(BuildCraftCore.externalBuildCraftTexture);
MinecraftForgeClient.preloadTexture(BuildCraftCore.customBuildCraftTexture);
MinecraftForgeClient.preloadTexture(BuildCraftCore.customBuildCraftSprites);
MinecraftForgeClient.preloadTexture(BuildCraftCore.externalBuildCraftTexture);
initialized = true;
}
@ -121,8 +119,7 @@ public class mod_BuildCraftCore extends NetworkMod {
}
@Override
public boolean renderWorldBlock(RenderBlocks renderblocks,
IBlockAccess iblockaccess, int i, int j, int k, Block block, int l) {
public boolean renderWorldBlock(RenderBlocks renderblocks, IBlockAccess iblockaccess, int i, int j, int k, Block block, int l) {
if (block.getRenderType() == BuildCraftCore.blockByEntityModel) {
// renderblocks.renderStandardBlock(block, i, j, k);
@ -133,26 +130,21 @@ public class mod_BuildCraftCore extends NetworkMod {
if (Block.lightValue[block.blockID] > 0)
f = 1.0F;
tessellator.setColorOpaque_F(f, f, f);
renderMarkerWithMeta(iblockaccess, block, i, j, k,
iblockaccess.getBlockMetadata(i, j, k));
renderMarkerWithMeta(iblockaccess, block, i, j, k, iblockaccess.getBlockMetadata(i, j, k));
} else if (block.getRenderType() == BuildCraftCore.pipeModel) {
PersistentTile tile = PersistentWorld.getWorld(iblockaccess)
.getTile(new BlockIndex(i, j, k));
PersistentTile tile = PersistentWorld.getWorld(iblockaccess).getTile(new BlockIndex(i, j, k));
if (tile == null || !(tile instanceof IPipe))
legacyPipeRender(renderblocks, iblockaccess, i, j, k, block, l);
else
pipeRender(renderblocks, iblockaccess, tile.tile, (IPipe) tile,
block, l);
pipeRender(renderblocks, iblockaccess, tile.tile, (IPipe) tile, block, l);
} else if (block.getRenderType() == BuildCraftCore.oilModel)
renderblocks.renderBlockFluids(block, i, j, k);
return true;
}
private void pipeRender(RenderBlocks renderblocks,
IBlockAccess iblockaccess, TileEntity tile, IPipe pipe,
Block block, int l) {
private void pipeRender(RenderBlocks renderblocks, IBlockAccess iblockaccess, TileEntity tile, IPipe pipe, Block block, int l) {
ITileBufferHolder holder = (ITileBufferHolder) tile;
float minSize = Utils.pipeMinPos;
@ -161,113 +153,84 @@ public class mod_BuildCraftCore extends NetworkMod {
pipe.setDrawingState(DrawingState.DrawingPipe);
pipe.prepareTextureFor(Orientations.Unknown);
block.setBlockBounds(minSize, minSize, minSize, maxSize, maxSize,
maxSize);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord,
tile.zCoord);
block.setBlockBounds(minSize, minSize, minSize, maxSize, maxSize, maxSize);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord);
if (Utils
.checkPipesConnections(tile, holder.getTile(Orientations.XNeg))) {
if (Utils.checkPipesConnections(tile, holder.getTile(Orientations.XNeg))) {
pipe.prepareTextureFor(Orientations.XNeg);
block.setBlockBounds(0.0F, minSize, minSize, minSize, maxSize,
maxSize);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord,
tile.zCoord);
block.setBlockBounds(0.0F, minSize, minSize, minSize, maxSize, maxSize);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord);
}
if (Utils
.checkPipesConnections(tile, holder.getTile(Orientations.XPos))) {
if (Utils.checkPipesConnections(tile, holder.getTile(Orientations.XPos))) {
pipe.prepareTextureFor(Orientations.XPos);
block.setBlockBounds(maxSize, minSize, minSize, 1.0F, maxSize,
maxSize);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord,
tile.zCoord);
block.setBlockBounds(maxSize, minSize, minSize, 1.0F, maxSize, maxSize);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord);
}
if (Utils
.checkPipesConnections(tile, holder.getTile(Orientations.YNeg))) {
if (Utils.checkPipesConnections(tile, holder.getTile(Orientations.YNeg))) {
pipe.prepareTextureFor(Orientations.YNeg);
block.setBlockBounds(minSize, 0.0F, minSize, maxSize, minSize,
maxSize);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord,
tile.zCoord);
block.setBlockBounds(minSize, 0.0F, minSize, maxSize, minSize, maxSize);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord);
}
if (Utils
.checkPipesConnections(tile, holder.getTile(Orientations.YPos))) {
if (Utils.checkPipesConnections(tile, holder.getTile(Orientations.YPos))) {
pipe.prepareTextureFor(Orientations.YPos);
block.setBlockBounds(minSize, maxSize, minSize, maxSize, 1.0F,
maxSize);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord,
tile.zCoord);
block.setBlockBounds(minSize, maxSize, minSize, maxSize, 1.0F, maxSize);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord);
}
if (Utils
.checkPipesConnections(tile, holder.getTile(Orientations.ZNeg))) {
if (Utils.checkPipesConnections(tile, holder.getTile(Orientations.ZNeg))) {
pipe.prepareTextureFor(Orientations.ZNeg);
block.setBlockBounds(minSize, minSize, 0.0F, maxSize, maxSize,
minSize);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord,
tile.zCoord);
block.setBlockBounds(minSize, minSize, 0.0F, maxSize, maxSize, minSize);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord);
}
if (Utils
.checkPipesConnections(tile, holder.getTile(Orientations.ZPos))) {
if (Utils.checkPipesConnections(tile, holder.getTile(Orientations.ZPos))) {
pipe.prepareTextureFor(Orientations.ZPos);
block.setBlockBounds(minSize, minSize, maxSize, maxSize, maxSize,
1.0F);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord,
tile.zCoord);
block.setBlockBounds(minSize, minSize, maxSize, maxSize, maxSize, 1.0F);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord);
}
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
pipe.prepareTextureFor(Orientations.Unknown);
MinecraftForgeClient
.bindTexture(BuildCraftCore.customBuildCraftTexture);
MinecraftForgeClient.bindTexture(BuildCraftCore.customBuildCraftTexture);
if (pipe.isWired(IPipe.WireColor.Red)) {
pipe.setDrawingState(DrawingState.DrawingRedWire);
pipeRedstoneRender(renderblocks, iblockaccess, tile, pipe, block,
l, Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMinPos,
IPipe.WireColor.Red);
pipeRedstoneRender(renderblocks, iblockaccess, tile, pipe, block, l, Utils.pipeMinPos, Utils.pipeMaxPos,
Utils.pipeMinPos, IPipe.WireColor.Red);
}
if (pipe.isWired(IPipe.WireColor.Blue)) {
pipe.setDrawingState(DrawingState.DrawingBlueWire);
pipeRedstoneRender(renderblocks, iblockaccess, tile, pipe, block,
l, Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos,
IPipe.WireColor.Blue);
pipeRedstoneRender(renderblocks, iblockaccess, tile, pipe, block, l, Utils.pipeMaxPos, Utils.pipeMaxPos,
Utils.pipeMaxPos, IPipe.WireColor.Blue);
}
if (pipe.isWired(IPipe.WireColor.Green)) {
pipe.setDrawingState(DrawingState.DrawingGreenWire);
pipeRedstoneRender(renderblocks, iblockaccess, tile, pipe, block,
l, Utils.pipeMaxPos, Utils.pipeMinPos, Utils.pipeMinPos,
IPipe.WireColor.Green);
pipeRedstoneRender(renderblocks, iblockaccess, tile, pipe, block, l, Utils.pipeMaxPos, Utils.pipeMinPos,
Utils.pipeMinPos, IPipe.WireColor.Green);
}
if (pipe.isWired(IPipe.WireColor.Yellow)) {
pipe.setDrawingState(DrawingState.DrawingYellowWire);
pipeRedstoneRender(renderblocks, iblockaccess, tile, pipe, block,
l, Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMaxPos,
IPipe.WireColor.Yellow);
pipeRedstoneRender(renderblocks, iblockaccess, tile, pipe, block, l, Utils.pipeMinPos, Utils.pipeMinPos,
Utils.pipeMaxPos, IPipe.WireColor.Yellow);
}
if (pipe.hasInterface())
pipeInterfaceRender(renderblocks, iblockaccess, tile, pipe, block,
l);
pipeInterfaceRender(renderblocks, iblockaccess, tile, pipe, block, l);
}
private boolean isConnectedWiredPipe(IPipe pipe, TileEntity tile2,
IPipe.WireColor color) {
private boolean isConnectedWiredPipe(IPipe pipe, TileEntity tile2, IPipe.WireColor color) {
return pipe.isWireConnectedTo(tile2, color);
}
private void pipeRedstoneRender(RenderBlocks renderblocks,
IBlockAccess iblockaccess, TileEntity tile, IPipe pipe,
Block block, int l, float cx, float cy, float cz,
IPipe.WireColor color) {
private void pipeRedstoneRender(RenderBlocks renderblocks, IBlockAccess iblockaccess, TileEntity tile, IPipe pipe,
Block block, int l, float cx, float cy, float cz, IPipe.WireColor color) {
ITileBufferHolder holder = (ITileBufferHolder) tile;
@ -354,56 +317,41 @@ public class mod_BuildCraftCore extends NetworkMod {
// Z render
if (minZ != Utils.pipeMinPos || maxZ != Utils.pipeMaxPos || !found) {
block.setBlockBounds(cx == Utils.pipeMinPos ? cx - 0.05F : cx,
cy == Utils.pipeMinPos ? cy - 0.05F : cy, minZ,
cx == Utils.pipeMinPos ? cx : cx + 0.05F,
cy == Utils.pipeMinPos ? cy : cy + 0.05F, maxZ);
block.setBlockBounds(cx == Utils.pipeMinPos ? cx - 0.05F : cx, cy == Utils.pipeMinPos ? cy - 0.05F : cy, minZ,
cx == Utils.pipeMinPos ? cx : cx + 0.05F, cy == Utils.pipeMinPos ? cy : cy + 0.05F, maxZ);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord,
tile.zCoord);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord);
}
// X render
if (minX != Utils.pipeMinPos || maxX != Utils.pipeMaxPos || !found) {
block.setBlockBounds(minX,
cy == Utils.pipeMinPos ? cy - 0.05F : cy,
cz == Utils.pipeMinPos ? cz - 0.05F : cz, maxX,
cy == Utils.pipeMinPos ? cy : cy + 0.05F,
cz == Utils.pipeMinPos ? cz : cz + 0.05F);
block.setBlockBounds(minX, cy == Utils.pipeMinPos ? cy - 0.05F : cy, cz == Utils.pipeMinPos ? cz - 0.05F : cz, maxX,
cy == Utils.pipeMinPos ? cy : cy + 0.05F, cz == Utils.pipeMinPos ? cz : cz + 0.05F);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord,
tile.zCoord);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord);
}
// Y render
if (minY != Utils.pipeMinPos || maxY != Utils.pipeMaxPos || !found) {
block.setBlockBounds(cx == Utils.pipeMinPos ? cx - 0.05F : cx,
minY, cz == Utils.pipeMinPos ? cz - 0.05F : cz,
cx == Utils.pipeMinPos ? cx : cx + 0.05F, maxY,
cz == Utils.pipeMinPos ? cz : cz + 0.05F);
block.setBlockBounds(cx == Utils.pipeMinPos ? cx - 0.05F : cx, minY, cz == Utils.pipeMinPos ? cz - 0.05F : cz,
cx == Utils.pipeMinPos ? cx : cx + 0.05F, maxY, cz == Utils.pipeMinPos ? cz : cz + 0.05F);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord,
tile.zCoord);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord);
}
if (center || !found) {
block.setBlockBounds(cx == Utils.pipeMinPos ? cx - 0.05F : cx,
cy == Utils.pipeMinPos ? cy - 0.05F : cy,
cz == Utils.pipeMinPos ? cz - 0.05F : cz,
cx == Utils.pipeMinPos ? cx : cx + 0.05F,
cy == Utils.pipeMinPos ? cy : cy + 0.05F,
cz == Utils.pipeMinPos ? cz : cz + 0.05F);
block.setBlockBounds(cx == Utils.pipeMinPos ? cx - 0.05F : cx, cy == Utils.pipeMinPos ? cy - 0.05F : cy,
cz == Utils.pipeMinPos ? cz - 0.05F : cz, cx == Utils.pipeMinPos ? cx : cx + 0.05F,
cy == Utils.pipeMinPos ? cy : cy + 0.05F, cz == Utils.pipeMinPos ? cz : cz + 0.05F);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord,
tile.zCoord);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord);
}
}
private void pipeInterfaceRender(RenderBlocks renderblocks,
IBlockAccess iblockaccess, TileEntity tile, IPipe pipe,
private void pipeInterfaceRender(RenderBlocks renderblocks, IBlockAccess iblockaccess, TileEntity tile, IPipe pipe,
Block block, int l) {
ITileBufferHolder holder = (ITileBufferHolder) tile;
@ -413,182 +361,133 @@ public class mod_BuildCraftCore extends NetworkMod {
float min = Utils.pipeMinPos + 0.05F;
float max = Utils.pipeMaxPos - 0.05F;
if (!Utils.checkPipesConnections(tile,
holder.getTile(Orientations.XNeg))) {
block.setBlockBounds(Utils.pipeMinPos - 0.10F, min, min,
Utils.pipeMinPos, max, max);
if (!Utils.checkPipesConnections(tile, holder.getTile(Orientations.XNeg))) {
block.setBlockBounds(Utils.pipeMinPos - 0.10F, min, min, Utils.pipeMinPos, max, max);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord,
tile.zCoord);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord);
}
if (!Utils.checkPipesConnections(tile,
holder.getTile(Orientations.XPos))) {
block.setBlockBounds(Utils.pipeMaxPos, min, min,
Utils.pipeMaxPos + 0.10F, max, max);
if (!Utils.checkPipesConnections(tile, holder.getTile(Orientations.XPos))) {
block.setBlockBounds(Utils.pipeMaxPos, min, min, Utils.pipeMaxPos + 0.10F, max, max);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord,
tile.zCoord);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord);
}
if (!Utils.checkPipesConnections(tile,
holder.getTile(Orientations.YNeg))) {
block.setBlockBounds(min, Utils.pipeMinPos - 0.10F, min, max,
Utils.pipeMinPos, max);
if (!Utils.checkPipesConnections(tile, holder.getTile(Orientations.YNeg))) {
block.setBlockBounds(min, Utils.pipeMinPos - 0.10F, min, max, Utils.pipeMinPos, max);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord,
tile.zCoord);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord);
}
if (!Utils.checkPipesConnections(tile,
holder.getTile(Orientations.YPos))) {
block.setBlockBounds(min, Utils.pipeMaxPos, min, max,
Utils.pipeMaxPos + 0.10F, max);
if (!Utils.checkPipesConnections(tile, holder.getTile(Orientations.YPos))) {
block.setBlockBounds(min, Utils.pipeMaxPos, min, max, Utils.pipeMaxPos + 0.10F, max);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord,
tile.zCoord);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord);
}
if (!Utils.checkPipesConnections(tile,
holder.getTile(Orientations.ZNeg))) {
block.setBlockBounds(min, min, Utils.pipeMinPos - 0.10F, max, max,
Utils.pipeMinPos);
if (!Utils.checkPipesConnections(tile, holder.getTile(Orientations.ZNeg))) {
block.setBlockBounds(min, min, Utils.pipeMinPos - 0.10F, max, max, Utils.pipeMinPos);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord,
tile.zCoord);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord);
}
if (!Utils.checkPipesConnections(tile,
holder.getTile(Orientations.ZPos))) {
block.setBlockBounds(min, min, Utils.pipeMaxPos, max, max,
Utils.pipeMaxPos + 0.10F);
if (!Utils.checkPipesConnections(tile, holder.getTile(Orientations.ZPos))) {
block.setBlockBounds(min, min, Utils.pipeMaxPos, max, max, Utils.pipeMaxPos + 0.10F);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord,
tile.zCoord);
renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord);
}
}
private void legacyPipeRender(RenderBlocks renderblocks,
IBlockAccess iblockaccess, int i, int j, int k, Block block, int l) {
private void legacyPipeRender(RenderBlocks renderblocks, IBlockAccess iblockaccess, int i, int j, int k, Block block, int l) {
float minSize = Utils.pipeMinPos;
float maxSize = Utils.pipeMaxPos;
((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k,
Orientations.Unknown);
block.setBlockBounds(minSize, minSize, minSize, maxSize, maxSize,
maxSize);
((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, Orientations.Unknown);
block.setBlockBounds(minSize, minSize, minSize, maxSize, maxSize, maxSize);
renderblocks.renderStandardBlock(block, i, j, k);
if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i - 1, j,
k)) {
((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k,
Orientations.XNeg);
block.setBlockBounds(0.0F, minSize, minSize, minSize, maxSize,
maxSize);
if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i - 1, j, k)) {
((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, Orientations.XNeg);
block.setBlockBounds(0.0F, minSize, minSize, minSize, maxSize, maxSize);
renderblocks.renderStandardBlock(block, i, j, k);
}
if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i + 1, j,
k)) {
((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k,
Orientations.XPos);
block.setBlockBounds(maxSize, minSize, minSize, 1.0F, maxSize,
maxSize);
if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i + 1, j, k)) {
((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, Orientations.XPos);
block.setBlockBounds(maxSize, minSize, minSize, 1.0F, maxSize, maxSize);
renderblocks.renderStandardBlock(block, i, j, k);
}
if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i, j - 1,
k)) {
((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k,
Orientations.YNeg);
block.setBlockBounds(minSize, 0.0F, minSize, maxSize, minSize,
maxSize);
if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i, j - 1, k)) {
((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, Orientations.YNeg);
block.setBlockBounds(minSize, 0.0F, minSize, maxSize, minSize, maxSize);
renderblocks.renderStandardBlock(block, i, j, k);
}
if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i, j + 1,
k)) {
((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k,
Orientations.YPos);
block.setBlockBounds(minSize, maxSize, minSize, maxSize, 1.0F,
maxSize);
if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i, j + 1, k)) {
((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, Orientations.YPos);
block.setBlockBounds(minSize, maxSize, minSize, maxSize, 1.0F, maxSize);
renderblocks.renderStandardBlock(block, i, j, k);
}
if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i, j,
k - 1)) {
((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k,
Orientations.ZNeg);
block.setBlockBounds(minSize, minSize, 0.0F, maxSize, maxSize,
minSize);
if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i, j, k - 1)) {
((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, Orientations.ZNeg);
block.setBlockBounds(minSize, minSize, 0.0F, maxSize, maxSize, minSize);
renderblocks.renderStandardBlock(block, i, j, k);
}
if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i, j,
k + 1)) {
((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k,
Orientations.ZPos);
block.setBlockBounds(minSize, minSize, maxSize, maxSize, maxSize,
1.0F);
if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i, j, k + 1)) {
((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, Orientations.ZPos);
block.setBlockBounds(minSize, minSize, maxSize, maxSize, maxSize, 1.0F);
renderblocks.renderStandardBlock(block, i, j, k);
}
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k,
Orientations.Unknown);
((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, Orientations.Unknown);
}
RenderItem itemRenderer = new RenderItem();
@Override
public void renderInvBlock(RenderBlocks renderblocks, Block block, int i,
int j) {
public void renderInvBlock(RenderBlocks renderblocks, Block block, int i, int j) {
if (block.getRenderType() == BuildCraftCore.blockByEntityModel) {
EntityRenderIndex index = new EntityRenderIndex(block, i);
if (blockByEntityRenders.containsKey(index))
blockByEntityRenders.get(index).inventoryRender(-0.5, -0.5,
-0.5, 0, 0);
blockByEntityRenders.get(index).inventoryRender(-0.5, -0.5, -0.5, 0, 0);
} else if (block.getRenderType() == BuildCraftCore.markerModel) {
// Do nothing here...
} else if (block.getRenderType() == BuildCraftCore.pipeModel) {
Tessellator tessellator = Tessellator.instance;
block.setBlockBounds(Utils.pipeMinPos, 0.0F, Utils.pipeMinPos,
Utils.pipeMaxPos, 1.0F, Utils.pipeMaxPos);
block.setBlockBounds(Utils.pipeMinPos, 0.0F, Utils.pipeMinPos, Utils.pipeMaxPos, 1.0F, Utils.pipeMaxPos);
block.setBlockBoundsForItemRender();
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1F, 0.0F);
renderblocks.renderBottomFace(block, 0.0D, 0.0D, 0.0D,
block.getBlockTextureFromSideAndMetadata(0, i));
renderblocks.renderBottomFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(0, i));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderblocks.renderTopFace(block, 0.0D, 0.0D, 0.0D,
block.getBlockTextureFromSideAndMetadata(1, i));
renderblocks.renderTopFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(1, i));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1F);
renderblocks.renderEastFace(block, 0.0D, 0.0D, 0.0D,
block.getBlockTextureFromSideAndMetadata(2, i));
renderblocks.renderEastFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(2, i));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderblocks.renderWestFace(block, 0.0D, 0.0D, 0.0D,
block.getBlockTextureFromSideAndMetadata(3, i));
renderblocks.renderWestFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(3, i));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1F, 0.0F, 0.0F);
renderblocks.renderNorthFace(block, 0.0D, 0.0D, 0.0D,
block.getBlockTextureFromSideAndMetadata(4, i));
renderblocks.renderNorthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(4, i));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderblocks.renderSouthFace(block, 0.0D, 0.0D, 0.0D,
block.getBlockTextureFromSideAndMetadata(5, i));
renderblocks.renderSouthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(5, i));
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
@ -610,8 +509,7 @@ public class mod_BuildCraftCore extends NetworkMod {
}
public static void initializeMarkerMatrix() {
double frontXBase[][] = { { -0.0625, -0.0625, -0.0625, -0.0625 },
{ 1, 0, 0, 1 }, { -0.5, -0.5, 0.5, 0.5 } };
double frontXBase[][] = { { -0.0625, -0.0625, -0.0625, -0.0625 }, { 1, 0, 0, 1 }, { -0.5, -0.5, 0.5, 0.5 } };
frontX[3] = safeClone(frontXBase);
rotateFace(frontX[3]);
@ -627,8 +525,7 @@ public class mod_BuildCraftCore extends NetworkMod {
rotateFace(frontX[0]);
rotateFace(frontX[0]);
double frontZBase[][] = { { -0.5, -0.5, 0.5, 0.5 }, { 1, 0, 0, 1 },
{ 0.0625, 0.0625, 0.0625, 0.0625 } };
double frontZBase[][] = { { -0.5, -0.5, 0.5, 0.5 }, { 1, 0, 0, 1 }, { 0.0625, 0.0625, 0.0625, 0.0625 } };
frontZ[5] = safeClone(frontZBase);
@ -644,9 +541,7 @@ public class mod_BuildCraftCore extends NetworkMod {
rotateFace(frontZ[0]);
rotateFace(frontZ[0]);
double frontYBase[][] = { { -0.5, -0.5, 0.5, 0.5 },
{ -0.0625, -0.0625, -0.0625, -0.0625 },
{ 0.5, -0.5, -0.5, 0.5 } };
double frontYBase[][] = { { -0.5, -0.5, 0.5, 0.5 }, { -0.0625, -0.0625, -0.0625, -0.0625 }, { 0.5, -0.5, -0.5, 0.5 } };
frontY[4] = safeClone(frontYBase);
rotateFace(frontY[4]);
@ -664,8 +559,7 @@ public class mod_BuildCraftCore extends NetworkMod {
}
public void renderMarkerWithMeta(IBlockAccess iblockaccess, Block block,
double x, double y, double z, int meta) {
public void renderMarkerWithMeta(IBlockAccess iblockaccess, Block block, double x, double y, double z, int meta) {
Tessellator tessellator = Tessellator.instance;
int xCoord = (int) x;
@ -736,63 +630,39 @@ public class mod_BuildCraftCore extends NetworkMod {
d8 = f2 + 0.0234375D;
if (meta == 5 || meta == 4 || meta == 3 || meta == 0) {
tessellator.addVertexWithUV(x + frontX[m][0][0], y
+ frontX[m][1][0], z + frontX[m][2][0], f, f2);
tessellator.addVertexWithUV(x + frontX[m][0][1], y
+ frontX[m][1][1], z + frontX[m][2][1], f, f3);
tessellator.addVertexWithUV(x + frontX[m][0][2], y
+ frontX[m][1][2], z + frontX[m][2][2], f1, f3);
tessellator.addVertexWithUV(x + frontX[m][0][3], y
+ frontX[m][1][3], z + frontX[m][2][3], f1, f2);
tessellator.addVertexWithUV(x + frontX[m][0][0], y + frontX[m][1][0], z + frontX[m][2][0], f, f2);
tessellator.addVertexWithUV(x + frontX[m][0][1], y + frontX[m][1][1], z + frontX[m][2][1], f, f3);
tessellator.addVertexWithUV(x + frontX[m][0][2], y + frontX[m][1][2], z + frontX[m][2][2], f1, f3);
tessellator.addVertexWithUV(x + frontX[m][0][3], y + frontX[m][1][3], z + frontX[m][2][3], f1, f2);
tessellator.addVertexWithUV(x - frontX[m][0][3], y
+ frontX[m][1][3], z + frontX[m][2][3], f1, f2);
tessellator.addVertexWithUV(x - frontX[m][0][2], y
+ frontX[m][1][2], z + frontX[m][2][2], f1, f3);
tessellator.addVertexWithUV(x - frontX[m][0][1], y
+ frontX[m][1][1], z + frontX[m][2][1], f, f3);
tessellator.addVertexWithUV(x - frontX[m][0][0], y
+ frontX[m][1][0], z + frontX[m][2][0], f, f2);
tessellator.addVertexWithUV(x - frontX[m][0][3], y + frontX[m][1][3], z + frontX[m][2][3], f1, f2);
tessellator.addVertexWithUV(x - frontX[m][0][2], y + frontX[m][1][2], z + frontX[m][2][2], f1, f3);
tessellator.addVertexWithUV(x - frontX[m][0][1], y + frontX[m][1][1], z + frontX[m][2][1], f, f3);
tessellator.addVertexWithUV(x - frontX[m][0][0], y + frontX[m][1][0], z + frontX[m][2][0], f, f2);
}
if (meta == 5 || meta == 2 || meta == 1 || meta == 0) {
tessellator.addVertexWithUV(x + frontZ[m][0][0], y
+ frontZ[m][1][0], z + frontZ[m][2][0], f, f2);
tessellator.addVertexWithUV(x + frontZ[m][0][1], y
+ frontZ[m][1][1], z + frontZ[m][2][1], f, f3);
tessellator.addVertexWithUV(x + frontZ[m][0][2], y
+ frontZ[m][1][2], z + frontZ[m][2][2], f1, f3);
tessellator.addVertexWithUV(x + frontZ[m][0][3], y
+ frontZ[m][1][3], z + frontZ[m][2][3], f1, f2);
tessellator.addVertexWithUV(x + frontZ[m][0][0], y + frontZ[m][1][0], z + frontZ[m][2][0], f, f2);
tessellator.addVertexWithUV(x + frontZ[m][0][1], y + frontZ[m][1][1], z + frontZ[m][2][1], f, f3);
tessellator.addVertexWithUV(x + frontZ[m][0][2], y + frontZ[m][1][2], z + frontZ[m][2][2], f1, f3);
tessellator.addVertexWithUV(x + frontZ[m][0][3], y + frontZ[m][1][3], z + frontZ[m][2][3], f1, f2);
tessellator.addVertexWithUV(x + frontZ[m][0][3], y
+ frontZ[m][1][3], z - frontZ[m][2][3], f1, f2);
tessellator.addVertexWithUV(x + frontZ[m][0][2], y
+ frontZ[m][1][2], z - frontZ[m][2][2], f1, f3);
tessellator.addVertexWithUV(x + frontZ[m][0][1], y
+ frontZ[m][1][1], z - frontZ[m][2][1], f, f3);
tessellator.addVertexWithUV(x + frontZ[m][0][0], y
+ frontZ[m][1][0], z - frontZ[m][2][0], f, f2);
tessellator.addVertexWithUV(x + frontZ[m][0][3], y + frontZ[m][1][3], z - frontZ[m][2][3], f1, f2);
tessellator.addVertexWithUV(x + frontZ[m][0][2], y + frontZ[m][1][2], z - frontZ[m][2][2], f1, f3);
tessellator.addVertexWithUV(x + frontZ[m][0][1], y + frontZ[m][1][1], z - frontZ[m][2][1], f, f3);
tessellator.addVertexWithUV(x + frontZ[m][0][0], y + frontZ[m][1][0], z - frontZ[m][2][0], f, f2);
}
if (meta == 4 || meta == 3 || meta == 2 || meta == 1) {
tessellator.addVertexWithUV(x + frontY[m][0][0], y + 0.5
+ frontY[m][1][0], z + frontY[m][2][0], f, f2);
tessellator.addVertexWithUV(x + frontY[m][0][1], y + 0.5
+ frontY[m][1][1], z + frontY[m][2][1], f, f3);
tessellator.addVertexWithUV(x + frontY[m][0][2], y + 0.5
+ frontY[m][1][2], z + frontY[m][2][2], f1, f3);
tessellator.addVertexWithUV(x + frontY[m][0][3], y + 0.5
+ frontY[m][1][3], z + frontY[m][2][3], f1, f2);
tessellator.addVertexWithUV(x + frontY[m][0][0], y + 0.5 + frontY[m][1][0], z + frontY[m][2][0], f, f2);
tessellator.addVertexWithUV(x + frontY[m][0][1], y + 0.5 + frontY[m][1][1], z + frontY[m][2][1], f, f3);
tessellator.addVertexWithUV(x + frontY[m][0][2], y + 0.5 + frontY[m][1][2], z + frontY[m][2][2], f1, f3);
tessellator.addVertexWithUV(x + frontY[m][0][3], y + 0.5 + frontY[m][1][3], z + frontY[m][2][3], f1, f2);
tessellator.addVertexWithUV(x + frontY[m][0][3], y + 0.5
- frontY[m][1][3], z + frontY[m][2][3], f1, f2);
tessellator.addVertexWithUV(x + frontY[m][0][2], y + 0.5
- frontY[m][1][2], z + frontY[m][2][2], f1, f3);
tessellator.addVertexWithUV(x + frontY[m][0][1], y + 0.5
- frontY[m][1][1], z + frontY[m][2][1], f, f3);
tessellator.addVertexWithUV(x + frontY[m][0][0], y + 0.5
- frontY[m][1][0], z + frontY[m][2][0], f, f2);
tessellator.addVertexWithUV(x + frontY[m][0][3], y + 0.5 - frontY[m][1][3], z + frontY[m][2][3], f1, f2);
tessellator.addVertexWithUV(x + frontY[m][0][2], y + 0.5 - frontY[m][1][2], z + frontY[m][2][2], f1, f3);
tessellator.addVertexWithUV(x + frontY[m][0][1], y + 0.5 - frontY[m][1][1], z + frontY[m][2][1], f, f3);
tessellator.addVertexWithUV(x + frontY[m][0][0], y + 0.5 - frontY[m][1][0], z + frontY[m][2][0], f, f2);
}
}
@ -816,8 +686,7 @@ public class mod_BuildCraftCore extends NetworkMod {
if (d.getTime() - lastReport > 10000) {
lastReport = d.getTime();
int bytes = ClassMapping.report();
System.out.println("BuildCraft bandwidth = " + (bytes / 10)
+ " bytes / second");
System.out.println("BuildCraft bandwidth = " + (bytes / 10) + " bytes / second");
System.out.println();
}
}

View file

@ -26,15 +26,13 @@ public class mod_BuildCraftDevel extends NetworkMod {
mod_BuildCraftCore.initialize();
Property cheatId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("cheat.id", 255);
Property cheatId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("cheat.id", 255);
CraftingManager craftingmanager = CraftingManager.getInstance();
cheatBlock = new BlockCheat(Integer.parseInt(cheatId.value));
ModLoader.registerBlock(cheatBlock);
craftingmanager.addRecipe(new ItemStack(cheatBlock, 1), new Object[] {
"# ", " ", Character.valueOf('#'), Block.dirt });
craftingmanager.addRecipe(new ItemStack(cheatBlock, 1), new Object[] { "# ", " ", Character.valueOf('#'), Block.dirt });
BuildCraftCore.mainConfiguration.save();
}
@ -45,8 +43,7 @@ public class mod_BuildCraftDevel extends NetworkMod {
}
@Override
public void load() {
}
public void load() {}
@Override
public boolean clientSideRequired() {

View file

@ -33,26 +33,18 @@ public class mod_BuildCraftEnergy extends NetworkMod {
super.modsLoaded();
BuildCraftEnergy.initialize();
mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex(
BuildCraftEnergy.engineBlock, 0), new RenderEngine(
mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftEnergy.engineBlock, 0), new RenderEngine(
"/net/minecraft/src/buildcraft/energy/gui/base_wood.png"));
mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex(
BuildCraftEnergy.engineBlock, 1), new RenderEngine(
mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftEnergy.engineBlock, 1), new RenderEngine(
"/net/minecraft/src/buildcraft/energy/gui/base_stone.png"));
mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex(
BuildCraftEnergy.engineBlock, 2), new RenderEngine(
mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftEnergy.engineBlock, 2), new RenderEngine(
"/net/minecraft/src/buildcraft/energy/gui/base_iron.png"));
ModLoader.getMinecraftInstance().renderEngine
.registerTextureFX(new TextureOilFX());
ModLoader.getMinecraftInstance().renderEngine
.registerTextureFX(new TextureFuelFX());
ModLoader.getMinecraftInstance().renderEngine
.registerTextureFX(new TextureOilFlowFX());
ModLoader.getMinecraftInstance().renderEngine.registerTextureFX(new TextureOilFX());
ModLoader.getMinecraftInstance().renderEngine.registerTextureFX(new TextureFuelFX());
ModLoader.getMinecraftInstance().renderEngine.registerTextureFX(new TextureOilFlowFX());
ModLoader.registerTileEntity(TileEngine.class,
"net.minecraft.src.buildcraft.energy.Engine",
new RenderEngine());
ModLoader.registerTileEntity(TileEngine.class, "net.minecraft.src.buildcraft.energy.Engine", new RenderEngine());
// CoreProxy.registerGUI(this,
// Utils.packetIdToInt(PacketIds.EngineSteamGUI));

View file

@ -42,30 +42,21 @@ public class mod_BuildCraftFactory extends NetworkMod {
// CoreProxy.registerGUI(this,
// Utils.packetIdToInt(PacketIds.AutoCraftingGUI));
ModLoader.registerTileEntity(TileTank.class,
"net.minecraft.src.buildcraft.factory.TileTank",
new RenderTank());
ModLoader.registerTileEntity(TileTank.class, "net.minecraft.src.buildcraft.factory.TileTank", new RenderTank());
ModLoader.registerTileEntity(TileRefinery.class,
"net.minecraft.src.buildcraft.factory.Refinery",
ModLoader.registerTileEntity(TileRefinery.class, "net.minecraft.src.buildcraft.factory.Refinery", new RenderRefinery());
mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftFactory.refineryBlock, 0),
new RenderRefinery());
mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex(
BuildCraftFactory.refineryBlock, 0), new RenderRefinery());
ModLoader.registerTileEntity(TileHopper.class, "net.minecraft.src.buildcraft.factory.TileHopper", new RenderHopper());
ModLoader.registerTileEntity(TileHopper.class,
"net.minecraft.src.buildcraft.factory.TileHopper",
new RenderHopper());
mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex(
BuildCraftFactory.hopperBlock, 0), new RenderHopper());
mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftFactory.hopperBlock, 0), new RenderHopper());
// Detect the presence of NEI and add overlay for the Autocrafting Table
try {
Class<?> neiRenderer = Class
.forName("codechicken.nei.DefaultOverlayRenderer");
Method method = neiRenderer.getMethod("registerGuiOverlay",
Class.class, String.class, int.class, int.class);
Class<?> neiRenderer = Class.forName("codechicken.nei.DefaultOverlayRenderer");
Method method = neiRenderer.getMethod("registerGuiOverlay", Class.class, String.class, int.class, int.class);
method.invoke(null, GuiAutoCrafting.class, "crafting", 5, 11);
ModLoader.getLogger().fine("NEI detected, adding NEI overlay");
} catch (Exception e) {

View file

@ -43,8 +43,7 @@ public class mod_BuildCraftSilicon extends NetworkMod {
}
@Override
public boolean renderWorldBlock(RenderBlocks renderblocks,
IBlockAccess iblockaccess, int x, int y, int z, Block block, int l) {
public boolean renderWorldBlock(RenderBlocks renderblocks, IBlockAccess iblockaccess, int x, int y, int z, Block block, int l) {
int meta = iblockaccess.getBlockMetadata(x, y, z);
@ -57,8 +56,7 @@ public class mod_BuildCraftSilicon extends NetworkMod {
block.setBlockBounds(0.0F, 0.0F, 0.0F, 4F / 16F, 1, 1);
renderblocks.renderStandardBlock(block, x, y, z);
block.setBlockBounds(4F / 16F, 5F / 16F, 5F / 16F, 13F / 16F,
11F / 16F, 11F / 16F);
block.setBlockBounds(4F / 16F, 5F / 16F, 5F / 16F, 13F / 16F, 11F / 16F, 11F / 16F);
renderblocks.renderStandardBlock(block, x, y, z);
} else if (meta == Orientations.XNeg.ordinal()) {
renderblocks.uvRotateEast = 1;
@ -69,8 +67,7 @@ public class mod_BuildCraftSilicon extends NetworkMod {
block.setBlockBounds(1F - 4F / 16F, 0.0F, 0.0F, 1, 1, 1);
renderblocks.renderStandardBlock(block, x, y, z);
block.setBlockBounds(1F - 13F / 16F, 5F / 16F, 5F / 16F,
1F - 4F / 16F, 11F / 16F, 11F / 16F);
block.setBlockBounds(1F - 13F / 16F, 5F / 16F, 5F / 16F, 1F - 4F / 16F, 11F / 16F, 11F / 16F);
renderblocks.renderStandardBlock(block, x, y, z);
} else if (meta == Orientations.ZNeg.ordinal()) {
renderblocks.uvRotateSouth = 1;
@ -79,8 +76,7 @@ public class mod_BuildCraftSilicon extends NetworkMod {
block.setBlockBounds(0.0F, 0.0F, 1F - 4F / 16F, 1, 1, 1);
renderblocks.renderStandardBlock(block, x, y, z);
block.setBlockBounds(5F / 16F, 5F / 16F, 1F - 13F / 16F, 11F / 16F,
11F / 16F, 1F - 4F / 16F);
block.setBlockBounds(5F / 16F, 5F / 16F, 1F - 13F / 16F, 11F / 16F, 11F / 16F, 1F - 4F / 16F);
renderblocks.renderStandardBlock(block, x, y, z);
} else if (meta == Orientations.ZPos.ordinal()) {
renderblocks.uvRotateSouth = 2;
@ -91,8 +87,7 @@ public class mod_BuildCraftSilicon extends NetworkMod {
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1, 1, 4F / 16F);
renderblocks.renderStandardBlock(block, x, y, z);
block.setBlockBounds(5F / 16F, 5F / 16F, 4F / 16F, 11F / 16F,
11F / 16F, 13F / 16F);
block.setBlockBounds(5F / 16F, 5F / 16F, 4F / 16F, 11F / 16F, 11F / 16F, 13F / 16F);
renderblocks.renderStandardBlock(block, x, y, z);
} else if (meta == Orientations.YNeg.ordinal()) {
renderblocks.uvRotateEast = 3;
@ -103,15 +98,13 @@ public class mod_BuildCraftSilicon extends NetworkMod {
block.setBlockBounds(0.0F, 1.0F - 4F / 16F, 0.0F, 1.0F, 1.0F, 1.0F);
renderblocks.renderStandardBlock(block, x, y, z);
block.setBlockBounds(5F / 16F, 1F - 13F / 16F, 5F / 16F, 11F / 16F,
1F - 4F / 16F, 11F / 16F);
block.setBlockBounds(5F / 16F, 1F - 13F / 16F, 5F / 16F, 11F / 16F, 1F - 4F / 16F, 11F / 16F);
renderblocks.renderStandardBlock(block, x, y, z);
} else if (meta == Orientations.YPos.ordinal()) {
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1, 4F / 16F, 1);
renderblocks.renderStandardBlock(block, x, y, z);
block.setBlockBounds(5F / 16F, 4F / 16F, 5F / 16F, 11F / 16F,
13F / 16F, 11F / 16F);
block.setBlockBounds(5F / 16F, 4F / 16F, 5F / 16F, 11F / 16F, 13F / 16F, 11F / 16F);
renderblocks.renderStandardBlock(block, x, y, z);
}
@ -128,17 +121,14 @@ public class mod_BuildCraftSilicon extends NetworkMod {
}
@Override
public void renderInvBlock(RenderBlocks renderblocks, Block block, int i,
int j) {
block.setBlockBounds(Utils.pipeMinPos, 0.0F, Utils.pipeMinPos,
Utils.pipeMaxPos, 1.0F, Utils.pipeMaxPos);
public void renderInvBlock(RenderBlocks renderblocks, Block block, int i, int j) {
block.setBlockBounds(Utils.pipeMinPos, 0.0F, Utils.pipeMinPos, Utils.pipeMaxPos, 1.0F, Utils.pipeMaxPos);
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1, 4F / 16F, 1);
renderBlockInInv(renderblocks, block, 0);
block.setBlockBounds(5F / 16F, 4F / 16F, 5F / 16F, 11F / 16F,
13F / 16F, 11F / 16F);
block.setBlockBounds(5F / 16F, 4F / 16F, 5F / 16F, 11F / 16F, 13F / 16F, 11F / 16F);
renderBlockInInv(renderblocks, block, 1);
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
@ -149,38 +139,32 @@ public class mod_BuildCraftSilicon extends NetworkMod {
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1F, 0.0F);
renderblocks.renderBottomFace(block, 0.0D, 0.0D, 0.0D,
block.getBlockTextureFromSideAndMetadata(0, i));
renderblocks.renderBottomFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(0, i));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderblocks.renderTopFace(block, 0.0D, 0.0D, 0.0D,
block.getBlockTextureFromSideAndMetadata(1, i));
renderblocks.renderTopFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(1, i));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1F);
renderblocks.renderEastFace(block, 0.0D, 0.0D, 0.0D,
block.getBlockTextureFromSideAndMetadata(2, i));
renderblocks.renderEastFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(2, i));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderblocks.renderWestFace(block, 0.0D, 0.0D, 0.0D,
block.getBlockTextureFromSideAndMetadata(3, i));
renderblocks.renderWestFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(3, i));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1F, 0.0F, 0.0F);
renderblocks.renderNorthFace(block, 0.0D, 0.0D, 0.0D,
block.getBlockTextureFromSideAndMetadata(4, i));
renderblocks.renderNorthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(4, i));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderblocks.renderSouthFace(block, 0.0D, 0.0D, 0.0D,
block.getBlockTextureFromSideAndMetadata(5, i));
renderblocks.renderSouthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(5, i));
tessellator.draw();
}

View file

@ -19,8 +19,7 @@ import net.minecraft.src.forge.NetworkMod;
import org.lwjgl.opengl.GL11;
public class mod_BuildCraftTransport extends NetworkMod implements
IItemRenderer {
public class mod_BuildCraftTransport extends NetworkMod implements IItemRenderer {
public static mod_BuildCraftTransport instance;
@ -36,48 +35,28 @@ public class mod_BuildCraftTransport extends NetworkMod implements
// CoreProxy.registerGUI(this,
// Utils.packetIdToInt(PacketIds.DiamondPipeGUI));
MinecraftForgeClient.registerItemRenderer(
BuildCraftTransport.pipeItemsWood.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(
BuildCraftTransport.pipeItemsCobblestone.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(
BuildCraftTransport.pipeItemsStone.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(
BuildCraftTransport.pipeItemsIron.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(
BuildCraftTransport.pipeItemsGold.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(
BuildCraftTransport.pipeItemsDiamond.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(
BuildCraftTransport.pipeItemsObsidian.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsWood.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsCobblestone.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsStone.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsIron.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsGold.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsDiamond.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsObsidian.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(
BuildCraftTransport.pipeLiquidsWood.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(
BuildCraftTransport.pipeLiquidsCobblestone.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(
BuildCraftTransport.pipeLiquidsStone.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(
BuildCraftTransport.pipeLiquidsIron.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(
BuildCraftTransport.pipeLiquidsGold.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsWood.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsCobblestone.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsStone.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsIron.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsGold.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(
BuildCraftTransport.pipePowerWood.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(
BuildCraftTransport.pipePowerStone.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(
BuildCraftTransport.pipePowerGold.shiftedIndex, this);
MinecraftForgeClient
.registerItemRenderer(
BuildCraftTransport.pipeStructureCobblestone.shiftedIndex,
this);
MinecraftForgeClient.registerItemRenderer(
BuildCraftTransport.pipeItemsStipes.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerWood.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerStone.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerGold.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeStructureCobblestone.shiftedIndex, this);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsStipes.shiftedIndex, this);
}
public static void registerTilePipe(Class<? extends TileEntity> clas,
String name) {
public static void registerTilePipe(Class<? extends TileEntity> clas, String name) {
ModLoader.registerTileEntity(clas, name, new RenderPipe());
}
@ -97,20 +76,17 @@ public class mod_BuildCraftTransport extends NetworkMod implements
return false;
}
private void renderPipeItem(RenderBlocks render, ItemStack item,
float translateX, float translateY, float translateZ) {
private void renderPipeItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) {
// GL11.glBindTexture(GL11.GL_TEXTURE_2D, 10);
Tessellator tessellator = Tessellator.instance;
Block block = BuildCraftTransport.genericPipeBlock;
int textureID = ((ItemPipe) Item.itemsList[item.itemID])
.getTextureIndex();
int textureID = ((ItemPipe) Item.itemsList[item.itemID]).getTextureIndex();
if (textureID > 255)
textureID -= 256;
block.setBlockBounds(Utils.pipeMinPos, 0.0F, Utils.pipeMinPos,
Utils.pipeMaxPos, 1.0F, Utils.pipeMaxPos);
block.setBlockBounds(Utils.pipeMinPos, 0.0F, Utils.pipeMinPos, Utils.pipeMaxPos, 1.0F, Utils.pipeMaxPos);
block.setBlockBoundsForItemRender();
GL11.glTranslatef(translateX, translateY, translateZ);
tessellator.startDrawingQuads();
@ -209,8 +185,7 @@ public class mod_BuildCraftTransport extends NetworkMod implements
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item,
ItemRendererHelper helper) {
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
return true;
}

View file

@ -17,30 +17,29 @@ import net.minecraft.src.World;
public class APIProxy {
public static boolean isClient (World world) {
public static boolean isClient(World world) {
return false;
}
public static boolean isServerSide () {
public static boolean isServerSide() {
return true;
}
public static boolean isRemote() {
return false;
}
public static void removeEntity (Entity entity) {
public static void removeEntity(Entity entity) {
entity.setDead();
}
public static Random createNewRandom (World world) {
return new Random (world.getSeed());
public static Random createNewRandom(World world) {
return new Random(world.getSeed());
}
public static EntityPlayer createNewPlayer (World world) {
public static EntityPlayer createNewPlayer(World world) {
return new EntityPlayer(world) {
};
}
}

View file

@ -15,7 +15,7 @@ import net.minecraft.src.World;
public class BuildersProxy {
public static boolean canPlaceTorch(World world, int i, int j, int k) {
Block block = Block.blocksList [world.getBlockId(i, j, k)];
Block block = Block.blocksList[world.getBlockId(i, j, k)];
if (block == null || !block.renderAsNormalBlock())
return false;
@ -23,7 +23,7 @@ public class BuildersProxy {
return true;
}
public static String getOwner (TileBlueprintLibrary library) {
public static String getOwner(TileBlueprintLibrary library) {
return library.owner;
}

View file

@ -14,27 +14,26 @@ import net.minecraft.src.IInventory;
class CraftingTemplate extends CraftingTemplateRoot {
public CraftingTemplate (IInventory playerInventory, TileArchitect template) {
super (playerInventory, template);
public CraftingTemplate(IInventory playerInventory, TileArchitect template) {
super(playerInventory, template);
}
@Override
public void onCraftGuiOpened(ICrafting icrafting) {
super.onCraftGuiOpened(icrafting);
icrafting.updateCraftingInventoryInfo(this, 0, template.computingTime);
}
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);
}
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;
}
computingTime = template.computingTime;
}
}

View file

@ -11,35 +11,34 @@ import net.minecraft.src.forge.IGuiHandler;
public class GuiHandler implements IGuiHandler {
@Override
public Object getGuiElement(int ID, EntityPlayer player, World world,
int x, int y, int z) {
public Object getGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
if(!world.blockExists(x, y, z))
if (!world.blockExists(x, y, z))
return null;
TileEntity tile = world.getBlockTileEntity(x, y, z);
switch(ID) {
switch (ID) {
case GuiIds.ARCHITECT_TABLE:
if(!(tile instanceof TileArchitect))
if (!(tile instanceof TileArchitect))
return null;
return new CraftingTemplate(player.inventory, (TileArchitect)tile);
return new CraftingTemplate(player.inventory, (TileArchitect) tile);
case GuiIds.BLUEPRINT_LIBRARY:
if(!(tile instanceof TileBlueprintLibrary))
if (!(tile instanceof TileBlueprintLibrary))
return null;
return new ContainerBlueprintLibrary(player, (TileBlueprintLibrary)tile);
return new ContainerBlueprintLibrary(player, (TileBlueprintLibrary) tile);
case GuiIds.BUILDER:
if(!(tile instanceof TileBuilder))
if (!(tile instanceof TileBuilder))
return null;
return new CraftingBuilder(player.inventory, (TileBuilder)tile);
return new CraftingBuilder(player.inventory, (TileBuilder) tile);
case GuiIds.FILLER:
if(!(tile instanceof TileFiller))
if (!(tile instanceof TileFiller))
return null;
return new CraftingFiller(player.inventory, (TileFiller)tile);
return new CraftingFiller(player.inventory, (TileFiller) tile);
default:
return null;

View file

@ -28,20 +28,26 @@ import net.minecraft.src.forge.NetworkMod;
public class CoreProxy {
public static String getCurrentLanguage() { return null; }
/// FIXING GENERAL MLMP AND DEOBFUSCATION DERPINESS
public static String getCurrentLanguage() {
return null;
}
// / FIXING GENERAL MLMP AND DEOBFUSCATION DERPINESS
public static void addName(Object obj, String s) {}
public static void registerBlock(Block block) {
Item.itemsList[block.blockID] = null;
Item.itemsList[block.blockID] = new ItemBlockBuildCraft(block.blockID - 256, block.getBlockName());
}
public static void registerTileEntity(Class clas, String ident) {
ModLoader.registerTileEntity(clas, ident);
}
public static void setField804 (EntityItem item, float value) {
public static void setField804(EntityItem item, float value) {
item.field_432_ae = value;
}
public static void onCraftingPickup(World world, EntityPlayer player, ItemStack stack) {
stack.onCrafting(world, player, stack.stackSize);
}
@ -50,14 +56,12 @@ public class CoreProxy {
return new File("BuildCraft.cfg");
}
public static void sendToPlayers(Packet packet, World w, int x, int y,
int z, int maxDistance, NetworkMod mod) {
public static void sendToPlayers(Packet packet, World w, int x, int y, int z, int maxDistance, NetworkMod mod) {
if (packet != null) {
for (int j = 0; j < w.playerEntities.size(); j++) {
EntityPlayerMP player = (EntityPlayerMP)w.playerEntities.get(j);
EntityPlayerMP player = (EntityPlayerMP) w.playerEntities.get(j);
if (Math.abs(player.posX - x) <= maxDistance
&& Math.abs(player.posY - y) <= maxDistance
if (Math.abs(player.posX - x) <= maxDistance && Math.abs(player.posY - y) <= maxDistance
&& Math.abs(player.posZ - z) <= maxDistance)
player.playerNetServerHandler.sendPacket(packet);
}
@ -65,10 +69,10 @@ public class CoreProxy {
}
public static void sendToPlayer(EntityPlayer entityplayer, BuildCraftPacket packet) {
EntityPlayerMP player = (EntityPlayerMP)entityplayer;
EntityPlayerMP player = (EntityPlayerMP) entityplayer;
player.playerNetServerHandler.sendPacket(packet.getPacket());
}
/**
* Server side stub.
*/
@ -83,7 +87,7 @@ public class CoreProxy {
}
public static int addFuel (int id, int dmg) {
public static int addFuel(int id, int dmg) {
return ModLoader.addAllFuel(id, dmg);
}
@ -91,19 +95,18 @@ public class CoreProxy {
return 0;
}
public static long getHash (IBlockAccess iBlockAccess) {
// return iBlockAccess.hashCode();
public static long getHash(IBlockAccess iBlockAccess) {
// return iBlockAccess.hashCode();
return 0;
}
public static void TakenFromCrafting(EntityPlayer thePlayer,
ItemStack itemstack, IInventory craftMatrix) {
public static void TakenFromCrafting(EntityPlayer thePlayer, ItemStack itemstack, IInventory craftMatrix) {
ModLoader.takenFromCrafting(thePlayer, itemstack, craftMatrix);
}
public static void BindTexture(String texture){
public static void BindTexture(String texture) {
}
}

View file

@ -14,12 +14,9 @@ public class ConnectionHandler implements IConnectionHandler {
}
@Override
public void onLogin(NetworkManager network, Packet1Login login) {
}
public void onLogin(NetworkManager network, Packet1Login login) {}
@Override
public void onDisconnect(NetworkManager network, String message,
Object[] args) {
}
public void onDisconnect(NetworkManager network, String message, Object[] args) {}
}

View file

@ -6,7 +6,6 @@ import net.minecraft.src.forge.IPacketHandler;
public class PacketHandler implements IPacketHandler {
@Override
public void onPacketData(NetworkManager network, String channel, byte[] data) {
}
public void onPacketData(NetworkManager network, String channel, byte[] data) {}
}

View file

@ -14,8 +14,7 @@ import net.minecraft.src.InventoryPlayer;
public class ContainerEngine extends ContainerEngineRoot {
public ContainerEngine(InventoryPlayer inventoryplayer,
TileEngine tileEngine) {
public ContainerEngine(InventoryPlayer inventoryplayer, TileEngine tileEngine) {
super(inventoryplayer, tileEngine);
// TODO Auto-generated constructor stub
}

View file

@ -11,19 +11,18 @@ import net.minecraft.src.forge.IGuiHandler;
public class GuiHandler implements IGuiHandler {
@Override
public Object getGuiElement(int ID, EntityPlayer player, World world,
int x, int y, int z) {
public Object getGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
if(!world.blockExists(x, y, z))
if (!world.blockExists(x, y, z))
return null;
TileEntity tile = world.getBlockTileEntity(x, y, z);
if(!(tile instanceof TileEngine))
if (!(tile instanceof TileEngine))
return null;
TileEngine engine = (TileEngine)tile;
TileEngine engine = (TileEngine) tile;
switch(ID) {
switch (ID) {
case GuiIds.ENGINE_IRON:
return new ContainerEngine(player.inventory, engine);

View file

@ -11,30 +11,29 @@ import net.minecraft.src.forge.IGuiHandler;
public class GuiHandler implements IGuiHandler {
@Override
public Object getGuiElement(int ID, EntityPlayer player, World world,
int x, int y, int z) {
public Object getGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
if(!world.blockExists(x, y, z))
if (!world.blockExists(x, y, z))
return null;
TileEntity tile = world.getBlockTileEntity(x, y, z);
switch(ID) {
switch (ID) {
case GuiIds.AUTO_CRAFTING_TABLE:
if(!(tile instanceof TileAutoWorkbench))
if (!(tile instanceof TileAutoWorkbench))
return null;
return new ContainerAutoWorkbench(player.inventory, (TileAutoWorkbench)tile);
return new ContainerAutoWorkbench(player.inventory, (TileAutoWorkbench) tile);
case GuiIds.REFINERY:
if(!(tile instanceof TileRefinery))
if (!(tile instanceof TileRefinery))
return null;
return new ContainerRefinery(player.inventory, (TileRefinery)tile);
return new ContainerRefinery(player.inventory, (TileRefinery) tile);
case GuiIds.HOPPER:
if (!(tile instanceof TileHopper))
return null;
return new ContainerHopper(player.inventory, (TileHopper)tile);
return new ContainerHopper(player.inventory, (TileHopper) tile);
default:
return null;

View file

@ -14,12 +14,9 @@ public class ConnectionHandler implements IConnectionHandler {
}
@Override
public void onLogin(NetworkManager network, Packet1Login login) {
}
public void onLogin(NetworkManager network, Packet1Login login) {}
@Override
public void onDisconnect(NetworkManager network, String message,
Object[] args) {
}
public void onDisconnect(NetworkManager network, String message, Object[] args) {}
}

View file

@ -17,15 +17,14 @@ public class PacketHandler implements IPacketHandler {
@Override
public void onPacketData(NetworkManager network, String channel, byte[] bytes) {
DataInputStream data = new DataInputStream(new ByteArrayInputStream(bytes));
try
{
NetServerHandler net = (NetServerHandler)network.getNetHandler();
try {
NetServerHandler net = (NetServerHandler) network.getNetHandler();
int packetID = data.read();
PacketUpdate packet = new PacketUpdate();
switch (packetID) {
case PacketIds.REFINERY_FILTER_SET:
@ -35,31 +34,31 @@ public class PacketHandler implements IPacketHandler {
}
} catch(Exception ex) {
} catch (Exception ex) {
ex.printStackTrace();
}
}
private TileRefinery getRefinery(World world, int x, int y, int z) {
if(!world.blockExists(x, y, z))
if (!world.blockExists(x, y, z))
return null;
TileEntity tile = world.getBlockTileEntity(x, y, z);
if(!(tile instanceof TileRefinery))
if (!(tile instanceof TileRefinery))
return null;
return (TileRefinery)tile;
return (TileRefinery) tile;
}
private void onRefinerySelect(EntityPlayerMP playerEntity, PacketUpdate packet) {
TileRefinery tile = getRefinery(playerEntity.worldObj, packet.posX, packet.posY, packet.posZ);
if(tile == null)
if (tile == null)
return;
tile.setFilter(packet.payload.intPayload[0], packet.payload.intPayload[1]);
}
}

View file

@ -12,20 +12,19 @@ import net.minecraft.src.forge.IGuiHandler;
public class GuiHandler implements IGuiHandler {
@Override
public Object getGuiElement(int ID, EntityPlayer player, World world,
int x, int y, int z) {
public Object getGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
if(!world.blockExists(x, y, z))
if (!world.blockExists(x, y, z))
return null;
TileEntity tile = world.getBlockTileEntity(x, y, z);
switch(ID) {
switch (ID) {
case GuiIds.ASSEMBLY_TABLE:
if(!(tile instanceof TileAssemblyTable))
if (!(tile instanceof TileAssemblyTable))
return null;
return new ContainerAssemblyTable(player.inventory, (TileAssemblyTable)tile);
return new ContainerAssemblyTable(player.inventory, (TileAssemblyTable) tile);
default:
return null;

View file

@ -20,8 +20,7 @@ public class ConnectionHandler implements IConnectionHandler {
}
@Override
public void onDisconnect(NetworkManager network, String message,
Object[] args) {
public void onDisconnect(NetworkManager network, String message, Object[] args) {
// TODO Auto-generated method stub
}

View file

@ -20,9 +20,8 @@ public class PacketHandler implements IPacketHandler {
public void onPacketData(NetworkManager network, String channel, byte[] bytes) {
DataInputStream data = new DataInputStream(new ByteArrayInputStream(bytes));
try
{
NetServerHandler net = (NetServerHandler)network.getNetHandler();
try {
NetServerHandler net = (NetServerHandler) network.getNetHandler();
int packetID = data.read();
switch (packetID) {
@ -40,7 +39,7 @@ public class PacketHandler implements IPacketHandler {
}
} catch(Exception ex) {
} catch (Exception ex) {
ex.printStackTrace();
}
@ -48,25 +47,26 @@ public class PacketHandler implements IPacketHandler {
private TileAssemblyTable getAssemblyTable(World world, int x, int y, int z) {
if(!world.blockExists(x, y, z))
if (!world.blockExists(x, y, z))
return null;
TileEntity tile = world.getBlockTileEntity(x, y, z);
if(!(tile instanceof TileAssemblyTable))
if (!(tile instanceof TileAssemblyTable))
return null;
return (TileAssemblyTable)tile;
return (TileAssemblyTable) tile;
}
/**
* Sends the current selection on the assembly table to a player.
*
* @param player
* @param packet
*/
private void onAssemblyGetSelection(EntityPlayerMP player, PacketCoordinates packet) {
TileAssemblyTable tile = getAssemblyTable(player.worldObj, packet.posX, packet.posY, packet.posZ);
if(tile == null)
if (tile == null)
return;
tile.sendSelectionTo(player);
@ -74,15 +74,16 @@ public class PacketHandler implements IPacketHandler {
/**
* Sets the selection on an assembly table according to player request.
*
* @param player
* @param packet
*/
private void onAssemblySelect(EntityPlayerMP player, PacketUpdate packet) {
TileAssemblyTable tile = getAssemblyTable(player.worldObj, packet.posX, packet.posY, packet.posZ);
if(tile == null)
if (tile == null)
return;
TileAssemblyTable.SelectionMessage message = new TileAssemblyTable.SelectionMessage();
TileAssemblyTable.selectionMessageWrapper.fromPayload(message, packet.payload);
tile.handleSelectionMessage(message);

View file

@ -11,19 +11,18 @@ import net.minecraft.src.forge.IGuiHandler;
public class GuiHandler implements IGuiHandler {
@Override
public Object getGuiElement(int ID, EntityPlayer player, World world,
int x, int y, int z) {
public Object getGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
if(!world.blockExists(x, y, z))
if (!world.blockExists(x, y, z))
return null;
TileEntity tile = world.getBlockTileEntity(x, y, z);
if(!(tile instanceof TileGenericPipe))
if (!(tile instanceof TileGenericPipe))
return null;
TileGenericPipe pipe = (TileGenericPipe)tile;
TileGenericPipe pipe = (TileGenericPipe) tile;
switch(ID) {
switch (ID) {
case GuiIds.PIPE_DIAMOND:
return new CraftingDiamondPipe(player.inventory, pipe);

View file

@ -15,7 +15,7 @@ import net.minecraft.src.World;
public class TransportProxy {
public static void obsidianPipePickup (World world, EntityItem item, TileEntity tile) {
public static void obsidianPipePickup(World world, EntityItem item, TileEntity tile) {
}

View file

@ -20,8 +20,7 @@ public class ConnectionHandler implements IConnectionHandler {
}
@Override
public void onDisconnect(NetworkManager network, String message,
Object[] args) {
public void onDisconnect(NetworkManager network, String message, Object[] args) {
// TODO Auto-generated method stub
}

View file

@ -23,9 +23,8 @@ public class PacketHandler implements IPacketHandler {
@Override
public void onPacketData(NetworkManager network, String channel, byte[] bytes) {
DataInputStream data = new DataInputStream(new ByteArrayInputStream(bytes));
try
{
NetServerHandler net = (NetServerHandler)network.getNetHandler();
try {
NetServerHandler net = (NetServerHandler) network.getNetHandler();
int packetID = data.read();
switch (packetID) {
@ -34,68 +33,72 @@ public class PacketHandler implements IPacketHandler {
packet.readData(data);
onDiamondPipeSelect(net.getPlayerEntity(), packet);
break;
case PacketIds.GATE_REQUEST_INIT:
PacketCoordinates packetU = new PacketCoordinates();
packetU.readData(data);
onGateInitRequest(net.getPlayerEntity(), packetU);
break;
case PacketIds.GATE_REQUEST_SELECTION:
PacketCoordinates packetS = new PacketCoordinates();
packetS.readData(data);
onGateSelectionRequest(net.getPlayerEntity(), packetS);
break;
case PacketIds.GATE_SELECTION_CHANGE:
PacketUpdate packetC = new PacketUpdate();
packetC.readData(data);
onGateSelectionChange(net.getPlayerEntity(), packetC);
break;
}
} catch(Exception ex) {
} catch (Exception ex) {
ex.printStackTrace();
}
}
/**
* Handles selection changes on a gate.
*
* @param playerEntity
* @param packet
*/
private void onGateSelectionChange(EntityPlayerMP playerEntity, PacketUpdate packet) {
if(!(playerEntity.craftingInventory instanceof CraftingGateInterface))
if (!(playerEntity.craftingInventory instanceof CraftingGateInterface))
return;
((CraftingGateInterface)playerEntity.craftingInventory).handleSelectionChange(packet);
((CraftingGateInterface) playerEntity.craftingInventory).handleSelectionChange(packet);
}
/**
* Handles gate gui (current) selection requests.
*
* @param playerEntity
* @param packet
*/
private void onGateSelectionRequest(EntityPlayerMP playerEntity, PacketCoordinates packet) {
if(!(playerEntity.craftingInventory instanceof CraftingGateInterface))
if (!(playerEntity.craftingInventory instanceof CraftingGateInterface))
return;
((CraftingGateInterface)playerEntity.craftingInventory).sendSelection(playerEntity);
((CraftingGateInterface) playerEntity.craftingInventory).sendSelection(playerEntity);
}
/**
* Handles received gate gui initialization requests.
*
* @param playerEntity
* @param packet
*/
private void onGateInitRequest(EntityPlayerMP playerEntity, PacketCoordinates packet) {
if(!(playerEntity.craftingInventory instanceof CraftingGateInterface))
return;
((CraftingGateInterface)playerEntity.craftingInventory).handleInitRequest(playerEntity);
if (!(playerEntity.craftingInventory instanceof CraftingGateInterface))
return;
((CraftingGateInterface) playerEntity.craftingInventory).handleInitRequest(playerEntity);
}
/**
* Retrieves pipe at specified coordinates if any.
*
* @param world
* @param x
* @param y
@ -103,29 +106,30 @@ public class PacketHandler implements IPacketHandler {
* @return
*/
private TileGenericPipe getPipe(World world, int x, int y, int z) {
if(!world.blockExists(x, y, z))
return null;
TileEntity tile = world.getBlockTileEntity(x, y, z);
if(!(tile instanceof TileGenericPipe))
if (!world.blockExists(x, y, z))
return null;
return (TileGenericPipe)tile;
TileEntity tile = world.getBlockTileEntity(x, y, z);
if (!(tile instanceof TileGenericPipe))
return null;
return (TileGenericPipe) tile;
}
/**
* Handles selection changes on diamond pipe guis.
*
* @param player
* @param packet
*/
private void onDiamondPipeSelect(EntityPlayerMP player, PacketSlotChange packet) {
TileGenericPipe pipe = getPipe(player.worldObj, packet.posX, packet.posY, packet.posZ);
if(pipe == null)
if (pipe == null)
return;
if(!(pipe.pipe.logic instanceof PipeLogicDiamond))
if (!(pipe.pipe.logic instanceof PipeLogicDiamond))
return;
pipe.pipe.logic.setInventorySlotContents(packet.slot, packet.stack);
}

View file

@ -16,7 +16,7 @@ public class mod_BuildCraftBuilders extends NetworkMod {
public static mod_BuildCraftBuilders instance;
public mod_BuildCraftBuilders () {
public mod_BuildCraftBuilders() {
instance = this;
}
@ -26,7 +26,7 @@ public class mod_BuildCraftBuilders extends NetworkMod {
}
@Override
public void modsLoaded () {
public void modsLoaded() {
super.modsLoaded();
BuildCraftBuilders.initialize();
@ -37,6 +37,13 @@ public class mod_BuildCraftBuilders extends NetworkMod {
return DefaultProps.VERSION;
}
@Override public boolean clientSideRequired() { return true; }
@Override public boolean serverSideRequired() { return true; }
@Override
public boolean clientSideRequired() {
return true;
}
@Override
public boolean serverSideRequired() {
return true;
}
}

View file

@ -20,18 +20,18 @@ public class mod_BuildCraftCore extends NetworkMod {
public static mod_BuildCraftCore instance;
public mod_BuildCraftCore () {
public mod_BuildCraftCore() {
instance = this;
}
BuildCraftCore proxy = new BuildCraftCore();
public static void initialize () {
BuildCraftCore.initialize ();
public static void initialize() {
BuildCraftCore.initialize();
}
@Override
public void modsLoaded () {
public void modsLoaded() {
mod_BuildCraftCore.initialize();
BuildCraftCore.initializeModel(this);
ModLoader.setInGameHook(this, true, true);
@ -43,7 +43,7 @@ public class mod_BuildCraftCore extends NetworkMod {
@Override
public String getVersion() {
return version ();
return version();
}
long lastReport = 0;
@ -56,11 +56,11 @@ public class mod_BuildCraftCore extends NetworkMod {
if (d.getTime() - lastReport > 10000) {
lastReport = d.getTime();
int bytes = ClassMapping.report();
System.out.println ("BuildCraft bandwidth = " + (bytes / 10) + " bytes / second");
System.out.println ();
System.out.println("BuildCraft bandwidth = " + (bytes / 10) + " bytes / second");
System.out.println();
}
}
return true;
}
@ -69,7 +69,14 @@ public class mod_BuildCraftCore extends NetworkMod {
BuildCraftCore.load();
}
@Override public boolean clientSideRequired() { return true; }
@Override public boolean serverSideRequired() { return true; }
@Override
public boolean clientSideRequired() {
return true;
}
@Override
public boolean serverSideRequired() {
return true;
}
}

View file

@ -24,12 +24,11 @@ public class mod_BuildCraftEnergy extends NetworkMod {
}
@Override
public void modsLoaded () {
public void modsLoaded() {
super.modsLoaded();
BuildCraftEnergy.initialize();
ModLoader.registerTileEntity(TileEngine.class,
"net.minecraft.src.buildcraft.energy.Engine");
ModLoader.registerTileEntity(TileEngine.class, "net.minecraft.src.buildcraft.energy.Engine");
}
@Override
@ -38,16 +37,23 @@ public class mod_BuildCraftEnergy extends NetworkMod {
}
@Override
public void generateSurface(World world, Random random, int i, int j) {
BuildCraftEnergy.generateSurface (world, random, i, j);
}
public void generateSurface(World world, Random random, int i, int j) {
BuildCraftEnergy.generateSurface(world, random, i, j);
}
@Override
public void load() {
BuildCraftEnergy.load();
}
@Override public boolean clientSideRequired() { return true; }
@Override public boolean serverSideRequired() { return true; }
@Override
public boolean clientSideRequired() {
return true;
}
@Override
public boolean serverSideRequired() {
return true;
}
}

View file

@ -21,7 +21,7 @@ public class mod_BuildCraftFactory extends NetworkMod {
}
@Override
public void modsLoaded () {
public void modsLoaded() {
super.modsLoaded();
BuildCraftFactory.initialize();
@ -37,6 +37,13 @@ public class mod_BuildCraftFactory extends NetworkMod {
BuildCraftFactory.load();
}
@Override public boolean clientSideRequired() { return true; }
@Override public boolean serverSideRequired() { return true; }
@Override
public boolean clientSideRequired() {
return true;
}
@Override
public boolean serverSideRequired() {
return true;
}
}

View file

@ -23,7 +23,7 @@ public class mod_BuildCraftSilicon extends NetworkMod {
}
@Override
public void modsLoaded () {
public void modsLoaded() {
super.modsLoaded();
BuildCraftTransport.initialize();
@ -33,34 +33,28 @@ public class mod_BuildCraftSilicon extends NetworkMod {
}
/*
@Override
public void handlePacket(Packet230ModLoader packet, EntityPlayerMP entityplayermp) {
int x = packet.dataInt[0];
int y = packet.dataInt[1];
int z = packet.dataInt[2];
TileEntity tile = entityplayermp.worldObj.getBlockTileEntity(x, y,
z);
switch (PacketIds.values()[packet.packetType]) {
case AssemblyTableSelect:
if (tile instanceof TileAssemblyTable) {
TileAssemblyTable assemblyTable = (TileAssemblyTable) tile;
TileAssemblyTable.SelectionMessage message = new TileAssemblyTable.SelectionMessage();
TileAssemblyTable.selectionMessageWrapper.updateFromPacket(message, packet);
assemblyTable.handleSelectionMessage (message);
}
break;
case AssemblyTableGetSelection:
if (tile instanceof TileAssemblyTable) {
TileAssemblyTable assemblyTable = (TileAssemblyTable) tile;
assemblyTable.sendSelectionTo(entityplayermp);
}
}
}*/
* @Override public void handlePacket(Packet230ModLoader packet,
* EntityPlayerMP entityplayermp) { int x = packet.dataInt[0]; int y =
* packet.dataInt[1]; int z = packet.dataInt[2];
*
* TileEntity tile = entityplayermp.worldObj.getBlockTileEntity(x, y, z);
*
* switch (PacketIds.values()[packet.packetType]) { case
* AssemblyTableSelect: if (tile instanceof TileAssemblyTable) {
* TileAssemblyTable assemblyTable = (TileAssemblyTable) tile;
* TileAssemblyTable.SelectionMessage message = new
* TileAssemblyTable.SelectionMessage();
*
* TileAssemblyTable.selectionMessageWrapper.updateFromPacket(message,
* packet);
*
* assemblyTable.handleSelectionMessage (message); }
*
* break; case AssemblyTableGetSelection: if (tile instanceof
* TileAssemblyTable) { TileAssemblyTable assemblyTable =
* (TileAssemblyTable) tile; assemblyTable.sendSelectionTo(entityplayermp);
* } } }
*/
@Override
public String getVersion() {
@ -72,6 +66,13 @@ public class mod_BuildCraftSilicon extends NetworkMod {
BuildCraftSilicon.load();
}
@Override public boolean clientSideRequired() { return true; }
@Override public boolean serverSideRequired() { return true; }
@Override
public boolean clientSideRequired() {
return true;
}
@Override
public boolean serverSideRequired() {
return true;
}
}

View file

@ -21,12 +21,12 @@ public class mod_BuildCraftTransport extends NetworkMod {
}
@Override
public void modsLoaded () {
public void modsLoaded() {
super.modsLoaded();
BuildCraftTransport.initialize();
}
public static void registerTilePipe (Class <? extends TileEntity> clas, String name) {
public static void registerTilePipe(Class<? extends TileEntity> clas, String name) {
ModLoader.registerTileEntity(clas, name);
}
@ -40,7 +40,14 @@ public class mod_BuildCraftTransport extends NetworkMod {
BuildCraftTransport.load();
}
@Override public boolean clientSideRequired() { return true; }
@Override public boolean serverSideRequired() { return true; }
@Override
public boolean clientSideRequired() {
return true;
}
@Override
public boolean serverSideRequired() {
return true;
}
}

View file

@ -18,8 +18,7 @@ public class BuildCraftBlockUtil {
return block.damageDropped(world.getBlockMetadata(i, j, k));
}
public static ArrayList<ItemStack> getItemStackFromBlock(World world,
int i, int j, int k) {
public static ArrayList<ItemStack> getItemStackFromBlock(World world, int i, int j, int k) {
Block block = Block.blocksList[world.getBlockId(i, j, k)];
if (block == null)
@ -34,8 +33,7 @@ public class BuildCraftBlockUtil {
int blockId = world.getBlockId(x, y, z);
if (blockId != 0 && BuildCraftCore.dropBrokenBlocks)
Block.blocksList[blockId].dropBlockAsItem(world, x, y, z,
world.getBlockMetadata(x, y, z), 0);
Block.blocksList[blockId].dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
world.setBlockWithNotify(x, y, z, 0);
}

View file

@ -67,6 +67,7 @@ import net.minecraft.src.forge.MinecraftForge;
import net.minecraft.src.forge.Property;
public class BuildCraftBuilders {
public static final int LIBRARY_PAGE_SIZE = 12;
public static final int MAX_BLUEPRINTS_NAME_SIZE = 88;
@ -94,8 +95,7 @@ public class BuildCraftBuilders {
FillerManager.registry = new FillerRegistry();
// Register gui handler
MinecraftForge.setGuiHandler(mod_BuildCraftBuilders.instance,
new GuiHandler());
MinecraftForge.setGuiHandler(mod_BuildCraftBuilders.instance, new GuiHandler());
}
public static void initialize() {
@ -107,40 +107,27 @@ public class BuildCraftBuilders {
mod_BuildCraftCore.initialize();
BuildCraftCore.initializeGears();
Property templateItemId = BuildCraftCore.mainConfiguration
.getOrCreateIntProperty("templateItem.id",
Configuration.CATEGORY_ITEM,
DefaultProps.TEMPLATE_ITEM_ID);
Property blueprintItemId = BuildCraftCore.mainConfiguration
.getOrCreateIntProperty("blueprintItem.id",
Configuration.CATEGORY_ITEM,
DefaultProps.BLUEPRINT_ITEM_ID);
Property markerId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("marker.id", DefaultProps.MARKER_ID);
Property pathMarkerId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("pathMarker.id",
DefaultProps.PATH_MARKER_ID);
Property fillerId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("filler.id", DefaultProps.FILLER_ID);
Property builderId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("builder.id",
DefaultProps.BUILDER_ID);
Property architectId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("architect.id",
DefaultProps.ARCHITECT_ID);
Property libraryId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("blueprintLibrary.id",
DefaultProps.BLUEPRINT_LIBRARY_ID);
Property templateItemId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("templateItem.id",
Configuration.CATEGORY_ITEM, DefaultProps.TEMPLATE_ITEM_ID);
Property blueprintItemId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("blueprintItem.id",
Configuration.CATEGORY_ITEM, DefaultProps.BLUEPRINT_ITEM_ID);
Property markerId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("marker.id", DefaultProps.MARKER_ID);
Property pathMarkerId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("pathMarker.id",
DefaultProps.PATH_MARKER_ID);
Property fillerId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("filler.id", DefaultProps.FILLER_ID);
Property builderId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("builder.id", DefaultProps.BUILDER_ID);
Property architectId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("architect.id",
DefaultProps.ARCHITECT_ID);
Property libraryId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("blueprintLibrary.id",
DefaultProps.BLUEPRINT_LIBRARY_ID);
BuildCraftCore.mainConfiguration.save();
templateItem = new ItemBptTemplate(
Integer.parseInt(templateItemId.value));
templateItem = new ItemBptTemplate(Integer.parseInt(templateItemId.value));
templateItem.setItemName("templateItem");
CoreProxy.addName(templateItem, "Template");
blueprintItem = new ItemBptBluePrint(
Integer.parseInt(blueprintItemId.value));
blueprintItem = new ItemBptBluePrint(Integer.parseInt(blueprintItemId.value));
blueprintItem.setItemName("blueprintItem");
CoreProxy.addName(blueprintItem, "Blueprint");
@ -148,10 +135,8 @@ public class BuildCraftBuilders {
CoreProxy.registerBlock(markerBlock.setBlockName("markerBlock"));
CoreProxy.addName(markerBlock, "Land Mark");
pathMarkerBlock = new BlockPathMarker(
Integer.parseInt(pathMarkerId.value));
CoreProxy
.registerBlock(pathMarkerBlock.setBlockName("pathMarkerBlock"));
pathMarkerBlock = new BlockPathMarker(Integer.parseInt(pathMarkerId.value));
CoreProxy.registerBlock(pathMarkerBlock.setBlockName("pathMarkerBlock"));
CoreProxy.addName(pathMarkerBlock, "Path Mark");
fillerBlock = new BlockFiller(Integer.parseInt(fillerId.value));
@ -166,42 +151,35 @@ public class BuildCraftBuilders {
CoreProxy.registerBlock(architectBlock.setBlockName("architectBlock"));
CoreProxy.addName(architectBlock, "Architect Table");
libraryBlock = new BlockBlueprintLibrary(
Integer.parseInt(libraryId.value));
libraryBlock = new BlockBlueprintLibrary(Integer.parseInt(libraryId.value));
CoreProxy.registerBlock(libraryBlock.setBlockName("libraryBlock"));
CoreProxy.addName(libraryBlock, "Blueprint Library");
CoreProxy.registerTileEntity(TileMarker.class, "Marker");
CoreProxy.registerTileEntity(TileFiller.class, "Filler");
CoreProxy.registerTileEntity(TileBuilder.class,
"net.minecraft.src.builders.TileBuilder");
CoreProxy.registerTileEntity(TileArchitect.class,
"net.minecraft.src.builders.TileTemplate");
CoreProxy.registerTileEntity(TilePathMarker.class,
"net.minecraft.src.builders.TilePathMarker");
CoreProxy.registerTileEntity(TileBlueprintLibrary.class,
"net.minecraft.src.builders.TileBlueprintLibrary");
CoreProxy.registerTileEntity(TileBuilder.class, "net.minecraft.src.builders.TileBuilder");
CoreProxy.registerTileEntity(TileArchitect.class, "net.minecraft.src.builders.TileTemplate");
CoreProxy.registerTileEntity(TilePathMarker.class, "net.minecraft.src.builders.TilePathMarker");
CoreProxy.registerTileEntity(TileBlueprintLibrary.class, "net.minecraft.src.builders.TileBlueprintLibrary");
// / INIT FILLER PATTERNS
FillerManager.registry.addRecipe(new FillerFillAll(), new Object[] {
"bbb", "bbb", "bbb", Character.valueOf('b'),
FillerManager.registry.addRecipe(new FillerFillAll(), new Object[] { "bbb", "bbb", "bbb", Character.valueOf('b'),
new ItemStack(Block.brick, 1) });
FillerManager.registry.addRecipe(new FillerFlattener(), new Object[] {
" ", "ggg", "bbb", Character.valueOf('g'), Block.glass,
Character.valueOf('b'), Block.brick });
FillerManager.registry.addRecipe(new FillerFlattener(), new Object[] { " ", "ggg", "bbb", Character.valueOf('g'),
Block.glass, Character.valueOf('b'), Block.brick });
FillerManager.registry.addRecipe(new FillerRemover(), new Object[] {
"ggg", "ggg", "ggg", Character.valueOf('g'), Block.glass });
FillerManager.registry.addRecipe(new FillerRemover(), new Object[] { "ggg", "ggg", "ggg", Character.valueOf('g'),
Block.glass });
FillerManager.registry.addRecipe(new FillerFillWalls(), new Object[] {
"bbb", "b b", "bbb", Character.valueOf('b'), Block.brick });
FillerManager.registry.addRecipe(new FillerFillWalls(), new Object[] { "bbb", "b b", "bbb", Character.valueOf('b'),
Block.brick });
FillerManager.registry.addRecipe(new FillerFillPyramid(), new Object[] {
" ", " b ", "bbb", Character.valueOf('b'), Block.brick });
FillerManager.registry.addRecipe(new FillerFillPyramid(), new Object[] { " ", " b ", "bbb", Character.valueOf('b'),
Block.brick });
FillerManager.registry.addRecipe(new FillerFillStairs(), new Object[] {
" b", " bb", "bbb", Character.valueOf('b'), Block.brick });
FillerManager.registry.addRecipe(new FillerFillStairs(), new Object[] { " b", " bb", "bbb", Character.valueOf('b'),
Block.brick });
BuildCraftCore.mainConfiguration.save();
@ -224,65 +202,45 @@ public class BuildCraftBuilders {
new BptBlockDirt(Block.grass.blockID);
new BptBlockDirt(Block.tilledField.blockID);
new BptBlockDelegate(Block.torchRedstoneIdle.blockID,
Block.torchRedstoneActive.blockID);
new BptBlockDelegate(Block.stoneOvenActive.blockID,
Block.stoneOvenIdle.blockID);
new BptBlockDelegate(Block.pistonMoving.blockID,
Block.pistonBase.blockID);
new BptBlockDelegate(Block.torchRedstoneIdle.blockID, Block.torchRedstoneActive.blockID);
new BptBlockDelegate(Block.stoneOvenActive.blockID, Block.stoneOvenIdle.blockID);
new BptBlockDelegate(Block.pistonMoving.blockID, Block.pistonBase.blockID);
new BptBlockWallSide(Block.torchWood.blockID);
new BptBlockWallSide(Block.torchRedstoneActive.blockID);
new BptBlockRotateMeta(Block.ladder.blockID, new int[] { 2, 5, 3, 4 },
true);
new BptBlockRotateMeta(Block.fenceGate.blockID,
new int[] { 0, 1, 2, 3 }, true);
new BptBlockRotateMeta(Block.ladder.blockID, new int[] { 2, 5, 3, 4 }, true);
new BptBlockRotateMeta(Block.fenceGate.blockID, new int[] { 0, 1, 2, 3 }, true);
new BptBlockRotateInventory(Block.stoneOvenIdle.blockID, new int[] { 2,
5, 3, 4 }, true);
new BptBlockRotateInventory(Block.chest.blockID,
new int[] { 2, 5, 3, 4 }, true);
new BptBlockRotateInventory(Block.lockedChest.blockID, new int[] { 2,
5, 3, 4 }, true);
new BptBlockRotateInventory(Block.dispenser.blockID, new int[] { 2, 5,
3, 4 }, true);
new BptBlockRotateInventory(Block.stoneOvenIdle.blockID, new int[] { 2, 5, 3, 4 }, true);
new BptBlockRotateInventory(Block.chest.blockID, new int[] { 2, 5, 3, 4 }, true);
new BptBlockRotateInventory(Block.lockedChest.blockID, new int[] { 2, 5, 3, 4 }, true);
new BptBlockRotateInventory(Block.dispenser.blockID, new int[] { 2, 5, 3, 4 }, true);
new BptBlockInventory(Block.brewingStand.blockID);
new BptBlockRotateMeta(Block.vine.blockID, new int[] { 1, 4, 8, 2 },
false);
new BptBlockRotateMeta(Block.trapdoor.blockID,
new int[] { 0, 1, 2, 3 }, false);
new BptBlockRotateMeta(Block.vine.blockID, new int[] { 1, 4, 8, 2 }, false);
new BptBlockRotateMeta(Block.trapdoor.blockID, new int[] { 0, 1, 2, 3 }, false);
new BptBlockLever(Block.button.blockID);
new BptBlockLever(Block.lever.blockID);
new BptBlockCustomStack(Block.stone.blockID, new ItemStack(Block.stone));
new BptBlockCustomStack(Block.redstoneWire.blockID, new ItemStack(
Item.redstone));
new BptBlockCustomStack(Block.stairDouble.blockID, new ItemStack(
Block.stairSingle, 2));
new BptBlockCustomStack(Block.redstoneWire.blockID, new ItemStack(Item.redstone));
new BptBlockCustomStack(Block.stairDouble.blockID, new ItemStack(Block.stairSingle, 2));
new BptBlockCustomStack(Block.cake.blockID, new ItemStack(Item.cake));
new BptBlockCustomStack(Block.crops.blockID, new ItemStack(Item.seeds));
new BptBlockCustomStack(Block.pumpkinStem.blockID, new ItemStack(
Item.pumpkinSeeds));
new BptBlockCustomStack(Block.melonStem.blockID, new ItemStack(
Item.melonSeeds));
new BptBlockCustomStack(Block.glowStone.blockID, new ItemStack(
Block.glowStone));
new BptBlockCustomStack(Block.pumpkinStem.blockID, new ItemStack(Item.pumpkinSeeds));
new BptBlockCustomStack(Block.melonStem.blockID, new ItemStack(Item.melonSeeds));
new BptBlockCustomStack(Block.glowStone.blockID, new ItemStack(Block.glowStone));
new BptBlockRedstoneRepeater(Block.redstoneRepeaterActive.blockID);
new BptBlockRedstoneRepeater(Block.redstoneRepeaterIdle.blockID);
new BptBlockLiquid(Block.waterStill.blockID, new ItemStack(
Item.bucketWater));
new BptBlockLiquid(Block.waterMoving.blockID, new ItemStack(
Item.bucketWater));
new BptBlockLiquid(Block.lavaStill.blockID, new ItemStack(
Item.bucketLava));
new BptBlockLiquid(Block.lavaMoving.blockID, new ItemStack(
Item.bucketLava));
new BptBlockLiquid(Block.waterStill.blockID, new ItemStack(Item.bucketWater));
new BptBlockLiquid(Block.waterMoving.blockID, new ItemStack(Item.bucketWater));
new BptBlockLiquid(Block.lavaStill.blockID, new ItemStack(Item.bucketLava));
new BptBlockLiquid(Block.lavaMoving.blockID, new ItemStack(Item.bucketLava));
new BptBlockIgnoreMeta(Block.rail.blockID);
new BptBlockIgnoreMeta(Block.railPowered.blockID);
@ -310,10 +268,8 @@ public class BuildCraftBuilders {
// BUILDCRAFT BLOCKS
new BptBlockRotateInventory(architectBlock.blockID, new int[] { 2, 5,
3, 4 }, true);
new BptBlockRotateInventory(builderBlock.blockID, new int[] { 2, 5, 3,
4 }, true);
new BptBlockRotateInventory(architectBlock.blockID, new int[] { 2, 5, 3, 4 }, true);
new BptBlockRotateInventory(builderBlock.blockID, new int[] { 2, 5, 3, 4 }, true);
new BptBlockInventory(libraryBlock.blockID);
@ -331,65 +287,35 @@ public class BuildCraftBuilders {
public static void loadRecipes() {
CraftingManager craftingmanager = CraftingManager.getInstance();
craftingmanager.addRecipe(new ItemStack(templateItem, 1), new Object[] {
"ppp", "pip", "ppp", Character.valueOf('i'),
new ItemStack(Item.dyePowder, 1, 0), Character.valueOf('p'),
Item.paper });
craftingmanager.addRecipe(new ItemStack(templateItem, 1), new Object[] { "ppp", "pip", "ppp", Character.valueOf('i'),
new ItemStack(Item.dyePowder, 1, 0), Character.valueOf('p'), Item.paper });
craftingmanager.addRecipe(
new ItemStack(blueprintItem, 1),
new Object[] { "ppp", "pip", "ppp", Character.valueOf('i'),
new ItemStack(Item.dyePowder, 1, 4),
Character.valueOf('p'), Item.paper });
craftingmanager.addRecipe(new ItemStack(blueprintItem, 1), new Object[] { "ppp", "pip", "ppp", Character.valueOf('i'),
new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('p'), Item.paper });
craftingmanager.addRecipe(new ItemStack(markerBlock, 1), new Object[] {
"l ", "r ", Character.valueOf('l'),
new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('r'),
Block.torchRedstoneActive });
craftingmanager.addRecipe(new ItemStack(markerBlock, 1), new Object[] { "l ", "r ", Character.valueOf('l'),
new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('r'), Block.torchRedstoneActive });
craftingmanager.addRecipe(
new ItemStack(pathMarkerBlock, 1),
new Object[] { "l ", "r ", Character.valueOf('l'),
new ItemStack(Item.dyePowder, 1, 2),
Character.valueOf('r'), Block.torchRedstoneActive });
craftingmanager.addRecipe(new ItemStack(pathMarkerBlock, 1), new Object[] { "l ", "r ", Character.valueOf('l'),
new ItemStack(Item.dyePowder, 1, 2), Character.valueOf('r'), Block.torchRedstoneActive });
craftingmanager.addRecipe(new ItemStack(fillerBlock, 1), new Object[] {
"btb", "ycy", "gCg", Character.valueOf('b'),
new ItemStack(Item.dyePowder, 1, 0), Character.valueOf('t'),
markerBlock, Character.valueOf('y'),
new ItemStack(Item.dyePowder, 1, 11), Character.valueOf('c'),
Block.workbench, Character.valueOf('g'),
BuildCraftCore.goldGearItem, Character.valueOf('C'),
Block.chest });
craftingmanager.addRecipe(new ItemStack(fillerBlock, 1), new Object[] { "btb", "ycy", "gCg", Character.valueOf('b'),
new ItemStack(Item.dyePowder, 1, 0), Character.valueOf('t'), markerBlock, Character.valueOf('y'),
new ItemStack(Item.dyePowder, 1, 11), Character.valueOf('c'), Block.workbench, Character.valueOf('g'),
BuildCraftCore.goldGearItem, Character.valueOf('C'), Block.chest });
craftingmanager.addRecipe(new ItemStack(builderBlock, 1), new Object[] {
"btb", "ycy", "gCg", Character.valueOf('b'),
new ItemStack(Item.dyePowder, 1, 0), Character.valueOf('t'),
markerBlock, Character.valueOf('y'),
new ItemStack(Item.dyePowder, 1, 11), Character.valueOf('c'),
Block.workbench, Character.valueOf('g'),
BuildCraftCore.diamondGearItem, Character.valueOf('C'),
Block.chest });
craftingmanager.addRecipe(new ItemStack(builderBlock, 1), new Object[] { "btb", "ycy", "gCg", Character.valueOf('b'),
new ItemStack(Item.dyePowder, 1, 0), Character.valueOf('t'), markerBlock, Character.valueOf('y'),
new ItemStack(Item.dyePowder, 1, 11), Character.valueOf('c'), Block.workbench, Character.valueOf('g'),
BuildCraftCore.diamondGearItem, Character.valueOf('C'), Block.chest });
craftingmanager
.addRecipe(
new ItemStack(architectBlock, 1),
new Object[] { "btb", "ycy", "gCg",
Character.valueOf('b'),
new ItemStack(Item.dyePowder, 1, 0),
Character.valueOf('t'), markerBlock,
Character.valueOf('y'),
new ItemStack(Item.dyePowder, 1, 11),
Character.valueOf('c'), Block.workbench,
Character.valueOf('g'),
BuildCraftCore.diamondGearItem,
Character.valueOf('C'),
new ItemStack(templateItem, 1) });
craftingmanager.addRecipe(new ItemStack(architectBlock, 1), new Object[] { "btb", "ycy", "gCg", Character.valueOf('b'),
new ItemStack(Item.dyePowder, 1, 0), Character.valueOf('t'), markerBlock, Character.valueOf('y'),
new ItemStack(Item.dyePowder, 1, 11), Character.valueOf('c'), Block.workbench, Character.valueOf('g'),
BuildCraftCore.diamondGearItem, Character.valueOf('C'), new ItemStack(templateItem, 1) });
craftingmanager.addRecipe(new ItemStack(libraryBlock, 1), new Object[] {
"bbb", "bBb", "bbb", Character.valueOf('b'),
new ItemStack(blueprintItem), Character.valueOf('B'),
Block.bookShelf });
craftingmanager.addRecipe(new ItemStack(libraryBlock, 1), new Object[] { "bbb", "bBb", "bbb", Character.valueOf('b'),
new ItemStack(blueprintItem), Character.valueOf('B'), Block.bookShelf });
}
public static BptPlayerIndex getPlayerIndex(String name) {
@ -397,8 +323,7 @@ public class BuildCraftBuilders {
if (!playerLibrary.containsKey(name))
try {
playerLibrary.put(name, new BptPlayerIndex(name + ".list",
rootIndex));
playerLibrary.put(name, new BptPlayerIndex(name + ".list", rootIndex));
} catch (IOException e) {
e.printStackTrace();
}

View file

@ -90,43 +90,31 @@ public class BuildCraftCore {
public static int markerModel;
public static int oilModel;
public static Trigger triggerMachineActive = new TriggerMachine(
DefaultProps.TRIGGER_MACHINE_ACTIVE, true);
public static Trigger triggerMachineInactive = new TriggerMachine(
DefaultProps.TRIGGER_MACHINE_INACTIVE, false);
public static Trigger triggerEmptyInventory = new TriggerInventory(
DefaultProps.TRIGGER_EMPTY_INVENTORY, TriggerInventory.State.Empty);
public static Trigger triggerContainsInventory = new TriggerInventory(
DefaultProps.TRIGGER_CONTAINS_INVENTORY,
public static Trigger triggerMachineActive = new TriggerMachine(DefaultProps.TRIGGER_MACHINE_ACTIVE, true);
public static Trigger triggerMachineInactive = new TriggerMachine(DefaultProps.TRIGGER_MACHINE_INACTIVE, false);
public static Trigger triggerEmptyInventory = new TriggerInventory(DefaultProps.TRIGGER_EMPTY_INVENTORY,
TriggerInventory.State.Empty);
public static Trigger triggerContainsInventory = new TriggerInventory(DefaultProps.TRIGGER_CONTAINS_INVENTORY,
TriggerInventory.State.Contains);
public static Trigger triggerSpaceInventory = new TriggerInventory(
DefaultProps.TRIGGER_SPACE_INVENTORY, TriggerInventory.State.Space);
public static Trigger triggerFullInventory = new TriggerInventory(
DefaultProps.TRIGGER_FULL_INVENTORY, TriggerInventory.State.Full);
public static Trigger triggerEmptyLiquid = new TriggerLiquidContainer(
DefaultProps.TRIGGER_EMPTY_LIQUID,
public static Trigger triggerSpaceInventory = new TriggerInventory(DefaultProps.TRIGGER_SPACE_INVENTORY,
TriggerInventory.State.Space);
public static Trigger triggerFullInventory = new TriggerInventory(DefaultProps.TRIGGER_FULL_INVENTORY,
TriggerInventory.State.Full);
public static Trigger triggerEmptyLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_EMPTY_LIQUID,
TriggerLiquidContainer.State.Empty);
public static Trigger triggerContainsLiquid = new TriggerLiquidContainer(
DefaultProps.TRIGGER_CONTAINS_LIQUID,
public static Trigger triggerContainsLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_CONTAINS_LIQUID,
TriggerLiquidContainer.State.Contains);
public static Trigger triggerSpaceLiquid = new TriggerLiquidContainer(
DefaultProps.TRIGGER_SPACE_LIQUID,
public static Trigger triggerSpaceLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_SPACE_LIQUID,
TriggerLiquidContainer.State.Space);
public static Trigger triggerFullLiquid = new TriggerLiquidContainer(
DefaultProps.TRIGGER_FULL_LIQUID, TriggerLiquidContainer.State.Full);
public static Trigger triggerRedstoneActive = new TriggerRedstoneInput(
DefaultProps.TRIGGER_REDSTONE_ACTIVE, true);
public static Trigger triggerRedstoneInactive = new TriggerRedstoneInput(
DefaultProps.TRIGGER_REDSTONE_INACTIVE, false);
public static Trigger triggerFullLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_FULL_LIQUID,
TriggerLiquidContainer.State.Full);
public static Trigger triggerRedstoneActive = new TriggerRedstoneInput(DefaultProps.TRIGGER_REDSTONE_ACTIVE, true);
public static Trigger triggerRedstoneInactive = new TriggerRedstoneInput(DefaultProps.TRIGGER_REDSTONE_INACTIVE, false);
public static Action actionRedstone = new ActionRedstoneOutput(
DefaultProps.ACTION_REDSTONE);
public static Action actionOn = new ActionMachineControl(
DefaultProps.ACTION_ON, Mode.On);
public static Action actionOff = new ActionMachineControl(
DefaultProps.ACTION_OFF, Mode.Off);
public static Action actionLoop = new ActionMachineControl(
DefaultProps.ACTION_LOOP, Mode.Loop);
public static Action actionRedstone = new ActionRedstoneOutput(DefaultProps.ACTION_REDSTONE);
public static Action actionOn = new ActionMachineControl(DefaultProps.ACTION_ON, Mode.On);
public static Action actionOff = new ActionMachineControl(DefaultProps.ACTION_OFF, Mode.Off);
public static Action actionLoop = new ActionMachineControl(DefaultProps.ACTION_LOOP, Mode.Loop);
public static String customBuildCraftTexture = "/net/minecraft/src/buildcraft/core/gui/block_textures.png";
@ -150,30 +138,25 @@ public class BuildCraftCore {
// MinecraftForge.registerEntity(EntityBlock.class,
// mod_BuildCraftCore.instance, EntityIds.BLOCK, 64, 10, true);
MinecraftForge.registerEntity(EntityRobot.class,
mod_BuildCraftCore.instance, EntityIds.ROBOT, 64, 3, true);
MinecraftForge.registerEntity(EntityLaser.class,
mod_BuildCraftCore.instance, EntityIds.LASER, 64, 10, false);
MinecraftForge.registerEntity(EntityRobot.class, mod_BuildCraftCore.instance, EntityIds.ROBOT, 64, 3, true);
MinecraftForge.registerEntity(EntityLaser.class, mod_BuildCraftCore.instance, EntityIds.LASER, 64, 10, false);
}
public static void initialize() {
if (initialized)
return;
ModLoader.getLogger().fine(
"Starting BuildCraft " + mod_BuildCraftCore.version());
ModLoader.getLogger().fine("Starting BuildCraft " + mod_BuildCraftCore.version());
ModLoader.getLogger().fine("Copyright (c) SpaceToad, 2011");
ModLoader.getLogger().fine("http://www.mod-buildcraft.com");
System.out.println("Starting BuildCraft "
+ mod_BuildCraftCore.version());
System.out.println("Starting BuildCraft " + mod_BuildCraftCore.version());
System.out.println("Copyright (c) SpaceToad, 2011-2012");
System.out.println("http://www.mod-buildcraft.com");
initialized = true;
mainConfiguration = new BuildCraftConfiguration(new File(
CoreProxy.getBuildCraftBase(), "config/buildcraft.cfg"), true);
mainConfiguration = new BuildCraftConfiguration(new File(CoreProxy.getBuildCraftBase(), "config/buildcraft.cfg"), true);
mainConfiguration.load();
redLaserTexture = 0 * 16 + 2;
@ -181,34 +164,27 @@ public class BuildCraftCore {
stripesLaserTexture = 0 * 16 + 3;
transparentTexture = 0 * 16 + 0;
Property continuousCurrent = BuildCraftCore.mainConfiguration
.getOrCreateBooleanProperty("current.continuous",
Configuration.CATEGORY_GENERAL,
DefaultProps.CURRENT_CONTINUOUS);
Property continuousCurrent = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("current.continuous",
Configuration.CATEGORY_GENERAL, DefaultProps.CURRENT_CONTINUOUS);
continuousCurrent.comment = "set to true for allowing machines to be driven by continuous current";
continuousCurrentModel = Boolean.parseBoolean(continuousCurrent.value);
Property trackNetwork = BuildCraftCore.mainConfiguration
.getOrCreateBooleanProperty("trackNetworkUsage",
Configuration.CATEGORY_GENERAL, false);
Property trackNetwork = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("trackNetworkUsage",
Configuration.CATEGORY_GENERAL, false);
trackNetworkUsage = Boolean.parseBoolean(trackNetwork.value);
Property dropBlock = BuildCraftCore.mainConfiguration
.getOrCreateBooleanProperty("dropBrokenBlocks",
Configuration.CATEGORY_GENERAL, true);
Property dropBlock = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("dropBrokenBlocks",
Configuration.CATEGORY_GENERAL, true);
dropBlock.comment = "set to false to prevent fillers from dropping blocks.";
dropBrokenBlocks = Boolean.parseBoolean(dropBlock.value);
Property powerFrameworkClass = BuildCraftCore.mainConfiguration
.getOrCreateProperty("power.framework",
Configuration.CATEGORY_GENERAL,
"buildcraft.energy.PneumaticPowerFramework");
Property powerFrameworkClass = BuildCraftCore.mainConfiguration.getOrCreateProperty("power.framework",
Configuration.CATEGORY_GENERAL, "buildcraft.energy.PneumaticPowerFramework");
Property factor = BuildCraftCore.mainConfiguration
.getOrCreateIntProperty("network.updateFactor",
Configuration.CATEGORY_GENERAL, 10);
Property factor = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("network.updateFactor",
Configuration.CATEGORY_GENERAL, 10);
factor.comment = "increasing this number will decrease network update frequency, useful for overloaded servers";
updateFactor = Integer.parseInt(factor.value);
@ -221,10 +197,7 @@ public class BuildCraftCore {
if (forcePneumaticPower)
try {
PowerFramework.currentFramework = (PowerFramework) Class
.forName(
prefix
+ "buildcraft.energy.PneumaticPowerFramework")
.getConstructor().newInstance();
.forName(prefix + "buildcraft.energy.PneumaticPowerFramework").getConstructor().newInstance();
} catch (Throwable e) {
e.printStackTrace();
}
@ -234,30 +207,25 @@ public class BuildCraftCore {
if (className.startsWith("net.minecraft.src."))
className = className.replace("net.minecraft.src.", "");
PowerFramework.currentFramework = (PowerFramework) Class
.forName(prefix + className).getConstructor()
PowerFramework.currentFramework = (PowerFramework) Class.forName(prefix + className).getConstructor()
.newInstance();
} catch (Throwable e) {
e.printStackTrace();
PowerFramework.currentFramework = new RedstonePowerFramework();
}
Property wrenchId = BuildCraftCore.mainConfiguration
.getOrCreateIntProperty("wrench.id",
Configuration.CATEGORY_ITEM, DefaultProps.WRENCH_ID);
Property wrenchId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("wrench.id", Configuration.CATEGORY_ITEM,
DefaultProps.WRENCH_ID);
mainConfiguration.save();
initializeGears();
wrenchItem = (new ItemWrench(Integer.parseInt(wrenchId.value)))
.setIconIndex(0 * 16 + 2).setItemName("wrenchItem");
wrenchItem = (new ItemWrench(Integer.parseInt(wrenchId.value))).setIconIndex(0 * 16 + 2).setItemName("wrenchItem");
CoreProxy.addName(wrenchItem, "Wrench");
BuildCraftAPI.liquids.add(new LiquidData(Block.waterStill.blockID,
Block.waterMoving.blockID, Item.bucketWater));
BuildCraftAPI.liquids.add(new LiquidData(Block.lavaStill.blockID,
Block.lavaMoving.blockID, Item.bucketLava));
BuildCraftAPI.liquids.add(new LiquidData(Block.waterStill.blockID, Block.waterMoving.blockID, Item.bucketWater));
BuildCraftAPI.liquids.add(new LiquidData(Block.lavaStill.blockID, Block.lavaMoving.blockID, Item.bucketLava));
BuildCraftAPI.softBlocks[Block.tallGrass.blockID] = true;
BuildCraftAPI.softBlocks[Block.snow.blockID] = true;
@ -273,55 +241,41 @@ public class BuildCraftCore {
public static void loadRecipes() {
CraftingManager craftingmanager = CraftingManager.getInstance();
craftingmanager.addRecipe(new ItemStack(wrenchItem), new Object[] {
"I I", " G ", " I ", Character.valueOf('I'), Item.ingotIron,
Character.valueOf('G'), stoneGearItem });
craftingmanager.addRecipe(new ItemStack(wrenchItem), new Object[] { "I I", " G ", " I ", Character.valueOf('I'),
Item.ingotIron, Character.valueOf('G'), stoneGearItem });
craftingmanager.addRecipe(new ItemStack(woodenGearItem), new Object[] {
" S ", "S S", " S ", Character.valueOf('S'), Item.stick });
craftingmanager.addRecipe(new ItemStack(woodenGearItem), new Object[] { " S ", "S S", " S ", Character.valueOf('S'),
Item.stick });
craftingmanager.addRecipe(new ItemStack(stoneGearItem), new Object[] {
" I ", "IGI", " I ", Character.valueOf('I'), Block.cobblestone,
Character.valueOf('G'), woodenGearItem });
craftingmanager.addRecipe(new ItemStack(stoneGearItem), new Object[] { " I ", "IGI", " I ", Character.valueOf('I'),
Block.cobblestone, Character.valueOf('G'), woodenGearItem });
craftingmanager.addRecipe(new ItemStack(ironGearItem), new Object[] {
" I ", "IGI", " I ", Character.valueOf('I'), Item.ingotIron,
Character.valueOf('G'), stoneGearItem });
craftingmanager.addRecipe(new ItemStack(ironGearItem), new Object[] { " I ", "IGI", " I ", Character.valueOf('I'),
Item.ingotIron, Character.valueOf('G'), stoneGearItem });
craftingmanager.addRecipe(new ItemStack(goldGearItem), new Object[] {
" I ", "IGI", " I ", Character.valueOf('I'), Item.ingotGold,
Character.valueOf('G'), ironGearItem });
craftingmanager.addRecipe(new ItemStack(goldGearItem), new Object[] { " I ", "IGI", " I ", Character.valueOf('I'),
Item.ingotGold, Character.valueOf('G'), ironGearItem });
craftingmanager.addRecipe(new ItemStack(diamondGearItem), new Object[] {
" I ", "IGI", " I ", Character.valueOf('I'), Item.diamond,
Character.valueOf('G'), goldGearItem });
craftingmanager.addRecipe(new ItemStack(diamondGearItem), new Object[] { " I ", "IGI", " I ", Character.valueOf('I'),
Item.diamond, Character.valueOf('G'), goldGearItem });
}
public static void initializeGears() {
if (gearsInitialized)
return;
Property woodenGearId = BuildCraftCore.mainConfiguration
.getOrCreateIntProperty("woodenGearItem.id",
Configuration.CATEGORY_ITEM,
DefaultProps.WOODEN_GEAR_ID);
Property stoneGearId = BuildCraftCore.mainConfiguration
.getOrCreateIntProperty("stoneGearItem.id",
Configuration.CATEGORY_ITEM, DefaultProps.STONE_GEAR_ID);
Property ironGearId = BuildCraftCore.mainConfiguration
.getOrCreateIntProperty("ironGearItem.id",
Configuration.CATEGORY_ITEM, DefaultProps.IRON_GEAR_ID);
Property goldenGearId = BuildCraftCore.mainConfiguration
.getOrCreateIntProperty("goldenGearItem.id",
Configuration.CATEGORY_ITEM,
DefaultProps.GOLDEN_GEAR_ID);
Property diamondGearId = BuildCraftCore.mainConfiguration
.getOrCreateIntProperty("diamondGearItem.id",
Configuration.CATEGORY_ITEM,
DefaultProps.DIAMOND_GEAR_ID);
Property modifyWorld = BuildCraftCore.mainConfiguration
.getOrCreateBooleanProperty("modifyWorld",
Configuration.CATEGORY_GENERAL, true);
Property woodenGearId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("woodenGearItem.id",
Configuration.CATEGORY_ITEM, DefaultProps.WOODEN_GEAR_ID);
Property stoneGearId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("stoneGearItem.id",
Configuration.CATEGORY_ITEM, DefaultProps.STONE_GEAR_ID);
Property ironGearId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("ironGearItem.id",
Configuration.CATEGORY_ITEM, DefaultProps.IRON_GEAR_ID);
Property goldenGearId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("goldenGearItem.id",
Configuration.CATEGORY_ITEM, DefaultProps.GOLDEN_GEAR_ID);
Property diamondGearId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("diamondGearItem.id",
Configuration.CATEGORY_ITEM, DefaultProps.DIAMOND_GEAR_ID);
Property modifyWorld = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("modifyWorld",
Configuration.CATEGORY_GENERAL, true);
modifyWorld.comment = "set to false if BuildCraft should not generate custom blocks (e.g. oil)";
BuildCraftCore.mainConfiguration.save();
@ -330,26 +284,24 @@ public class BuildCraftCore {
gearsInitialized = true;
woodenGearItem = (new ItemBuildCraft(
Integer.parseInt(woodenGearId.value))).setIconIndex(1 * 16 + 0)
.setItemName("woodenGearItem");
woodenGearItem = (new ItemBuildCraft(Integer.parseInt(woodenGearId.value))).setIconIndex(1 * 16 + 0).setItemName(
"woodenGearItem");
CoreProxy.addName(woodenGearItem, "Wooden Gear");
stoneGearItem = (new ItemBuildCraft(Integer.parseInt(stoneGearId.value)))
.setIconIndex(1 * 16 + 1).setItemName("stoneGearItem");
stoneGearItem = (new ItemBuildCraft(Integer.parseInt(stoneGearId.value))).setIconIndex(1 * 16 + 1).setItemName(
"stoneGearItem");
CoreProxy.addName(stoneGearItem, "Stone Gear");
ironGearItem = (new ItemBuildCraft(Integer.parseInt(ironGearId.value)))
.setIconIndex(1 * 16 + 2).setItemName("ironGearItem");
ironGearItem = (new ItemBuildCraft(Integer.parseInt(ironGearId.value))).setIconIndex(1 * 16 + 2).setItemName(
"ironGearItem");
CoreProxy.addName(ironGearItem, "Iron Gear");
goldGearItem = (new ItemBuildCraft(Integer.parseInt(goldenGearId.value)))
.setIconIndex(1 * 16 + 3).setItemName("goldGearItem");
goldGearItem = (new ItemBuildCraft(Integer.parseInt(goldenGearId.value))).setIconIndex(1 * 16 + 3).setItemName(
"goldGearItem");
CoreProxy.addName(goldGearItem, "Gold Gear");
diamondGearItem = (new ItemBuildCraft(
Integer.parseInt(diamondGearId.value)))
.setIconIndex(1 * 16 + 4).setItemName("diamondGearItem");
diamondGearItem = (new ItemBuildCraft(Integer.parseInt(diamondGearId.value))).setIconIndex(1 * 16 + 4).setItemName(
"diamondGearItem");
CoreProxy.addName(diamondGearItem, "Diamond Gear");
BuildCraftCore.mainConfiguration.save();

View file

@ -53,19 +53,16 @@ public class BuildCraftEnergy {
private static boolean initialized = false;
public static Trigger triggerBlueEngineHeat = new TriggerEngineHeat(
DefaultProps.TRIGGER_BLUE_ENGINE_HEAT, EnergyStage.Blue);
public static Trigger triggerGreenEngineHeat = new TriggerEngineHeat(
DefaultProps.TRIGGER_GREEN_ENGINE_HEAT, EnergyStage.Green);
public static Trigger triggerYellowEngineHeat = new TriggerEngineHeat(
DefaultProps.TRIGGER_YELLOW_ENGINE_HEAT, EnergyStage.Yellow);
public static Trigger triggerRedEngineHeat = new TriggerEngineHeat(
DefaultProps.TRIGGER_RED_ENGINE_HEAT, EnergyStage.Red);
public static Trigger triggerBlueEngineHeat = new TriggerEngineHeat(DefaultProps.TRIGGER_BLUE_ENGINE_HEAT, EnergyStage.Blue);
public static Trigger triggerGreenEngineHeat = new TriggerEngineHeat(DefaultProps.TRIGGER_GREEN_ENGINE_HEAT,
EnergyStage.Green);
public static Trigger triggerYellowEngineHeat = new TriggerEngineHeat(DefaultProps.TRIGGER_YELLOW_ENGINE_HEAT,
EnergyStage.Yellow);
public static Trigger triggerRedEngineHeat = new TriggerEngineHeat(DefaultProps.TRIGGER_RED_ENGINE_HEAT, EnergyStage.Red);
public static void load() {
// Register gui handler
MinecraftForge.setGuiHandler(mod_BuildCraftEnergy.instance,
new GuiHandler());
MinecraftForge.setGuiHandler(mod_BuildCraftEnergy.instance, new GuiHandler());
// MinecraftForge.registerEntity(EntityMechanicalArm.class,
// mod_BuildCraftEnergy.instance, EntityIds.MECHANICAL_ARM, 50, 10,
@ -80,46 +77,35 @@ public class BuildCraftEnergy {
BuildCraftCore.initialize();
Property engineId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("engine.id", DefaultProps.ENGINE_ID);
Property oilStillId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("oilStill.id",
DefaultProps.OIL_STILL_ID);
Property oilMovingId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("oilMoving.id",
DefaultProps.OIL_MOVING_ID);
Property bucketOilId = BuildCraftCore.mainConfiguration
.getOrCreateIntProperty("bucketOil.id",
Configuration.CATEGORY_ITEM, DefaultProps.BUCKET_OIL_ID);
Property bucketFuelId = BuildCraftCore.mainConfiguration
.getOrCreateIntProperty("bucketFuel.id",
Configuration.CATEGORY_ITEM,
DefaultProps.BUCKET_FUEL_ID);
Property itemFuelId = BuildCraftCore.mainConfiguration
.getOrCreateIntProperty("fuel.id", Configuration.CATEGORY_ITEM,
DefaultProps.FUEL_ID);
Property engineId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("engine.id", DefaultProps.ENGINE_ID);
Property oilStillId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("oilStill.id",
DefaultProps.OIL_STILL_ID);
Property oilMovingId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("oilMoving.id",
DefaultProps.OIL_MOVING_ID);
Property bucketOilId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("bucketOil.id",
Configuration.CATEGORY_ITEM, DefaultProps.BUCKET_OIL_ID);
Property bucketFuelId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("bucketFuel.id",
Configuration.CATEGORY_ITEM, DefaultProps.BUCKET_FUEL_ID);
Property itemFuelId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("fuel.id", Configuration.CATEGORY_ITEM,
DefaultProps.FUEL_ID);
BuildCraftCore.mainConfiguration.save();
engineBlock = new BlockEngine(Integer.parseInt(engineId.value));
Item.itemsList[engineBlock.blockID] = null;
Item.itemsList[engineBlock.blockID] = (new ItemEngine(
engineBlock.blockID - 256));
Item.itemsList[engineBlock.blockID] = (new ItemEngine(engineBlock.blockID - 256));
CoreProxy.addName(new ItemStack(engineBlock, 1, 0), "Redstone Engine");
CoreProxy.addName(new ItemStack(engineBlock, 1, 1), "Steam Engine");
CoreProxy
.addName(new ItemStack(engineBlock, 1, 2), "Combustion Engine");
CoreProxy.addName(new ItemStack(engineBlock, 1, 2), "Combustion Engine");
oilMoving = (new BlockOilFlowing(Integer.parseInt(oilMovingId.value),
Material.water)).setHardness(100F).setLightOpacity(3)
.setBlockName("oil");
oilMoving = (new BlockOilFlowing(Integer.parseInt(oilMovingId.value), Material.water)).setHardness(100F)
.setLightOpacity(3).setBlockName("oil");
CoreProxy.addName(oilMoving.setBlockName("oilMoving"), "Oil");
CoreProxy.registerBlock(oilMoving);
oilStill = (new BlockOilStill(Integer.parseInt(oilStillId.value),
Material.water)).setHardness(100F).setLightOpacity(3)
oilStill = (new BlockOilStill(Integer.parseInt(oilStillId.value), Material.water)).setHardness(100F).setLightOpacity(3)
.setBlockName("oil");
CoreProxy.addName(oilStill.setBlockName("oilStill"), "Oil");
CoreProxy.registerBlock(oilStill);
@ -129,33 +115,25 @@ public class BuildCraftEnergy {
MinecraftForge.registerCustomBucketHandler(new OilBucketHandler());
bucketOil = (new ItemBucketOil(Integer.parseInt(bucketOilId.value)))
.setItemName("bucketOil").setContainerItem(Item.bucketEmpty);
bucketOil = (new ItemBucketOil(Integer.parseInt(bucketOilId.value))).setItemName("bucketOil").setContainerItem(
Item.bucketEmpty);
CoreProxy.addName(bucketOil, "Oil Bucket");
fuel = new ItemBuildCraft(Integer.parseInt(itemFuelId.value))
.setItemName("fuel");
fuel = new ItemBuildCraft(Integer.parseInt(itemFuelId.value)).setItemName("fuel");
CoreProxy.addName(fuel, "Fuel");
bucketFuel = new ItemBuildCraft(Integer.parseInt(bucketFuelId.value))
.setIconIndex(0 * 16 + 3).setItemName("bucketFuel")
bucketFuel = new ItemBuildCraft(Integer.parseInt(bucketFuelId.value)).setIconIndex(0 * 16 + 3).setItemName("bucketFuel")
.setMaxStackSize(1).setContainerItem(Item.bucketEmpty);
CoreProxy.addName(bucketFuel, "Fuel Bucket");
BuildCraftAPI.registerRefineryRecipe(new RefineryRecipe(
oilStill.blockID, 1, 0, 0, 10, fuel.shiftedIndex, 1, 1));
BuildCraftAPI.registerRefineryRecipe(new RefineryRecipe(oilStill.blockID, 1, 0, 0, 10, fuel.shiftedIndex, 1, 1));
BuildCraftAPI.ironEngineFuel.put(Block.lavaStill.blockID,
new IronEngineFuel(oilStill.blockID, 1, 20000));
BuildCraftAPI.ironEngineFuel.put(oilStill.blockID, new IronEngineFuel(
oilStill.blockID, 2, 10000));
BuildCraftAPI.ironEngineFuel.put(fuel.shiftedIndex, new IronEngineFuel(
fuel.shiftedIndex, 5, 50000));
BuildCraftAPI.ironEngineFuel.put(Block.lavaStill.blockID, new IronEngineFuel(oilStill.blockID, 1, 20000));
BuildCraftAPI.ironEngineFuel.put(oilStill.blockID, new IronEngineFuel(oilStill.blockID, 2, 10000));
BuildCraftAPI.ironEngineFuel.put(fuel.shiftedIndex, new IronEngineFuel(fuel.shiftedIndex, 5, 50000));
BuildCraftAPI.liquids.add(new LiquidData(oilStill.blockID,
oilMoving.blockID, bucketOil));
BuildCraftAPI.liquids.add(new LiquidData(fuel.shiftedIndex, 0,
bucketFuel));
BuildCraftAPI.liquids.add(new LiquidData(oilStill.blockID, oilMoving.blockID, bucketOil));
BuildCraftAPI.liquids.add(new LiquidData(fuel.shiftedIndex, 0, bucketFuel));
BuildCraftAPI.softBlocks[oilMoving.blockID] = true;
BuildCraftAPI.softBlocks[oilStill.blockID] = true;
@ -169,21 +147,15 @@ public class BuildCraftEnergy {
public static void loadRecipes() {
CraftingManager craftingmanager = CraftingManager.getInstance();
craftingmanager.addRecipe(new ItemStack(engineBlock, 1, 0),
new Object[] { "www", " g ", "GpG", Character.valueOf('w'),
Block.planks, Character.valueOf('g'), Block.glass,
Character.valueOf('G'), BuildCraftCore.woodenGearItem,
Character.valueOf('p'), Block.pistonBase });
craftingmanager.addRecipe(new ItemStack(engineBlock, 1, 1),
new Object[] { "www", " g ", "GpG", Character.valueOf('w'),
Block.cobblestone, Character.valueOf('g'), Block.glass,
Character.valueOf('G'), BuildCraftCore.stoneGearItem,
Character.valueOf('p'), Block.pistonBase });
craftingmanager.addRecipe(new ItemStack(engineBlock, 1, 2),
new Object[] { "www", " g ", "GpG", Character.valueOf('w'),
Item.ingotIron, Character.valueOf('g'), Block.glass,
Character.valueOf('G'), BuildCraftCore.ironGearItem,
Character.valueOf('p'), Block.pistonBase });
craftingmanager.addRecipe(new ItemStack(engineBlock, 1, 0), new Object[] { "www", " g ", "GpG", Character.valueOf('w'),
Block.planks, Character.valueOf('g'), Block.glass, Character.valueOf('G'), BuildCraftCore.woodenGearItem,
Character.valueOf('p'), Block.pistonBase });
craftingmanager.addRecipe(new ItemStack(engineBlock, 1, 1), new Object[] { "www", " g ", "GpG", Character.valueOf('w'),
Block.cobblestone, Character.valueOf('g'), Block.glass, Character.valueOf('G'), BuildCraftCore.stoneGearItem,
Character.valueOf('p'), Block.pistonBase });
craftingmanager.addRecipe(new ItemStack(engineBlock, 1, 2), new Object[] { "www", " g ", "GpG", Character.valueOf('w'),
Item.ingotIron, Character.valueOf('g'), Block.glass, Character.valueOf('G'), BuildCraftCore.ironGearItem,
Character.valueOf('p'), Block.pistonBase });
}
public static void generateSurface(World world, Random random, int i, int j) {

View file

@ -40,6 +40,7 @@ import net.minecraft.src.forge.MinecraftForge;
import net.minecraft.src.forge.Property;
public class BuildCraftFactory {
public static BlockQuarry quarryBlock;
public static BlockMiningWell miningWellBlock;
public static BlockAutoWorkbench autoWorkbenchBlock;
@ -62,8 +63,7 @@ public class BuildCraftFactory {
MinecraftForge.registerConnectionHandler(new ConnectionHandler());
// Register gui handler
MinecraftForge.setGuiHandler(mod_BuildCraftFactory.instance,
new GuiHandler());
MinecraftForge.setGuiHandler(mod_BuildCraftFactory.instance, new GuiHandler());
// MinecraftForge.registerEntity(EntityMechanicalArm.class,
// mod_BuildCraftFactory.instance, EntityIds.MECHANICAL_ARM, 50, 10,
@ -79,53 +79,38 @@ public class BuildCraftFactory {
mod_BuildCraftCore.initialize();
BuildCraftCore.initializeGears();
allowMining = Boolean.parseBoolean(BuildCraftCore.mainConfiguration
.getOrCreateBooleanProperty("mining.enabled",
Configuration.CATEGORY_GENERAL, true).value);
allowMining = Boolean.parseBoolean(BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("mining.enabled",
Configuration.CATEGORY_GENERAL, true).value);
Property minigWellId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("miningWell.id",
DefaultProps.MINING_WELL_ID);
Property plainPipeId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("drill.id", DefaultProps.DRILL_ID);
Property autoWorkbenchId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("autoWorkbench.id",
DefaultProps.AUTO_WORKBENCH_ID);
Property frameId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("frame.id", DefaultProps.FRAME_ID);
Property quarryId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("quarry.id", DefaultProps.QUARRY_ID);
Property pumpId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("pump.id", DefaultProps.PUMP_ID);
Property tankId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("tank.id", DefaultProps.TANK_ID);
Property minigWellId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("miningWell.id",
DefaultProps.MINING_WELL_ID);
Property plainPipeId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("drill.id", DefaultProps.DRILL_ID);
Property autoWorkbenchId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("autoWorkbench.id",
DefaultProps.AUTO_WORKBENCH_ID);
Property frameId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("frame.id", DefaultProps.FRAME_ID);
Property quarryId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("quarry.id", DefaultProps.QUARRY_ID);
Property pumpId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("pump.id", DefaultProps.PUMP_ID);
Property tankId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("tank.id", DefaultProps.TANK_ID);
Property refineryId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("refinery.id",
DefaultProps.REFINERY_ID);
Property hopperId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("hopper.id", DefaultProps.HOPPER_ID);
Property hopperDisable = BuildCraftCore.mainConfiguration
.getOrCreateBooleanProperty("hopper.disabled", "Block Savers",
false);
.getOrCreateBlockIdProperty("refinery.id", DefaultProps.REFINERY_ID);
Property hopperId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("hopper.id", DefaultProps.HOPPER_ID);
Property hopperDisable = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("hopper.disabled", "Block Savers",
false);
BuildCraftCore.mainConfiguration.save();
MinecraftForge.registerCustomBucketHandler(new TankBucketHandler());
miningWellBlock = new BlockMiningWell(
Integer.parseInt(minigWellId.value));
CoreProxy
.registerBlock(miningWellBlock.setBlockName("miningWellBlock"));
miningWellBlock = new BlockMiningWell(Integer.parseInt(minigWellId.value));
CoreProxy.registerBlock(miningWellBlock.setBlockName("miningWellBlock"));
CoreProxy.addName(miningWellBlock, "Mining Well");
plainPipeBlock = new BlockPlainPipe(Integer.parseInt(plainPipeId.value));
CoreProxy.registerBlock(plainPipeBlock.setBlockName("plainPipeBlock"));
CoreProxy.addName(plainPipeBlock, "Mining Pipe");
autoWorkbenchBlock = new BlockAutoWorkbench(
Integer.parseInt(autoWorkbenchId.value));
CoreProxy.registerBlock(autoWorkbenchBlock
.setBlockName("autoWorkbenchBlock"));
autoWorkbenchBlock = new BlockAutoWorkbench(Integer.parseInt(autoWorkbenchId.value));
CoreProxy.registerBlock(autoWorkbenchBlock.setBlockName("autoWorkbenchBlock"));
CoreProxy.addName(autoWorkbenchBlock, "Automatic Crafting Table");
frameBlock = new BlockFrame(Integer.parseInt(frameId.value));
@ -158,20 +143,14 @@ public class BuildCraftFactory {
CoreProxy.registerTileEntity(TileQuarry.class, "Machine");
CoreProxy.registerTileEntity(TileMiningWell.class, "MiningWell");
CoreProxy.registerTileEntity(TileAutoWorkbench.class, "AutoWorkbench");
CoreProxy.registerTileEntity(TilePump.class,
"net.minecraft.src.buildcraft.factory.TilePump");
CoreProxy.registerTileEntity(TileTank.class,
"net.minecraft.src.buildcraft.factory.TileTank");
CoreProxy.registerTileEntity(TileRefinery.class,
"net.minecraft.src.buildcraft.factory.Refinery");
CoreProxy.registerTileEntity(TileLaser.class,
"net.minecraft.src.buildcraft.factory.TileLaser");
CoreProxy.registerTileEntity(TileAssemblyTable.class,
"net.minecraft.src.buildcraft.factory.TileAssemblyTable");
CoreProxy.registerTileEntity(TilePump.class, "net.minecraft.src.buildcraft.factory.TilePump");
CoreProxy.registerTileEntity(TileTank.class, "net.minecraft.src.buildcraft.factory.TileTank");
CoreProxy.registerTileEntity(TileRefinery.class, "net.minecraft.src.buildcraft.factory.Refinery");
CoreProxy.registerTileEntity(TileLaser.class, "net.minecraft.src.buildcraft.factory.TileLaser");
CoreProxy.registerTileEntity(TileAssemblyTable.class, "net.minecraft.src.buildcraft.factory.TileAssemblyTable");
if (!hopperDisabled) {
CoreProxy.registerTileEntity(TileHopper.class,
"net.minecraft.src.buildcraft.factory.TileHopper");
CoreProxy.registerTileEntity(TileHopper.class, "net.minecraft.src.buildcraft.factory.TileHopper");
}
drillTexture = 2 * 16 + 1;
@ -192,42 +171,31 @@ public class BuildCraftFactory {
if (allowMining) {
craftingmanager.addRecipe(new ItemStack(miningWellBlock, 1),
new Object[] { "ipi", "igi", "iPi", Character.valueOf('p'),
Item.redstone, Character.valueOf('i'),
Item.ingotIron, Character.valueOf('g'),
BuildCraftCore.ironGearItem,
Character.valueOf('P'), Item.pickaxeSteel });
new Object[] { "ipi", "igi", "iPi", Character.valueOf('p'), Item.redstone, Character.valueOf('i'),
Item.ingotIron, Character.valueOf('g'), BuildCraftCore.ironGearItem, Character.valueOf('P'),
Item.pickaxeSteel });
craftingmanager.addRecipe(new ItemStack(quarryBlock), new Object[] {
"ipi", "gig", "dDd", Character.valueOf('i'),
BuildCraftCore.ironGearItem, Character.valueOf('p'),
Item.redstone, Character.valueOf('g'),
BuildCraftCore.goldGearItem, Character.valueOf('d'),
BuildCraftCore.diamondGearItem, Character.valueOf('D'),
craftingmanager.addRecipe(new ItemStack(quarryBlock), new Object[] { "ipi", "gig", "dDd", Character.valueOf('i'),
BuildCraftCore.ironGearItem, Character.valueOf('p'), Item.redstone, Character.valueOf('g'),
BuildCraftCore.goldGearItem, Character.valueOf('d'), BuildCraftCore.diamondGearItem, Character.valueOf('D'),
Item.pickaxeDiamond, });
}
craftingmanager.addRecipe(new ItemStack(autoWorkbenchBlock),
new Object[] { " g ", "gwg", " g ", Character.valueOf('w'),
Block.workbench, Character.valueOf('g'),
BuildCraftCore.woodenGearItem });
craftingmanager.addRecipe(new ItemStack(autoWorkbenchBlock), new Object[] { " g ", "gwg", " g ", Character.valueOf('w'),
Block.workbench, Character.valueOf('g'), BuildCraftCore.woodenGearItem });
craftingmanager.addRecipe(new ItemStack(pumpBlock),
new Object[] { "T ", "W ", Character.valueOf('T'), tankBlock,
Character.valueOf('W'), miningWellBlock, });
craftingmanager.addRecipe(new ItemStack(pumpBlock), new Object[] { "T ", "W ", Character.valueOf('T'), tankBlock,
Character.valueOf('W'), miningWellBlock, });
craftingmanager.addRecipe(new ItemStack(tankBlock), new Object[] {
"ggg", "g g", "ggg", Character.valueOf('g'), Block.glass, });
craftingmanager.addRecipe(new ItemStack(tankBlock), new Object[] { "ggg", "g g", "ggg", Character.valueOf('g'),
Block.glass, });
craftingmanager.addRecipe(new ItemStack(refineryBlock), new Object[] {
" ", "RTR", "TGT", Character.valueOf('T'), tankBlock,
Character.valueOf('G'), BuildCraftCore.diamondGearItem,
Character.valueOf('R'), Block.torchRedstoneActive, });
craftingmanager.addRecipe(new ItemStack(refineryBlock), new Object[] { " ", "RTR", "TGT", Character.valueOf('T'),
tankBlock, Character.valueOf('G'), BuildCraftCore.diamondGearItem, Character.valueOf('R'),
Block.torchRedstoneActive, });
if (!hopperDisabled) {
craftingmanager.addRecipe(new ItemStack(hopperBlock), new Object[] {
"ICI", "IGI", " I ", Character.valueOf('I'),
Item.ingotIron, Character.valueOf('C'), Block.chest,
Character.valueOf('G'), BuildCraftCore.stoneGearItem });
craftingmanager.addRecipe(new ItemStack(hopperBlock), new Object[] { "ICI", "IGI", " I ", Character.valueOf('I'),
Item.ingotIron, Character.valueOf('C'), Block.chest, Character.valueOf('G'), BuildCraftCore.stoneGearItem });
}
}

View file

@ -36,8 +36,7 @@ public class BuildCraftSilicon {
MinecraftForge.registerConnectionHandler(new ConnectionHandler());
// Register gui handler
MinecraftForge.setGuiHandler(mod_BuildCraftSilicon.instance,
new GuiHandler());
MinecraftForge.setGuiHandler(mod_BuildCraftSilicon.instance, new GuiHandler());
}
public static void initialize() {
@ -48,12 +47,10 @@ public class BuildCraftSilicon {
mod_BuildCraftCore.initialize();
Property laserId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("laser.id", DefaultProps.LASER_ID);
Property laserId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("laser.id", DefaultProps.LASER_ID);
Property assemblyTableId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("assemblyTable.id",
DefaultProps.ASSEMBLY_TABLE_ID);
Property assemblyTableId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("assemblyTable.id",
DefaultProps.ASSEMBLY_TABLE_ID);
BuildCraftCore.mainConfiguration.save();
@ -61,158 +58,101 @@ public class BuildCraftSilicon {
CoreProxy.addName(laserBlock.setBlockName("laserBlock"), "Laser");
CoreProxy.registerBlock(laserBlock);
assemblyTableBlock = new BlockAssemblyTable(
Integer.parseInt(assemblyTableId.value));
CoreProxy.addName(
assemblyTableBlock.setBlockName("assemblyTableBlock"),
"Assembly Table");
assemblyTableBlock = new BlockAssemblyTable(Integer.parseInt(assemblyTableId.value));
CoreProxy.addName(assemblyTableBlock.setBlockName("assemblyTableBlock"), "Assembly Table");
CoreProxy.registerBlock(assemblyTableBlock);
redstoneChipset = new ItemRedstoneChipset(DefaultProps.REDSTONE_CHIPSET);
redstoneChipset.setItemName("redstoneChipset");
// / REDSTONE CHIPSETS
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(
new ItemStack[] { new ItemStack(Item.redstone) }, 10000,
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.redstone) }, 10000,
new ItemStack(redstoneChipset, 1, 0)));
CoreProxy.addName(new ItemStack(redstoneChipset, 1, 0),
"Redstone Chipset");
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] {
new ItemStack(Item.redstone), new ItemStack(Item.ingotIron) },
20000, new ItemStack(redstoneChipset, 1, 1)));
CoreProxy.addName(new ItemStack(redstoneChipset, 1, 1),
"Redstone Iron Chipset");
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] {
new ItemStack(Item.redstone), new ItemStack(Item.ingotGold) },
40000, new ItemStack(redstoneChipset, 1, 2)));
CoreProxy.addName(new ItemStack(redstoneChipset, 1, 2),
"Redstone Golden Chipset");
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] {
new ItemStack(Item.redstone), new ItemStack(Item.diamond) },
80000, new ItemStack(redstoneChipset, 1, 3)));
CoreProxy.addName(new ItemStack(redstoneChipset, 1, 3),
"Redstone Diamond Chipset");
CoreProxy.addName(new ItemStack(redstoneChipset, 1, 0), "Redstone Chipset");
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.redstone),
new ItemStack(Item.ingotIron) }, 20000, new ItemStack(redstoneChipset, 1, 1)));
CoreProxy.addName(new ItemStack(redstoneChipset, 1, 1), "Redstone Iron Chipset");
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.redstone),
new ItemStack(Item.ingotGold) }, 40000, new ItemStack(redstoneChipset, 1, 2)));
CoreProxy.addName(new ItemStack(redstoneChipset, 1, 2), "Redstone Golden Chipset");
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.redstone),
new ItemStack(Item.diamond) }, 80000, new ItemStack(redstoneChipset, 1, 3)));
CoreProxy.addName(new ItemStack(redstoneChipset, 1, 3), "Redstone Diamond Chipset");
// PULSATING CHIPSETS
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] {
new ItemStack(Item.redstone), new ItemStack(Item.enderPearl) },
40000, new ItemStack(redstoneChipset, 2, 4)));
CoreProxy.addName(new ItemStack(redstoneChipset, 1, 4),
"Pulsating Chipset");
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.redstone),
new ItemStack(Item.enderPearl) }, 40000, new ItemStack(redstoneChipset, 2, 4)));
CoreProxy.addName(new ItemStack(redstoneChipset, 1, 4), "Pulsating Chipset");
// / REDSTONE GATES
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(
new ItemStack[] { new ItemStack(redstoneChipset, 1, 0) },
20000, new ItemStack(BuildCraftTransport.pipeGate, 1, 0)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 0),
"Gate");
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(redstoneChipset, 1, 0) }, 20000,
new ItemStack(BuildCraftTransport.pipeGate, 1, 0)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 0), "Gate");
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] {
new ItemStack(BuildCraftTransport.pipeGate, 1, 0),
new ItemStack(redstoneChipset, 1, 4),
new ItemStack(redstoneChipset, 1, 1) }, 10000, new ItemStack(
BuildCraftTransport.pipeGateAutarchic, 1, 0)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic,
1, 0), "Autarchic Gate");
new ItemStack(BuildCraftTransport.pipeGate, 1, 0), new ItemStack(redstoneChipset, 1, 4),
new ItemStack(redstoneChipset, 1, 1) }, 10000, new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 0)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 0), "Autarchic Gate");
// / IRON AND GATES
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(redstoneChipset, 1, 1),
new ItemStack(BuildCraftTransport.redPipeWire) }, 40000, new ItemStack(BuildCraftTransport.pipeGate, 1, 1)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 1), "Iron AND Gate");
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] {
new ItemStack(redstoneChipset, 1, 1),
new ItemStack(BuildCraftTransport.redPipeWire) }, 40000,
new ItemStack(BuildCraftTransport.pipeGate, 1, 1)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 1),
"Iron AND Gate");
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] {
new ItemStack(BuildCraftTransport.pipeGate, 1, 1),
new ItemStack(redstoneChipset, 1, 4),
new ItemStack(redstoneChipset, 1, 1) }, 20000, new ItemStack(
BuildCraftTransport.pipeGateAutarchic, 1, 1)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic,
1, 1), "Autarchic Iron AND Gate");
new ItemStack(BuildCraftTransport.pipeGate, 1, 1), new ItemStack(redstoneChipset, 1, 4),
new ItemStack(redstoneChipset, 1, 1) }, 20000, new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 1)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 1), "Autarchic Iron AND Gate");
// / IRON OR GATES
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(redstoneChipset, 1, 1),
new ItemStack(BuildCraftTransport.redPipeWire) }, 40000, new ItemStack(BuildCraftTransport.pipeGate, 1, 2)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 2), "Iron OR Gate");
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] {
new ItemStack(redstoneChipset, 1, 1),
new ItemStack(BuildCraftTransport.redPipeWire) }, 40000,
new ItemStack(BuildCraftTransport.pipeGate, 1, 2)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 2),
"Iron OR Gate");
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] {
new ItemStack(BuildCraftTransport.pipeGate, 1, 2),
new ItemStack(redstoneChipset, 1, 4),
new ItemStack(redstoneChipset, 1, 1) }, 20000, new ItemStack(
BuildCraftTransport.pipeGateAutarchic, 1, 2)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic,
1, 2), "Autarchic Iron OR Gate");
new ItemStack(BuildCraftTransport.pipeGate, 1, 2), new ItemStack(redstoneChipset, 1, 4),
new ItemStack(redstoneChipset, 1, 1) }, 20000, new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 2)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 2), "Autarchic Iron OR Gate");
// / GOLD AND GATES
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] {
new ItemStack(redstoneChipset, 1, 2),
new ItemStack(BuildCraftTransport.redPipeWire),
new ItemStack(BuildCraftTransport.bluePipeWire) }, 80000,
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(redstoneChipset, 1, 2),
new ItemStack(BuildCraftTransport.redPipeWire), new ItemStack(BuildCraftTransport.bluePipeWire) }, 80000,
new ItemStack(BuildCraftTransport.pipeGate, 1, 3)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 3),
"Gold AND Gate");
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 3), "Gold AND Gate");
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] {
new ItemStack(BuildCraftTransport.pipeGate, 1, 3),
new ItemStack(redstoneChipset, 1, 4),
new ItemStack(redstoneChipset, 1, 1) }, 40000, new ItemStack(
BuildCraftTransport.pipeGateAutarchic, 1, 3)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic,
1, 3), "Autarchic Gold AND Gate");
new ItemStack(BuildCraftTransport.pipeGate, 1, 3), new ItemStack(redstoneChipset, 1, 4),
new ItemStack(redstoneChipset, 1, 1) }, 40000, new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 3)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 3), "Autarchic Gold AND Gate");
// / GOLD OR GATES
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] {
new ItemStack(redstoneChipset, 1, 2),
new ItemStack(BuildCraftTransport.redPipeWire),
new ItemStack(BuildCraftTransport.bluePipeWire) }, 80000,
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(redstoneChipset, 1, 2),
new ItemStack(BuildCraftTransport.redPipeWire), new ItemStack(BuildCraftTransport.bluePipeWire) }, 80000,
new ItemStack(BuildCraftTransport.pipeGate, 1, 4)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 4),
"Gold OR Gate");
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 4), "Gold OR Gate");
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] {
new ItemStack(BuildCraftTransport.pipeGate, 1, 4),
new ItemStack(redstoneChipset, 1, 4),
new ItemStack(redstoneChipset, 1, 1) }, 40000, new ItemStack(
BuildCraftTransport.pipeGateAutarchic, 1, 4)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic,
1, 4), "Autarchic Gold OR Gate");
new ItemStack(BuildCraftTransport.pipeGate, 1, 4), new ItemStack(redstoneChipset, 1, 4),
new ItemStack(redstoneChipset, 1, 1) }, 40000, new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 4)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 4), "Autarchic Gold OR Gate");
// / DIAMOND AND GATES
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] {
new ItemStack(redstoneChipset, 1, 3),
new ItemStack(BuildCraftTransport.redPipeWire),
new ItemStack(BuildCraftTransport.bluePipeWire),
new ItemStack(BuildCraftTransport.greenPipeWire),
new ItemStack(BuildCraftTransport.yellowPipeWire) }, 160000,
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(redstoneChipset, 1, 3),
new ItemStack(BuildCraftTransport.redPipeWire), new ItemStack(BuildCraftTransport.bluePipeWire),
new ItemStack(BuildCraftTransport.greenPipeWire), new ItemStack(BuildCraftTransport.yellowPipeWire) }, 160000,
new ItemStack(BuildCraftTransport.pipeGate, 1, 5)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 5),
"Diamond AND Gate");
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 5), "Diamond AND Gate");
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] {
new ItemStack(BuildCraftTransport.pipeGate, 1, 5),
new ItemStack(redstoneChipset, 1, 4),
new ItemStack(redstoneChipset, 1, 1) }, 80000, new ItemStack(
BuildCraftTransport.pipeGateAutarchic, 1, 5)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic,
1, 5), "Autarchic Diamond AND Gate");
new ItemStack(BuildCraftTransport.pipeGate, 1, 5), new ItemStack(redstoneChipset, 1, 4),
new ItemStack(redstoneChipset, 1, 1) }, 80000, new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 5)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 5), "Autarchic Diamond AND Gate");
// / DIAMOND OR GATES
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] {
new ItemStack(redstoneChipset, 1, 3),
new ItemStack(BuildCraftTransport.redPipeWire),
new ItemStack(BuildCraftTransport.bluePipeWire),
new ItemStack(BuildCraftTransport.greenPipeWire),
new ItemStack(BuildCraftTransport.yellowPipeWire) }, 160000,
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(redstoneChipset, 1, 3),
new ItemStack(BuildCraftTransport.redPipeWire), new ItemStack(BuildCraftTransport.bluePipeWire),
new ItemStack(BuildCraftTransport.greenPipeWire), new ItemStack(BuildCraftTransport.yellowPipeWire) }, 160000,
new ItemStack(BuildCraftTransport.pipeGate, 1, 6)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 6),
"Diamond OR Gate");
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 6), "Diamond OR Gate");
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] {
new ItemStack(BuildCraftTransport.pipeGate, 1, 6),
new ItemStack(redstoneChipset, 1, 4),
new ItemStack(redstoneChipset, 1, 1) }, 80000, new ItemStack(
BuildCraftTransport.pipeGateAutarchic, 1, 6)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic,
1, 6), "Autarchic Diamond OR Gate");
new ItemStack(BuildCraftTransport.pipeGate, 1, 6), new ItemStack(redstoneChipset, 1, 4),
new ItemStack(redstoneChipset, 1, 1) }, 80000, new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 6)));
CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 6), "Autarchic Diamond OR Gate");
new BptBlockRotateMeta(laserBlock.blockID, new int[] { 2, 5, 3, 4 },
true);
new BptBlockRotateMeta(laserBlock.blockID, new int[] { 2, 5, 3, 4 }, true);
new BptBlockInventory(assemblyTableBlock.blockID);
if (BuildCraftCore.loadDefaultRecipes)
@ -223,20 +163,13 @@ public class BuildCraftSilicon {
public static void loadRecipes() {
CraftingManager craftingmanager = CraftingManager.getInstance();
craftingmanager.addRecipe(new ItemStack(laserBlock), new Object[] {
"ORR", "DDR", "ORR", Character.valueOf('O'), Block.obsidian,
Character.valueOf('R'), Item.redstone, Character.valueOf('D'),
Item.diamond, });
craftingmanager.addRecipe(new ItemStack(laserBlock), new Object[] { "ORR", "DDR", "ORR", Character.valueOf('O'),
Block.obsidian, Character.valueOf('R'), Item.redstone, Character.valueOf('D'), Item.diamond, });
craftingmanager
.addRecipe(
new ItemStack(assemblyTableBlock),
new Object[] { "ORO", "ODO", "OGO",
Character.valueOf('O'), Block.obsidian,
Character.valueOf('R'), Item.redstone,
Character.valueOf('D'), Item.diamond,
Character.valueOf('G'),
BuildCraftCore.diamondGearItem, });
craftingmanager.addRecipe(new ItemStack(assemblyTableBlock),
new Object[] { "ORO", "ODO", "OGO", Character.valueOf('O'), Block.obsidian, Character.valueOf('R'),
Item.redstone, Character.valueOf('D'), Item.diamond, Character.valueOf('G'),
BuildCraftCore.diamondGearItem, });
}
public static void initializeModel(BaseMod mod) {

View file

@ -101,49 +101,35 @@ public class BuildCraftTransport {
public static Item pipeStructureCobblestone;
public static int groupItemsTrigger;
public static Trigger triggerPipeEmpty = new TriggerPipeContents(
DefaultProps.TRIGGER_PIPE_EMPTY, Kind.Empty);
public static Trigger triggerPipeItems = new TriggerPipeContents(
DefaultProps.TRIGGER_PIPE_ITEMS, Kind.ContainsItems);
public static Trigger triggerPipeLiquids = new TriggerPipeContents(
DefaultProps.TRIGGER_PIPE_LIQUIDS, Kind.ContainsLiquids);
public static Trigger triggerPipeEnergy = new TriggerPipeContents(
DefaultProps.TRIGGER_PIPE_ENERGY, Kind.ContainsEnergy);
public static Trigger triggerRedSignalActive = new TriggerPipeSignal(
DefaultProps.TRIGGER_RED_SIGNAL_ACTIVE, true, IPipe.WireColor.Red);
public static Trigger triggerRedSignalInactive = new TriggerPipeSignal(
DefaultProps.TRIGGER_RED_SIGNAL_INACTIVE, false,
public static Trigger triggerPipeEmpty = new TriggerPipeContents(DefaultProps.TRIGGER_PIPE_EMPTY, Kind.Empty);
public static Trigger triggerPipeItems = new TriggerPipeContents(DefaultProps.TRIGGER_PIPE_ITEMS, Kind.ContainsItems);
public static Trigger triggerPipeLiquids = new TriggerPipeContents(DefaultProps.TRIGGER_PIPE_LIQUIDS, Kind.ContainsLiquids);
public static Trigger triggerPipeEnergy = new TriggerPipeContents(DefaultProps.TRIGGER_PIPE_ENERGY, Kind.ContainsEnergy);
public static Trigger triggerRedSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_RED_SIGNAL_ACTIVE, true,
IPipe.WireColor.Red);
public static Trigger triggerBlueSignalActive = new TriggerPipeSignal(
DefaultProps.TRIGGER_BLUE_SIGNAL_ACTIVE, true, IPipe.WireColor.Blue);
public static Trigger triggerBlueSignalInactive = new TriggerPipeSignal(
DefaultProps.TRIGGER_BLUE_SIGNAL_INACTIVE, false,
public static Trigger triggerRedSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_RED_SIGNAL_INACTIVE, false,
IPipe.WireColor.Red);
public static Trigger triggerBlueSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_BLUE_SIGNAL_ACTIVE, true,
IPipe.WireColor.Blue);
public static Trigger triggerGreenSignalActive = new TriggerPipeSignal(
DefaultProps.TRIGGER_GREEN_SIGNAL_ACTIVE, true,
public static Trigger triggerBlueSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_BLUE_SIGNAL_INACTIVE, false,
IPipe.WireColor.Blue);
public static Trigger triggerGreenSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_GREEN_SIGNAL_ACTIVE, true,
IPipe.WireColor.Green);
public static Trigger triggerGreenSignalInactive = new TriggerPipeSignal(
DefaultProps.TRIGGER_GREEN_SIGNAL_INACTIVE, false,
public static Trigger triggerGreenSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_GREEN_SIGNAL_INACTIVE, false,
IPipe.WireColor.Green);
public static Trigger triggerYellowSignalActive = new TriggerPipeSignal(
DefaultProps.TRIGGER_YELLOW_SIGNAL_ACTIVE, true,
public static Trigger triggerYellowSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_YELLOW_SIGNAL_ACTIVE, true,
IPipe.WireColor.Yellow);
public static Trigger triggerYellowSignalInactive = new TriggerPipeSignal(
DefaultProps.TRIGGER_YELLOW_SIGNAL_INACTIVE, false,
public static Trigger triggerYellowSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_YELLOW_SIGNAL_INACTIVE, false,
IPipe.WireColor.Yellow);
public static Action actionRedSignal = new ActionSignalOutput(
DefaultProps.ACTION_RED_SIGNAL, IPipe.WireColor.Red);
public static Action actionBlueSignal = new ActionSignalOutput(
DefaultProps.ACTION_BLUE_SIGNAL, IPipe.WireColor.Blue);
public static Action actionGreenSignal = new ActionSignalOutput(
DefaultProps.ACTION_GREEN_SIGNAL, IPipe.WireColor.Green);
public static Action actionYellowSignal = new ActionSignalOutput(
DefaultProps.ACTION_YELLOW_SIGNAL, IPipe.WireColor.Yellow);
public static Action actionEnergyPulser = new ActionEnergyPulser(
DefaultProps.ACTION_ENERGY_PULSER);
public static Action actionRedSignal = new ActionSignalOutput(DefaultProps.ACTION_RED_SIGNAL, IPipe.WireColor.Red);
public static Action actionBlueSignal = new ActionSignalOutput(DefaultProps.ACTION_BLUE_SIGNAL, IPipe.WireColor.Blue);
public static Action actionGreenSignal = new ActionSignalOutput(DefaultProps.ACTION_GREEN_SIGNAL, IPipe.WireColor.Green);
public static Action actionYellowSignal = new ActionSignalOutput(DefaultProps.ACTION_YELLOW_SIGNAL, IPipe.WireColor.Yellow);
public static Action actionEnergyPulser = new ActionEnergyPulser(DefaultProps.ACTION_ENERGY_PULSER);
private static class PipeRecipe {
boolean isShapeless = false; // pipe recipes come shaped and unshaped.
ItemStack result;
Object[] input;
@ -156,8 +142,7 @@ public class BuildCraftTransport {
MinecraftForge.registerConnectionHandler(new ConnectionHandler());
// Register gui handler
MinecraftForge.setGuiHandler(mod_BuildCraftTransport.instance,
new GuiHandler());
MinecraftForge.setGuiHandler(mod_BuildCraftTransport.instance, new GuiHandler());
}
public static void initialize() {
@ -168,131 +153,98 @@ public class BuildCraftTransport {
mod_BuildCraftCore.initialize();
Property loadLegacyPipes = BuildCraftCore.mainConfiguration
.getOrCreateBooleanProperty("loadLegacyPipes",
Configuration.CATEGORY_GENERAL, true);
Property loadLegacyPipes = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("loadLegacyPipes",
Configuration.CATEGORY_GENERAL, true);
loadLegacyPipes.comment = "set to true to load pre 2.2.5 worlds pipes";
Property alwaysConnect = BuildCraftCore.mainConfiguration
.getOrCreateBooleanProperty("pipes.alwaysConnect",
Configuration.CATEGORY_GENERAL,
DefaultProps.PIPES_ALWAYS_CONNECT);
Property alwaysConnect = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("pipes.alwaysConnect",
Configuration.CATEGORY_GENERAL, DefaultProps.PIPES_ALWAYS_CONNECT);
alwaysConnect.comment = "set to false to deactivate pipe connection rules, true by default";
Property exclusionList = BuildCraftCore.mainConfiguration
.getOrCreateProperty("woodenPipe.exclusion",
Configuration.CATEGORY_BLOCK, "");
Property exclusionList = BuildCraftCore.mainConfiguration.getOrCreateProperty("woodenPipe.exclusion",
Configuration.CATEGORY_BLOCK, "");
PipeLogicWood.excludedBlocks = exclusionList.value.split(",");
Property maxItemInPipesProp = BuildCraftCore.mainConfiguration
.getOrCreateIntProperty("pipes.maxItems",
Configuration.CATEGORY_GENERAL, 100);
Property maxItemInPipesProp = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("pipes.maxItems",
Configuration.CATEGORY_GENERAL, 100);
maxItemInPipesProp.comment = "pipes containing more than this amount of items will explode, not dropping any item";
maxItemsInPipes = Integer.parseInt(maxItemInPipesProp.value);
Property groupItemsTriggerProp = BuildCraftCore.mainConfiguration
.getOrCreateIntProperty("pipes.groupItemsTrigger",
Configuration.CATEGORY_GENERAL, 32);
Property groupItemsTriggerProp = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("pipes.groupItemsTrigger",
Configuration.CATEGORY_GENERAL, 32);
groupItemsTriggerProp.comment = "when reaching this amount of objects in a pipes, items will be automatically grouped";
groupItemsTrigger = Integer.parseInt(groupItemsTriggerProp.value);
Property genericPipeId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("pipe.id",
DefaultProps.GENERIC_PIPE_ID);
Property genericPipeId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("pipe.id",
DefaultProps.GENERIC_PIPE_ID);
for (int j = 0; j < PipeLogicWood.excludedBlocks.length; ++j)
PipeLogicWood.excludedBlocks[j] = PipeLogicWood.excludedBlocks[j]
.trim();
PipeLogicWood.excludedBlocks[j] = PipeLogicWood.excludedBlocks[j].trim();
BuildCraftCore.mainConfiguration.save();
pipeWaterproof = new ItemBuildCraft(DefaultProps.PIPE_WATERPROOF_ID)
.setIconIndex(2 * 16 + 1);
pipeWaterproof = new ItemBuildCraft(DefaultProps.PIPE_WATERPROOF_ID).setIconIndex(2 * 16 + 1);
pipeWaterproof.setItemName("pipeWaterproof");
CoreProxy.addName(pipeWaterproof, "Pipe Waterproof");
genericPipeBlock = new BlockGenericPipe(
Integer.parseInt(genericPipeId.value));
genericPipeBlock = new BlockGenericPipe(Integer.parseInt(genericPipeId.value));
CoreProxy.registerBlock(genericPipeBlock);
// Fixing retro-compatiblity
mod_BuildCraftTransport.registerTilePipe(TileDummyGenericPipe.class,
"net.minecraft.src.buildcraft.GenericPipe");
mod_BuildCraftTransport.registerTilePipe(TileDummyGenericPipe.class, "net.minecraft.src.buildcraft.GenericPipe");
mod_BuildCraftTransport.registerTilePipe(TileDummyGenericPipe2.class,
"net.minecraft.src.buildcraft.transport.TileGenericPipe");
mod_BuildCraftTransport.registerTilePipe(TileGenericPipe.class,
"net.minecraft.src.buildcraft.transport.GenericPipe");
mod_BuildCraftTransport.registerTilePipe(TileGenericPipe.class, "net.minecraft.src.buildcraft.transport.GenericPipe");
pipeItemsWood = createPipe(DefaultProps.PIPE_ITEMS_WOOD_ID,
PipeItemsWood.class, "Wooden Transport Pipe", Block.planks,
pipeItemsWood = createPipe(DefaultProps.PIPE_ITEMS_WOOD_ID, PipeItemsWood.class, "Wooden Transport Pipe", Block.planks,
Block.glass, Block.planks);
pipeItemsCobblestone = createPipe(
DefaultProps.PIPE_ITEMS_COBBLESTONE_ID,
PipeItemsCobblestone.class, "Cobblestone Transport Pipe",
Block.cobblestone, Block.glass, Block.cobblestone);
pipeItemsStone = createPipe(DefaultProps.PIPE_ITEMS_STONE_ID,
PipeItemsStone.class, "Stone Transport Pipe", Block.stone,
pipeItemsCobblestone = createPipe(DefaultProps.PIPE_ITEMS_COBBLESTONE_ID, PipeItemsCobblestone.class,
"Cobblestone Transport Pipe", Block.cobblestone, Block.glass, Block.cobblestone);
pipeItemsStone = createPipe(DefaultProps.PIPE_ITEMS_STONE_ID, PipeItemsStone.class, "Stone Transport Pipe", Block.stone,
Block.glass, Block.stone);
pipeItemsIron = createPipe(DefaultProps.PIPE_ITEMS_IRON_ID,
PipeItemsIron.class, "Iron Transport Pipe", Item.ingotIron,
pipeItemsIron = createPipe(DefaultProps.PIPE_ITEMS_IRON_ID, PipeItemsIron.class, "Iron Transport Pipe", Item.ingotIron,
Block.glass, Item.ingotIron);
pipeItemsGold = createPipe(DefaultProps.PIPE_ITEMS_GOLD_ID,
PipeItemsGold.class, "Golden Transport Pipe", Item.ingotGold,
pipeItemsGold = createPipe(DefaultProps.PIPE_ITEMS_GOLD_ID, PipeItemsGold.class, "Golden Transport Pipe", Item.ingotGold,
Block.glass, Item.ingotGold);
pipeItemsDiamond = createPipe(DefaultProps.PIPE_ITEMS_DIAMOND_ID,
PipeItemsDiamond.class, "Diamond Transport Pipe", Item.diamond,
Block.glass, Item.diamond);
pipeItemsObsidian = createPipe(DefaultProps.PIPE_ITEMS_OBSIDIAN_ID,
PipeItemsObsidian.class, "Obsidian Transport Pipe",
pipeItemsDiamond = createPipe(DefaultProps.PIPE_ITEMS_DIAMOND_ID, PipeItemsDiamond.class, "Diamond Transport Pipe",
Item.diamond, Block.glass, Item.diamond);
pipeItemsObsidian = createPipe(DefaultProps.PIPE_ITEMS_OBSIDIAN_ID, PipeItemsObsidian.class, "Obsidian Transport Pipe",
Block.obsidian, Block.glass, Block.obsidian);
pipeLiquidsWood = createPipe(DefaultProps.PIPE_LIQUIDS_WOOD_ID,
PipeLiquidsWood.class, "Wooden Waterproof Pipe",
pipeLiquidsWood = createPipe(DefaultProps.PIPE_LIQUIDS_WOOD_ID, PipeLiquidsWood.class, "Wooden Waterproof Pipe",
pipeWaterproof, pipeItemsWood, null);
pipeLiquidsCobblestone = createPipe(
DefaultProps.PIPE_LIQUIDS_COBBLESTONE_ID,
PipeLiquidsCobblestone.class, "Cobblestone Waterproof Pipe",
pipeWaterproof, pipeItemsCobblestone, null);
pipeLiquidsStone = createPipe(DefaultProps.PIPE_LIQUIDS_STONE_ID,
PipeLiquidsStone.class, "Stone Waterproof Pipe",
pipeLiquidsCobblestone = createPipe(DefaultProps.PIPE_LIQUIDS_COBBLESTONE_ID, PipeLiquidsCobblestone.class,
"Cobblestone Waterproof Pipe", pipeWaterproof, pipeItemsCobblestone, null);
pipeLiquidsStone = createPipe(DefaultProps.PIPE_LIQUIDS_STONE_ID, PipeLiquidsStone.class, "Stone Waterproof Pipe",
pipeWaterproof, pipeItemsStone, null);
pipeLiquidsIron = createPipe(DefaultProps.PIPE_LIQUIDS_IRON_ID,
PipeLiquidsIron.class, "Iron Waterproof Pipe", pipeWaterproof,
pipeItemsIron, null);
pipeLiquidsGold = createPipe(DefaultProps.PIPE_LIQUIDS_GOLD_ID,
PipeLiquidsGold.class, "Golden Waterproof Pipe",
pipeLiquidsIron = createPipe(DefaultProps.PIPE_LIQUIDS_IRON_ID, PipeLiquidsIron.class, "Iron Waterproof Pipe",
pipeWaterproof, pipeItemsIron, null);
pipeLiquidsGold = createPipe(DefaultProps.PIPE_LIQUIDS_GOLD_ID, PipeLiquidsGold.class, "Golden Waterproof Pipe",
pipeWaterproof, pipeItemsGold, null);
// diamond
// obsidian
pipePowerWood = createPipe(DefaultProps.PIPE_POWER_WOOD_ID,
PipePowerWood.class, "Wooden Conductive Pipe", Item.redstone,
pipePowerWood = createPipe(DefaultProps.PIPE_POWER_WOOD_ID, PipePowerWood.class, "Wooden Conductive Pipe", Item.redstone,
pipeItemsWood, null);
// cobblestone
pipePowerStone = createPipe(DefaultProps.PIPE_POWER_STONE_ID,
PipePowerStone.class, "Stone Conductive Pipe", Item.redstone,
pipeItemsStone, null);
pipePowerStone = createPipe(DefaultProps.PIPE_POWER_STONE_ID, PipePowerStone.class, "Stone Conductive Pipe",
Item.redstone, pipeItemsStone, null);
// iron
pipePowerGold = createPipe(DefaultProps.PIPE_POWER_GOLD_ID,
PipePowerGold.class, "Golden Conductive Pipe", Item.redstone,
pipePowerGold = createPipe(DefaultProps.PIPE_POWER_GOLD_ID, PipePowerGold.class, "Golden Conductive Pipe", Item.redstone,
pipeItemsGold, null);
// diamond
// obsidian
// Fix name and recipe (Structure pipe insteand of Signal?)
pipeStructureCobblestone = createPipe(
DefaultProps.PIPE_STRUCTURE_COBBLESTONE_ID,
PipeStructureCobblestone.class, "Cobblestone Structure Pipe",
Block.gravel, pipeItemsCobblestone, null);
pipeStructureCobblestone = createPipe(DefaultProps.PIPE_STRUCTURE_COBBLESTONE_ID, PipeStructureCobblestone.class,
"Cobblestone Structure Pipe", Block.gravel, pipeItemsCobblestone, null);
// Fix the recipe
pipeItemsStipes = createPipe(DefaultProps.PIPE_ITEMS_STRIPES_ID,
PipeItemsStripes.class, "Stripes Transport Pipe",
new ItemStack(Item.dyePowder, 1, 0), Block.glass,
new ItemStack(Item.dyePowder, 1, 11));
pipeItemsStipes = createPipe(DefaultProps.PIPE_ITEMS_STRIPES_ID, PipeItemsStripes.class, "Stripes Transport Pipe",
new ItemStack(Item.dyePowder, 1, 0), Block.glass, new ItemStack(Item.dyePowder, 1, 11));
// dockingStationBlock = new
// BlockDockingStation(Integer.parseInt(dockingStationId.value));
@ -306,100 +258,64 @@ public class BuildCraftTransport {
for (int j = 0; j < 6; ++j)
diamondTextures[j] = 1 * 16 + 6 + j;
redPipeWire = new ItemBuildCraft(DefaultProps.RED_PIPE_WIRE)
.setIconIndex(4 * 16 + 0);
redPipeWire = new ItemBuildCraft(DefaultProps.RED_PIPE_WIRE).setIconIndex(4 * 16 + 0);
redPipeWire.setItemName("redPipeWire");
CoreProxy.addName(redPipeWire, "Red Pipe Wire");
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] {
new ItemStack(Item.dyePowder, 1, 1),
new ItemStack(Item.redstone, 1),
new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(
redPipeWire, 8)));
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 1),
new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(redPipeWire, 8)));
bluePipeWire = new ItemBuildCraft(DefaultProps.BLUE_PIPE_WIRE)
.setIconIndex(4 * 16 + 1);
bluePipeWire = new ItemBuildCraft(DefaultProps.BLUE_PIPE_WIRE).setIconIndex(4 * 16 + 1);
bluePipeWire.setItemName("bluePipeWire");
CoreProxy.addName(bluePipeWire, "Blue Pipe Wire");
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] {
new ItemStack(Item.dyePowder, 1, 4),
new ItemStack(Item.redstone, 1),
new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(
bluePipeWire, 8)));
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 4),
new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(bluePipeWire, 8)));
greenPipeWire = new ItemBuildCraft(DefaultProps.GREEN_PIPE_WIRE)
.setIconIndex(4 * 16 + 2);
greenPipeWire = new ItemBuildCraft(DefaultProps.GREEN_PIPE_WIRE).setIconIndex(4 * 16 + 2);
greenPipeWire.setItemName("greenPipeWire");
CoreProxy.addName(greenPipeWire, "Green Pipe Wire");
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] {
new ItemStack(Item.dyePowder, 1, 2),
new ItemStack(Item.redstone, 1),
new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(
greenPipeWire, 8)));
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 2),
new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(greenPipeWire, 8)));
yellowPipeWire = new ItemBuildCraft(DefaultProps.YELLOW_PIPE_WIRE)
.setIconIndex(4 * 16 + 3);
yellowPipeWire = new ItemBuildCraft(DefaultProps.YELLOW_PIPE_WIRE).setIconIndex(4 * 16 + 3);
yellowPipeWire.setItemName("yellowPipeWire");
CoreProxy.addName(yellowPipeWire, "Yellow Pipe Wire");
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] {
new ItemStack(Item.dyePowder, 1, 11),
new ItemStack(Item.redstone, 1),
new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(
yellowPipeWire, 8)));
BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 11),
new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(yellowPipeWire, 8)));
pipeGate = new ItemGate(DefaultProps.GATE_ID, 0)
.setIconIndex(2 * 16 + 3);
pipeGate = new ItemGate(DefaultProps.GATE_ID, 0).setIconIndex(2 * 16 + 3);
pipeGate.setItemName("pipeGate");
pipeGateAutarchic = new ItemGate(DefaultProps.GATE_AUTARCHIC_ID, 1)
.setIconIndex(2 * 16 + 3);
pipeGateAutarchic = new ItemGate(DefaultProps.GATE_AUTARCHIC_ID, 1).setIconIndex(2 * 16 + 3);
pipeGateAutarchic.setItemName("pipeGateAutarchic");
alwaysConnectPipes = Boolean.parseBoolean(alwaysConnect.value);
if (loadLegacyPipes.value.equals("true")) {
Property woodenPipeId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("woodenPipe.id",
DefaultProps.WOODEN_PIPE_ID);
Property stonePipeId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("stonePipe.id",
DefaultProps.STONE_PIPE_ID);
Property ironPipeId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("ironPipe.id",
DefaultProps.IRON_PIPE_ID);
Property goldenPipeId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("goldenPipe.id",
DefaultProps.GOLDEN_PIPE_ID);
Property diamondPipeId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("diamondPipe.id",
DefaultProps.DIAMOND_PIPE_ID);
Property obsidianPipeId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("obsidianPipe.id",
DefaultProps.OBSIDIAN_PIPE_ID);
Property cobblestonePipeId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("cobblestonePipe.id",
DefaultProps.COBBLESTONE_PIPE_ID);
CoreProxy.registerBlock(new LegacyBlock(Integer
.parseInt(woodenPipeId.value), pipeItemsWood.shiftedIndex));
CoreProxy.registerBlock(new LegacyBlock(Integer
.parseInt(stonePipeId.value), pipeItemsStone.shiftedIndex));
CoreProxy.registerBlock(new LegacyBlock(Integer
.parseInt(ironPipeId.value), pipeItemsIron.shiftedIndex));
CoreProxy.registerBlock(new LegacyBlock(Integer
.parseInt(goldenPipeId.value), pipeItemsGold.shiftedIndex));
CoreProxy.registerBlock(new LegacyBlock(Integer
.parseInt(diamondPipeId.value),
pipeItemsDiamond.shiftedIndex));
CoreProxy.registerBlock(new LegacyBlock(Integer
.parseInt(obsidianPipeId.value),
pipeItemsObsidian.shiftedIndex));
CoreProxy.registerBlock(new LegacyBlock(Integer
.parseInt(cobblestonePipeId.value),
pipeItemsCobblestone.shiftedIndex));
Property woodenPipeId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("woodenPipe.id",
DefaultProps.WOODEN_PIPE_ID);
Property stonePipeId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("stonePipe.id",
DefaultProps.STONE_PIPE_ID);
Property ironPipeId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("ironPipe.id",
DefaultProps.IRON_PIPE_ID);
Property goldenPipeId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("goldenPipe.id",
DefaultProps.GOLDEN_PIPE_ID);
Property diamondPipeId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("diamondPipe.id",
DefaultProps.DIAMOND_PIPE_ID);
Property obsidianPipeId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("obsidianPipe.id",
DefaultProps.OBSIDIAN_PIPE_ID);
Property cobblestonePipeId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("cobblestonePipe.id",
DefaultProps.COBBLESTONE_PIPE_ID);
CoreProxy.registerBlock(new LegacyBlock(Integer.parseInt(woodenPipeId.value), pipeItemsWood.shiftedIndex));
CoreProxy.registerBlock(new LegacyBlock(Integer.parseInt(stonePipeId.value), pipeItemsStone.shiftedIndex));
CoreProxy.registerBlock(new LegacyBlock(Integer.parseInt(ironPipeId.value), pipeItemsIron.shiftedIndex));
CoreProxy.registerBlock(new LegacyBlock(Integer.parseInt(goldenPipeId.value), pipeItemsGold.shiftedIndex));
CoreProxy.registerBlock(new LegacyBlock(Integer.parseInt(diamondPipeId.value), pipeItemsDiamond.shiftedIndex));
CoreProxy.registerBlock(new LegacyBlock(Integer.parseInt(obsidianPipeId.value), pipeItemsObsidian.shiftedIndex));
CoreProxy
.registerTileEntity(LegacyTile.class,
"net.buildcraft.src.buildcraft.transport.legacy.LegacyTile");
.registerBlock(new LegacyBlock(Integer.parseInt(cobblestonePipeId.value), pipeItemsCobblestone.shiftedIndex));
CoreProxy.registerTileEntity(LegacyTile.class, "net.buildcraft.src.buildcraft.transport.legacy.LegacyTile");
}
BuildCraftCore.mainConfiguration.save();
@ -422,9 +338,8 @@ public class BuildCraftTransport {
CraftingManager craftingmanager = CraftingManager.getInstance();
// Add base recipe for pipe waterproof.
craftingmanager.addRecipe(new ItemStack(pipeWaterproof, 1),
new Object[] { "W ", " ", Character.valueOf('W'),
new ItemStack(Item.dyePowder, 1, 2) });
craftingmanager.addRecipe(new ItemStack(pipeWaterproof, 1), new Object[] { "W ", " ", Character.valueOf('W'),
new ItemStack(Item.dyePowder, 1, 2) });
// Add pipe recipes
for (PipeRecipe p : pipeRecipes)
@ -434,15 +349,12 @@ public class BuildCraftTransport {
craftingmanager.addRecipe(p.result, p.input);
}
private static Item createPipe(int defaultID, Class<? extends Pipe> clas,
String descr, Object ingredient1, Object ingredient2,
Object ingredient3) {
String name = Character.toLowerCase(clas.getSimpleName().charAt(0))
+ clas.getSimpleName().substring(1);
private static Item createPipe(int defaultID, Class<? extends Pipe> clas, String descr, Object ingredient1,
Object ingredient2, Object ingredient3) {
String name = Character.toLowerCase(clas.getSimpleName().charAt(0)) + clas.getSimpleName().substring(1);
Property prop = BuildCraftCore.mainConfiguration
.getOrCreateIntProperty(name + ".id",
Configuration.CATEGORY_ITEM, defaultID);
Property prop = BuildCraftCore.mainConfiguration.getOrCreateIntProperty(name + ".id", Configuration.CATEGORY_ITEM,
defaultID);
int id = Integer.parseInt(prop.value);
Item res = BlockGenericPipe.registerPipe(id, clas);
@ -454,10 +366,8 @@ public class BuildCraftTransport {
if (ingredient1 != null && ingredient2 != null && ingredient3 != null) {
recipe.result = new ItemStack(res, 8);
recipe.input = new Object[] { " ", "ABC", " ",
Character.valueOf('A'), ingredient1,
Character.valueOf('B'), ingredient2,
Character.valueOf('C'), ingredient3 };
recipe.input = new Object[] { " ", "ABC", " ", Character.valueOf('A'), ingredient1, Character.valueOf('B'),
ingredient2, Character.valueOf('C'), ingredient3 };
pipeRecipes.add(recipe);
} else if (ingredient1 != null && ingredient2 != null) {

View file

@ -10,6 +10,7 @@
package net.minecraft.src.buildcraft.api;
public abstract class Action {
public int id;
public Action(int id) {

View file

@ -10,6 +10,7 @@
package net.minecraft.src.buildcraft.api;
public class BlockSignature {
public String blockClassName;
public String tileClassName;
public String blockName;
@ -45,8 +46,7 @@ public class BlockSignature {
public String toString() {
replaceNullWithStar();
return "#B/" + blockClassName + "/" + tileClassName + "/" + blockName
+ "/" + mod + "/" + modVersion + "/" + customField;
return "#B/" + blockClassName + "/" + tileClassName + "/" + blockName + "/" + mod + "/" + modVersion + "/" + customField;
}
public void replaceNullWithStar() {

View file

@ -66,8 +66,7 @@ public class BptBlock {
* requirements are met, they will be removed all at once from the builder,
* before calling buildBlock.
*/
public void addRequirements(BptSlotInfo slot, IBptContext context,
LinkedList<ItemStack> requirements) {
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
if (slot.blockId != 0) {
if (slot.storedRequirements.size() != 0) {
requirements.addAll(slot.storedRequirements);
@ -91,11 +90,9 @@ public class BptBlock {
* for updating req (with the remaining requirements if any) and stack
* (after usage)
*/
public void useItem(BptSlotInfo slot, IBptContext context, ItemStack req,
ItemStack stack) {
public void useItem(BptSlotInfo slot, IBptContext context, ItemStack req, ItemStack stack) {
if (stack.isItemStackDamageable()) {
if (req.getItemDamage() + stack.getItemDamage() <= stack
.getMaxDamage()) {
if (req.getItemDamage() + stack.getItemDamage() <= stack.getMaxDamage()) {
stack.setItemDamage(req.getItemDamage() + stack.getItemDamage());
req.stackSize = 0;
}
@ -128,8 +125,7 @@ public class BptBlock {
* subprogram is permissive and doesn't take into account metadata.
*/
public boolean isValid(BptSlotInfo slot, IBptContext context) {
return slot.blockId == context.world().getBlockId(slot.x, slot.y,
slot.z);
return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z);
}
/**
@ -144,14 +140,11 @@ public class BptBlock {
*/
public void buildBlock(BptSlotInfo slot, IBptContext context) {
// Meta needs to be specified twice, depending on the block behavior
context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z,
slot.blockId, slot.meta);
context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z,
slot.meta);
context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, slot.blockId, slot.meta);
context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta);
if (Block.blocksList[slot.blockId] instanceof BlockContainer) {
TileEntity tile = context.world().getBlockTileEntity(slot.x,
slot.y, slot.z);
TileEntity tile = context.world().getBlockTileEntity(slot.x, slot.y, slot.z);
slot.cpt.setInteger("x", slot.x);
slot.cpt.setInteger("y", slot.y);
@ -180,8 +173,7 @@ public class BptBlock {
* By default, if the block is a BlockContainer, tile information will be to
* save / load the block.
*/
public void initializeFromWorld(BptSlotInfo slot, IBptContext context,
int x, int y, int z) {
public void initializeFromWorld(BptSlotInfo slot, IBptContext context, int x, int y, int z) {
if (Block.blocksList[slot.blockId] instanceof BlockContainer) {
TileEntity tile = context.world().getBlockTileEntity(x, y, z);
@ -191,9 +183,8 @@ public class BptBlock {
}
if (Block.blocksList[slot.blockId] != null) {
ArrayList<ItemStack> req = Block.blocksList[slot.blockId]
.getBlockDropped(context.world(), x, y, z, context.world()
.getBlockMetadata(x, y, z), 0);
ArrayList<ItemStack> req = Block.blocksList[slot.blockId].getBlockDropped(context.world(), x, y, z, context.world()
.getBlockMetadata(x, y, z), 0);
if (req != null) {
slot.storedRequirements.addAll(req);
@ -252,10 +243,8 @@ public class BptBlock {
BlockSignature inst = BuildCraftAPI.getBlockSignature(block);
return starMatch(sig.blockName, inst.blockName)
&& starMatch(sig.blockClassName, inst.blockClassName)
&& starMatch(sig.tileClassName, inst.tileClassName)
&& starMatch(sig.customField, inst.customField)
return starMatch(sig.blockName, inst.blockName) && starMatch(sig.blockClassName, inst.blockClassName)
&& starMatch(sig.tileClassName, inst.tileClassName) && starMatch(sig.customField, inst.customField)
&& starMatch(sig.mod, inst.mod);
}

View file

@ -48,8 +48,7 @@ public class BuildCraftAPI {
}
for (LiquidData d : liquids) {
if (d.filled.itemID == filledItem.itemID
&& d.filled.getItemDamage() == filledItem.getItemDamage()) {
if (d.filled.itemID == filledItem.itemID && d.filled.getItemDamage() == filledItem.getItemDamage()) {
return d.liquidId;
}
}
@ -86,17 +85,14 @@ public class BuildCraftAPI {
* water...)
*/
public static boolean softBlock(int blockId) {
return blockId == 0 || softBlocks[blockId]
|| Block.blocksList[blockId] == null;
return blockId == 0 || softBlocks[blockId] || Block.blocksList[blockId] == null;
}
/**
* Return true if the block cannot be broken, typically bedrock and lava
*/
public static boolean unbreakableBlock(int blockId) {
return blockId == Block.bedrock.blockID
|| blockId == Block.lavaStill.blockID
|| blockId == Block.lavaMoving.blockID;
return blockId == Block.bedrock.blockID || blockId == Block.lavaStill.blockID || blockId == Block.lavaMoving.blockID;
}
@Deprecated
@ -105,8 +101,7 @@ public class BuildCraftAPI {
int blockId = world.getBlockId(x, y, z);
if (blockId != 0) {
Block.blocksList[blockId].dropBlockAsItem(world, x, y, z,
world.getBlockMetadata(x, y, z), 0);
Block.blocksList[blockId].dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
}
world.setBlockWithNotify(x, y, z, 0);
@ -126,8 +121,7 @@ public class BuildCraftAPI {
}
}
public static RefineryRecipe findRefineryRecipe(int liquid1, int qty1,
int liquid2, int qty2) {
public static RefineryRecipe findRefineryRecipe(int liquid1, int qty1, int liquid2, int qty2) {
int l1 = qty1 > 0 ? liquid1 : 0;
int l2 = qty2 > 0 ? liquid2 : 0;
@ -147,8 +141,7 @@ public class BuildCraftAPI {
continue;
}
if ((r.sourceQty2 == 0 && (src2 == 0 || src2 == src1))
|| r.sourceId2 == src2) {
if ((r.sourceQty2 == 0 && (src2 == 0 || src2 == src1)) || r.sourceId2 == src2) {
return r;
}
}
@ -163,8 +156,7 @@ public class BuildCraftAPI {
public static ItemSignature getItemSignature(Item item) {
ItemSignature sig = new ItemSignature();
if (item.shiftedIndex >= Block.blocksList.length
+ BuildCraftAPI.LAST_ORIGINAL_ITEM) {
if (item.shiftedIndex >= Block.blocksList.length + BuildCraftAPI.LAST_ORIGINAL_ITEM) {
sig.itemClassName = item.getClass().getSimpleName();
}
@ -179,13 +171,11 @@ public class BuildCraftAPI {
}
}
public static LinkedList<Trigger> getNeighborTriggers(Block block,
TileEntity entity) {
public static LinkedList<Trigger> getNeighborTriggers(Block block, TileEntity entity) {
LinkedList<Trigger> triggers = new LinkedList<Trigger>();
for (ITriggerProvider provider : triggerProviders) {
LinkedList<Trigger> toAdd = provider.getNeighborTriggers(block,
entity);
LinkedList<Trigger> toAdd = provider.getNeighborTriggers(block, entity);
if (toAdd != null) {
for (Trigger t : toAdd) {
@ -205,13 +195,11 @@ public class BuildCraftAPI {
}
}
public static LinkedList<Action> getNeighborActions(Block block,
TileEntity entity) {
public static LinkedList<Action> getNeighborActions(Block block, TileEntity entity) {
LinkedList<Action> actions = new LinkedList<Action>();
for (IActionProvider provider : actionProviders) {
LinkedList<Action> toAdd = provider.getNeighborActions(block,
entity);
LinkedList<Action> toAdd = provider.getNeighborActions(block, entity);
if (toAdd != null) {
for (Action t : toAdd) {

View file

@ -77,8 +77,7 @@ public class EntityPassiveItem {
posZ = z;
}
public EntityPassiveItem(World world, double d, double d1, double d2,
ItemStack itemstack) {
public EntityPassiveItem(World world, double d, double d1, double d2, ItemStack itemstack) {
this(world, d, d1, d2);
this.item = itemstack.copy();
}
@ -88,8 +87,7 @@ public class EntityPassiveItem {
posY = nbttagcompound.getDouble("y");
posZ = nbttagcompound.getDouble("z");
speed = nbttagcompound.getFloat("speed");
item = ItemStack.loadItemStackFromNBT(nbttagcompound
.getCompoundTag("Item"));
item = ItemStack.loadItemStackFromNBT(nbttagcompound.getCompoundTag("Item"));
NBTTagList contribList = nbttagcompound.getTagList("contribList");
@ -104,8 +102,7 @@ public class EntityPassiveItem {
}
try {
IPassiveItemContribution contrib = ((IPassiveItemContribution) Class
.forName(className).newInstance());
IPassiveItemContribution contrib = ((IPassiveItemContribution) Class.forName(className).newInstance());
contrib.readFromNBT(cpt);
@ -160,16 +157,12 @@ public class EntityPassiveItem {
Position motion = new Position(0, 0, 0, dir);
motion.moveForwards(0.1 + speed * 2F);
EntityItem entityitem = new EntityItem(worldObj, posX, posY, posZ,
item);
EntityItem entityitem = new EntityItem(worldObj, posX, posY, posZ, item);
float f3 = 0.00F + worldObj.rand.nextFloat() * 0.04F - 0.02F;
entityitem.motionX = (float) worldObj.rand.nextGaussian() * f3
+ motion.x;
entityitem.motionY = (float) worldObj.rand.nextGaussian() * f3
+ motion.y;
entityitem.motionZ = (float) worldObj.rand.nextGaussian() * f3
+ +motion.z;
entityitem.motionX = (float) worldObj.rand.nextGaussian() * f3 + motion.x;
entityitem.motionY = (float) worldObj.rand.nextGaussian() * f3 + motion.y;
entityitem.motionZ = (float) worldObj.rand.nextGaussian() * f3 + +motion.z;
worldObj.spawnEntityInWorld(entityitem);
remove();
@ -200,12 +193,10 @@ public class EntityPassiveItem {
}
public boolean isCorrupted() {
return item == null || item.stackSize <= 0
|| Item.itemsList[item.itemID] == null;
return item == null || item.stackSize <= 0 || Item.itemsList[item.itemID] == null;
}
public void addContribution(String key,
IPassiveItemContribution contribution) {
public void addContribution(String key, IPassiveItemContribution contribution) {
contributions.put(key, contribution);
}

View file

@ -19,7 +19,6 @@ public interface IActionProvider {
/**
* Returns the list of actions available to a gate next to the given block.
*/
public abstract LinkedList<Action> getNeighborActions(Block block,
TileEntity tile);
public abstract LinkedList<Action> getNeighborActions(Block block, TileEntity tile);
}

View file

@ -17,7 +17,6 @@ public interface IBlockPipe {
* With special kind of pipes, connectors texture has to vary (e.g. diamond
* or iron pipes.
*/
public void prepareTextureFor(IBlockAccess blockAccess, int i, int j,
int k, Orientations connection);
public void prepareTextureFor(IBlockAccess blockAccess, int i, int j, int k, Orientations connection);
}

View file

@ -12,6 +12,6 @@ package net.minecraft.src.buildcraft.api;
import net.minecraft.src.IBlockAccess;
public interface ILegacyPipeConnection {
public boolean isPipeConnected(IBlockAccess blockAccess, int x1, int y1,
int z1, int x2, int y2, int z2);
public boolean isPipeConnected(IBlockAccess blockAccess, int x1, int y1, int z1, int x2, int y2, int z2);
}

View file

@ -10,5 +10,6 @@
package net.minecraft.src.buildcraft.api;
public interface IPipeConnection {
public boolean isPipeConnected(Orientations with);
}

View file

@ -25,7 +25,6 @@ public interface ITriggerProvider {
/**
* Returns the list of triggers available to a gate next to the given block.
*/
public abstract LinkedList<Trigger> getNeighborTriggers(Block block,
TileEntity tile);
public abstract LinkedList<Trigger> getNeighborTriggers(Block block, TileEntity tile);
}

View file

@ -10,6 +10,7 @@
package net.minecraft.src.buildcraft.api;
public class IronEngineFuel {
public final int fuelId;
public final int powerPerCycle;
public final int totalBurningTime;

View file

@ -10,6 +10,7 @@
package net.minecraft.src.buildcraft.api;
public class ItemSignature {
public String itemClassName;
public String itemName;

Some files were not shown because too many files have changed in this diff Show more