<1500 errors

This commit is contained in:
aidancbrady committed 2016-05-24 21:22:39 -04:00
1 parent 1f33df57fa
commit c6a09b5658
433 files changed
+2967 -1474

No files matched your search

+2 -2
View File
@@ -2,11 +2,11 @@ package buildcraft.api;
import java.util.Arrays;
import org.apache.commons.lang3.StringUtils;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.LoaderState;
import org.apache.commons.lang3.StringUtils;
import buildcraft.api.core.BCLog;
public class APIHelper {
View File
File mode changed.
View File
File mode changed.
+2 -2
View File
@@ -2,10 +2,10 @@ package buildcraft.api;
import java.util.Set;
import net.minecraft.item.Item;
import org.apache.commons.lang3.tuple.Triple;
import net.minecraft.item.Item;
public interface ITripleRegistry<T extends ObjectDefinition> extends ISimpleRegistry<T> {
/** @return An unmodifiable set containing all the current mappings of the registry */
Set<Triple<String, Item, T>> getDefinitions();
+1 -1
View File
@@ -16,7 +16,7 @@ public class ObjectDefinition {
protected static String getCurrentMod() {
ModContainer container = Loader.instance().activeModContainer();
if (container == null) {
throw new IllegalStateException("Pipes MUST be registered inside a mod");
throw new IllegalStateException("Objects MUST be created inside a mod");
}
return container.getModId();
}
+1 -1
View File
@@ -1,7 +1,7 @@
package buildcraft.api.blocks;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public interface IColorRemovable {
-1
View File
@@ -6,4 +6,3 @@
package buildcraft.api.blocks;
import net.minecraftforge.fml.common.API;
@@ -6,8 +6,8 @@ package buildcraft.api.blueprints;
import java.io.File;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
/** This class is provided as a utility class for third-party mods that would like to easily deploy structures that are
View File
File mode changed.
+3 -2
View File
@@ -4,14 +4,15 @@
* should be located as "LICENSE.API" in the BuildCraft source code distribution. */
package buildcraft.api.blueprints;
import net.minecraft.util.Vec3;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import buildcraft.api.core.IBox;
/** This interface provide contextual information when building or initializing blueprint slots. */
public interface IBuilderContext {
Vec3 rotatePositionLeft(Vec3 pos);
Vec3d rotatePositionLeft(Vec3d pos);
IBox surroundingBox();
View File
File mode changed.
View File
File mode changed.
@@ -6,10 +6,14 @@ package buildcraft.api.blueprints;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map.Entry;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ListMultimap;
import org.apache.logging.log4j.Level;
import net.minecraft.block.Block;
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.entity.Entity;
@@ -19,6 +23,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagShort;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.fml.common.FMLModContainer;
import net.minecraftforge.fml.common.Loader;
@@ -26,13 +31,10 @@ import net.minecraftforge.fml.common.ModContainer;
import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
import org.apache.logging.log4j.Level;
import buildcraft.api.core.BCLog;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ListMultimap;
// Deprecated as NBT will be saved in a compressing format rather than only for blocks, items and entities.
@Deprecated
public class MappingRegistry {
public HashMap<Block, Integer> blockToId = new HashMap<Block, Integer>();
@@ -100,7 +102,7 @@ public class MappingRegistry {
public ResourceLocation itemIdToWorld(int id) throws MappingNotFoundException {
Item item = getItemForId(id);
return Item.itemRegistry.getNameForObject(item);
return Item.REGISTRY.getNameForObject(item);
}
public Block getBlockForId(int id) throws MappingNotFoundException {
@@ -134,7 +136,7 @@ public class MappingRegistry {
public ResourceLocation blockIdToWorld(int id) throws MappingNotFoundException {
Block block = getBlockForId(id);
return Block.blockRegistry.getNameForObject(block);
return Block.REGISTRY.getNameForObject(block);
}
public Class<? extends Entity> getEntityForId(int id) throws MappingNotFoundException {
@@ -164,7 +166,7 @@ public class MappingRegistry {
// 1.7.10 back-compat
if (nbt.hasKey("id", Constants.NBT.TAG_SHORT)) {
Item item = getItemForId(nbt.getShort("id"));
nbt.setString("id", (Item.itemRegistry.getNameForObject(item).toString()));
nbt.setString("id", (Item.REGISTRY.getNameForObject(item).toString()));
}
}
@@ -215,7 +217,7 @@ public class MappingRegistry {
for (Block b : idToBlock) {
NBTTagCompound sub = new NBTTagCompound();
if (b != null) {
Object obj = Block.blockRegistry.getNameForObject(b);
Object obj = Block.REGISTRY.getNameForObject(b);
if (obj == null) {
BCLog.logger.error("Block " + b.getUnlocalizedName() + " (" + b.getClass().getName()
+ ") does not have a registry name! This is a bug!");
@@ -241,7 +243,7 @@ public class MappingRegistry {
for (Item i : idToItem) {
NBTTagCompound sub = new NBTTagCompound();
if (i != null) {
ResourceLocation obj = Item.itemRegistry.getNameForObject(i);
ResourceLocation obj = Item.REGISTRY.getNameForObject(i);
if (obj == null) {
BCLog.logger.error("Item " + i.getUnlocalizedName() + " (" + i.getClass().getName()
+ ") does not have a registry name! This is a bug!");
@@ -322,15 +324,15 @@ public class MappingRegistry {
ResourceLocation location = new ResourceLocation(name);
Block b = null;
if (!Block.blockRegistry.containsKey(location) && name.contains(":")) {
if (!Block.REGISTRY.containsKey(location) && name.contains(":")) {
b = (Block) getMissingMappingFromFML(true, name, i);
if (b != null) {
BCLog.logger.info("Remapped " + name + " to " + Block.blockRegistry.getNameForObject(b));
BCLog.logger.info("Remapped " + name + " to " + Block.REGISTRY.getNameForObject(b));
}
}
if (b == null && Block.blockRegistry.containsKey(location)) {
b = (Block) Block.blockRegistry.getObject(location);
if (b == null && Block.REGISTRY.containsKey(location)) {
b = (Block) Block.REGISTRY.getObject(location);
}
if (b != null) {
@@ -357,15 +359,15 @@ public class MappingRegistry {
ResourceLocation location = new ResourceLocation(name);
Item item = null;
if (!Item.itemRegistry.containsKey(location) && name.contains(":")) {
if (!Item.REGISTRY.containsKey(location) && name.contains(":")) {
item = (Item) getMissingMappingFromFML(false, name, i);
if (item != null) {
BCLog.logger.info("Remapped " + name + " to " + Item.itemRegistry.getNameForObject(item));
BCLog.logger.info("Remapped " + name + " to " + Item.REGISTRY.getNameForObject(item));
}
}
if (item == null && Item.itemRegistry.containsKey(location)) {
item = (Item) Item.itemRegistry.getObject(location);
if (item == null && Item.REGISTRY.containsKey(location)) {
item = (Item) Item.REGISTRY.getObject(location);
}
if (item != null) {
@@ -406,16 +408,19 @@ public class MappingRegistry {
}
public void addToCrashReport(CrashReportCategory cat) {
Comparator<Entry<?, Integer>> comparator = (e1, e2) -> e1.getValue() - e2.getValue();
cat.addCrashSection("Item Map Count", itemToId.size());
itemToId.entrySet().stream().sorted(comparator).forEach(e -> cat.addCrashSection(" - ID " + e.getValue(), Item.itemRegistry.getNameForObject(
e.getKey())));
for (Entry<Item, Integer> e : itemToId.entrySet()) {
cat.addCrashSection(" - ID " + e.getValue(), Item.REGISTRY.getNameForObject(e.getKey()));
}
cat.addCrashSection("Block Map Count", blockToId.size());
blockToId.entrySet().stream().sorted(comparator).forEach(e -> cat.addCrashSection(" - ID " + e.getValue(), e.getKey()));
for (Entry<Block, Integer> e : blockToId.entrySet()) {
cat.addCrashSection(" - ID " + e.getValue(), Block.REGISTRY.getNameForObject(e.getKey()));
}
cat.addCrashSection("Entity Map Count", entityToId.size());
entityToId.entrySet().stream().sorted(comparator).forEach(e -> cat.addCrashSection(" - ID " + e.getValue(), e.getKey()));
for (Entry<Class<? extends Entity>, Integer> e : entityToId.entrySet()) {
cat.addCrashSection(" - ID " + e.getValue(), e.getKey());
}
}
}
@@ -8,8 +8,9 @@ import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.BlockPos;
import net.minecraft.util.Vec3;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import buildcraft.api.core.IInvSlot;
/** A schematic is a piece of a blueprint. It allows to stock blocks or entities to blueprints, and can have a state
@@ -97,12 +98,12 @@ public abstract class Schematic {
}
/** Applies translations to all positions in the schematic to center in the blueprint referential */
public void translateToBlueprint(Vec3 transform) {
public void translateToBlueprint(Vec3d transform) {
}
/** Apply translations to all positions in the schematic to center in the builder referential */
public void translateToWorld(Vec3 transform) {}
public void translateToWorld(Vec3d transform) {}
/** Translates blocks and item ids to the blueprint referential */
public void idsToBlueprint(MappingRegistry registry) {}
@@ -4,26 +4,21 @@
* should be located as "LICENSE.API" in the BuildCraft source code distribution. */
package buildcraft.api.blueprints;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.*;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFalling;
import net.minecraft.block.BlockLiquid;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumFacing.Axis;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.fluids.BlockFluidBase;
import buildcraft.api.core.BCLog;
public class SchematicBlock extends SchematicBlockBase {
@@ -124,6 +119,7 @@ public class SchematicBlock extends SchematicBlockBase {
context.world().setBlockState(pos, state, 3);
}
@Override
public boolean doNotUse() {
return doNotUse;
}
@@ -193,21 +189,7 @@ public class SchematicBlock extends SchematicBlockBase {
// Pretty much all blocks (that rotate) rotate this way now
@Override
public void rotateLeft(IBuilderContext context) {
IProperty<EnumFacing> facingProp = getFacingProp();
if (facingProp != null) {
EnumFacing face = state.getValue(facingProp);
if (face.getAxis() == Axis.Y) return;
state = state.withProperty(facingProp, face.rotateY());
}
}
protected IProperty<EnumFacing> getFacingProp() {
Collection<IProperty> props = state.getPropertyNames();
for (IProperty prop : props) {
if ("facing".equals(prop.getName()) && state.getValue(prop) instanceof EnumFacing) {
return prop;
}
}
return null;
// FIXME: This might be the wrong way
state = state.withRotation(Rotation.CLOCKWISE_90);
}
}
@@ -16,7 +16,8 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagDouble;
import net.minecraft.nbt.NBTTagFloat;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.Vec3;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.common.util.Constants;
public class SchematicEntity extends Schematic {
@@ -47,17 +48,17 @@ public class SchematicEntity extends Schematic {
}
@Override
public void translateToBlueprint(Vec3 transform) {
public void translateToBlueprint(Vec3d transform) {
NBTTagList nbttaglist = entityNBT.getTagList("Pos", 6);
Vec3 pos = new Vec3(nbttaglist.getDoubleAt(0), nbttaglist.getDoubleAt(1), nbttaglist.getDoubleAt(2));
Vec3d pos = new Vec3d(nbttaglist.getDoubleAt(0), nbttaglist.getDoubleAt(1), nbttaglist.getDoubleAt(2));
pos = pos.add(transform);
entityNBT.setTag("Pos", this.newDoubleNBTList(pos.xCoord, pos.yCoord, pos.zCoord));
}
@Override
public void translateToWorld(Vec3 transform) {
public void translateToWorld(Vec3d transform) {
NBTTagList nbttaglist = entityNBT.getTagList("Pos", 6);
Vec3 pos = new Vec3(nbttaglist.getDoubleAt(0), nbttaglist.getDoubleAt(1), nbttaglist.getDoubleAt(2));
Vec3d pos = new Vec3d(nbttaglist.getDoubleAt(0), nbttaglist.getDoubleAt(1), nbttaglist.getDoubleAt(2));
pos = pos.add(transform);
entityNBT.setTag("Pos", this.newDoubleNBTList(pos.xCoord, pos.yCoord, pos.zCoord));
@@ -78,7 +79,7 @@ public class SchematicEntity extends Schematic {
@Override
public void rotateLeft(IBuilderContext context) {
NBTTagList nbttaglist = entityNBT.getTagList("Pos", 6);
Vec3 pos = new Vec3(nbttaglist.getDoubleAt(0), nbttaglist.getDoubleAt(1), nbttaglist.getDoubleAt(2));
Vec3d pos = new Vec3d(nbttaglist.getDoubleAt(0), nbttaglist.getDoubleAt(1), nbttaglist.getDoubleAt(2));
pos = context.rotatePositionLeft(pos);
entityNBT.setTag("Pos", this.newDoubleNBTList(pos.xCoord, pos.yCoord, pos.zCoord));
@@ -123,7 +124,7 @@ public class SchematicEntity extends Schematic {
if (sub.getInteger("id") >= 0) {
// Maps the id in the blueprint to the id in the world
sub.setInteger("id", Item.itemRegistry.getIDForObject(registry.getItemForId(sub.getInteger("id"))));
sub.setInteger("id", Item.REGISTRY.getIDForObject(registry.getItemForId(sub.getInteger("id"))));
rqs.add(ItemStack.loadItemStackFromNBT(sub));
} else {
@@ -166,12 +167,12 @@ public class SchematicEntity extends Schematic {
public boolean isAlreadyBuilt(IBuilderContext context) {
NBTTagList nbttaglist = entityNBT.getTagList("Pos", 6);
Vec3 newPosition = new Vec3(nbttaglist.getDoubleAt(0), nbttaglist.getDoubleAt(1), nbttaglist.getDoubleAt(2));
Vec3d newPosition = new Vec3d(nbttaglist.getDoubleAt(0), nbttaglist.getDoubleAt(1), nbttaglist.getDoubleAt(2));
for (Object o : context.world().loadedEntityList) {
Entity e = (Entity) o;
Vec3 existingPositon = new Vec3(e.posX, e.posY, e.posZ);
Vec3d existingPositon = new Vec3d(e.posX, e.posY, e.posZ);
if (existingPositon.distanceTo(newPosition) <= 0.1) {
return true;
+2 -1
View File
@@ -9,7 +9,8 @@ import java.util.List;
import net.minecraft.block.BlockLiquid;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fluids.FluidStack;
public class SchematicFluid extends SchematicBlock {
@@ -11,9 +11,10 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.WorldServer;
import buildcraft.api.core.BuildCraftAPI;
public class SchematicMask extends SchematicBlockBase {
@@ -36,7 +37,7 @@ public class SchematicMask extends SchematicBlockBase {
return;
} else {
ItemStack stack = stacks.get(0);
EntityPlayer player = BuildCraftAPI.proxy.getBuildCraftPlayer((WorldServer) context.world()).get();
EntityPlayer player = BuildCraftAPI.fakePlayerProvider.getBuildCraftPlayer((WorldServer) context.world()).get();
// force the block to be air block, in case it's just a soft
// block which replacement is not straightforward
@@ -10,8 +10,10 @@ import java.util.List;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import buildcraft.api.core.JavaTools;
public class SchematicTile extends SchematicBlock {
@@ -46,7 +48,8 @@ public class SchematicTile extends SchematicBlock {
tileNBT.setInteger("x", pos.getX());
tileNBT.setInteger("y", pos.getY());
tileNBT.setInteger("z", pos.getZ());
TileEntity tile = TileEntity.createAndLoadEntity(tileNBT);
// The minecraft server argument doesn't seem to be used...
TileEntity tile = TileEntity.create(tileNBT);
tile.setWorldObj(context.world());
context.world().setTileEntity(pos, tile);
}
-1
View File
@@ -6,4 +6,3 @@
package buildcraft.api.blueprints;
import net.minecraftforge.fml.common.API;
@@ -10,6 +10,7 @@ import java.util.Random;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.Constants;
public abstract class RedstoneBoardNBT<T> {
@@ -6,6 +6,7 @@ package buildcraft.api.boards;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import buildcraft.api.robots.EntityRobotBase;
public abstract class RedstoneBoardRobotNBT extends RedstoneBoardNBT<EntityRobotBase> {
-1
View File
@@ -6,4 +6,3 @@
package buildcraft.api.boards;
import net.minecraftforge.fml.common.API;
View File
File mode changed.
+5 -5
View File
@@ -8,16 +8,16 @@ import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import net.minecraft.block.Block;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public final class BuildCraftAPI {
public static ICoreProxy proxy;
public static IBCFakePlayer fakePlayerProvider;
public static final Set<Block> softBlocks = Sets.newHashSet();
public static final HashMap<String, IWorldProperty> worldProperties = Maps.newHashMap();
+2 -2
View File
@@ -2,10 +2,10 @@ package buildcraft.api.core;
import java.util.Map;
import net.minecraftforge.common.config.Property;
import com.google.common.collect.Maps;
import net.minecraftforge.common.config.Property;
/** Use this to access the various config options. It is recommended that you use this as opposed to the variables in
* the mod, as users may only install the modules that they want, and not the one you may have refereed to. */
@Deprecated
+3 -2
View File
@@ -10,7 +10,8 @@ import java.util.Random;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -116,7 +117,7 @@ public enum EnumColor implements IStringSerializable {
}
public String getLocalizedName() {
return StatCollector.translateToLocal(getTag());
return I18n.translateToLocal(getTag());
}
public String getDye() {
+10 -5
View File
@@ -1,28 +1,29 @@
package buildcraft.api.core;
import io.netty.buffer.ByteBuf;
import java.util.Locale;
import java.util.Map;
import com.google.common.collect.Maps;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTBase.NBTPrimitive;
import net.minecraft.nbt.NBTTagString;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.IStringSerializable;
import com.google.common.collect.Maps;
import io.netty.buffer.ByteBuf;
public enum EnumPipePart implements IStringSerializable,INetworkLoadable_BC8<EnumPipePart> {
public enum EnumPipePart implements IStringSerializable, INetworkLoadable_BC8<EnumPipePart> {
DOWN(EnumFacing.DOWN),
UP(EnumFacing.UP),
NORTH(EnumFacing.NORTH),
SOUTH(EnumFacing.SOUTH),
WEST(EnumFacing.WEST),
EAST(EnumFacing.EAST),
/** CENTER, UNKNOWN and ALL are all valid uses of this constant. */
/** CENTER, UNKNOWN and ALL are all valid uses of this. */
CENTER(null);
public static final EnumPipePart[] VALUES = values();
private static final Map<EnumFacing, EnumPipePart> facingMap = Maps.newEnumMap(EnumFacing.class);
private static final Map<String, EnumPipePart> nameMap = Maps.newHashMap();
private static final int MAX_VALUES = values().length;
@@ -36,6 +37,10 @@ public enum EnumPipePart implements IStringSerializable,INetworkLoadable_BC8<Enu
}
}
public static int ordinal(EnumFacing face) {
return face == null ? 6 : face.ordinal();
}
public static EnumPipePart fromFacing(EnumFacing face) {
if (face == null) return EnumPipePart.CENTER;
return facingMap.get(face);
+1 -1
View File
@@ -4,7 +4,7 @@
* should be located as "LICENSE.API" in the BuildCraft source code distribution. */
package buildcraft.api.core;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
/** To be implemented by TileEntities able to provide a square area on the world, typically BuildCraft markers. */
public interface IAreaProvider {
@@ -9,6 +9,6 @@ import java.lang.ref.WeakReference;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.WorldServer;
public interface ICoreProxy {
public interface IBCFakePlayer {
WeakReference<EntityPlayer> getBuildCraftPlayer(WorldServer world);
}
+1 -1
View File
@@ -4,7 +4,7 @@
* should be located as "LICENSE.API" in the BuildCraft source code distribution. */
package buildcraft.api.core;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
public interface IBox extends IZone {
IBox expand(int amount);
View File
File mode changed.
@@ -4,9 +4,9 @@
* of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */
package buildcraft.api.core;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
public interface IFluidFilter {
boolean matches(Fluid fluid);
boolean matches(FluidStack fluid);
}
+1
View File
@@ -2,6 +2,7 @@ package buildcraft.api.core;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
+5 -1
View File
@@ -2,10 +2,14 @@ package buildcraft.api.core;
import java.util.List;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import buildcraft.api.items.IMapLocation.MapLocationType;
/** To be implemented by TileEntities able to provide a path on the world, typically BuildCraft path markers. */
public interface IPathProvider {
/** @return The completed path. This should loop back onto itself (The last position is the same as the first
* position) if you are {@link MapLocationType#PATH_REPEATING} */
List<BlockPos> getPath();
/** Remove from the world all objects used to define the path. */
View File
File mode changed.
View File
File mode changed.
@@ -4,7 +4,7 @@
* should be located as "LICENSE.API" in the BuildCraft source code distribution. */
package buildcraft.api.core;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public interface IWorldProperty {
+5 -5
View File
@@ -6,12 +6,12 @@ package buildcraft.api.core;
import java.util.Random;
import net.minecraft.util.BlockPos;
import net.minecraft.util.Vec3;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
public interface IZone {
/** Returns the smallest possible distance that the index would have to be changed by in order for
* {@link #contains(Vec3)} to return true. If the position is already inside then this will return 0 */
* {@link #contains(Vec3d)} to return true. If the position is already inside then this will return 0 */
double distanceTo(BlockPos index);
/** Returns {@link #distanceTo(BlockPos)} but squared. Usually this will be quicker to calculate. */
@@ -19,8 +19,8 @@ public interface IZone {
/** Returns true if the point is enclosed by this zone, such that none of the coordinates lie outside the range
* specified by this zone. */
boolean contains(Vec3 point);
boolean contains(Vec3d point);
/** Gets a random position that {@link #contains(Vec3)} will return true. */
/** Gets a random position that {@link #contains(Vec3d)} will return true. */
BlockPos getRandomBlockPos(Random rand);
}
+37 -16
View File
@@ -2,15 +2,17 @@ package buildcraft.api.core;
import java.util.Map;
import java.util.UUID;
import java.util.function.Supplier;
import com.google.common.base.Supplier;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -23,8 +25,18 @@ public abstract class Identifier {
private static Map<String, Supplier<Identifier>> registeredIdentifiers;
static {
registeredIdentifiers.put("mincraft:tile", () -> new Tile(0, null));
registeredIdentifiers.put("mincraft:entity", () -> new MovableEntity(0, null));
registeredIdentifiers.put("mincraft:tile", new Supplier<Identifier>() {
@Override
public Identifier get() {
return new Tile(0, null);
}
});
registeredIdentifiers.put("mincraft:entity", new Supplier<Identifier>() {
@Override
public Identifier get() {
return new MovableEntity(0, null);
}
});
}
protected final int dimId;
@@ -85,7 +97,7 @@ public abstract class Identifier {
public static Tile create(TileEntity tile) {
if (tile.getWorld() == null) throw new NullPointerException("tile.getWorld() for the tile " + tile.getClass());
if (tile.getPos() == null) throw new NullPointerException("tile.getPos() for the tile " + tile.getClass());
return new Tile(tile.getWorld().provider.getDimensionId(), tile.getPos());
return new Tile(tile.getWorld().provider.getDimension(), tile.getPos());
}
private Tile(int dimId, BlockPos pos) {
@@ -132,7 +144,7 @@ public abstract class Identifier {
@SideOnly(Side.CLIENT)
public TileEntity getByIdentifierClient() {
World world = Minecraft.getMinecraft().theWorld;
if (world == null || world.provider.getDimensionId() != dimId) return null;
if (world == null || world.provider.getDimension() != dimId) return null;
return world.getTileEntity(pos);
}
@@ -140,7 +152,7 @@ public abstract class Identifier {
@SideOnly(Side.CLIENT)
public boolean isLoadedClient() {
World world = Minecraft.getMinecraft().theWorld;
if (world == null || world.provider.getDimensionId() != dimId) return false;
if (world == null || world.provider.getDimension() != dimId) return false;
return world.getTileEntity(pos) != null;
}
@@ -152,7 +164,7 @@ public abstract class Identifier {
public static MovableEntity create(Entity ent) {
if (ent.getEntityWorld() == null) throw new NullPointerException("ent.getEntityWorld() for the entity " + ent.getClass());
if (ent.getPersistentID() == null) throw new NullPointerException("ent.getPersistentID() for the entity " + ent.getClass());
return new MovableEntity(ent.getEntityWorld().provider.getDimensionId(), ent.getPersistentID());
return new MovableEntity(ent.getEntityWorld().provider.getDimension(), ent.getPersistentID());
}
private MovableEntity(int dimId, UUID uniqueId) {
@@ -160,34 +172,43 @@ public abstract class Identifier {
this.uniqueId = uniqueId;
}
private Entity get(World world) {
for (Entity entity : world.loadedEntityList) {
if (entity.getPersistentID().equals(uniqueId)) {
return entity;
}
}
return null;
}
@Override
public Entity getByIdentifier(MinecraftServer server) {
World world = server.worldServerForDimension(dimId);
if (world == null || world.provider.getDimensionId() != dimId) return null;
return world.loadedEntityList.stream().filter(e -> e.getPersistentID().equals(uniqueId)).findFirst().orElse(null);
if (world == null || world.provider.getDimension() != dimId) return null;
return get(world);
}
@Override
public boolean isLoaded(MinecraftServer server) {
World world = server.worldServerForDimension(dimId);
if (world == null || world.provider.getDimensionId() != dimId) return false;
return world.loadedEntityList.stream().filter(e -> e.getPersistentID().equals(uniqueId)).findFirst().orElse(null) != null;
if (world == null || world.provider.getDimension() != dimId) return false;
return get(world) != null;
}
@Override
@SideOnly(Side.CLIENT)
public Entity getByIdentifierClient() {
World world = Minecraft.getMinecraft().theWorld;
if (world == null || world.provider.getDimensionId() != dimId) return null;
return world.loadedEntityList.stream().filter(e -> e.getPersistentID().equals(uniqueId)).findFirst().orElse(null);
if (world == null || world.provider.getDimension() != dimId) return null;
return get(world);
}
@Override
@SideOnly(Side.CLIENT)
public boolean isLoadedClient() {
World world = Minecraft.getMinecraft().theWorld;
if (world == null || world.provider.getDimensionId() != dimId) return false;
return world.loadedEntityList.stream().filter(e -> e.getPersistentID().equals(uniqueId)).findFirst().orElse(null) != null;
if (world == null || world.provider.getDimension() != dimId) return false;
return get(world) != null;
}
@Override
View File
File mode changed.
+3 -3
View File
@@ -7,6 +7,7 @@ package buildcraft.api.core;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack;
@@ -80,8 +81,7 @@ public final class StackKey {
}
}
if (fluidStack != null) {
if (fluidStack.getFluid().getID() != k.fluidStack.getFluid().getID() || fluidStack.amount != k.fluidStack.amount || !objectsEqual(
fluidStack.tag, k.fluidStack.tag)) {
if (!fluidStack.isFluidEqual(k.fluidStack) || fluidStack.amount != k.fluidStack.amount) {
return false;
}
}
@@ -98,7 +98,7 @@ public final class StackKey {
}
result = 31 * result + 7;
if (fluidStack != null) {
result = 31 * result + fluidStack.getFluid().getID();
result = 31 * result + fluidStack.getFluid().getName().hashCode();
result = 31 * result + fluidStack.amount;
result = 31 * result + objectHashCode(fluidStack.tag);
}
+1 -2
View File
@@ -2,8 +2,7 @@
*
* The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which
* should be located as "LICENSE.API" in the BuildCraft source code distribution. */
@API(apiVersion = "2.0", owner = "BuildCraft|Core", provides = "BuildCraftAPI|core")
@API(apiVersion = "2.1", owner = "BuildCraft|Core", provides = "BuildCraftAPI|core")
package buildcraft.api.core;
import net.minecraftforge.fml.common.API;
+1 -1
View File
@@ -4,8 +4,8 @@
* of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */
package buildcraft.api.core.render;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
/* This interface designates a block as a state machine responsible for culling For implementation details look into
View File
File mode changed.
View File
File mode changed.
+1 -1
View File
@@ -6,7 +6,7 @@ import java.util.List;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+1 -1
View File
@@ -5,7 +5,7 @@ import java.util.List;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-1
View File
@@ -6,4 +6,3 @@
package buildcraft.api.crops;
import net.minecraftforge.fml.common.API;
+1
View File
@@ -1,6 +1,7 @@
package buildcraft.api.enums;
import net.minecraft.item.ItemStack;
import buildcraft.api.items.IBlueprintItem;
public enum EnumBlueprintType {
View File
File mode changed.
+6 -3
View File
@@ -1,8 +1,8 @@
package buildcraft.api.enums;
import net.minecraft.util.IStringSerializable;
import java.util.Locale;
import org.apache.commons.lang3.StringUtils;
import net.minecraft.util.IStringSerializable;
public enum EnumEnergyStage implements IStringSerializable {
BLUE,
@@ -11,10 +11,13 @@ public enum EnumEnergyStage implements IStringSerializable {
RED,
OVERHEAT,
BLACK;
public static final EnumEnergyStage[] VALUES = values();
private final String modelName = name().toLowerCase(Locale.ROOT);
public String getModelName() {
return StringUtils.lowerCase(name());
return modelName;
}
@Override
+10 -5
View File
@@ -1,7 +1,5 @@
package buildcraft.api.enums;
import java.util.Locale;
import net.minecraft.util.IStringSerializable;
public enum EnumEngineType implements IStringSerializable {
@@ -10,18 +8,25 @@ public enum EnumEngineType implements IStringSerializable {
IRON("energy", "iron"),
CREATIVE("energy", "creative");
public final String unlocalizedTag;
public final String resourceLocation;
public static final EnumEngineType[] VALUES = values();
EnumEngineType(String mod, String loc) {
unlocalizedTag = loc;
resourceLocation = "buildcraft" + mod + ":blocks/engine/inv/" + loc + "/";
}
@Override
public String getName() {
return name();
return unlocalizedTag;
}
public String getModelName() {
return getName().toLowerCase(Locale.ROOT);
public static EnumEngineType fromMeta(int meta) {
if (meta < 0 || meta >= VALUES.length) {
meta = 0;
}
return VALUES[meta];
}
}
View File
File mode changed.
+1
View File
@@ -2,6 +2,7 @@ package buildcraft.api.enums;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.IStringSerializable;
import buildcraft.api.properties.BuildCraftProperties;
public enum EnumLaserTableType implements IStringSerializable {
+1
View File
@@ -2,6 +2,7 @@ package buildcraft.api.enums;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.IStringSerializable;
import buildcraft.api.properties.BuildCraftProperties;
public enum EnumMachineState implements IStringSerializable {
View File
File mode changed.
+4 -2
View File
@@ -3,11 +3,12 @@ package buildcraft.api.enums;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.util.IStringSerializable;
import buildcraft.api.properties.BuildCraftProperties;
public enum EnumSpring implements IStringSerializable {
WATER(5, -1, Blocks.water.getDefaultState()),
WATER(5, -1, Blocks.WATER.getDefaultState()),
OIL(6000, 8, null); // Set in BuildCraftEnergy
public static final EnumSpring[] VALUES = values();
public final int tickRate, chance;
@@ -21,9 +22,10 @@ public enum EnumSpring implements IStringSerializable {
}
public static EnumSpring fromState(IBlockState state) {
return (EnumSpring) state.getValue(BuildCraftProperties.SPRING_TYPE);
return state.getValue(BuildCraftProperties.SPRING_TYPE);
}
@Override
public String getName() {
return this.name();
}
-1
View File
@@ -6,4 +6,3 @@
package buildcraft.api.enums;
import net.minecraftforge.fml.common.API;
+1
View File
@@ -6,6 +6,7 @@ package buildcraft.api.events;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;
+2 -1
View File
@@ -6,7 +6,8 @@ package buildcraft.api.events;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;
+5 -3
View File
@@ -5,15 +5,17 @@
package buildcraft.api.events;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.BlockPos;
import net.minecraft.item.Item;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.common.eventhandler.Event;
public class PipePlacedEvent extends Event {
public EntityPlayer player;
public String pipeType;
public Item pipeType;
public BlockPos pos;
public PipePlacedEvent(EntityPlayer player, String pipeType, BlockPos pos) {
public PipePlacedEvent(EntityPlayer player, Item pipeType, BlockPos pos) {
this.player = player;
this.pipeType = pipeType;
this.pos = pos;
+2
View File
@@ -6,8 +6,10 @@ package buildcraft.api.events;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;
import buildcraft.api.robots.EntityRobotBase;
public abstract class RobotEvent extends Event {
+1
View File
@@ -5,6 +5,7 @@
package buildcraft.api.events;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;
-1
View File
@@ -6,4 +6,3 @@
package buildcraft.api.events;
import net.minecraftforge.fml.common.API;
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
-1
View File
@@ -6,4 +6,3 @@
package buildcraft.api.facades;
import net.minecraftforge.fml.common.API;
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
-1
View File
@@ -6,4 +6,3 @@
package buildcraft.api.filler;
import net.minecraftforge.fml.common.API;
View File
File mode changed.
View File
File mode changed.
+1
View File
@@ -7,6 +7,7 @@ package buildcraft.api.fuels;
import java.util.Collection;
import net.minecraftforge.fluids.Fluid;
import buildcraft.api.core.StackKey;
public interface ICoolantManager {
View File
File mode changed.
+8
View File
@@ -7,13 +7,21 @@ package buildcraft.api.fuels;
import java.util.Collection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
public interface IFuelManager {
IFuel addFuel(IFuel fuel);
IFuel addFuel(Fluid fluid, int powerPerCycle, int totalBurningTime);
IDirtyFuel addDirtyFuel(Fluid fuel, int powerPerCycle, int totalBurningTime, FluidStack residue);
Collection<IFuel> getFuels();
IFuel getFuel(Fluid fluid);
public interface IDirtyFuel extends IFuel {
/** @return The residue fluidstack, per bucket of original fuel. */
FluidStack getResidue();
}
}
+1
View File
@@ -5,6 +5,7 @@
package buildcraft.api.fuels;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public interface ISolidCoolant {
-1
View File
@@ -6,4 +6,3 @@
package buildcraft.api.fuels;
import net.minecraftforge.fml.common.API;
+4 -3
View File
@@ -4,10 +4,11 @@
* should be located as "LICENSE.API" in the BuildCraft source code distribution. */
package buildcraft.api.gates;
import java.util.List;
import java.util.Collection;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import buildcraft.api.statements.IActionInternal;
import buildcraft.api.statements.IStatement;
import buildcraft.api.statements.IStatementParameter;
@@ -43,9 +44,9 @@ public abstract class GateExpansionController {
return false;
}
public void addTriggers(List<ITriggerInternal> list) {}
public void addTriggers(Collection<ITriggerInternal> list) {}
public void addActions(List<IActionInternal> list) {}
public void addActions(Collection<IActionInternal> list) {}
public void writeToNBT(NBTTagCompound nbt) {}
@@ -0,0 +1,36 @@
package buildcraft.api.gates;
import java.util.Arrays;
import net.minecraft.util.BlockRenderLayer;
public class GateExpansionModelKey<K extends GateExpansionModelKey<K>> {
public final BlockRenderLayer layer;
public final IExpansionBaker<K> baker;
private final int hash;
public GateExpansionModelKey(BlockRenderLayer layer, IExpansionBaker<K> baker) {
if (layer != BlockRenderLayer.CUTOUT && layer != BlockRenderLayer.TRANSLUCENT) {
throw new IllegalArgumentException("Unsuported layer! Was " + layer + ", wanted CUTOUT or TRANSLUCENT");
}
if (baker == null) throw new NullPointerException("baker");
this.layer = layer;
this.baker = baker;
hash = Arrays.hashCode(new int[] { layer.hashCode(), System.identityHashCode(baker) });
}
@Override
public int hashCode() {
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (getClass() != obj.getClass()) return false;
GateExpansionModelKey<?> other = (GateExpansionModelKey<?>) obj;
if (baker != other.baker) return false;
return true;
}
}
+3 -7
View File
@@ -4,16 +4,12 @@
* should be located as "LICENSE.API" in the BuildCraft source code distribution. */
package buildcraft.api.gates;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import net.minecraft.item.ItemStack;
import java.util.*;
import com.google.common.collect.HashBiMap;
import net.minecraft.item.ItemStack;
public final class GateExpansions {
private static final Map<String, IGateExpansion> expansions = new HashMap<String, IGateExpansion>();
private static final ArrayList<IGateExpansion> expansionIDs = new ArrayList<IGateExpansion>();
+13
View File
@@ -0,0 +1,13 @@
package buildcraft.api.gates;
import com.google.common.collect.ImmutableList;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.vertex.VertexFormat;
public interface IExpansionBaker<K extends GateExpansionModelKey<K>> {
/** @return The vertex format used to generate the quads. */
VertexFormat getVertexFormat();
ImmutableList<BakedQuad> bake(K key);
}
+5 -2
View File
@@ -4,6 +4,7 @@
* should be located as "LICENSE.API" in the BuildCraft source code distribution. */
package buildcraft.api.gates;
import java.util.Collection;
import java.util.List;
import buildcraft.api.statements.IStatement;
@@ -18,13 +19,15 @@ public interface IGate extends ISidedStatementContainer {
IPipe getPipe();
Collection<IGateExpansion> getExpansions();
List<IStatement> getTriggers();
List<IStatement> getActions();
List<StatementSlot> getActiveActions();
List<IStatementParameter> getTriggerParameters(int index);
List<IStatementParameter> getTriggerParameters(int slot);
List<IStatementParameter> getActionParameters(int index);
List<IStatementParameter> getActionParameters(int slot);
}
+5 -8
View File
@@ -4,12 +4,10 @@
* should be located as "LICENSE.API" in the BuildCraft source code distribution. */
package buildcraft.api.gates;
import java.util.List;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -25,9 +23,8 @@ public interface IGateExpansion {
void textureStitch(TextureMap map);
@SideOnly(Side.CLIENT)
IGateStaticRenderState getRenderState();
GateExpansionModelKey<?> getRenderModelKey(BlockRenderLayer layer);
public interface IGateStaticRenderState {
List<BakedQuad> bake(VertexFormat format);
}
// FIXME : This is ugly.
boolean canAddToGate(int numTriggerParameters, int numActionParameters);
}
-1
View File
@@ -6,4 +6,3 @@
package buildcraft.api.gates;
import net.minecraftforge.fml.common.API;
+1
View File
@@ -1,6 +1,7 @@
package buildcraft.api.items;
import net.minecraft.item.ItemStack;
import buildcraft.api.enums.EnumBlueprintType;
public interface IBlueprintItem extends INamedItem {
+1
View File
@@ -1,6 +1,7 @@
package buildcraft.api.items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-3
View File
@@ -3,8 +3,5 @@ package buildcraft.api.items;
import net.minecraft.item.ItemStack;
public interface IList extends INamedItem {
@Deprecated
String getLabel(ItemStack stack);
boolean matches(ItemStack stackList, ItemStack item);
}
+5 -2
View File
@@ -3,8 +3,9 @@ package buildcraft.api.items;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import buildcraft.api.core.IBox;
import buildcraft.api.core.IZone;
@@ -15,7 +16,9 @@ public interface IMapLocation extends INamedItem {
SPOT,
AREA,
PATH,
ZONE;
ZONE,
/** Like PATH but repeats around in a loop. */
PATH_REPEATING;
public final int meta = ordinal();
View File
File mode changed.
-1
View File
@@ -6,4 +6,3 @@
package buildcraft.api.items;
import net.minecraftforge.fml.common.API;
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
Loaded 100 of 433 files, more files were not shown because too many files have changed in this diff. Show more