Update for 1.7.2

Commit for version 1.1.0, the update to minecraft 1.7.2
This commit is contained in:
Tombenpotter committed 2014-04-17 22:27:40 +02:00
1 parent ad11bd5173
commit 1986c7a08f
220 files changed
+2521 -3434

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
package baubles.api;
public enum BaubleType {
RING,
AMULET,
BELT
}
+34
View File
@@ -0,0 +1,34 @@
package baubles.api;
import java.lang.reflect.Method;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import cpw.mods.fml.common.FMLLog;
/**
* @author Azanor
*/
public class BaublesApi {
static Method getBaubles;
/**
* Retrieves the baubles inventory for the supplied player
*/
public static IInventory getBaubles(EntityPlayer player) {
IInventory ot = null;
try {
if(getBaubles == null) {
Class fake = Class.forName("baubles.common.lib.PlayerHandler");
getBaubles = fake.getMethod("getPlayerBaubles", EntityPlayer.class);
}
ot = (IInventory) getBaubles.invoke(null, player);
} catch(Exception ex) {
FMLLog.warning("[Baubles API] Could not invoke baubles.common.lib.PlayerHandler method getPlayerBaubles");
}
return ot;
}
}
+46
View File
@@ -0,0 +1,46 @@
package baubles.api;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
/**
*
* @author Azanor
*
* This interface should be extended by items that can be worn in bauble slots
*
*/
public interface IBauble {
/**
* This method return the type of bauble this is.
* Type is used to determine the slots it can go into.
*/
public BaubleType getBaubleType(ItemStack itemstack);
/**
* This method is called once per tick if the bauble is being worn by a player
*/
public void onWornTick(ItemStack itemstack, EntityLivingBase player);
/**
* This method is called when the bauble is equipped by a player
*/
public void onEquipped(ItemStack itemstack, EntityLivingBase player);
/**
* This method is called when the bauble is unequipped by a player
*/
public void onUnequipped(ItemStack itemstack, EntityLivingBase player);
/**
* can this bauble be placed in a bauble slot
*/
public boolean canEquip(ItemStack itemstack, EntityLivingBase player);
/**
* Can this bauble be removed from a bauble slot
*/
public boolean canUnequip(ItemStack itemstack, EntityLivingBase player);
}
Binary file not shown.
+6 -4
View File
@@ -1,8 +1,9 @@
package ic2.api;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.util.ForgeDirection;
/**
* Represents the 6 possible directions along the axis of a block.
@@ -57,12 +58,13 @@ public enum Direction {
int coords[] = { tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord };
coords[dir/2] += getSign();
World world = tileEntity.getWorldObj();
if (tileEntity.worldObj != null && tileEntity.worldObj.blockExists(coords[0], coords[1], coords[2])) {
if (world != null && world.blockExists(coords[0], coords[1], coords[2])) {
try {
return tileEntity.worldObj.getBlockTileEntity(coords[0], coords[1], coords[2]);
return world.getTileEntity(coords[0], coords[1], coords[2]);
} catch (Exception e) {
throw new RuntimeException("error getting TileEntity at dim "+tileEntity.worldObj.provider.dimensionId+" "+coords[0]+"/"+coords[1]+"/"+coords[2]);
throw new RuntimeException("error getting TileEntity at dim "+world.provider.dimensionId+" "+coords[0]+"/"+coords[1]+"/"+coords[2]);
}
}
return null;
Binary file not shown.
Binary file not shown.
+6 -6
View File
@@ -1,11 +1,11 @@
package ic2.api.crops;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.IIcon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -103,8 +103,8 @@ public abstract class CropCard
* This method will get called by IC2, don't call it yourself.
*/
@SideOnly(Side.CLIENT)
public void registerSprites(IconRegister iconRegister) {
textures = new Icon[maxSize()];
public void registerSprites(IIconRegister iconRegister) {
textures = new IIcon[maxSize()];
for (int i = 1; i <= textures.length; i++) {
textures[i-1] = iconRegister.registerIcon("ic2:crop/blockCrop."+name()+"."+i);
@@ -118,7 +118,7 @@ public abstract class CropCard
* @return 0-255, representing the sprite index on the crop's spritesheet.
*/
@SideOnly(Side.CLIENT)
public Icon getSprite(ICropTile crop) {
public IIcon getSprite(ICropTile crop) {
if (crop.getSize() <= 0 || crop.getSize() > textures.length) return null;
return textures[crop.getSize() - 1];
@@ -370,5 +370,5 @@ public abstract class CropCard
}
@SideOnly(Side.CLIENT)
protected Icon textures[];
protected IIcon textures[];
}
Binary file not shown.
+15 -2
View File
@@ -1,12 +1,14 @@
package ic2.api.crops;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.world.biome.BiomeGenBase;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraftforge.common.BiomeDictionary.Type;
/**
* General management of the crop system.
*/
@@ -24,6 +26,17 @@ public abstract class Crops {
*/
public abstract void addBiomeBonus(BiomeGenBase biome, int humidityBonus, int nutrientsBonus);
/**
* Adds a crop humidity and nutrient biome bonus.
*
* 0 indicates no bonus and negative values indicate a penalty.
*
* @param type Forge biome type to apply the bonus in
* @param humidityBonus Humidity stat bonus
* @param nutrientsBonus Nutrient stat bonus
*/
public abstract void addBiomeBonus(Type type, int humidityBonus, int nutrientsBonus);
/**
* Gets the humidity bonus for a biome.
*
@@ -92,7 +105,7 @@ public abstract class Crops {
* This method will get called by IC2, don't call it yourself.
*/
@SideOnly(Side.CLIENT)
public abstract void startSpriteRegistration(IconRegister iconRegister);
public abstract void startSpriteRegistration(IIconRegister iconRegister);
/**
* Returns the ID for the given crop.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+2 -2
View File
@@ -3,7 +3,7 @@ package ic2.api.energy;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.util.ForgeDirection;
/**
* Interface representing the methods provided by the global EnergyNet class.
@@ -14,7 +14,7 @@ public interface IEnergyNet {
/**
* Get the EnergyNet-registered tile entity at the specified position.
*
* This is not the same as World.getBlockTileEntity(), it's possible to register delegate tile
* This is not the same as World.getTileEntity(), it's possible to register delegate tile
* entities with the energy net which are different from what's actually in the world. Those
* delegates allow to use separate TileEntity objects just for the EnergyNet interfaces,
* simplifying cross-mod dependencies and multi-blocks.
@@ -15,7 +15,7 @@ public class EnergyTileEvent extends WorldEvent {
public final IEnergyTile energyTile;
public EnergyTileEvent(IEnergyTile energyTile1) {
super(((TileEntity) energyTile1).worldObj);
super(((TileEntity) energyTile1).getWorldObj());
this.energyTile = energyTile1;
}
Binary file not shown.
@@ -6,8 +6,8 @@ import net.minecraft.tileentity.TileEntity;
import cpw.mods.fml.common.FMLCommonHandler;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.ForgeDirection;
import ic2.api.energy.EnergyNet;
import ic2.api.energy.event.EnergyTileLoadEvent;
@@ -127,7 +127,7 @@ public class BasicSink extends TileEntity implements IEnergySink {
if (!addedToEnet &&
!FMLCommonHandler.instance().getEffectiveSide().isClient() &&
Info.isIc2Available()) {
worldObj = parent.worldObj;
worldObj = parent.getWorldObj();
xCoord = parent.xCoord;
yCoord = parent.yCoord;
zCoord = parent.zCoord;
Binary file not shown.
@@ -6,8 +6,8 @@ import net.minecraft.tileentity.TileEntity;
import cpw.mods.fml.common.FMLCommonHandler;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.ForgeDirection;
import ic2.api.energy.EnergyNet;
import ic2.api.energy.event.EnergyTileLoadEvent;
@@ -127,7 +127,7 @@ public class BasicSource extends TileEntity implements IEnergySource {
if (!addedToEnet &&
!FMLCommonHandler.instance().getEffectiveSide().isClient() &&
Info.isIc2Available()) {
worldObj = parent.worldObj;
worldObj = parent.getWorldObj();
xCoord = parent.xCoord;
yCoord = parent.yCoord;
zCoord = parent.zCoord;
@@ -2,7 +2,7 @@ package ic2.api.energy.tile;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.util.ForgeDirection;
/**
* For internal/multi-block usage only.
@@ -19,7 +19,7 @@ public interface IEnergyAcceptor extends IEnergyTile {
* The TileEntity in the emitter parameter is what was originally added to the energy net,
* which may be normal in-world TileEntity, a delegate or an IMetaDelegate.
*
* @param emitter energy emitter
* @param emitter energy emitter, may also be null or an IMetaDelegate
* @param direction direction the energy is being received from
*/
boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction);
@@ -2,7 +2,7 @@ package ic2.api.energy.tile;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.util.ForgeDirection;
/**
* For internal/multi-block usage only.
@@ -19,7 +19,7 @@ public interface IEnergyEmitter extends IEnergyTile {
* The TileEntity in the receiver parameter is what was originally added to the energy net,
* which may be normal in-world TileEntity, a delegate or an IMetaDelegate.
*
* @param receiver receiver, may be an IMetaDelegate
* @param receiver receiver, may also be null or an IMetaDelegate
* @param direction direction the receiver is from the emitter
* @return Whether energy should be emitted
*/
Binary file not shown.
@@ -1,6 +1,6 @@
package ic2.api.energy.tile;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.util.ForgeDirection;
/**
* Allows a tile entity (mostly a machine) to receive energy.
@@ -14,6 +14,8 @@ public interface IEnergySink extends IEnergyAcceptor {
* This value is unrelated to getMaxSafeInput().
*
* Make sure that injectEnergy() does accepts energy if demandsEnergy() returns anything > 0.
*
* @note Modifying the energy net from this method is disallowed.
*
* @return max accepted input in eu
*/
@@ -38,6 +40,8 @@ public interface IEnergySink extends IEnergyAcceptor {
* limit.
*
* This value is unrelated to demandsEnergy().
*
* @note Modifying the energy net from this method is disallowed.
*
* @return max safe input in eu
*/
Binary file not shown.
@@ -10,6 +10,8 @@ public interface IEnergySource extends IEnergyEmitter {
* Energy output provided by the source this tick.
* This is typically Math.min(stored energy, max output/tick).
*
* @note Modifying the energy net from this method is disallowed.
*
* @return Energy offered this tick
*/
double getOfferedEnergy();
Binary file not shown.
Binary file not shown.
Binary file not shown.
+2 -1
View File
@@ -5,7 +5,8 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.event.Cancelable;
import cpw.mods.fml.common.eventhandler.Cancelable;
import net.minecraftforge.event.world.WorldEvent;
/**
Binary file not shown.
+2 -1
View File
@@ -2,7 +2,8 @@ package ic2.api.event;
import net.minecraft.world.World;
import net.minecraftforge.event.Cancelable;
import cpw.mods.fml.common.eventhandler.Cancelable;
import net.minecraftforge.event.world.WorldEvent;
@Cancelable
Binary file not shown.
@@ -1,8 +1,10 @@
package ic2.api.event;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraftforge.event.Cancelable;
import cpw.mods.fml.common.eventhandler.Cancelable;
import net.minecraftforge.event.world.WorldEvent;
@Cancelable
@@ -14,21 +16,21 @@ public class RetextureEvent extends WorldEvent {
public final int side;
// referenced block (to grab the texture from)
public final int referencedBlockId;
public final Block referencedBlock;
public final int referencedMeta;
public final int referencedSide;
// set to true to confirm the operation
public boolean applied = false;
public RetextureEvent(World world1, int x1, int y1, int z1, int side1, int referencedBlockId1, int referencedMeta1, int referencedSide1) {
public RetextureEvent(World world1, int x1, int y1, int z1, int side1, Block referencedBlock, int referencedMeta1, int referencedSide1) {
super(world1);
this.x = x1;
this.y = y1;
this.z = z1;
this.side = side1;
this.referencedBlockId = referencedBlockId1;
this.referencedBlock = referencedBlock;
this.referencedMeta = referencedMeta1;
this.referencedSide = referencedSide1;
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -13,7 +13,7 @@ import net.minecraft.item.ItemStack;
* Blocks: Block.blocksList[x.itemID]
* Items: x.getItem()
*/
public final class Items {
public final class IC2Items {
/**
* Get an ItemStack for a specific item name, example: Items.getItem("resin")
* See the list below for item names.
@@ -583,7 +583,7 @@ public final class Items {
* @return IC2 package name, if unable to be determined defaults to ic2
*/
private static String getPackage() {
Package pkg = Items.class.getPackage();
Package pkg = IC2Items.class.getPackage();
if (pkg != null) {
String packageName = pkg.getName();
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3 -2
View File
@@ -1,5 +1,6 @@
package ic2.api.item;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
/**
@@ -20,14 +21,14 @@ public interface IElectricItem {
*
* @return Item ID to use
*/
int getChargedItemId(ItemStack itemStack);
Item getChargedItem(ItemStack itemStack);
/**
* Get the item ID to use for a charge energy of 0.
*
* @return Item ID to use
*/
int getEmptyItemId(ItemStack itemStack);
Item getEmptyItem(ItemStack itemStack);
/**
* Get the item's maximum charge energy in EU.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,7 @@
package ic2.api.network;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
/**
* Allows an item to receive network events received from the server.
@@ -9,10 +10,10 @@ public interface INetworkItemEventListener {
/**
* Called when a network event is received.
*
* @param metaData item metadata
* @param itemStack item stack
* @param player player containing the item
* @param event event ID
*/
void onNetworkEvent(int metaData, EntityPlayer player, int event);
void onNetworkEvent(ItemStack stack, EntityPlayer player, int event);
}
Binary file not shown.
@@ -5,7 +5,6 @@ import java.lang.reflect.Method;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
/**
* Provides methods to initiate events and synchronize tile entity fields in SMP.
@@ -112,51 +111,9 @@ public final class NetworkHelper {
}
}
/**
* Schedule a block update (re-render) on the clients in range.
*
* If this method is being executed on the client (i.e. Singleplayer), it'll just trigger the
* block update locally.
*
* @param world World containing the block
* @param x The block's x coordinate
* @param y The block's y coordinate
* @param z The block's z coordinate
*/
public static void announceBlockUpdate(World world, int x, int y, int z) {
try {
if (NetworkManager_announceBlockUpdate == null) NetworkManager_announceBlockUpdate = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("announceBlockUpdate", World.class, Integer.TYPE, Integer.TYPE, Integer.TYPE);
if (instance == null) instance = getInstance();
NetworkManager_announceBlockUpdate.invoke(instance, world, x, y, z);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
// client -> server
/**
* Ask the server to send the values of the fields specified.
*
* See updateTileEntityField for the supported field types.
*
* The implementation is currently limited to TileEntitys as data providers. The tile entity
* has to be fully initialized when executing this method (i.e. valid worldObj+coords).
*
* This method doesn't do anything if executed on the server.
*
* @param dataProvider Object implementing the INetworkDataProvider interface
*
* @deprecated no need to call this anymore, IC2 initiates it automatically
*/
@Deprecated
public static void requestInitialData(INetworkDataProvider dataProvider) {
//
}
/**
* Immediately send an event for the specified TileEntity to the server.
*
@@ -231,7 +188,6 @@ public final class NetworkHelper {
private static Method NetworkManager_updateTileEntityField;
private static Method NetworkManager_initiateTileEntityEvent;
private static Method NetworkManager_initiateItemEvent;
private static Method NetworkManager_announceBlockUpdate;
private static Method NetworkManager_initiateClientTileEntityEvent;
private static Method NetworkManager_initiateClientItemEvent;
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -9,13 +9,13 @@ import net.minecraft.item.ItemStack;
*
* @author Richard
*/
public interface IListRecipeManager extends Iterable<ItemStack> {
public interface IListRecipeManager extends Iterable<IRecipeInput> {
/**
* Adds a stack to the list.
*
* @param stack Stack to add
*/
public void add(ItemStack stack);
public void add(IRecipeInput input);
/**
* Checks whether the specified stack is in the list.
@@ -37,5 +37,5 @@ public interface IListRecipeManager extends Iterable<ItemStack> {
*
* @return List of stacks
*/
public List<ItemStack> getStacks();
public List<IRecipeInput> getInputs();
}
Binary file not shown.
@@ -1,15 +1,11 @@
package ic2.api.recipe;
import java.util.List;
import net.minecraft.item.ItemStack;
public interface IPatternStorage {
boolean addPattern(ItemStack itemstack);
boolean transferPattern(ItemStack itemstack, int amountUU , int amountEU);
int[] getPatternvalus(ItemStack itemstack);
short getPatternCount();
ItemStack getPatternItemstack(int index);
List<ItemStack> getPatterns();
}
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,54 @@
package ic2.api.recipe;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData;
import net.minecraftforge.fluids.FluidStack;
public class RecipeInputFluidContainer implements IRecipeInput {
public RecipeInputFluidContainer(Fluid fluid) {
this(fluid, FluidContainerRegistry.BUCKET_VOLUME);
}
public RecipeInputFluidContainer(Fluid fluid, int amount) {
this.fluid = fluid;
this.amount = amount;
}
@Override
public boolean matches(ItemStack subject) {
FluidStack fs = FluidContainerRegistry.getFluidForFilledItem(subject);
if (fs == null) return false;
return fs.getFluid() == fluid;
}
@Override
public int getAmount() {
return amount;
}
@Override
public List<ItemStack> getInputs() {
List<ItemStack> ret = new ArrayList<ItemStack>();
for (FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) {
if (data.fluid.getFluid() == fluid) ret.add(data.filledContainer);
}
return ret;
}
@Override
public String toString() {
return "RInputFluidContainer<"+amount+"x"+fluid.getName()+">";
}
public final Fluid fluid;
public final int amount;
}
@@ -13,6 +13,8 @@ public class RecipeInputItemStack implements IRecipeInput {
}
public RecipeInputItemStack(ItemStack aInput, int aAmount) {
if (aInput.getItem() == null) throw new IllegalArgumentException("Invalid item stack specfied");
input = aInput.copy(); // Never forget to copy.
amount = aAmount;
}
@@ -32,6 +34,13 @@ public class RecipeInputItemStack implements IRecipeInput {
return Arrays.asList(input);
}
@Override
public String toString() {
ItemStack stack = input.copy();
input.stackSize = amount;
return "RInputItemStack<"+stack+">";
}
public final ItemStack input;
public final int amount;
}
Binary file not shown.
@@ -12,8 +12,13 @@ public class RecipeInputOreDict implements IRecipeInput {
}
public RecipeInputOreDict(String input1, int amount1) {
this(input1, amount1, null);
}
public RecipeInputOreDict(String input1, int amount1, Integer meta) {
this.input = input1;
this.amount = amount1;
this.meta = meta;
}
@Override
@@ -21,8 +26,10 @@ public class RecipeInputOreDict implements IRecipeInput {
List<ItemStack> inputs = OreDictionary.getOres(input);
for (ItemStack input1 : inputs) {
if (subject.itemID == input1.itemID &&
(subject.getItemDamage() == input1.getItemDamage() || input1.getItemDamage() == OreDictionary.WILDCARD_VALUE)) {
int metaRequired = meta == null ? input1.getItemDamage() : meta;
if (subject.getItem() == input1.getItem() &&
(subject.getItemDamage() == metaRequired || metaRequired == OreDictionary.WILDCARD_VALUE)) {
return true;
}
}
@@ -40,6 +47,16 @@ public class RecipeInputOreDict implements IRecipeInput {
return OreDictionary.getOres(input);
}
@Override
public String toString() {
if (meta == null) {
return "RInputOreDict<"+amount+"x"+input+">";
} else {
return "RInputOreDict<"+amount+"x"+input+"@"+meta+">";
}
}
public final String input;
public final int amount;
public final Integer meta;
}
Binary file not shown.
Binary file not shown.
-1
View File
@@ -17,7 +17,6 @@ public class Recipes {
public static IMachineRecipeManager metalformerCutting;
public static IMachineRecipeManager metalformerRolling;
public static IMachineRecipeManager oreWashing;
public static IMachineRecipeManager Scanner;
public static ICannerBottleRecipeManager cannerBottle;
public static ICannerEnrichRecipeManager cannerEnrich;
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,6 @@
package ic2.api.tile;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.util.ForgeDirection;
/**
* Interface implemented by the tile entity of energy storage blocks.
Binary file not shown.
Loaded 100 of 220 files, more files were not shown because too many files have changed in this diff. Show more