This commit is contained in:
asiekierka 2015-03-17 08:24:14 +01:00
parent 88f71fdca9
commit 96492136c5
18 changed files with 71 additions and 25 deletions

View file

@ -2,7 +2,9 @@ package buildcraft.api.items;
import net.minecraft.item.ItemStack;
public interface IList {
public interface IList extends INamedItem {
@Deprecated
String getLabel(ItemStack stack);
boolean matches(ItemStack stackList, ItemStack item);
}

View file

@ -10,7 +10,7 @@ import buildcraft.api.core.IZone;
/**
* Created by asie on 2/28/15.
*/
public interface IMapLocation {
public interface IMapLocation extends INamedItem {
public enum MapLocationType {
CLEAN, SPOT, AREA, PATH, ZONE
}

View file

@ -0,0 +1,8 @@
package buildcraft.api.items;
import net.minecraft.item.ItemStack;
public interface INamedItem {
String getName(ItemStack stack);
boolean setName(ItemStack stack, String name);
}

View file

@ -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.0", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|items")
@API(apiVersion = "1.1", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|items")
package buildcraft.api.items;
import cpw.mods.fml.common.API;

View file

@ -15,7 +15,6 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public interface IStatement {
/**
* Every statement needs a unique tag, it should be in the format of
* "<modid>:<name>.

View file

@ -0,0 +1,17 @@
package buildcraft.api.statements;
import net.minecraftforge.common.util.ForgeDirection;
/**
* This interface can be used by tiles to override external trigger
* behaviour.
*
* Please use wisely.
*/
public interface ITriggerExternalOverride {
public enum Result {
TRUE, FALSE, IGNORE
}
Result override(ForgeDirection side, IStatementContainer source, IStatementParameter[] parameters);
}

View file

@ -155,8 +155,11 @@ gate.trigger.pipe.wire.active=%s Pipe Signal On
gate.trigger.pipe.wire.inactive=%s Pipe Signal Off
gate.trigger.timer=%s Sec Timer
gate.trigger.robot.sleep=Sleep
gate.trigger.machine.energyStoredHigh=High Energy Stored
gate.trigger.machine.energyStoredLow=Low Energy Stored
gate.trigger.machine.energyStored.high=High Energy Stored
gate.trigger.machine.energyStored.low=Low Energy Stored
gate.trigger.machine.energyStored.below25=Energy < 25%
gate.trigger.machine.energyStored.below50=Energy < 50%
gate.trigger.machine.energyStored.below75=Energy < 75%
gate.trigger.light.bright=Bright
gate.trigger.light.dark=Dark
gate.trigger.time.0=Night

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 B

After

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 B

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 557 B

View file

@ -1,28 +1,37 @@
Additions:
* **New textures!** - "Essence" made by (CyanideX)
* **Modularization** - BuildCraft is back to being modules (asie)
* Optimizations to BuildCraft pipes (asie, Player)
* New blocks:
* Blocks:
* Blueprint Library renamed to Electronic Library, supports copying books - and soon other things! (asie)
* New items:
* Items:
* Paintbrush for dyeing pipes and other supported blocks (asie)
* Debugger for developer use (asie)
* New gate expansions:
* Light Sensor for detecting brightness in front of a gate (asie)
* Gate recipes now show up in NEI properly (asie)
* Improved robot light handling - the light now denotes sleep state and battery charge level (asie)
* Lasers now glow in the night (asie)
* New Robot triggers and actions: Linked, Reserved, In Station and Robot Mandatory (asie)
* Made items in pipes move at a much smoother rate (asie)
* Optimizations here and there (asie)
* Map Locations can now be named (in the Zone Planner) (asie)
* Gates:
* Gate recipes now show up in NEI properly (asie)
* Light Sensor expansion for detecting brightness in front of a gate (asie)
* Pipes:
* Massive optimizations - up to 3x less server-intensive (asie, Player)
* Made items in pipes move at a much smoother rate (asie)
* Robots:
* Improved robot light handling - the light now denotes sleep state and battery charge level (asie)
* New Robot triggers and actions: Linked, Reserved, In Station and Robot Mandatory (asie)
* Robots can now use modded pickaxes, shovels and axes (asie)
* Misc.:
* Lasers now glow in the night (asie)
* Miscellanous optimizations (asie)
* Packets are now sent in a separate thread, causing most of the pipe optimizations and many other things (asie, Player)
Bugfixes:
* **Stopped wooden item pipes from exploding** (asie)
* Structure pipes not respecting blocking pluggables (asie)
* Fixed alternate slimeball-based pipe sealant recipe being uncraftable (asie)
* Fixed minor Zone Planner rendering issues (asie)
APIs:
* IDebuggable, for debugger compatibility in tile entities (asie)
* LibraryAPI for supporting copying of custom items in the Electronic Library (asie)
* ISided/IRedstoneStatementContainer (asie)
Breaking changes:
* Item pipes may no longer be connected to the front of the Mining Well or Quarry.

View file

@ -180,8 +180,8 @@ public class BuildCraftCore extends BuildCraftMod {
public static int markerModel;
public static ITriggerExternal triggerMachineActive = new TriggerMachine(true);
public static ITriggerExternal triggerMachineInactive = new TriggerMachine(false);
public static IStatement triggerEnergyHigh = new TriggerEnergy(true);
public static IStatement triggerEnergyLow = new TriggerEnergy(false);
public static IStatement triggerEnergyHigh = new TriggerEnergy(TriggerEnergy.TriggerType.HIGH);
public static IStatement triggerEnergyLow = new TriggerEnergy(TriggerEnergy.TriggerType.LOW);
public static ITriggerExternal triggerEmptyInventory = new TriggerInventory(TriggerInventory.State.Empty);
public static ITriggerExternal triggerContainsInventory = new TriggerInventory(TriggerInventory.State.Contains);
public static ITriggerExternal triggerSpaceInventory = new TriggerInventory(TriggerInventory.State.Space);

View file

@ -13,6 +13,11 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import com.google.common.base.Splitter;
import com.google.common.base.Strings;
import com.google.common.collect.Iterables;
import com.google.common.primitives.Ints;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
@ -22,6 +27,7 @@ import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
import net.minecraftforge.fluids.FluidStack;
import buildcraft.BuildCraftTransport;
import buildcraft.api.core.BCLog;
import buildcraft.core.recipes.AssemblyRecipeManager;
import buildcraft.core.recipes.RefineryRecipeManager;
@ -55,7 +61,7 @@ public final class InterModComms {
}
}
}
public static void processAssemblyRecipeRemoveIMC(IMCEvent event, IMCMessage msg) {
if (msg.isStringMessage()) {
AssemblyRecipeManager.INSTANCE.removeRecipe(msg.getStringValue());

View file

@ -11,6 +11,7 @@ package buildcraft.core.statements;
import java.util.LinkedList;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
@ -26,7 +27,6 @@ import buildcraft.api.statements.containers.IRedstoneStatementContainer;
import buildcraft.api.tiles.IHasWork;
public class DefaultTriggerProvider implements ITriggerProvider {
@Override
public LinkedList<ITriggerExternal> getExternalTriggers(ForgeDirection side, TileEntity tile) {
LinkedList<ITriggerExternal> res = new LinkedList<ITriggerExternal>();

View file

@ -8,6 +8,7 @@
*/
package buildcraft.core.statements;
import java.util.Locale;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.tileentity.TileEntity;
@ -38,7 +39,7 @@ public class TriggerEnergy extends BCStatement implements ITriggerInternal {
}
}
private boolean high;
private final boolean high;
public TriggerEnergy(boolean high) {
super("buildcraft:energyStored" + (high ? "high" : "low"));
@ -48,7 +49,7 @@ public class TriggerEnergy extends BCStatement implements ITriggerInternal {
@Override
public String getDescription() {
return StringUtils.localize("gate.trigger.machine.energyStored" + (high ? "High" : "Low"));
return StringUtils.localize("gate.trigger.machine.energyStored." + (high ? "high" : "low"));
}
private boolean isTriggeredEnergyHandler(IEnergyConnection connection, ForgeDirection side) {
@ -68,10 +69,11 @@ public class TriggerEnergy extends BCStatement implements ITriggerInternal {
}
if (energyMaxStored > 0) {
float level = (energyStored / energyMaxStored);
if (high) {
return (energyStored / energyMaxStored) > 0.95;
return level > 0.95F;
} else {
return (energyStored / energyMaxStored) < 0.05;
return level < 0.05F;
}
}
return false;