2017-06-20 19:54:45 +02:00
|
|
|
package techreborn.tiles;
|
|
|
|
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2017-06-20 22:38:51 +02:00
|
|
|
import net.minecraft.inventory.IInventory;
|
2017-06-20 22:31:21 +02:00
|
|
|
import net.minecraft.item.crafting.IRecipe;
|
2017-06-20 19:54:45 +02:00
|
|
|
import net.minecraft.util.EnumFacing;
|
2017-06-20 22:31:21 +02:00
|
|
|
import net.minecraft.util.ResourceLocation;
|
|
|
|
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
2017-06-20 22:38:51 +02:00
|
|
|
import reborncore.api.tile.IInventoryProvider;
|
2017-06-20 19:54:45 +02:00
|
|
|
import reborncore.common.powerSystem.TilePowerAcceptor;
|
2017-06-20 22:38:51 +02:00
|
|
|
import reborncore.common.util.Inventory;
|
2017-06-20 19:54:45 +02:00
|
|
|
import techreborn.client.container.IContainerProvider;
|
|
|
|
import techreborn.client.container.builder.BuiltContainer;
|
|
|
|
import techreborn.client.container.builder.ContainerBuilder;
|
|
|
|
|
2017-06-20 22:31:21 +02:00
|
|
|
import javax.annotation.Nullable;
|
|
|
|
|
2017-06-20 19:54:45 +02:00
|
|
|
/**
|
|
|
|
* Created by modmuss50 on 20/06/2017.
|
|
|
|
*/
|
2017-06-20 22:38:51 +02:00
|
|
|
public class TileAutoCraftingTable extends TilePowerAcceptor implements IContainerProvider, IInventoryProvider {
|
2017-06-20 22:31:21 +02:00
|
|
|
|
|
|
|
ResourceLocation currentRecipe;
|
|
|
|
|
2017-06-20 22:38:51 +02:00
|
|
|
public Inventory inventory = new Inventory(10, "TileAutoCraftingTable", 64, this);
|
|
|
|
|
2017-06-20 22:31:21 +02:00
|
|
|
public void setCurrentRecipe(ResourceLocation recipe){
|
|
|
|
currentRecipe = recipe;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Nullable
|
|
|
|
public IRecipe getIRecipe(){
|
|
|
|
if(currentRecipe == null){
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
return ForgeRegistries.RECIPES.getValue(currentRecipe);
|
|
|
|
}
|
|
|
|
|
2017-06-20 19:54:45 +02:00
|
|
|
public TileAutoCraftingTable() {
|
|
|
|
super();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public double getBaseMaxPower() {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public double getBaseMaxOutput() {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public double getBaseMaxInput() {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canAcceptEnergy(EnumFacing enumFacing) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canProvideEnergy(EnumFacing enumFacing) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public BuiltContainer createContainer(EntityPlayer player) {
|
2017-06-20 22:38:51 +02:00
|
|
|
return new ContainerBuilder("autocraftingTable").player(player.inventory).inventory().hotbar()
|
|
|
|
.addInventory().tile(this).slot(0, 30, 20).slot(1, 50, 20).slot(2, 70, 20).slot(3, 90, 20)
|
|
|
|
.slot(4, 110, 20).slot(5, 130, 20).outputSlot(6, 40, 66).addInventory()
|
|
|
|
.create();
|
2017-06-20 19:54:45 +02:00
|
|
|
}
|
2017-06-20 22:31:21 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canBeUpgraded() {
|
|
|
|
return false;
|
|
|
|
}
|
2017-06-20 22:38:51 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public IInventory getInventory() {
|
|
|
|
return inventory;
|
|
|
|
}
|
2017-06-20 19:54:45 +02:00
|
|
|
}
|