Skip to content

Commit

Permalink
Disable MCMP and add a setting to enable it optionally. ( Related #310 )
Browse files Browse the repository at this point in the history
  • Loading branch information
AlgorithmX2 committed Nov 24, 2017
1 parent dacf302 commit 4f06e5a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
6 changes: 5 additions & 1 deletion src/main/java/mod/chiselsandbits/config/ModConfig.java
Expand Up @@ -35,10 +35,13 @@ public class ModConfig extends Configuration
// mod settings...
@Configured( category = "Integration Settings" )
public boolean ShowBitsInJEI;

@Configured( category = "Integration Settings" )
public boolean enableVivecraftCompatibility;

@Configured( category = "Integration Settings" )
public boolean enableMCMultipart;

@Configured( category = "Troubleshooting" )
public boolean enableAPITestingItem;

Expand Down Expand Up @@ -403,6 +406,7 @@ private void setDefaults()
enableBitSaw = true;
ShowBitsInJEI = false;
enableVivecraftCompatibility = false;
enableMCMultipart = false;
}

public ModConfig(
Expand Down
Expand Up @@ -16,28 +16,42 @@ public class MCMultipart2Addon implements IMCMPAddon

private static String TE_CHISELEDPART = ChiselsAndBits.MODID + ":mod.chiselsandbits.TileEntityChiseled";

private boolean isEnabled()
{
return ChiselsAndBits.getConfig().enableMCMultipart;
}

public MCMultipart2Addon()
{
ChiselsAndBits.registerWithBus( this );
if ( isEnabled() )
{
ChiselsAndBits.registerWithBus( this );
}
}

@SubscribeEvent
public void registerSlot(
RegistryEvent.Register<IPartSlot> e )
{
e.getRegistry().register( MultiPartSlots.BITS );
if ( isEnabled() )
{
e.getRegistry().register( MultiPartSlots.BITS );
}
}

@Override
public void registerParts(
IMultipartRegistry registry )
{
GameRegistry.registerTileEntity( ChiseledBlockPart.class, TE_CHISELEDPART );

MCMultipartProxy.proxyMCMultiPart.relay = new MCMultipart2Proxy();
for ( BlockChiseled blk : ChiselsAndBits.getBlocks().getConversions().values() )
if ( isEnabled() )
{
registry.registerPartWrapper( blk, new ChiseledBlockMultiPart( blk ) );
GameRegistry.registerTileEntity( ChiseledBlockPart.class, TE_CHISELEDPART );

MCMultipartProxy.proxyMCMultiPart.relay = new MCMultipart2Proxy();
for ( BlockChiseled blk : ChiselsAndBits.getBlocks().getConversions().values() )
{
registry.registerPartWrapper( blk, new ChiseledBlockMultiPart( blk ) );
}
}
}

Expand Down

0 comments on commit 4f06e5a

Please sign in to comment.