Fixes #675 No disabled feature should log spam or crash anymore.
Deprecates the old usage of the AEItemDefinitions via the direct method access of * blocks() * parts() * items() * materials() and thus use the new re-direct via definitions(). All definitions are now initialized, no matter what. But SubItems, Items and Blocks are not registered, if by chance are disabled.
This commit is contained in:
@@ -23,6 +23,7 @@ import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
import appeng.container.guisync.GuiSync;
|
||||
import appeng.container.interfaces.IProgressProvider;
|
||||
import appeng.container.slot.SlotOutput;
|
||||
@@ -140,8 +141,11 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
|
||||
otherSlot = this.top.getStack();
|
||||
|
||||
// name presses
|
||||
if ( AEApi.instance().materials().materialNamePress.sameAsStack( otherSlot ) )
|
||||
return AEApi.instance().materials().materialNamePress.sameAsStack( is );
|
||||
final IItemDefinition namePress = AEApi.instance().definitions().materials().namePress();
|
||||
if ( namePress.isSameAs( otherSlot ) )
|
||||
{
|
||||
return namePress.isSameAs( is );
|
||||
}
|
||||
|
||||
// everything else
|
||||
for (InscriberRecipe i : Inscribe.RECIPES )
|
||||
|
||||
@@ -163,10 +163,10 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
if ( this.monitor != this.host.getItemInventory() )
|
||||
this.isContainerValid = false;
|
||||
|
||||
for (Enum set : this.serverCM.getSettings())
|
||||
for (Settings set : this.serverCM.getSettings())
|
||||
{
|
||||
Enum sideLocal = this.serverCM.getSetting( set );
|
||||
Enum sideRemote = this.clientCM.getSetting( set );
|
||||
Enum<?> sideLocal = this.serverCM.getSetting( set );
|
||||
Enum<?> sideRemote = this.clientCM.getSetting( set );
|
||||
|
||||
if ( sideLocal != sideRemote )
|
||||
{
|
||||
|
||||
@@ -39,6 +39,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
import appeng.api.networking.security.MachineSource;
|
||||
import appeng.api.storage.IMEMonitor;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
@@ -218,7 +219,11 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
this.patternSlotIN.putStack( null );
|
||||
|
||||
// add a new encoded pattern.
|
||||
this.patternSlotOUT.putStack( output = AEApi.instance().items().itemEncodedPattern.stack( 1 ) );
|
||||
for ( ItemStack encodedPatternStack : AEApi.instance().definitions().items().encodedPattern().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
output = encodedPatternStack;
|
||||
this.patternSlotOUT.putStack( output );
|
||||
}
|
||||
}
|
||||
|
||||
// encode the slot.
|
||||
@@ -303,7 +308,12 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
if ( output == null )
|
||||
return false;
|
||||
|
||||
return AEApi.instance().items().itemEncodedPattern.sameAsStack( output ) || AEApi.instance().materials().materialBlankPattern.sameAsStack( output );
|
||||
final IDefinitions definitions = AEApi.instance().definitions();
|
||||
|
||||
boolean isPattern = definitions.items().encodedPattern().isSameAs( output );
|
||||
isPattern |= definitions.materials().blankPattern().isSameAs( output );
|
||||
|
||||
return isPattern;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -120,10 +120,13 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn
|
||||
{
|
||||
if ( this.myName.length() > 0 )
|
||||
{
|
||||
ItemStack name = AEApi.instance().materials().materialNamePress.stack( 1 );
|
||||
NBTTagCompound c = Platform.openNbtData( name );
|
||||
c.setString( "InscribeName", this.myName );
|
||||
return name;
|
||||
for ( ItemStack namePressStack : AEApi.instance().definitions().materials().namePress().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
final NBTTagCompound compound = Platform.openNbtData( namePressStack );
|
||||
compound.setString( "InscribeName", this.myName );
|
||||
|
||||
return namePressStack;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user