1.15 port
This commit is contained in:
@@ -31,7 +31,7 @@ public class CraftBranchFailure extends Exception
|
||||
|
||||
public CraftBranchFailure( final IAEItemStack what, final long howMany )
|
||||
{
|
||||
super( "Failed: " + what.getItem().getUnlocalizedName() + " x " + howMany );
|
||||
super( "Failed: " + what.getItem().getRegistryName() + " x " + howMany );
|
||||
this.missing = what.copy();
|
||||
this.missing.setStackSize( howMany );
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.google.common.base.Stopwatch;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
@@ -108,7 +108,7 @@ public class CraftingJob implements Runnable, ICraftingJob
|
||||
return this.availableCheck.extractItems( available, Actionable.MODULATE, this.actionSrc );
|
||||
}
|
||||
|
||||
public void writeToNBT( final NBTTagCompound out )
|
||||
public void writeToNBT( final CompoundNBT out )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -377,7 +377,7 @@ public class CraftingJob implements Runnable, ICraftingJob
|
||||
|
||||
if( this.actionSrc.player().isPresent() )
|
||||
{
|
||||
final EntityPlayer player = this.actionSrc.player().get();
|
||||
final PlayerEntity player = this.actionSrc.player().get();
|
||||
|
||||
actionSource = player.toString();
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package appeng.crafting;
|
||||
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.crafting.ICraftingCPU;
|
||||
@@ -39,14 +39,14 @@ public class CraftingLink implements ICraftingLink
|
||||
private boolean done = false;
|
||||
private CraftingLinkNexus tie;
|
||||
|
||||
public CraftingLink( final NBTTagCompound data, final ICraftingRequester req )
|
||||
public CraftingLink( final CompoundNBT data, final ICraftingRequester req )
|
||||
{
|
||||
this.CraftID = data.getString( "CraftID" );
|
||||
this.setCanceled( data.getBoolean( "canceled" ) );
|
||||
this.setDone( data.getBoolean( "done" ) );
|
||||
this.standalone = data.getBoolean( "standalone" );
|
||||
|
||||
if( !data.hasKey( "req" ) || !data.getBoolean( "req" ) )
|
||||
if( !data.contains( "req" ) || !data.getBoolean( "req" ) )
|
||||
{
|
||||
throw new IllegalStateException( "Invalid Crafting Link for Object" );
|
||||
}
|
||||
@@ -55,14 +55,14 @@ public class CraftingLink implements ICraftingLink
|
||||
this.cpu = null;
|
||||
}
|
||||
|
||||
public CraftingLink( final NBTTagCompound data, final ICraftingCPU cpu )
|
||||
public CraftingLink( final CompoundNBT data, final ICraftingCPU cpu )
|
||||
{
|
||||
this.CraftID = data.getString( "CraftID" );
|
||||
this.setCanceled( data.getBoolean( "canceled" ) );
|
||||
this.setDone( data.getBoolean( "done" ) );
|
||||
this.standalone = data.getBoolean( "standalone" );
|
||||
|
||||
if( !data.hasKey( "req" ) || data.getBoolean( "req" ) )
|
||||
if( !data.contains( "req" ) || data.getBoolean( "req" ) )
|
||||
{
|
||||
throw new IllegalStateException( "Invalid Crafting Link for Object" );
|
||||
}
|
||||
@@ -138,13 +138,13 @@ public class CraftingLink implements ICraftingLink
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( final NBTTagCompound tag )
|
||||
public void writeToNBT( final CompoundNBT tag )
|
||||
{
|
||||
tag.setString( "CraftID", this.CraftID );
|
||||
tag.setBoolean( "canceled", this.isCanceled() );
|
||||
tag.setBoolean( "done", this.isDone() );
|
||||
tag.setBoolean( "standalone", this.standalone );
|
||||
tag.setBoolean( "req", this.getRequester() != null );
|
||||
tag.putString( "CraftID", this.CraftID );
|
||||
tag.putBoolean( "canceled", this.isCanceled() );
|
||||
tag.putBoolean( "done", this.isDone() );
|
||||
tag.putBoolean( "standalone", this.standalone );
|
||||
tag.putBoolean( "req", this.getRequester() != null );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,11 +23,11 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.inventory.CraftingInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
import net.minecraftforge.fml.hooks.BasicEventHooks;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
@@ -70,14 +70,14 @@ public class CraftingTreeProcess
|
||||
{
|
||||
final IAEItemStack[] list = details.getInputs();
|
||||
|
||||
final InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 );
|
||||
final CraftingInventory ic = new CraftingInventory( new ContainerNull(), 3, 3 );
|
||||
final IAEItemStack[] is = details.getInputs();
|
||||
for( int x = 0; x < ic.getSizeInventory(); x++ )
|
||||
{
|
||||
ic.setInventorySlotContents( x, is[x] == null ? ItemStack.EMPTY : is[x].createItemStack() );
|
||||
}
|
||||
|
||||
FMLCommonHandler.instance().firePlayerCraftingEvent( Platform.getPlayer( (WorldServer) world ), details.getOutput( ic, world ), ic );
|
||||
BasicEventHooks.firePlayerCraftingEvent( Platform.getPlayer( (ServerWorld) world ), details.getOutput( ic, world ), ic );
|
||||
|
||||
for( int x = 0; x < ic.getSizeInventory(); x++ )
|
||||
{
|
||||
@@ -191,7 +191,7 @@ public class CraftingTreeProcess
|
||||
|
||||
if( this.fullSimulation )
|
||||
{
|
||||
final InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 );
|
||||
final CraftingInventory ic = new CraftingInventory( new ContainerNull(), 3, 3 );
|
||||
|
||||
for( final Entry<CraftingTreeNode, Long> entry : this.nodes.entrySet() )
|
||||
{
|
||||
@@ -201,7 +201,7 @@ public class CraftingTreeProcess
|
||||
ic.setInventorySlotContents( entry.getKey().getSlot(), stack.createItemStack() );
|
||||
}
|
||||
|
||||
FMLCommonHandler.instance().firePlayerCraftingEvent( Platform.getPlayer( (WorldServer) this.world ), this.details.getOutput( ic, this.world ), ic );
|
||||
BasicEventHooks.firePlayerCraftingEvent( Platform.getPlayer( (ServerWorld) this.world ), this.details.getOutput( ic, this.world ), ic );
|
||||
|
||||
for( int x = 0; x < ic.getSizeInventory(); x++ )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user