-Liquid and Energy Phantomface

-InvTweaks API
This commit is contained in:
Ellpeck 2015-05-29 18:17:28 +02:00
parent 5fd285d3bc
commit 9f7031fdfe
31 changed files with 683 additions and 23 deletions

View file

@ -6,9 +6,7 @@ import ellpeck.actuallyadditions.ActuallyAdditions;
import ellpeck.actuallyadditions.inventory.GuiHandler;
import ellpeck.actuallyadditions.tile.TileEntityPhantomPlacer;
import ellpeck.actuallyadditions.tile.TileEntityPhantomface;
import ellpeck.actuallyadditions.util.BlockUtil;
import ellpeck.actuallyadditions.util.INameableItem;
import ellpeck.actuallyadditions.util.ModUtil;
import ellpeck.actuallyadditions.util.*;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -92,6 +90,8 @@ public class BlockPhantomface extends BlockContainerBase implements INameableIte
return new TileEntityPhantomPlacer.TileEntityPhantomBreaker();
case LIQUIFACE:
return new TileEntityPhantomface.TileEntityPhantomLiquiface();
case ENERGYFACE:
return new TileEntityPhantomface.TileEntityPhantomEnergyface();
default:
return new TileEntityPhantomface.TileEntityPhantomItemface();
}
@ -117,6 +117,8 @@ public class BlockPhantomface extends BlockContainerBase implements INameableIte
return "blockPhantomBreaker";
case LIQUIFACE:
return "blockPhantomLiquiface";
case ENERGYFACE:
return "blockPhantomEnergyface";
default:
return "blockPhantomface";
}
@ -148,6 +150,11 @@ public class BlockPhantomface extends BlockContainerBase implements INameableIte
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
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

View file

@ -47,14 +47,13 @@ public class BlockPlant extends BlockCrops implements INameableItem, IFactoryHar
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);
if(metadata >= 7){
for (int i = 0; i < 3 + fortune; ++i){
if (world.rand.nextInt(15) <= metadata){
ret.add(new ItemStack(this.seedItem));
}
for(int i = 0; i < 3; ++i){
if(world.rand.nextInt(15) <= metadata) 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()));
else ret.add(this.returnItem.copy());
}
else ret.add(new ItemStack(this.seedItem));
return ret;
}

View file

@ -49,6 +49,7 @@ public class InitBlocks{
public static Block blockPhantomPlacer;
public static Block blockPhantomBreaker;
public static Block blockPhantomLiquiface;
public static Block blockPhantomEnergyface;
public static void init(){
Util.logInfo("Initializing Blocks...");
@ -75,6 +76,9 @@ public class InitBlocks{
blockPhantomLiquiface = new BlockPhantomface(BlockPhantomface.LIQUIFACE);
BlockUtil.register(blockPhantomLiquiface, BlockPhantomface.TheItemBlock.class);
blockPhantomEnergyface = new BlockPhantomface(BlockPhantomface.ENERGYFACE);
BlockUtil.register(blockPhantomEnergyface, BlockPhantomface.TheItemBlock.class);
blockPhantomBreaker = new BlockPhantomface(BlockPhantomface.BREAKER);
BlockUtil.register(blockPhantomBreaker, BlockPhantomface.TheItemBlock.class);

View file

@ -118,7 +118,7 @@ public class FoodCrafting{
//Chocolate
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', new ItemStack(Items.dye, 1, 3),
'M', new ItemStack(Items.milk_bucket));

View file

@ -27,6 +27,8 @@ public class CreativeTab extends CreativeTabs{
this.list = list;
this.addBlock(InitBlocks.blockPhantomface);
this.addBlock(InitBlocks.blockPhantomEnergyface);
this.addBlock(InitBlocks.blockPhantomLiquiface);
this.addBlock(InitBlocks.blockPhantomPlacer);
this.addBlock(InitBlocks.blockPhantomBreaker);
this.addBlock(InitBlocks.blockInputter);

View file

@ -15,6 +15,7 @@ public class RenderPlayerEventAA{
private RenderSpecial hoseRender = new RenderSpecial(new ModelTorch());
//private RenderSpecial paktoRender = new RenderSpecial(new ModelStandardBlock("Pakto"));
private RenderSpecial glenRender = new RenderSpecial(new ModelStandardBlock("Glenthor"));
private RenderSpecial lordiRender = new RenderSpecial(new ModelStandardBlock("Lordi"));
@SubscribeEvent(priority = EventPriority.HIGHEST)
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"))){
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);
}
}
}
}

View file

@ -18,6 +18,9 @@ public class HairyBallHandler{
addReturn(new ItemStack(Items.diamond), 2);
addReturn(new ItemStack(Items.name_tag), 1);
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.leather), 30);
addReturn(new ItemStack(Items.dye), 70);

View file

@ -33,6 +33,7 @@ public class TileEntityBase extends TileEntity{
GameRegistry.registerTileEntity(TileEntityCoalGenerator.class, ModUtil.MOD_ID_LOWER + ":tileEntityCoalGenerator");
GameRegistry.registerTileEntity(TileEntityPhantomface.TileEntityPhantomItemface.class, ModUtil.MOD_ID_LOWER + ":tileEntityPhantomItemface");
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.TileEntityPhantomBreaker.class, ModUtil.MOD_ID_LOWER + ":tileEntityPhantomBreaker");
}

View file

@ -159,7 +159,7 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE
@Override
public boolean canDrain(ForgeDirection from, Fluid fluid){
return true;
return from != ForgeDirection.UP;
}
@Override

View file

@ -1,7 +1,7 @@
package ellpeck.actuallyadditions.tile;
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.SideOnly;
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
@ -11,7 +11,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntityFurnace;
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);
@ -96,8 +96,8 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements
}
@Override
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate){
return this.storage.receiveEnergy(maxReceive, simulate);
public int extractEnergy(ForgeDirection from, int maxReceive, boolean simulate){
return this.storage.extractEnergy(maxReceive, simulate);
}
@Override

View file

@ -138,7 +138,7 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen
@Override
public boolean canDrain(ForgeDirection from, Fluid fluid){
return fluid == InitBlocks.fluidOil;
return from != ForgeDirection.UP && fluid == InitBlocks.fluidOil;
}
@Override

View file

@ -154,7 +154,7 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I
@Override
public boolean canFill(ForgeDirection from, Fluid fluid){
return fluid == InitBlocks.fluidOil;
return from != ForgeDirection.DOWN && fluid == InitBlocks.fluidOil;
}
@Override

View file

@ -1,7 +1,11 @@
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.config.values.ConfigIntValues;
import ellpeck.actuallyadditions.util.WorldUtil;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
@ -124,6 +128,40 @@ public class TileEntityPhantomface extends TileEntityInventoryBase{
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
public boolean canConnectTo(TileEntity tile){
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 TileEntityPhantomItemface(){

View file

@ -43,12 +43,12 @@ public class UpdateChecker{
if(update > client){
String notice1 = "info." + ModUtil.MOD_ID_LOWER + ".update.generic.desc";
String notice2 = "info." + ModUtil.MOD_ID_LOWER + ".update.versionComp.desc";
String notice3 = "info." + ModUtil.MOD_ID_LOWER + ".update.download.desc";
String notice4 = "info." + ModUtil.MOD_ID_LOWER + ".update.changelog.txt.desc";
String notice3 = "info." + ModUtil.MOD_ID_LOWER + ".update.changelog.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.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(notice4, changelog)));
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocalFormatted(notice3, changelog)));
player.addChatComponentMessage(IChatComponent.Serializer.func_150699_a(StatCollector.translateToLocalFormatted(notice4, "http://minecraft.curseforge.com/mc-mods/228404-actually-additions/files")));
}
}

View file

@ -35,7 +35,7 @@ public class WorldUtil{
public static void pushEnergy(World world, int x, int y, int z, ForgeDirection side, EnergyStorage storage){
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())){
int receive = ((IEnergyReceiver)tile).receiveEnergy(side.getOpposite(), Math.min(storage.getMaxExtract(), storage.getEnergyStored()), false);
storage.extractEnergy(receive, false);

View 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);
}

View 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);
}

View 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();
}

View 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);
}

View 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&lt;ItemStack&gt;.
*
* @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);
}

View 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,
}

View 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 {
}
}

View 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
}

View file

@ -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 {
}

View 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 {
}

View file

@ -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;
}

View file

@ -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.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
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!
@ -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.itemFoodSpaghetti.desc=The most generic food ever. So clichée.
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.itemFoodCarrotJuice.desc=Carrots, but pressed!
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.phantomBreaker.name=Phantom Breaker
container.actuallyadditions.phantomface.name=Phantomface
container.actuallyadditions.liquiface.name=Liquiface
container.actuallyadditions.energyface.name=Energyface
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

View file

@ -10,7 +10,7 @@
"authorList": [
"Ellpeck"
],
"credits": "xdqmhose, GlenthorLP, Paktosan",
"credits": "xdqmhose, GlenthorLP, Paktosan, Lordhallo",
"logoFile": "assets/actuallyadditions/textures/logo.png",
"screenshots": [
],