add power adapters, tweak energy render, cleanup
|
@ -8,32 +8,24 @@
|
|||
*/
|
||||
package buildcraft.api.core;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
public final class BCLog {
|
||||
|
||||
public static final Logger logger = LogManager.getLogger("BuildCraft");
|
||||
|
||||
/**
|
||||
* Deactivate constructor
|
||||
*/
|
||||
private BCLog() {
|
||||
}
|
||||
|
||||
public static void initLog() {
|
||||
|
||||
logger.info("Starting BuildCraft " + getVersion());
|
||||
logger.info("Copyright (c) SpaceToad, 2011-2015");
|
||||
logger.info("http://www.mod-buildcraft.com");
|
||||
@Deprecated
|
||||
public static void logErrorAPI(String mod, Throwable error, Class<?> classFile) {
|
||||
logErrorAPI(error, classFile);
|
||||
}
|
||||
|
||||
public static void logErrorAPI(String mod, Throwable error, Class<?> classFile) {
|
||||
StringBuilder msg = new StringBuilder(mod);
|
||||
msg.append(" API error, please update your mods. Error: ").append(error);
|
||||
public static void logErrorAPI(Throwable error, Class<?> classFile) {
|
||||
StringBuilder msg = new StringBuilder("API error! Please update your mods. Error: ");
|
||||
msg.append(error);
|
||||
StackTraceElement[] stackTrace = error.getStackTrace();
|
||||
if (stackTrace.length > 0) {
|
||||
msg.append(", ").append(stackTrace[0]);
|
||||
|
@ -42,19 +34,13 @@ public final class BCLog {
|
|||
logger.log(Level.ERROR, msg.toString());
|
||||
|
||||
if (classFile != null) {
|
||||
msg = new StringBuilder(mod);
|
||||
msg.append(" API error: ").append(classFile.getSimpleName()).append(" is loaded from ").append(classFile.getProtectionDomain().getCodeSource().getLocation());
|
||||
msg.append("API error: ").append(classFile.getSimpleName()).append(" is loaded from ").append(classFile.getProtectionDomain().getCodeSource().getLocation());
|
||||
logger.log(Level.ERROR, msg.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public static String getVersion() {
|
||||
try {
|
||||
Class<?> clazz = Class.forName("buildcraft.core.Version");
|
||||
Method method = clazz.getDeclaredMethod("getVersion");
|
||||
return String.valueOf(method.invoke(null));
|
||||
} catch (Exception e) {
|
||||
return "UNKNOWN VERSION";
|
||||
}
|
||||
}
|
||||
@Deprecated
|
||||
public static String getVersion() {
|
||||
return BuildCraftAPI.getVersion();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ import net.minecraft.world.World;
|
|||
* This class is a comparable container for integer block positions.
|
||||
*/
|
||||
public class BlockIndex implements Comparable<BlockIndex> {
|
||||
|
||||
public int x;
|
||||
public int y;
|
||||
public int z;
|
||||
|
@ -31,7 +30,6 @@ public class BlockIndex implements Comparable<BlockIndex> {
|
|||
* Creates an index for a block located on x, y. z
|
||||
*/
|
||||
public BlockIndex(int x, int y, int z) {
|
||||
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*/
|
||||
package buildcraft.api.core;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
@ -28,6 +29,16 @@ public final class BuildCraftAPI {
|
|||
private BuildCraftAPI() {
|
||||
}
|
||||
|
||||
public static String getVersion() {
|
||||
try {
|
||||
Class<?> clazz = Class.forName("buildcraft.core.Version");
|
||||
Method method = clazz.getDeclaredMethod("getVersion");
|
||||
return String.valueOf(method.invoke(null));
|
||||
} catch (Exception e) {
|
||||
return "UNKNOWN VERSION";
|
||||
}
|
||||
}
|
||||
|
||||
public static IWorldProperty getWorldProperty(String name) {
|
||||
return worldProperties.get(name);
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class Position implements ISerializable {
|
||||
|
||||
public double x, y, z;
|
||||
public ForgeDirection orientation;
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* Please check the contents of the license, which should be located
|
||||
* as "LICENSE.API" in the BuildCraft source code distribution.
|
||||
*/
|
||||
@API(apiVersion = "1.5", owner = "BuildCraft|Core", provides = "BuildCraftAPI|core")
|
||||
@API(apiVersion = "1.6", owner = "BuildCraft|Core", provides = "BuildCraftAPI|core")
|
||||
package buildcraft.api.core;
|
||||
import cpw.mods.fml.common.API;
|
||||
|
||||
|
|
|
@ -20,6 +20,8 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import buildcraft.api.core.BCLog;
|
||||
|
||||
public final class StatementManager {
|
||||
|
||||
public static Map<String, IStatement> statements = new HashMap<String, IStatement>();
|
||||
|
@ -159,6 +161,9 @@ public final class StatementManager {
|
|||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
} catch (Error error) {
|
||||
BCLog.logErrorAPI(error, IStatementParameter.class);
|
||||
throw error;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -377,6 +377,7 @@ item.FacadePhased.state_transparent=Transparent
|
|||
item.PipePlug.name=Pipe Plug
|
||||
item.Lens.name=Lens
|
||||
item.Filter.name=Filter
|
||||
item.PipePowerAdapter.name=Power Adapter
|
||||
item.debugger.name=Debugger
|
||||
item.debugger.warning=Use only for testing! Leaks secrets.
|
||||
item.package.name=Package
|
||||
|
|
Before Width: | Height: | Size: 299 B After Width: | Height: | Size: 283 B |
Before Width: | Height: | Size: 289 B After Width: | Height: | Size: 275 B |
BIN
buildcraft_resources/assets/buildcrafttransport/textures/blocks/pipes/pipePowerAdapterTop.png
Executable file → Normal file
Before Width: | Height: | Size: 272 B After Width: | Height: | Size: 272 B |
After Width: | Height: | Size: 293 B |
|
@ -5,6 +5,7 @@ BREAKING CHANGES!
|
|||
Additions:
|
||||
|
||||
* Clay fluid pipe! The power of insertion applied to liquids. (asie)
|
||||
* Power Adapters! Connect Kinesis Pipes to non-Kinesis pipes. (asie)
|
||||
* New blueprint library GUI, now featuring a scrollbar! (asie)
|
||||
* New Lists - sort by type, material, or both, and other improvements! (asie)
|
||||
|
||||
|
@ -15,4 +16,8 @@ Improvements:
|
|||
* Fluid pipe capacity and extraction rate now scales with the base flow multiplier. (asie)
|
||||
* Debugger support for fluid pipes (asie)
|
||||
* Add events for robot interaction and removal (asie)
|
||||
* Tweaked power beam rendering algorithm (asie)
|
||||
|
||||
Bugs fixed:
|
||||
|
||||
* Make Docking Station items look like the real thing (asie)
|
||||
|
|
|
@ -275,7 +275,9 @@ public class BuildCraftCore extends BuildCraftMod {
|
|||
|
||||
@Mod.EventHandler
|
||||
public void loadConfiguration(FMLPreInitializationEvent evt) {
|
||||
BCLog.initLog();
|
||||
BCLog.logger.info("Starting BuildCraft " + Version.getVersion());
|
||||
BCLog.logger.info("Copyright (c) the BuildCraft team, 2011-2015");
|
||||
BCLog.logger.info("http://www.mod-buildcraft.com");
|
||||
|
||||
new BCCreativeTab("main");
|
||||
|
||||
|
|
|
@ -142,8 +142,10 @@ import buildcraft.transport.pipes.PipePowerWood;
|
|||
import buildcraft.transport.pipes.PipeStructureCobblestone;
|
||||
import buildcraft.transport.pluggable.ItemLens;
|
||||
import buildcraft.transport.pluggable.ItemPlug;
|
||||
import buildcraft.transport.pluggable.ItemPowerAdapter;
|
||||
import buildcraft.transport.pluggable.LensPluggable;
|
||||
import buildcraft.transport.pluggable.PlugPluggable;
|
||||
import buildcraft.transport.pluggable.PowerAdapterPluggable;
|
||||
import buildcraft.transport.render.PipeRendererTESR;
|
||||
import buildcraft.transport.schematics.BptPipeFiltered;
|
||||
import buildcraft.transport.schematics.BptPipeRotatable;
|
||||
|
@ -323,54 +325,52 @@ public class BuildCraftTransport extends BuildCraftMod {
|
|||
CoreProxy.proxy.registerBlock(filteredBufferBlock.setBlockName("filteredBufferBlock"));
|
||||
|
||||
pipeWaterproof = new ItemBuildCraft();
|
||||
|
||||
pipeWaterproof.setUnlocalizedName("pipeWaterproof");
|
||||
CoreProxy.proxy.registerItem(pipeWaterproof);
|
||||
|
||||
genericPipeBlock = (BlockGenericPipe) CompatHooks.INSTANCE.getBlock(BlockGenericPipe.class);
|
||||
|
||||
CoreProxy.proxy.registerBlock(genericPipeBlock.setBlockName("pipeBlock"), ItemBlock.class);
|
||||
|
||||
pipeItemsWood = buildPipe(PipeItemsWood.class, "Wooden Transport Pipe", BCCreativeTab.get("pipes"), "plankWood", "blockGlassColorless", "plankWood");
|
||||
pipeItemsEmerald = buildPipe(PipeItemsEmerald.class, "Emerald Transport Pipe", BCCreativeTab.get("pipes"), "gemEmerald", "blockGlassColorless", "gemEmerald");
|
||||
pipeItemsCobblestone = buildPipe(PipeItemsCobblestone.class, "Cobblestone Transport Pipe", BCCreativeTab.get("pipes"), "cobblestone", "blockGlassColorless", "cobblestone");
|
||||
pipeItemsStone = buildPipe(PipeItemsStone.class, "Stone Transport Pipe", BCCreativeTab.get("pipes"), "stone", "blockGlassColorless", "stone");
|
||||
pipeItemsQuartz = buildPipe(PipeItemsQuartz.class, "Quartz Transport Pipe", BCCreativeTab.get("pipes"), "blockQuartz", "blockGlassColorless", "blockQuartz");
|
||||
pipeItemsIron = buildPipe(PipeItemsIron.class, "Iron Transport Pipe", BCCreativeTab.get("pipes"), "ingotIron", "blockGlassColorless", "ingotIron");
|
||||
pipeItemsGold = buildPipe(PipeItemsGold.class, "Golden Transport Pipe", BCCreativeTab.get("pipes"), "ingotGold", "blockGlassColorless", "ingotGold");
|
||||
pipeItemsDiamond = buildPipe(PipeItemsDiamond.class, "Diamond Transport Pipe", BCCreativeTab.get("pipes"), "gemDiamond", "blockGlassColorless", "gemDiamond");
|
||||
pipeItemsObsidian = buildPipe(PipeItemsObsidian.class, "Obsidian Transport Pipe", BCCreativeTab.get("pipes"), Blocks.obsidian, "blockGlassColorless", Blocks.obsidian);
|
||||
pipeItemsLapis = buildPipe(PipeItemsLapis.class, "Lapis Transport Pipe", BCCreativeTab.get("pipes"), "blockLapis", "blockGlassColorless", "blockLapis");
|
||||
pipeItemsDaizuli = buildPipe(PipeItemsDaizuli.class, "Daizuli Transport Pipe", BCCreativeTab.get("pipes"), "blockLapis", "blockGlassColorless", "gemDiamond");
|
||||
pipeItemsSandstone = buildPipe(PipeItemsSandstone.class, "Sandstone Transport Pipe", BCCreativeTab.get("pipes"), Blocks.sandstone, "blockGlassColorless", Blocks.sandstone);
|
||||
pipeItemsVoid = buildPipe(PipeItemsVoid.class, "Void Transport Pipe", BCCreativeTab.get("pipes"), "dyeBlack", "blockGlassColorless", "dustRedstone");
|
||||
pipeItemsEmzuli = buildPipe(PipeItemsEmzuli.class, "Emzuli Transport Pipe", BCCreativeTab.get("pipes"), "blockLapis", "blockGlassColorless", "gemEmerald");
|
||||
pipeItemsStripes = buildPipe(PipeItemsStripes.class, "Stripes Transport Pipe", BCCreativeTab.get("pipes"), "gearGold", "blockGlassColorless", "gearGold");
|
||||
pipeItemsClay = buildPipe(PipeItemsClay.class, "Clay Transport Pipe", BCCreativeTab.get("pipes"), Blocks.clay, "blockGlassColorless", Blocks.clay);
|
||||
pipeItemsWood = buildPipe(PipeItemsWood.class, "plankWood", "blockGlassColorless", "plankWood");
|
||||
pipeItemsEmerald = buildPipe(PipeItemsEmerald.class, "gemEmerald", "blockGlassColorless", "gemEmerald");
|
||||
pipeItemsCobblestone = buildPipe(PipeItemsCobblestone.class, "cobblestone", "blockGlassColorless", "cobblestone");
|
||||
pipeItemsStone = buildPipe(PipeItemsStone.class, "stone", "blockGlassColorless", "stone");
|
||||
pipeItemsQuartz = buildPipe(PipeItemsQuartz.class, "blockQuartz", "blockGlassColorless", "blockQuartz");
|
||||
pipeItemsIron = buildPipe(PipeItemsIron.class, "ingotIron", "blockGlassColorless", "ingotIron");
|
||||
pipeItemsGold = buildPipe(PipeItemsGold.class, "ingotGold", "blockGlassColorless", "ingotGold");
|
||||
pipeItemsDiamond = buildPipe(PipeItemsDiamond.class, "gemDiamond", "blockGlassColorless", "gemDiamond");
|
||||
pipeItemsObsidian = buildPipe(PipeItemsObsidian.class, Blocks.obsidian, "blockGlassColorless", Blocks.obsidian);
|
||||
pipeItemsLapis = buildPipe(PipeItemsLapis.class, "blockLapis", "blockGlassColorless", "blockLapis");
|
||||
pipeItemsDaizuli = buildPipe(PipeItemsDaizuli.class, "blockLapis", "blockGlassColorless", "gemDiamond");
|
||||
pipeItemsSandstone = buildPipe(PipeItemsSandstone.class, Blocks.sandstone, "blockGlassColorless", Blocks.sandstone);
|
||||
pipeItemsVoid = buildPipe(PipeItemsVoid.class, "dyeBlack", "blockGlassColorless", "dustRedstone");
|
||||
pipeItemsEmzuli = buildPipe(PipeItemsEmzuli.class, "blockLapis", "blockGlassColorless", "gemEmerald");
|
||||
pipeItemsStripes = buildPipe(PipeItemsStripes.class, "gearGold", "blockGlassColorless", "gearGold");
|
||||
pipeItemsClay = buildPipe(PipeItemsClay.class, Blocks.clay, "blockGlassColorless", Blocks.clay);
|
||||
|
||||
pipeFluidsWood = buildPipe(PipeFluidsWood.class, "Wooden Waterproof Pipe", BCCreativeTab.get("pipes"), pipeWaterproof, pipeItemsWood);
|
||||
pipeFluidsCobblestone = buildPipe(PipeFluidsCobblestone.class, "Cobblestone Waterproof Pipe", BCCreativeTab.get("pipes"), pipeWaterproof, pipeItemsCobblestone);
|
||||
pipeFluidsStone = buildPipe(PipeFluidsStone.class, "Stone Waterproof Pipe", BCCreativeTab.get("pipes"), pipeWaterproof, pipeItemsStone);
|
||||
pipeFluidsQuartz = buildPipe(PipeFluidsQuartz.class, "Quartz Waterproof Pipe", BCCreativeTab.get("pipes"), pipeWaterproof, pipeItemsQuartz);
|
||||
pipeFluidsIron = buildPipe(PipeFluidsIron.class, "Iron Waterproof Pipe", BCCreativeTab.get("pipes"), pipeWaterproof, pipeItemsIron);
|
||||
pipeFluidsGold = buildPipe(PipeFluidsGold.class, "Golden Waterproof Pipe", BCCreativeTab.get("pipes"), pipeWaterproof, pipeItemsGold);
|
||||
pipeFluidsEmerald = buildPipe(PipeFluidsEmerald.class, "Emerald Waterproof Pipe", BCCreativeTab.get("pipes"), pipeWaterproof, pipeItemsEmerald);
|
||||
pipeFluidsDiamond = buildPipe(PipeFluidsDiamond.class, "Diamond Waterproof Pipe", BCCreativeTab.get("pipes"), pipeWaterproof, pipeItemsDiamond);
|
||||
pipeFluidsSandstone = buildPipe(PipeFluidsSandstone.class, "Sandstone Waterproof Pipe", BCCreativeTab.get("pipes"), pipeWaterproof, pipeItemsSandstone);
|
||||
pipeFluidsVoid = buildPipe(PipeFluidsVoid.class, "Void Waterproof Pipe", BCCreativeTab.get("pipes"), pipeWaterproof, pipeItemsVoid);
|
||||
pipeFluidsClay = buildPipe(PipeFluidsClay.class, "Clay Waterproof Pipe", BCCreativeTab.get("pipes"), pipeWaterproof, pipeItemsClay);
|
||||
pipeFluidsWood = buildPipe(PipeFluidsWood.class, pipeWaterproof, pipeItemsWood);
|
||||
pipeFluidsCobblestone = buildPipe(PipeFluidsCobblestone.class, pipeWaterproof, pipeItemsCobblestone);
|
||||
pipeFluidsStone = buildPipe(PipeFluidsStone.class, pipeWaterproof, pipeItemsStone);
|
||||
pipeFluidsQuartz = buildPipe(PipeFluidsQuartz.class, pipeWaterproof, pipeItemsQuartz);
|
||||
pipeFluidsIron = buildPipe(PipeFluidsIron.class, pipeWaterproof, pipeItemsIron);
|
||||
pipeFluidsGold = buildPipe(PipeFluidsGold.class, pipeWaterproof, pipeItemsGold);
|
||||
pipeFluidsEmerald = buildPipe(PipeFluidsEmerald.class, pipeWaterproof, pipeItemsEmerald);
|
||||
pipeFluidsDiamond = buildPipe(PipeFluidsDiamond.class, pipeWaterproof, pipeItemsDiamond);
|
||||
pipeFluidsSandstone = buildPipe(PipeFluidsSandstone.class, pipeWaterproof, pipeItemsSandstone);
|
||||
pipeFluidsVoid = buildPipe(PipeFluidsVoid.class, pipeWaterproof, pipeItemsVoid);
|
||||
pipeFluidsClay = buildPipe(PipeFluidsClay.class, pipeWaterproof, pipeItemsClay);
|
||||
|
||||
pipePowerWood = buildPipe(PipePowerWood.class, "Wooden Kinesis Pipe", BCCreativeTab.get("pipes"), "dustRedstone", pipeItemsWood);
|
||||
pipePowerCobblestone = buildPipe(PipePowerCobblestone.class, "Cobblestone Kinesis Pipe", BCCreativeTab.get("pipes"), "dustRedstone", pipeItemsCobblestone);
|
||||
pipePowerStone = buildPipe(PipePowerStone.class, "Stone Kinesis Pipe", BCCreativeTab.get("pipes"), "dustRedstone", pipeItemsStone);
|
||||
pipePowerQuartz = buildPipe(PipePowerQuartz.class, "Quartz Kinesis Pipe", BCCreativeTab.get("pipes"), "dustRedstone", pipeItemsQuartz);
|
||||
pipePowerIron = buildPipe(PipePowerIron.class, "Iron Kinesis Pipe", BCCreativeTab.get("pipes"), "dustRedstone", pipeItemsIron);
|
||||
pipePowerGold = buildPipe(PipePowerGold.class, "Golden Kinesis Pipe", BCCreativeTab.get("pipes"), "dustRedstone", pipeItemsGold);
|
||||
pipePowerDiamond = buildPipe(PipePowerDiamond.class, "Diamond Kinesis Pipe", BCCreativeTab.get("pipes"), "dustRedstone", pipeItemsDiamond);
|
||||
pipePowerEmerald = buildPipe(PipePowerEmerald.class, "Emerald Kinesis Pipe", BCCreativeTab.get("pipes"), "dustRedstone", pipeItemsEmerald);
|
||||
pipePowerSandstone = buildPipe(PipePowerSandstone.class, "Sandstone Kinesis Pipe", BCCreativeTab.get("pipes"), "dustRedstone", pipeItemsSandstone);
|
||||
pipePowerWood = buildPipe(PipePowerWood.class, "dustRedstone", pipeItemsWood);
|
||||
pipePowerCobblestone = buildPipe(PipePowerCobblestone.class, "dustRedstone", pipeItemsCobblestone);
|
||||
pipePowerStone = buildPipe(PipePowerStone.class, "dustRedstone", pipeItemsStone);
|
||||
pipePowerQuartz = buildPipe(PipePowerQuartz.class, "dustRedstone", pipeItemsQuartz);
|
||||
pipePowerIron = buildPipe(PipePowerIron.class, "dustRedstone", pipeItemsIron);
|
||||
pipePowerGold = buildPipe(PipePowerGold.class, "dustRedstone", pipeItemsGold);
|
||||
pipePowerDiamond = buildPipe(PipePowerDiamond.class, "dustRedstone", pipeItemsDiamond);
|
||||
pipePowerEmerald = buildPipe(PipePowerEmerald.class, "dustRedstone", pipeItemsEmerald);
|
||||
pipePowerSandstone = buildPipe(PipePowerSandstone.class, "dustRedstone", pipeItemsSandstone);
|
||||
|
||||
pipeStructureCobblestone = buildPipe(PipeStructureCobblestone.class, "Cobblestone Structure Pipe", BCCreativeTab.get("pipes"), Blocks.gravel, pipeItemsCobblestone);
|
||||
pipeStructureCobblestone = buildPipe(PipeStructureCobblestone.class, Blocks.gravel, pipeItemsCobblestone);
|
||||
|
||||
pipeWire = new ItemPipeWire();
|
||||
CoreProxy.proxy.registerItem(pipeWire);
|
||||
|
@ -393,9 +393,9 @@ public class BuildCraftTransport extends BuildCraftMod {
|
|||
lensItem.setUnlocalizedName("pipeLens");
|
||||
CoreProxy.proxy.registerItem(lensItem);
|
||||
|
||||
//powerAdapterItem = new ItemPowerAdapter();
|
||||
//powerAdapterItem.setUnlocalizedName("pipePowerAdapter");
|
||||
//CoreProxy.proxy.registerItem(powerAdapterItem);
|
||||
powerAdapterItem = new ItemPowerAdapter();
|
||||
powerAdapterItem.setUnlocalizedName("pipePowerAdapter");
|
||||
CoreProxy.proxy.registerItem(powerAdapterItem);
|
||||
|
||||
gateCopier = new ItemGateCopier();
|
||||
CoreProxy.proxy.registerItem(gateCopier);
|
||||
|
@ -518,6 +518,7 @@ public class BuildCraftTransport extends BuildCraftMod {
|
|||
PipeManager.registerPipePluggable(GatePluggable.class, "gate");
|
||||
PipeManager.registerPipePluggable(LensPluggable.class, "lens");
|
||||
PipeManager.registerPipePluggable(PlugPluggable.class, "plug");
|
||||
PipeManager.registerPipePluggable(PowerAdapterPluggable.class, "powerAdapter");
|
||||
|
||||
GateExpansions.registerExpansion(GateExpansionPulsar.INSTANCE);
|
||||
GateExpansions.registerExpansion(GateExpansionTimer.INSTANCE);
|
||||
|
@ -669,11 +670,8 @@ public class BuildCraftTransport extends BuildCraftMod {
|
|||
} else {
|
||||
BCLog.logger.warn("**********************************************");
|
||||
BCLog.logger.warn("* You are using the BuildCraft Transport *");
|
||||
BCLog.logger.warn("* module WITHOUT the Silicon module. Certain *");
|
||||
BCLog.logger.warn("* crafting recipes will be unavailable, and *");
|
||||
BCLog.logger.warn("* you are HIGHLY encouraged to either add *");
|
||||
BCLog.logger.warn("* the module or add custom recipes for those *");
|
||||
BCLog.logger.warn("* parts of the mod. *");
|
||||
BCLog.logger.warn("* module WITHOUT the Silicon module. Gates *");
|
||||
BCLog.logger.warn("* will not be available. *");
|
||||
BCLog.logger.warn("**********************************************");
|
||||
|
||||
// Alternate recipes
|
||||
|
@ -697,8 +695,18 @@ public class BuildCraftTransport extends BuildCraftMod {
|
|||
InterModComms.processIMC(event);
|
||||
}
|
||||
|
||||
public static Item buildPipe(Class<? extends Pipe> clas, Object... ingredients) {
|
||||
return buildPipe(clas, BCCreativeTab.get("pipes"), ingredients);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static Item buildPipe(Class<? extends Pipe> clas,
|
||||
String descr, BCCreativeTab creativeTab,
|
||||
String descr, BCCreativeTab creativeTab,
|
||||
Object... ingredients) {
|
||||
return buildPipe(clas, creativeTab, ingredients);
|
||||
}
|
||||
|
||||
public static Item buildPipe(Class<? extends Pipe> clas, BCCreativeTab creativeTab,
|
||||
Object... ingredients) {
|
||||
ItemPipe res = BlockGenericPipe.registerPipe(clas, creativeTab);
|
||||
res.setUnlocalizedName(clas.getSimpleName());
|
||||
|
|
|
@ -143,9 +143,9 @@ public class PipeIconProvider implements IIconProvider {
|
|||
TransparentFacade("transparent_facade"),
|
||||
Transparent("core:misc/transparent"),
|
||||
//
|
||||
/* PipePowerAdapterTop("pipePowerAdapterTop"),
|
||||
PipePowerAdapterSide("pipePowerAdapterSide"),
|
||||
PipePowerAdapterBottom("pipePowerAdapterBottom"), */
|
||||
PipePowerAdapterBottom("pipePowerAdapterBottom"),
|
||||
PipePowerAdapterTop("pipePowerAdapterTop"),
|
||||
//
|
||||
ItemBox("itemBox");
|
||||
public static final TYPE[] VALUES = values();
|
||||
|
|
|
@ -222,7 +222,7 @@ public class PipeTransportPower extends PipeTransport implements IDebuggable {
|
|||
Object ep = providers[j];
|
||||
double watts = Math.min(internalPower[i] * powerQuery[j] / totalPowerQuery, internalPower[i]);
|
||||
|
||||
if (ep instanceof IPipeTile) {
|
||||
if (ep instanceof IPipeTile && ((IPipeTile) ep).getPipeType() == IPipeTile.PipeType.POWER) {
|
||||
Pipe<?> nearbyPipe = (Pipe<?>) ((IPipeTile) ep).getPipe();
|
||||
PipeTransportPower nearbyTransport = (PipeTransportPower) nearbyPipe.transport;
|
||||
watts = nearbyTransport.receiveEnergy(
|
||||
|
@ -260,11 +260,12 @@ public class PipeTransportPower extends PipeTransport implements IDebuggable {
|
|||
}
|
||||
float highestPower = 0.0F;
|
||||
for (int i = 0; i < 6; i++) {
|
||||
displayPower[i] = (short) Math.floor((float) (prevDisplayPower[i] * (DISPLAY_SMOOTHING - 1) + displayPower[i]) / DISPLAY_SMOOTHING);
|
||||
displayPower[i] = (short) Math.ceil((float) (prevDisplayPower[i] * (DISPLAY_SMOOTHING - 1) + displayPower[i]) / DISPLAY_SMOOTHING);
|
||||
if (displayPower[i] > highestPower) {
|
||||
highestPower = displayPower[i];
|
||||
}
|
||||
}
|
||||
|
||||
overload += highestPower > ((float) maxPower) * 0.95F ? 1 : -1;
|
||||
if (overload < 0) {
|
||||
overload = 0;
|
||||
|
@ -322,7 +323,7 @@ public class PipeTransportPower extends PipeTransport implements IDebuggable {
|
|||
for (int i = 0; i < 6; ++i) {
|
||||
if (transferQuery[i] != 0 && tiles[i] != null) {
|
||||
TileEntity entity = tiles[i];
|
||||
if (entity instanceof IPipeTile) {
|
||||
if (entity instanceof IPipeTile && ((IPipeTile) entity).getPipeType() == IPipeTile.PipeType.POWER) {
|
||||
IPipeTile nearbyTile = (IPipeTile) entity;
|
||||
if (nearbyTile.getPipe() == null) {
|
||||
continue;
|
||||
|
|
|
@ -66,7 +66,7 @@ import buildcraft.transport.pluggable.PlugPluggable;
|
|||
public class TileGenericPipe extends TileEntity implements IFluidHandler,
|
||||
IPipeTile, ITileBufferHolder, IEnergyHandler, IDropControlInventory,
|
||||
ISyncedTile, ISolidSideTile, IGuiReturnHandler, IRedstoneEngineReceiver,
|
||||
IDebuggable {
|
||||
IDebuggable, IPipeConnection {
|
||||
|
||||
public boolean initialized = false;
|
||||
public final PipeRenderState renderState = new PipeRenderState();
|
||||
|
@ -1280,4 +1280,12 @@ public class TileGenericPipe extends TileEntity implements IFluidHandler,
|
|||
((IDebuggable) getPipePluggable(side)).getDebugInfo(info, side, debugger, player);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConnectOverride overridePipeConnection(PipeType type, ForgeDirection with) {
|
||||
if (type == PipeType.POWER && hasPipePluggable(with) && getPipePluggable(with) instanceof IEnergyHandler) {
|
||||
return ConnectOverride.CONNECT;
|
||||
}
|
||||
return ConnectOverride.DEFAULT;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,6 @@ import io.netty.buffer.ByteBuf;
|
|||
|
||||
import buildcraft.core.lib.network.PacketCoordinates;
|
||||
import buildcraft.core.network.PacketIds;
|
||||
import buildcraft.transport.render.PipeRendererTESR;
|
||||
|
||||
public class PacketPowerUpdate extends PacketCoordinates {
|
||||
|
||||
|
@ -32,7 +31,7 @@ public class PacketPowerUpdate extends PacketCoordinates {
|
|||
displayPower = new short[] { 0, 0, 0, 0, 0, 0 };
|
||||
overload = data.readBoolean();
|
||||
for (int i = 0; i < displayPower.length; i++) {
|
||||
displayPower[i] = data.readUnsignedByte();
|
||||
displayPower[i] = data.readShort();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,8 +40,7 @@ public class PacketPowerUpdate extends PacketCoordinates {
|
|||
super.writeData(data);
|
||||
data.writeBoolean(overload);
|
||||
for (short element : displayPower) {
|
||||
data.writeByte(Math.min(PipeRendererTESR.POWER_STAGES,
|
||||
(int) Math.ceil(element * PipeRendererTESR.DISPLAY_MULTIPLIER)));
|
||||
data.writeShort(element);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,23 +8,17 @@
|
|||
*/
|
||||
package buildcraft.transport.pluggable;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cofh.api.energy.IEnergyHandler;
|
||||
import buildcraft.api.transport.IPipe;
|
||||
import buildcraft.api.transport.IPipeTile;
|
||||
import buildcraft.api.transport.pluggable.IPipePluggableItem;
|
||||
import buildcraft.api.transport.pluggable.PipePluggable;
|
||||
import buildcraft.core.lib.items.ItemBuildCraft;
|
||||
|
||||
public class ItemPowerAdapter extends ItemBuildCraft implements IPipePluggableItem {
|
||||
|
||||
public ItemPowerAdapter() {
|
||||
super();
|
||||
}
|
||||
|
@ -39,24 +33,9 @@ public class ItemPowerAdapter extends ItemBuildCraft implements IPipePluggableIt
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
this.itemIcon = par1IconRegister.registerIcon("buildcraft:pipePowerAdapter");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getSpriteNumber() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PipePluggable createPipePluggable(IPipe pipe, ForgeDirection side, ItemStack stack) {
|
||||
if (pipe.getTile().getPipeType() != IPipeTile.PipeType.POWER && pipe instanceof IEnergyHandler) {
|
||||
return new PowerAdapterPluggable();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
return new PowerAdapterPluggable();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ import buildcraft.core.lib.utils.MatrixTranformations;
|
|||
import buildcraft.transport.PipeIconProvider;
|
||||
|
||||
public class PlugPluggable extends PipePluggable {
|
||||
private static final class PlugPluggableRenderer implements IPipePluggableRenderer {
|
||||
protected static final class PlugPluggableRenderer implements IPipePluggableRenderer {
|
||||
public static final IPipePluggableRenderer INSTANCE = new PlugPluggableRenderer();
|
||||
private float zFightOffset = 1 / 4096.0F;
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import net.minecraft.client.renderer.RenderBlocks;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cofh.api.energy.IEnergyHandler;
|
||||
|
@ -15,13 +16,15 @@ import buildcraft.api.transport.IPipe;
|
|||
import buildcraft.api.transport.IPipeTile;
|
||||
import buildcraft.api.transport.pluggable.IPipePluggableRenderer;
|
||||
import buildcraft.api.transport.pluggable.PipePluggable;
|
||||
import buildcraft.core.lib.render.FakeBlock;
|
||||
import buildcraft.core.lib.utils.MatrixTranformations;
|
||||
import buildcraft.transport.PipeIconProvider;
|
||||
|
||||
public class PowerAdapterPluggable extends PipePluggable implements IEnergyHandler {
|
||||
private static final int MAX_POWER = 40;
|
||||
private IPipeTile container;
|
||||
|
||||
public class PowerAdapterPluggableRenderer implements IPipePluggableRenderer {
|
||||
protected static final class PowerAdapterPluggableRenderer implements IPipePluggableRenderer {
|
||||
private float zFightOffset = 1 / 4096.0F;
|
||||
|
||||
@Override
|
||||
|
@ -32,17 +35,24 @@ public class PowerAdapterPluggable extends PipePluggable implements IEnergyHandl
|
|||
|
||||
float[][] zeroState = new float[3][2];
|
||||
|
||||
IIcon[] icons = FakeBlock.INSTANCE.getTextureState().popArray();
|
||||
int bottom = side.ordinal();
|
||||
|
||||
for (int i = 0; i < 6; i++) {
|
||||
icons[i] = BuildCraftTransport.instance.pipeIconProvider.getIcon(
|
||||
(i & 6) == (bottom & 6) ? PipeIconProvider.TYPE.PipePowerAdapterBottom.ordinal() : PipeIconProvider.TYPE.PipePowerAdapterSide.ordinal()
|
||||
);
|
||||
}
|
||||
|
||||
// X START - END
|
||||
zeroState[0][0] = 0.25F;
|
||||
zeroState[0][1] = 0.75F;
|
||||
zeroState[0][0] = 0.1875F;
|
||||
zeroState[0][1] = 0.8125F;
|
||||
// Y START - END
|
||||
zeroState[1][0] = 0.000F;
|
||||
zeroState[1][1] = 0.125F;
|
||||
zeroState[1][1] = 0.1251F;
|
||||
// Z START - END
|
||||
zeroState[2][0] = 0.25F;
|
||||
zeroState[2][1] = 0.75F;
|
||||
|
||||
blockStateMachine.getTextureState().set(BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.TYPE.PipeStructureCobblestone.ordinal())); // Structure Pipe
|
||||
zeroState[2][0] = 0.1875F;
|
||||
zeroState[2][1] = 0.8125F;
|
||||
|
||||
float[][] rotated = MatrixTranformations.deepClone(zeroState);
|
||||
MatrixTranformations.transform(rotated, side);
|
||||
|
@ -50,22 +60,25 @@ public class PowerAdapterPluggable extends PipePluggable implements IEnergyHandl
|
|||
renderblocks.setRenderBounds(rotated[0][0], rotated[1][0], rotated[2][0], rotated[0][1], rotated[1][1], rotated[2][1]);
|
||||
renderblocks.renderStandardBlock(blockStateMachine.getBlock(), x, y, z);
|
||||
|
||||
// X START - END
|
||||
zeroState[0][0] = 0.25F + 0.125F / 2 + zFightOffset;
|
||||
zeroState[0][1] = 0.75F - 0.125F / 2 + zFightOffset;
|
||||
// Y START - END
|
||||
zeroState[1][0] = 0.25F;
|
||||
zeroState[1][1] = 0.25F + 0.125F;
|
||||
// Z START - END
|
||||
zeroState[2][0] = 0.25F + 0.125F / 2;
|
||||
zeroState[2][1] = 0.75F - 0.125F / 2;
|
||||
icons[bottom] = icons[bottom ^ 1] = BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.TYPE.PipePowerAdapterTop.ordinal());
|
||||
|
||||
// X START - END
|
||||
zeroState[0][0] = 0.25F + zFightOffset;
|
||||
zeroState[0][1] = 0.75F - zFightOffset;
|
||||
// Y START - END
|
||||
zeroState[1][0] = 0.125F;
|
||||
zeroState[1][1] = 0.25F + zFightOffset;
|
||||
// Z START - END
|
||||
zeroState[2][0] = 0.25F + zFightOffset;
|
||||
zeroState[2][1] = 0.75F - zFightOffset;
|
||||
|
||||
blockStateMachine.getTextureState().set(BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.TYPE.PipeStructureCobblestone.ordinal())); // Structure Pipe
|
||||
rotated = MatrixTranformations.deepClone(zeroState);
|
||||
MatrixTranformations.transform(rotated, side);
|
||||
|
||||
renderblocks.setRenderBounds(rotated[0][0], rotated[1][0], rotated[2][0], rotated[0][1], rotated[1][1], rotated[2][1]);
|
||||
renderblocks.renderStandardBlock(blockStateMachine.getBlock(), x, y, z);
|
||||
|
||||
FakeBlock.INSTANCE.getTextureState().pushArray();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -95,7 +108,7 @@ public class PowerAdapterPluggable extends PipePluggable implements IEnergyHandl
|
|||
|
||||
@Override
|
||||
public ItemStack[] getDropItems(IPipeTile pipe) {
|
||||
return new ItemStack[] { new ItemStack(BuildCraftTransport.plugItem) };
|
||||
return new ItemStack[] { new ItemStack(BuildCraftTransport.powerAdapterItem) };
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -137,11 +150,11 @@ public class PowerAdapterPluggable extends PipePluggable implements IEnergyHandl
|
|||
|
||||
@Override
|
||||
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) {
|
||||
int maxR = Math.min(40, maxReceive);
|
||||
if (container instanceof IEnergyHandler) {
|
||||
int energyCanReceive = ((IEnergyHandler) container).receiveEnergy(from, maxR, true);
|
||||
int maxR = Math.min(MAX_POWER, maxReceive);
|
||||
if (container.getPipe() instanceof IEnergyHandler) {
|
||||
int energyCanReceive = ((IEnergyHandler) container.getPipe()).receiveEnergy(from, maxR, true);
|
||||
if (!simulate) {
|
||||
return ((IEnergyHandler) container).receiveEnergy(from, energyCanReceive, false);
|
||||
return ((IEnergyHandler) container.getPipe()).receiveEnergy(from, energyCanReceive, false);
|
||||
} else {
|
||||
return energyCanReceive;
|
||||
}
|
||||
|
@ -156,8 +169,8 @@ public class PowerAdapterPluggable extends PipePluggable implements IEnergyHandl
|
|||
|
||||
@Override
|
||||
public int getEnergyStored(ForgeDirection from) {
|
||||
if (container instanceof IEnergyHandler) {
|
||||
return ((IEnergyHandler) container).getEnergyStored(from);
|
||||
if (container.getPipe() instanceof IEnergyHandler) {
|
||||
return ((IEnergyHandler) container.getPipe()).getEnergyStored(from);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
@ -165,8 +178,8 @@ public class PowerAdapterPluggable extends PipePluggable implements IEnergyHandl
|
|||
|
||||
@Override
|
||||
public int getMaxEnergyStored(ForgeDirection from) {
|
||||
if (container instanceof IEnergyHandler) {
|
||||
return ((IEnergyHandler) container).getMaxEnergyStored(from);
|
||||
if (container.getPipe() instanceof IEnergyHandler) {
|
||||
return ((IEnergyHandler) container.getPipe()).getMaxEnergyStored(from);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
@ -176,4 +189,9 @@ public class PowerAdapterPluggable extends PipePluggable implements IEnergyHandl
|
|||
public boolean canConnectEnergy(ForgeDirection from) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requiresRenderUpdate(PipePluggable o) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,8 +60,8 @@ import buildcraft.transport.utils.FluidRenderData;
|
|||
public class PipeRendererTESR extends TileEntitySpecialRenderer {
|
||||
public static final PipeRendererTESR INSTANCE = new PipeRendererTESR();
|
||||
|
||||
public static final float DISPLAY_MULTIPLIER = 0.1f;
|
||||
public static final int POWER_STAGES = 100;
|
||||
public static final int POWER_STAGES = 256;
|
||||
private static final float POWER_MAGIC = 0.7F; // Math.pow(displayPower, POWER_MAGIC)
|
||||
|
||||
private static final int LIQUID_STAGES = 40;
|
||||
private static final int MAX_ITEMS_TO_RENDER = 10;
|
||||
|
@ -658,7 +658,6 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
|
|||
GL11.glPushMatrix();
|
||||
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
// GL11.glEnable(GL11.GL_BLEND);
|
||||
|
||||
GL11.glTranslatef((float) x, (float) y, (float) z);
|
||||
|
||||
|
@ -667,7 +666,7 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
|
|||
int[] displayList = pow.overload > 0 ? displayPowerListOverload : displayPowerList;
|
||||
|
||||
for (int side = 0; side < 6; ++side) {
|
||||
short stage = pow.displayPower[side];
|
||||
int stage = (int) Math.ceil(Math.pow(pow.displayPower[side], POWER_MAGIC));
|
||||
if (stage >= 1) {
|
||||
if (!pipe.container.isPipeConnected(ForgeDirection.getOrientation(side))) {
|
||||
continue;
|
||||
|
|