mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-25 16:38:33 +01:00
-Liquid and Energy Phantomface
-InvTweaks API
This commit is contained in:
parent
5fd285d3bc
commit
9f7031fdfe
31 changed files with 683 additions and 23 deletions
|
@ -6,9 +6,7 @@ import ellpeck.actuallyadditions.ActuallyAdditions;
|
||||||
import ellpeck.actuallyadditions.inventory.GuiHandler;
|
import ellpeck.actuallyadditions.inventory.GuiHandler;
|
||||||
import ellpeck.actuallyadditions.tile.TileEntityPhantomPlacer;
|
import ellpeck.actuallyadditions.tile.TileEntityPhantomPlacer;
|
||||||
import ellpeck.actuallyadditions.tile.TileEntityPhantomface;
|
import ellpeck.actuallyadditions.tile.TileEntityPhantomface;
|
||||||
import ellpeck.actuallyadditions.util.BlockUtil;
|
import ellpeck.actuallyadditions.util.*;
|
||||||
import ellpeck.actuallyadditions.util.INameableItem;
|
|
||||||
import ellpeck.actuallyadditions.util.ModUtil;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
@ -92,6 +90,8 @@ public class BlockPhantomface extends BlockContainerBase implements INameableIte
|
||||||
return new TileEntityPhantomPlacer.TileEntityPhantomBreaker();
|
return new TileEntityPhantomPlacer.TileEntityPhantomBreaker();
|
||||||
case LIQUIFACE:
|
case LIQUIFACE:
|
||||||
return new TileEntityPhantomface.TileEntityPhantomLiquiface();
|
return new TileEntityPhantomface.TileEntityPhantomLiquiface();
|
||||||
|
case ENERGYFACE:
|
||||||
|
return new TileEntityPhantomface.TileEntityPhantomEnergyface();
|
||||||
default:
|
default:
|
||||||
return new TileEntityPhantomface.TileEntityPhantomItemface();
|
return new TileEntityPhantomface.TileEntityPhantomItemface();
|
||||||
}
|
}
|
||||||
|
@ -117,6 +117,8 @@ public class BlockPhantomface extends BlockContainerBase implements INameableIte
|
||||||
return "blockPhantomBreaker";
|
return "blockPhantomBreaker";
|
||||||
case LIQUIFACE:
|
case LIQUIFACE:
|
||||||
return "blockPhantomLiquiface";
|
return "blockPhantomLiquiface";
|
||||||
|
case ENERGYFACE:
|
||||||
|
return "blockPhantomEnergyface";
|
||||||
default:
|
default:
|
||||||
return "blockPhantomface";
|
return "blockPhantomface";
|
||||||
}
|
}
|
||||||
|
@ -148,6 +150,11 @@ public class BlockPhantomface extends BlockContainerBase implements INameableIte
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
BlockUtil.addInformation(theBlock, list, 2, "");
|
BlockUtil.addInformation(theBlock, list, 2, "");
|
||||||
|
if(KeyUtil.isShiftPressed() && ((BlockPhantomface)this.theBlock).type == LIQUIFACE){
|
||||||
|
list.add(StringUtil.ORANGE+StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomLiquiface.desc.3"));
|
||||||
|
list.add(StringUtil.ORANGE+StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomLiquiface.desc.4"));
|
||||||
|
list.add(StringUtil.ORANGE+StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomLiquiface.desc.5"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -46,15 +46,14 @@ public class BlockPlant extends BlockCrops implements INameableItem, IFactoryHar
|
||||||
@Override
|
@Override
|
||||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune){
|
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune){
|
||||||
ArrayList<ItemStack> ret = super.getDrops(world, x, y, z, metadata, fortune);
|
ArrayList<ItemStack> ret = super.getDrops(world, x, y, z, metadata, fortune);
|
||||||
if (metadata >= 7){
|
if(metadata >= 7){
|
||||||
for (int i = 0; i < 3 + fortune; ++i){
|
for(int i = 0; i < 3; ++i){
|
||||||
if (world.rand.nextInt(15) <= metadata){
|
if(world.rand.nextInt(15) <= metadata) ret.add(new ItemStack(this.seedItem));
|
||||||
ret.add(new ItemStack(this.seedItem));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(this == InitBlocks.blockCanola) ret.add(new ItemStack(this.returnItem.getItem(), new Random().nextInt(3)+3, this.returnItem.getItemDamage()));
|
if(this == InitBlocks.blockCanola) ret.add(new ItemStack(this.returnItem.getItem(), new Random().nextInt(3)+3, this.returnItem.getItemDamage()));
|
||||||
else ret.add(this.returnItem.copy());
|
else ret.add(this.returnItem.copy());
|
||||||
}
|
}
|
||||||
|
else ret.add(new ItemStack(this.seedItem));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,7 @@ public class InitBlocks{
|
||||||
public static Block blockPhantomPlacer;
|
public static Block blockPhantomPlacer;
|
||||||
public static Block blockPhantomBreaker;
|
public static Block blockPhantomBreaker;
|
||||||
public static Block blockPhantomLiquiface;
|
public static Block blockPhantomLiquiface;
|
||||||
|
public static Block blockPhantomEnergyface;
|
||||||
|
|
||||||
public static void init(){
|
public static void init(){
|
||||||
Util.logInfo("Initializing Blocks...");
|
Util.logInfo("Initializing Blocks...");
|
||||||
|
@ -75,6 +76,9 @@ public class InitBlocks{
|
||||||
blockPhantomLiquiface = new BlockPhantomface(BlockPhantomface.LIQUIFACE);
|
blockPhantomLiquiface = new BlockPhantomface(BlockPhantomface.LIQUIFACE);
|
||||||
BlockUtil.register(blockPhantomLiquiface, BlockPhantomface.TheItemBlock.class);
|
BlockUtil.register(blockPhantomLiquiface, BlockPhantomface.TheItemBlock.class);
|
||||||
|
|
||||||
|
blockPhantomEnergyface = new BlockPhantomface(BlockPhantomface.ENERGYFACE);
|
||||||
|
BlockUtil.register(blockPhantomEnergyface, BlockPhantomface.TheItemBlock.class);
|
||||||
|
|
||||||
blockPhantomBreaker = new BlockPhantomface(BlockPhantomface.BREAKER);
|
blockPhantomBreaker = new BlockPhantomface(BlockPhantomface.BREAKER);
|
||||||
BlockUtil.register(blockPhantomBreaker, BlockPhantomface.TheItemBlock.class);
|
BlockUtil.register(blockPhantomBreaker, BlockPhantomface.TheItemBlock.class);
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,7 @@ public class FoodCrafting{
|
||||||
|
|
||||||
//Chocolate
|
//Chocolate
|
||||||
if(ConfigCrafting.CHOCOLATE.isEnabled())
|
if(ConfigCrafting.CHOCOLATE.isEnabled())
|
||||||
GameRegistry.addRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.CHOCOLATE.ordinal()),
|
GameRegistry.addRecipe(new ItemStack(InitItems.itemFoods, 3, TheFoods.CHOCOLATE.ordinal()),
|
||||||
"C C", "CMC", "C C",
|
"C C", "CMC", "C C",
|
||||||
'C', new ItemStack(Items.dye, 1, 3),
|
'C', new ItemStack(Items.dye, 1, 3),
|
||||||
'M', new ItemStack(Items.milk_bucket));
|
'M', new ItemStack(Items.milk_bucket));
|
||||||
|
|
|
@ -27,6 +27,8 @@ public class CreativeTab extends CreativeTabs{
|
||||||
this.list = list;
|
this.list = list;
|
||||||
|
|
||||||
this.addBlock(InitBlocks.blockPhantomface);
|
this.addBlock(InitBlocks.blockPhantomface);
|
||||||
|
this.addBlock(InitBlocks.blockPhantomEnergyface);
|
||||||
|
this.addBlock(InitBlocks.blockPhantomLiquiface);
|
||||||
this.addBlock(InitBlocks.blockPhantomPlacer);
|
this.addBlock(InitBlocks.blockPhantomPlacer);
|
||||||
this.addBlock(InitBlocks.blockPhantomBreaker);
|
this.addBlock(InitBlocks.blockPhantomBreaker);
|
||||||
this.addBlock(InitBlocks.blockInputter);
|
this.addBlock(InitBlocks.blockInputter);
|
||||||
|
|
|
@ -15,6 +15,7 @@ public class RenderPlayerEventAA{
|
||||||
private RenderSpecial hoseRender = new RenderSpecial(new ModelTorch());
|
private RenderSpecial hoseRender = new RenderSpecial(new ModelTorch());
|
||||||
//private RenderSpecial paktoRender = new RenderSpecial(new ModelStandardBlock("Pakto"));
|
//private RenderSpecial paktoRender = new RenderSpecial(new ModelStandardBlock("Pakto"));
|
||||||
private RenderSpecial glenRender = new RenderSpecial(new ModelStandardBlock("Glenthor"));
|
private RenderSpecial glenRender = new RenderSpecial(new ModelStandardBlock("Glenthor"));
|
||||||
|
private RenderSpecial lordiRender = new RenderSpecial(new ModelStandardBlock("Lordi"));
|
||||||
|
|
||||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||||
public void RenderPlayerEvent(RenderPlayerEvent.Pre event){
|
public void RenderPlayerEvent(RenderPlayerEvent.Pre event){
|
||||||
|
@ -41,6 +42,11 @@ public class RenderPlayerEventAA{
|
||||||
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("cb7b293a-5031-484e-b5be-b4f2f4e92726"))){
|
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("cb7b293a-5031-484e-b5be-b4f2f4e92726"))){
|
||||||
hoseRender.render(event.entityPlayer, event.partialRenderTick, 0.5F, 1.3F);
|
hoseRender.render(event.entityPlayer, event.partialRenderTick, 0.5F, 1.3F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Lordhallo
|
||||||
|
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("990ecf6d-15dd-442c-b91b-323a6420c78e"))){
|
||||||
|
lordiRender.render(event.entityPlayer, event.partialRenderTick, 0.3F, 1F);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,9 @@ public class HairyBallHandler{
|
||||||
addReturn(new ItemStack(Items.diamond), 2);
|
addReturn(new ItemStack(Items.diamond), 2);
|
||||||
addReturn(new ItemStack(Items.name_tag), 1);
|
addReturn(new ItemStack(Items.name_tag), 1);
|
||||||
addReturn(new ItemStack(Items.fish), 80);
|
addReturn(new ItemStack(Items.fish), 80);
|
||||||
|
addReturn(new ItemStack(Items.fish, 1), 60);
|
||||||
|
addReturn(new ItemStack(Items.fish, 2), 10);
|
||||||
|
addReturn(new ItemStack(Items.fish, 3), 40);
|
||||||
addReturn(new ItemStack(Items.feather), 60);
|
addReturn(new ItemStack(Items.feather), 60);
|
||||||
addReturn(new ItemStack(Items.leather), 30);
|
addReturn(new ItemStack(Items.leather), 30);
|
||||||
addReturn(new ItemStack(Items.dye), 70);
|
addReturn(new ItemStack(Items.dye), 70);
|
||||||
|
|
|
@ -33,6 +33,7 @@ public class TileEntityBase extends TileEntity{
|
||||||
GameRegistry.registerTileEntity(TileEntityCoalGenerator.class, ModUtil.MOD_ID_LOWER + ":tileEntityCoalGenerator");
|
GameRegistry.registerTileEntity(TileEntityCoalGenerator.class, ModUtil.MOD_ID_LOWER + ":tileEntityCoalGenerator");
|
||||||
GameRegistry.registerTileEntity(TileEntityPhantomface.TileEntityPhantomItemface.class, ModUtil.MOD_ID_LOWER + ":tileEntityPhantomItemface");
|
GameRegistry.registerTileEntity(TileEntityPhantomface.TileEntityPhantomItemface.class, ModUtil.MOD_ID_LOWER + ":tileEntityPhantomItemface");
|
||||||
GameRegistry.registerTileEntity(TileEntityPhantomface.TileEntityPhantomLiquiface.class, ModUtil.MOD_ID_LOWER + ":tileEntityPhantomLiquiface");
|
GameRegistry.registerTileEntity(TileEntityPhantomface.TileEntityPhantomLiquiface.class, ModUtil.MOD_ID_LOWER + ":tileEntityPhantomLiquiface");
|
||||||
|
GameRegistry.registerTileEntity(TileEntityPhantomface.TileEntityPhantomEnergyface.class, ModUtil.MOD_ID_LOWER + ":tileEntityPhantomEnergyface");
|
||||||
GameRegistry.registerTileEntity(TileEntityPhantomPlacer.class, ModUtil.MOD_ID_LOWER + ":tileEntityPhantomPlacer");
|
GameRegistry.registerTileEntity(TileEntityPhantomPlacer.class, ModUtil.MOD_ID_LOWER + ":tileEntityPhantomPlacer");
|
||||||
GameRegistry.registerTileEntity(TileEntityPhantomPlacer.TileEntityPhantomBreaker.class, ModUtil.MOD_ID_LOWER + ":tileEntityPhantomBreaker");
|
GameRegistry.registerTileEntity(TileEntityPhantomPlacer.TileEntityPhantomBreaker.class, ModUtil.MOD_ID_LOWER + ":tileEntityPhantomBreaker");
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,7 +159,7 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDrain(ForgeDirection from, Fluid fluid){
|
public boolean canDrain(ForgeDirection from, Fluid fluid){
|
||||||
return true;
|
return from != ForgeDirection.UP;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package ellpeck.actuallyadditions.tile;
|
package ellpeck.actuallyadditions.tile;
|
||||||
|
|
||||||
import cofh.api.energy.EnergyStorage;
|
import cofh.api.energy.EnergyStorage;
|
||||||
import cofh.api.energy.IEnergyReceiver;
|
import cofh.api.energy.IEnergyProvider;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||||
|
@ -11,7 +11,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntityFurnace;
|
import net.minecraft.tileentity.TileEntityFurnace;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class TileEntityCoalGenerator extends TileEntityInventoryBase implements IEnergyReceiver{
|
public class TileEntityCoalGenerator extends TileEntityInventoryBase implements IEnergyProvider{
|
||||||
|
|
||||||
public EnergyStorage storage = new EnergyStorage(60000, energyProducedPerTick+50);
|
public EnergyStorage storage = new EnergyStorage(60000, energyProducedPerTick+50);
|
||||||
|
|
||||||
|
@ -96,8 +96,8 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate){
|
public int extractEnergy(ForgeDirection from, int maxReceive, boolean simulate){
|
||||||
return this.storage.receiveEnergy(maxReceive, simulate);
|
return this.storage.extractEnergy(maxReceive, simulate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -138,7 +138,7 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDrain(ForgeDirection from, Fluid fluid){
|
public boolean canDrain(ForgeDirection from, Fluid fluid){
|
||||||
return fluid == InitBlocks.fluidOil;
|
return from != ForgeDirection.UP && fluid == InitBlocks.fluidOil;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -154,7 +154,7 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canFill(ForgeDirection from, Fluid fluid){
|
public boolean canFill(ForgeDirection from, Fluid fluid){
|
||||||
return fluid == InitBlocks.fluidOil;
|
return from != ForgeDirection.DOWN && fluid == InitBlocks.fluidOil;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
package ellpeck.actuallyadditions.tile;
|
package ellpeck.actuallyadditions.tile;
|
||||||
|
|
||||||
|
import cofh.api.energy.IEnergyHandler;
|
||||||
|
import cofh.api.energy.IEnergyProvider;
|
||||||
|
import cofh.api.energy.IEnergyReceiver;
|
||||||
import ellpeck.actuallyadditions.blocks.BlockPhantomface;
|
import ellpeck.actuallyadditions.blocks.BlockPhantomface;
|
||||||
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||||
|
import ellpeck.actuallyadditions.util.WorldUtil;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.inventory.ISidedInventory;
|
import net.minecraft.inventory.ISidedInventory;
|
||||||
|
@ -124,6 +128,40 @@ public class TileEntityPhantomface extends TileEntityInventoryBase{
|
||||||
this.type = BlockPhantomface.LIQUIFACE;
|
this.type = BlockPhantomface.LIQUIFACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateEntity(){
|
||||||
|
super.updateEntity();
|
||||||
|
|
||||||
|
if(!worldObj.isRemote){
|
||||||
|
if(this.isBoundTileInRage() && this.getHandler() != null){
|
||||||
|
this.pushFluid(ForgeDirection.UP);
|
||||||
|
this.pushFluid(ForgeDirection.DOWN);
|
||||||
|
this.pushFluid(ForgeDirection.NORTH);
|
||||||
|
this.pushFluid(ForgeDirection.EAST);
|
||||||
|
this.pushFluid(ForgeDirection.SOUTH);
|
||||||
|
this.pushFluid(ForgeDirection.WEST);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void pushFluid(ForgeDirection side){
|
||||||
|
TileEntity tile = WorldUtil.getTileEntityFromSide(side, worldObj, xCoord, yCoord, zCoord);
|
||||||
|
if(tile != null && tile instanceof IFluidHandler){
|
||||||
|
for(FluidTankInfo myInfo : this.getTankInfo(side)){
|
||||||
|
for(FluidTankInfo hisInfo : ((IFluidHandler)tile).getTankInfo(side.getOpposite())){
|
||||||
|
if(myInfo != null && hisInfo != null && myInfo.fluid != null){
|
||||||
|
if(((IFluidHandler)tile).canFill(side.getOpposite(), myInfo.fluid.getFluid()) && this.canDrain(side, myInfo.fluid.getFluid())){
|
||||||
|
FluidStack receive = this.drain(side, Math.min(hisInfo.capacity-(hisInfo.fluid == null ? 0 : hisInfo.fluid.amount), myInfo.fluid.amount), false);
|
||||||
|
int actualReceive = ((IFluidHandler)tile).fill(side.getOpposite(), receive, true);
|
||||||
|
this.drain(side, new FluidStack(receive.getFluid(), actualReceive), true);
|
||||||
|
worldObj.markBlockForUpdate(xCoord+side.offsetX, yCoord+side.offsetY, zCoord+side.offsetZ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canConnectTo(TileEntity tile){
|
public boolean canConnectTo(TileEntity tile){
|
||||||
return tile instanceof IFluidHandler;
|
return tile instanceof IFluidHandler;
|
||||||
|
@ -177,6 +215,105 @@ public class TileEntityPhantomface extends TileEntityInventoryBase{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class TileEntityPhantomEnergyface extends TileEntityPhantomface implements IEnergyHandler{
|
||||||
|
|
||||||
|
public TileEntityPhantomEnergyface(){
|
||||||
|
super("energyface");
|
||||||
|
this.type = BlockPhantomface.ENERGYFACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateEntity(){
|
||||||
|
super.updateEntity();
|
||||||
|
|
||||||
|
if(!worldObj.isRemote){
|
||||||
|
if(this.isBoundTileInRage() && this.getProvider() != null){
|
||||||
|
this.pushEnergy(ForgeDirection.UP);
|
||||||
|
this.pushEnergy(ForgeDirection.DOWN);
|
||||||
|
this.pushEnergy(ForgeDirection.NORTH);
|
||||||
|
this.pushEnergy(ForgeDirection.EAST);
|
||||||
|
this.pushEnergy(ForgeDirection.SOUTH);
|
||||||
|
this.pushEnergy(ForgeDirection.WEST);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void pushEnergy(ForgeDirection side){
|
||||||
|
TileEntity tile = WorldUtil.getTileEntityFromSide(side, worldObj, xCoord, yCoord, zCoord);
|
||||||
|
if(tile != null && tile instanceof IEnergyReceiver && this.getProvider().getEnergyStored(ForgeDirection.UNKNOWN) > 0){
|
||||||
|
if(((IEnergyReceiver)tile).canConnectEnergy(side.getOpposite()) && this.canConnectEnergy(side)){
|
||||||
|
int receive = this.extractEnergy(side, Math.min(((IEnergyReceiver)tile).getMaxEnergyStored(ForgeDirection.UNKNOWN)-((IEnergyReceiver)tile).getEnergyStored(ForgeDirection.UNKNOWN), this.getEnergyStored(ForgeDirection.UNKNOWN)), true);
|
||||||
|
int actualReceive = ((IEnergyReceiver)tile).receiveEnergy(side.getOpposite(), receive, false);
|
||||||
|
this.extractEnergy(side, actualReceive, false);
|
||||||
|
worldObj.markBlockForUpdate(xCoord+side.offsetX, yCoord+side.offsetY, zCoord+side.offsetZ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canConnectTo(TileEntity tile){
|
||||||
|
return tile instanceof IEnergyProvider || tile instanceof IEnergyReceiver;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnergyProvider getProvider(){
|
||||||
|
TileEntity tile = boundTile.getWorldObj().getTileEntity(boundTile.xCoord, boundTile.yCoord, boundTile.zCoord);
|
||||||
|
if(tile != null && tile instanceof IEnergyProvider){
|
||||||
|
return (IEnergyProvider)tile;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnergyReceiver getReceiver(){
|
||||||
|
TileEntity tile = boundTile.getWorldObj().getTileEntity(boundTile.xCoord, boundTile.yCoord, boundTile.zCoord);
|
||||||
|
if(tile != null && tile instanceof IEnergyReceiver){
|
||||||
|
return (IEnergyReceiver)tile;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasBoundTile(){
|
||||||
|
return super.hasBoundTile() && (this.boundTile instanceof IEnergyReceiver || this.boundTile instanceof IEnergyProvider);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate){
|
||||||
|
return this.isBoundTileInRage() && this.getReceiver() != null ? this.getReceiver().receiveEnergy(from, maxReceive, simulate) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate){
|
||||||
|
return this.isBoundTileInRage() && this.getProvider() != null ? this.getProvider().extractEnergy(from, maxExtract, simulate) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getEnergyStored(ForgeDirection from){
|
||||||
|
if(this.isBoundTileInRage()){
|
||||||
|
if(this.getProvider() != null) return this.getProvider().getEnergyStored(from);
|
||||||
|
if(this.getReceiver() != null) return this.getReceiver().getEnergyStored(from);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMaxEnergyStored(ForgeDirection from){
|
||||||
|
if(this.isBoundTileInRage()){
|
||||||
|
if(this.getProvider() != null) return this.getProvider().getMaxEnergyStored(from);
|
||||||
|
if(this.getReceiver() != null) return this.getReceiver().getMaxEnergyStored(from);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canConnectEnergy(ForgeDirection from){
|
||||||
|
if(this.isBoundTileInRage()){
|
||||||
|
if(this.getProvider() != null) return this.getProvider().canConnectEnergy(from);
|
||||||
|
if(this.getReceiver() != null) return this.getReceiver().canConnectEnergy(from);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static class TileEntityPhantomItemface extends TileEntityPhantomface{
|
public static class TileEntityPhantomItemface extends TileEntityPhantomface{
|
||||||
|
|
||||||
public TileEntityPhantomItemface(){
|
public TileEntityPhantomItemface(){
|
||||||
|
|
|
@ -43,12 +43,12 @@ public class UpdateChecker{
|
||||||
if(update > client){
|
if(update > client){
|
||||||
String notice1 = "info." + ModUtil.MOD_ID_LOWER + ".update.generic.desc";
|
String notice1 = "info." + ModUtil.MOD_ID_LOWER + ".update.generic.desc";
|
||||||
String notice2 = "info." + ModUtil.MOD_ID_LOWER + ".update.versionComp.desc";
|
String notice2 = "info." + ModUtil.MOD_ID_LOWER + ".update.versionComp.desc";
|
||||||
String notice3 = "info." + ModUtil.MOD_ID_LOWER + ".update.download.desc";
|
String notice3 = "info." + ModUtil.MOD_ID_LOWER + ".update.changelog.desc";
|
||||||
String notice4 = "info." + ModUtil.MOD_ID_LOWER + ".update.changelog.txt.desc";
|
String notice4 = "info." + ModUtil.MOD_ID_LOWER + ".update.download.desc";
|
||||||
player.addChatComponentMessage(IChatComponent.Serializer.func_150699_a(StatCollector.translateToLocal(notice1)));
|
player.addChatComponentMessage(IChatComponent.Serializer.func_150699_a(StatCollector.translateToLocal(notice1)));
|
||||||
player.addChatComponentMessage(IChatComponent.Serializer.func_150699_a(StatCollector.translateToLocalFormatted(notice2, ModUtil.VERSION, this.onlineVersion)));
|
player.addChatComponentMessage(IChatComponent.Serializer.func_150699_a(StatCollector.translateToLocalFormatted(notice2, ModUtil.VERSION, this.onlineVersion)));
|
||||||
player.addChatComponentMessage(IChatComponent.Serializer.func_150699_a(StatCollector.translateToLocalFormatted(notice3, "http://minecraft.curseforge.com/mc-mods/228404-actually-additions/files")));
|
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocalFormatted(notice3, changelog)));
|
||||||
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocalFormatted(notice4, changelog)));
|
player.addChatComponentMessage(IChatComponent.Serializer.func_150699_a(StatCollector.translateToLocalFormatted(notice4, "http://minecraft.curseforge.com/mc-mods/228404-actually-additions/files")));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class WorldUtil{
|
||||||
|
|
||||||
public static void pushEnergy(World world, int x, int y, int z, ForgeDirection side, EnergyStorage storage){
|
public static void pushEnergy(World world, int x, int y, int z, ForgeDirection side, EnergyStorage storage){
|
||||||
TileEntity tile = getTileEntityFromSide(side, world, x, y, z);
|
TileEntity tile = getTileEntityFromSide(side, world, x, y, z);
|
||||||
if(tile != null && tile instanceof IEnergyReceiver){
|
if(tile != null && tile instanceof IEnergyReceiver && storage.getEnergyStored() > 0){
|
||||||
if(((IEnergyReceiver)tile).canConnectEnergy(side.getOpposite())){
|
if(((IEnergyReceiver)tile).canConnectEnergy(side.getOpposite())){
|
||||||
int receive = ((IEnergyReceiver)tile).receiveEnergy(side.getOpposite(), Math.min(storage.getMaxExtract(), storage.getEnergyStored()), false);
|
int receive = ((IEnergyReceiver)tile).receiveEnergy(side.getOpposite(), Math.min(storage.getMaxExtract(), storage.getEnergyStored()), false);
|
||||||
storage.extractEnergy(receive, false);
|
storage.extractEnergy(receive, false);
|
||||||
|
|
68
src/main/java/invtweaks/api/IItemTree.java
Normal file
68
src/main/java/invtweaks/api/IItemTree.java
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2013 Andrew Crocker
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package invtweaks.api;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public interface IItemTree {
|
||||||
|
void registerOre(String category, String name, String oreName, int order);
|
||||||
|
|
||||||
|
boolean matches(List<IItemTreeItem> items, String keyword);
|
||||||
|
|
||||||
|
boolean isKeywordValid(String keyword);
|
||||||
|
|
||||||
|
Collection<IItemTreeCategory> getAllCategories();
|
||||||
|
|
||||||
|
IItemTreeCategory getRootCategory();
|
||||||
|
|
||||||
|
void setRootCategory(IItemTreeCategory category);
|
||||||
|
|
||||||
|
IItemTreeCategory getCategory(String keyword);
|
||||||
|
|
||||||
|
boolean isItemUnknown(String id, int damage);
|
||||||
|
|
||||||
|
List<IItemTreeItem> getItems(String id, int damage);
|
||||||
|
|
||||||
|
List<IItemTreeItem> getItems(String name);
|
||||||
|
|
||||||
|
IItemTreeItem getRandomItem(Random r);
|
||||||
|
|
||||||
|
boolean containsItem(String name);
|
||||||
|
|
||||||
|
boolean containsCategory(String name);
|
||||||
|
|
||||||
|
IItemTreeCategory addCategory(String parentCategory, String newCategory) throws NullPointerException;
|
||||||
|
|
||||||
|
void addCategory(String parentCategory, IItemTreeCategory newCategory) throws NullPointerException;
|
||||||
|
|
||||||
|
IItemTreeItem addItem(String parentCategory, String name, String id, int damage, int order)
|
||||||
|
throws NullPointerException;
|
||||||
|
|
||||||
|
void addItem(String parentCategory, IItemTreeItem newItem) throws NullPointerException;
|
||||||
|
|
||||||
|
int getKeywordDepth(String keyword);
|
||||||
|
|
||||||
|
int getKeywordOrder(String keyword);
|
||||||
|
}
|
46
src/main/java/invtweaks/api/IItemTreeCategory.java
Normal file
46
src/main/java/invtweaks/api/IItemTreeCategory.java
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2013 Andrew Crocker
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package invtweaks.api;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface IItemTreeCategory {
|
||||||
|
boolean contains(IItemTreeItem item);
|
||||||
|
|
||||||
|
void addCategory(IItemTreeCategory category);
|
||||||
|
|
||||||
|
void addItem(IItemTreeItem item);
|
||||||
|
|
||||||
|
Collection<IItemTreeCategory> getSubCategories();
|
||||||
|
|
||||||
|
Collection<List<IItemTreeItem>> getItems();
|
||||||
|
|
||||||
|
String getName();
|
||||||
|
|
||||||
|
int getCategoryOrder();
|
||||||
|
|
||||||
|
int findCategoryOrder(String keyword);
|
||||||
|
|
||||||
|
int findKeywordDepth(String keyword);
|
||||||
|
}
|
33
src/main/java/invtweaks/api/IItemTreeItem.java
Normal file
33
src/main/java/invtweaks/api/IItemTreeItem.java
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2013 Andrew Crocker
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package invtweaks.api;
|
||||||
|
|
||||||
|
public interface IItemTreeItem extends Comparable<IItemTreeItem> {
|
||||||
|
String getName();
|
||||||
|
|
||||||
|
String getId();
|
||||||
|
|
||||||
|
int getDamage();
|
||||||
|
|
||||||
|
int getOrder();
|
||||||
|
}
|
29
src/main/java/invtweaks/api/IItemTreeListener.java
Normal file
29
src/main/java/invtweaks/api/IItemTreeListener.java
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2013 Andrew Crocker
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package invtweaks.api;
|
||||||
|
|
||||||
|
import java.util.EventListener;
|
||||||
|
|
||||||
|
public interface IItemTreeListener extends EventListener {
|
||||||
|
void onTreeLoaded(IItemTree tree);
|
||||||
|
}
|
84
src/main/java/invtweaks/api/InvTweaksAPI.java
Normal file
84
src/main/java/invtweaks/api/InvTweaksAPI.java
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2013 Andrew Crocker
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package invtweaks.api;
|
||||||
|
|
||||||
|
import invtweaks.api.container.ContainerSection;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface to access functions exposed by Inventory Tweaks
|
||||||
|
* <p/>
|
||||||
|
* The main @Mod instance of the mod implements this interface, so a refernce to it can
|
||||||
|
* be obtained via @Instance("inventorytweaks") or methods in net.minecraftforge.fml.common.Loader
|
||||||
|
* <p/>
|
||||||
|
* All of these functions currently have no effect if called on a dedicated server.
|
||||||
|
*/
|
||||||
|
public interface InvTweaksAPI {
|
||||||
|
/**
|
||||||
|
* Add a listener for ItemTree load events
|
||||||
|
*
|
||||||
|
* @param listener
|
||||||
|
*/
|
||||||
|
void addOnLoadListener(IItemTreeListener listener);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove a listener for ItemTree load events
|
||||||
|
*
|
||||||
|
* @param listener
|
||||||
|
* @return true if the listener was previously added
|
||||||
|
*/
|
||||||
|
boolean removeOnLoadListener(IItemTreeListener listener);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle sorting shortcut state.
|
||||||
|
*
|
||||||
|
* @param enabled
|
||||||
|
*/
|
||||||
|
void setSortKeyEnabled(boolean enabled);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle sorting shortcut supression.
|
||||||
|
* Unlike setSortKeyEnabled, this flag is automatically cleared when GUIs are closed.
|
||||||
|
*
|
||||||
|
* @param enabled
|
||||||
|
*/
|
||||||
|
void setTextboxMode(boolean enabled);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compare two items using the default (non-rule based) algorithm,
|
||||||
|
* sutable for an implementation of Comparator<ItemStack>.
|
||||||
|
*
|
||||||
|
* @param i
|
||||||
|
* @param j
|
||||||
|
* @return A value with a sign representing the relative order of the item stacks
|
||||||
|
*/
|
||||||
|
int compareItems(ItemStack i, ItemStack j);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initiate a sort as if the player had clicked on a sorting button or pressed the sort key.
|
||||||
|
*
|
||||||
|
* @param section
|
||||||
|
* @param method
|
||||||
|
*/
|
||||||
|
void sort(ContainerSection section, SortingMethod method);
|
||||||
|
}
|
51
src/main/java/invtweaks/api/SortingMethod.java
Normal file
51
src/main/java/invtweaks/api/SortingMethod.java
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2013 Andrew Crocker
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package invtweaks.api;
|
||||||
|
|
||||||
|
public enum SortingMethod {
|
||||||
|
/**
|
||||||
|
* Standard 'r' sorting for generic inventories
|
||||||
|
*/
|
||||||
|
DEFAULT,
|
||||||
|
/**
|
||||||
|
* Sort method creating vertical columns of items.
|
||||||
|
* Used for chests only, requires container to have a valid row size for correct results.
|
||||||
|
*/
|
||||||
|
VERTICAL,
|
||||||
|
/**
|
||||||
|
* Sort method creating horizontal rows of items.
|
||||||
|
* Used for chests only, requires container to have a valid row size for correct results.
|
||||||
|
*/
|
||||||
|
HORIZONTAL,
|
||||||
|
/**
|
||||||
|
* Sort method for player inventory.
|
||||||
|
* Applies to extra player-specified sorting rules for the main inventory.
|
||||||
|
* Will always operate on main inventory.
|
||||||
|
*/
|
||||||
|
INVENTORY,
|
||||||
|
/**
|
||||||
|
* Attempts to even the number of items in each stack of the same type of item, without moving full stacks.
|
||||||
|
* Used in crafting grid sorting.
|
||||||
|
*/
|
||||||
|
EVEN_STACKS,
|
||||||
|
}
|
38
src/main/java/invtweaks/api/container/ChestContainer.java
Normal file
38
src/main/java/invtweaks/api/container/ChestContainer.java
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
package invtweaks.api.container;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A marker for containers that have a chest-like persistant storage component. Enables the Inventroy Tweaks sorting
|
||||||
|
* buttons for this container.
|
||||||
|
*/
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target(ElementType.TYPE)
|
||||||
|
public @interface ChestContainer {
|
||||||
|
// Set to true if the Inventory Tweaks sorting buttons should be shown for this container.
|
||||||
|
boolean showButtons() default true;
|
||||||
|
|
||||||
|
// Size of a chest row
|
||||||
|
int rowSize() default 9;
|
||||||
|
|
||||||
|
// Uses 'large chest' mode for sorting buttons
|
||||||
|
// (Renders buttons vertically down the right side of the GUI)
|
||||||
|
boolean isLargeChest() default false;
|
||||||
|
|
||||||
|
// Annotation for method to get size of a chest row if it is not a fixed size for this container class
|
||||||
|
// Signature int func()
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target(ElementType.METHOD)
|
||||||
|
@interface RowSizeCallback {
|
||||||
|
}
|
||||||
|
|
||||||
|
// Annotation for method to get size of a chest row if it is not a fixed size for this container class
|
||||||
|
// Signature int func()
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target(ElementType.METHOD)
|
||||||
|
@interface IsLargeCallback {
|
||||||
|
}
|
||||||
|
}
|
88
src/main/java/invtweaks/api/container/ContainerSection.java
Normal file
88
src/main/java/invtweaks/api/container/ContainerSection.java
Normal file
|
@ -0,0 +1,88 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2013 Andrew Crocker
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package invtweaks.api.container;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Names for specific parts of containers. For unknown container types (such as mod containers), only INVENTORY and
|
||||||
|
* CHEST sections are available.
|
||||||
|
*/
|
||||||
|
public enum ContainerSection {
|
||||||
|
/**
|
||||||
|
* The player's inventory
|
||||||
|
*/
|
||||||
|
INVENTORY,
|
||||||
|
/**
|
||||||
|
* The player's inventory (only the hotbar)
|
||||||
|
*/
|
||||||
|
INVENTORY_HOTBAR,
|
||||||
|
/**
|
||||||
|
* The player's inventory (all except the hotbar)
|
||||||
|
*/
|
||||||
|
INVENTORY_NOT_HOTBAR,
|
||||||
|
/**
|
||||||
|
* The chest or dispenser contents. Also used for unknown container contents.
|
||||||
|
*/
|
||||||
|
CHEST,
|
||||||
|
/**
|
||||||
|
* The crafting input
|
||||||
|
*/
|
||||||
|
CRAFTING_IN,
|
||||||
|
/**
|
||||||
|
* The crafting input, for containters that store it internally
|
||||||
|
*/
|
||||||
|
CRAFTING_IN_PERSISTENT,
|
||||||
|
/**
|
||||||
|
* The crafting output
|
||||||
|
*/
|
||||||
|
CRAFTING_OUT,
|
||||||
|
/**
|
||||||
|
* The armor slots
|
||||||
|
*/
|
||||||
|
ARMOR,
|
||||||
|
/**
|
||||||
|
* The furnace input
|
||||||
|
*/
|
||||||
|
FURNACE_IN,
|
||||||
|
/**
|
||||||
|
* The furnace output
|
||||||
|
*/
|
||||||
|
FURNACE_OUT,
|
||||||
|
/**
|
||||||
|
* The furnace fuel
|
||||||
|
*/
|
||||||
|
FURNACE_FUEL,
|
||||||
|
/**
|
||||||
|
* The enchantment table slot
|
||||||
|
*/
|
||||||
|
ENCHANTMENT,
|
||||||
|
/**
|
||||||
|
* The three bottles slots in brewing tables
|
||||||
|
* NOTE: Do not use without also using BREWING_INGREDIENT.
|
||||||
|
*/
|
||||||
|
BREWING_BOTTLES,
|
||||||
|
/**
|
||||||
|
* The top slot in brewing tables
|
||||||
|
* NOTE: Do not use without also using BREWING_BOTTLES.
|
||||||
|
*/
|
||||||
|
BREWING_INGREDIENT
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package invtweaks.api.container;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A marker for a method to call which returns the set of ContainerSections for this container.
|
||||||
|
* <p/>
|
||||||
|
* Signature of the method should be Map<ContainerSection, List<Slot>> func()
|
||||||
|
*/
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target(ElementType.METHOD)
|
||||||
|
public @interface ContainerSectionCallback {
|
||||||
|
}
|
15
src/main/java/invtweaks/api/container/IgnoreContainer.java
Normal file
15
src/main/java/invtweaks/api/container/IgnoreContainer.java
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
package invtweaks.api.container;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use this annotation to override inherited annotation properties and mark a Container as unsortable.
|
||||||
|
* This effect is inherited as well.
|
||||||
|
*/
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target(ElementType.TYPE)
|
||||||
|
public @interface IgnoreContainer {
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package invtweaks.api.container;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A marker for containers that need special treatment, such as crafting inputs or alternate player inventory positions,
|
||||||
|
* but do not have a chest-like component.
|
||||||
|
* <p/>
|
||||||
|
* Does not enable the Inventory Tweaks sorting buttons for this container.
|
||||||
|
*/
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target(ElementType.TYPE)
|
||||||
|
public @interface InventoryContainer {
|
||||||
|
// Set to true if the Inventory Tweaks options button should be shown for this container.
|
||||||
|
// (For instance, if you are replacing a vanilla container such as the player's inventory)
|
||||||
|
boolean showOptions() default true;
|
||||||
|
}
|
|
@ -55,6 +55,17 @@ tile.actuallyadditions.blockPhantomface.name=Phantomface
|
||||||
tooltip.actuallyadditions.blockPhantomface.desc.1=Like a Hopper-Chain, only Wireless! Connect me with a Phantom Connector!
|
tooltip.actuallyadditions.blockPhantomface.desc.1=Like a Hopper-Chain, only Wireless! Connect me with a Phantom Connector!
|
||||||
tooltip.actuallyadditions.blockPhantomface.desc.2=Input things into me to input into connected Blocks!
|
tooltip.actuallyadditions.blockPhantomface.desc.2=Input things into me to input into connected Blocks!
|
||||||
|
|
||||||
|
tile.actuallyadditions.blockPhantomEnergyface.name=Phantom Energyface
|
||||||
|
tooltip.actuallyadditions.blockPhantomEnergyface.desc.1=Like a Conduit, only Wireless! Connect me with a Phantom Connector!
|
||||||
|
tooltip.actuallyadditions.blockPhantomEnergyface.desc.2=Put RF through me!
|
||||||
|
|
||||||
|
tile.actuallyadditions.blockPhantomLiquiface.name=Phantom Liquiface
|
||||||
|
tooltip.actuallyadditions.blockPhantomLiquiface.desc.1=Like a Pipe, only Wireless! Connect me with a Phantom Connector!
|
||||||
|
tooltip.actuallyadditions.blockPhantomLiquiface.desc.2=Put Fluids through me! Auto-Outputs too!
|
||||||
|
tooltip.actuallyadditions.blockPhantomLiquiface.desc.3=Important: When having a linked Fluid Container that can input and output
|
||||||
|
tooltip.actuallyadditions.blockPhantomLiquiface.desc.4=the same Fluid, set possible Pipes to Input/Output Only Mode,
|
||||||
|
tooltip.actuallyadditions.blockPhantomLiquiface.desc.5=otherwise fluids will flow back and forward indefinitely!
|
||||||
|
|
||||||
tile.actuallyadditions.blockPhantomPlacer.name=Phantom Placer
|
tile.actuallyadditions.blockPhantomPlacer.name=Phantom Placer
|
||||||
tooltip.actuallyadditions.blockPhantomPlacer.desc.1=Places Blocks from a distance! Connect me with a Phantom Connector!
|
tooltip.actuallyadditions.blockPhantomPlacer.desc.1=Places Blocks from a distance! Connect me with a Phantom Connector!
|
||||||
tooltip.actuallyadditions.blockPhantomPlacer.desc.2=Sneak-Right-Click with an empty hand to see its Connections!
|
tooltip.actuallyadditions.blockPhantomPlacer.desc.2=Sneak-Right-Click with an empty hand to see its Connections!
|
||||||
|
@ -311,7 +322,7 @@ tooltip.actuallyadditions.itemFoodChocolateCake.desc=Looks delicious. With redbe
|
||||||
tooltip.actuallyadditions.itemFoodNoodle.desc=Just one. Like... that's not much.
|
tooltip.actuallyadditions.itemFoodNoodle.desc=Just one. Like... that's not much.
|
||||||
tooltip.actuallyadditions.itemFoodSpaghetti.desc=The most generic food ever. So clichée.
|
tooltip.actuallyadditions.itemFoodSpaghetti.desc=The most generic food ever. So clichée.
|
||||||
tooltip.actuallyadditions.itemFoodFrenchFry.desc=French. Fry.
|
tooltip.actuallyadditions.itemFoodFrenchFry.desc=French. Fry.
|
||||||
tooltip.actuallyadditions.itemFoodFrenchFries.desc=Much like French Fires, but actually taste good.
|
tooltip.actuallyadditions.itemFoodFrenchFries.desc=Much like French Fires, not as hot though...
|
||||||
tooltip.actuallyadditions.itemFoodFishNChips.desc=It's Fish. It's Chips. Or French Fries. Whatevs.
|
tooltip.actuallyadditions.itemFoodFishNChips.desc=It's Fish. It's Chips. Or French Fries. Whatevs.
|
||||||
tooltip.actuallyadditions.itemFoodCarrotJuice.desc=Carrots, but pressed!
|
tooltip.actuallyadditions.itemFoodCarrotJuice.desc=Carrots, but pressed!
|
||||||
tooltip.actuallyadditions.itemFoodPumpkinStew.desc=Like Mushroom Stew or Rabbit Stew, but pumpykinny.
|
tooltip.actuallyadditions.itemFoodPumpkinStew.desc=Like Mushroom Stew or Rabbit Stew, but pumpykinny.
|
||||||
|
@ -383,6 +394,8 @@ container.actuallyadditions.oilGenerator.name=Oil Generator
|
||||||
container.actuallyadditions.phantomPlacer.name=Phantom Placer
|
container.actuallyadditions.phantomPlacer.name=Phantom Placer
|
||||||
container.actuallyadditions.phantomBreaker.name=Phantom Breaker
|
container.actuallyadditions.phantomBreaker.name=Phantom Breaker
|
||||||
container.actuallyadditions.phantomface.name=Phantomface
|
container.actuallyadditions.phantomface.name=Phantomface
|
||||||
|
container.actuallyadditions.liquiface.name=Liquiface
|
||||||
|
container.actuallyadditions.energyface.name=Energyface
|
||||||
|
|
||||||
|
|
||||||
container.actuallyadditions.nei.crushing.name=Crusher
|
container.actuallyadditions.nei.crushing.name=Crusher
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 804 B |
Binary file not shown.
After Width: | Height: | Size: 809 B |
Binary file not shown.
After Width: | Height: | Size: 610 B |
|
@ -10,7 +10,7 @@
|
||||||
"authorList": [
|
"authorList": [
|
||||||
"Ellpeck"
|
"Ellpeck"
|
||||||
],
|
],
|
||||||
"credits": "xdqmhose, GlenthorLP, Paktosan",
|
"credits": "xdqmhose, GlenthorLP, Paktosan, Lordhallo",
|
||||||
"logoFile": "assets/actuallyadditions/textures/logo.png",
|
"logoFile": "assets/actuallyadditions/textures/logo.png",
|
||||||
"screenshots": [
|
"screenshots": [
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in a new issue