Skip to content
This repository has been archived by the owner on Jul 1, 2018. It is now read-only.

Commit

Permalink
Prefix tile entities with "cctweaks"
Browse files Browse the repository at this point in the history
In 1.11 the tiles are case insensitive which means we clash with CC's
modem. We convert them to the prefixed form now to avoid issues when
updating a world to 1.11.
  • Loading branch information
SquidDev committed Feb 13, 2017
1 parent 12c11d0 commit d328451
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 5 additions & 1 deletion src/main/java/org/squiddev/cctweaks/blocks/BlockBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ public boolean canLoad() {
@Override
public void preInit() {
GameRegistry.registerBlock(this, name);
GameRegistry.registerTileEntity(klass, name);
registerTileEntity(klass, name);
}

protected static void registerTileEntity(Class<? extends TileEntity> klass, String name) {
GameRegistry.registerTileEntityWithAlternatives(klass, CCTweaks.RESOURCE_DOMAIN + ":" + name, name);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ public String getUnlocalizedName(int meta) {
@Override
public void preInit() {
GameRegistry.registerBlock(this, ItemMultiBlock.class, name);
GameRegistry.registerTileEntity(TileDebugPeripheral.class, "debugPeripheral");
GameRegistry.registerTileEntity(TileDebugNetworkedPeripheral.class, "debugNetworkedPeripheral");
GameRegistry.registerTileEntity(TileDebugNode.class, "debugNode");
registerTileEntity(TileDebugPeripheral.class, "debugPeripheral");
registerTileEntity(TileDebugNetworkedPeripheral.class, "debugNetworkedPeripheral");
registerTileEntity(TileDebugNode.class, "debugNode");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ protected BlockState createBlockState() {
@Override
public void preInit() {
GameRegistry.registerBlock(this, ItemMultiBlock.class, name);
GameRegistry.registerTileEntity(TileNetworkedWirelessBridge.class, "wirelessBridge");
GameRegistry.registerTileEntity(TileNetworkedModem.class, "wiredModem");
registerTileEntity(TileNetworkedWirelessBridge.class, "wirelessBridge");
registerTileEntity(TileNetworkedModem.class, "wiredModem");
}

@Override
Expand Down

0 comments on commit d328451

Please sign in to comment.