More auto crafting table stuff

This commit is contained in:
modmuss50 2017-06-20 21:31:21 +01:00
parent 3071d19db0
commit a7316bc6c0
No known key found for this signature in database
GPG key ID: 203A5ED4D3E48BEA
6 changed files with 148 additions and 2 deletions

View file

@ -1,16 +1,36 @@
package techreborn.tiles;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import reborncore.common.powerSystem.TilePowerAcceptor;
import techreborn.client.container.IContainerProvider;
import techreborn.client.container.builder.BuiltContainer;
import techreborn.client.container.builder.ContainerBuilder;
import javax.annotation.Nullable;
/**
* Created by modmuss50 on 20/06/2017.
*/
public class TileAutoCraftingTable extends TilePowerAcceptor implements IContainerProvider {
ResourceLocation currentRecipe;
public void setCurrentRecipe(ResourceLocation recipe){
currentRecipe = recipe;
}
@Nullable
public IRecipe getIRecipe(){
if(currentRecipe == null){
return null;
}
return ForgeRegistries.RECIPES.getValue(currentRecipe);
}
public TileAutoCraftingTable() {
super();
}
@ -44,4 +64,9 @@ public class TileAutoCraftingTable extends TilePowerAcceptor implements IContain
public BuiltContainer createContainer(EntityPlayer player) {
return new ContainerBuilder("autocraftingTable").player(player.inventory).inventory().hotbar().addInventory().create();
}
@Override
public boolean canBeUpgraded() {
return false;
}
}