From a45d4bd5bc41e4b99e35bf4cbf1dcffc2400335c Mon Sep 17 00:00:00 2001 From: LemADEC Date: Tue, 2 Feb 2021 02:18:54 +0100 Subject: [PATCH] Code cleanup --- .../warpdrive/block/movement/TileEntityTransporterCore.java | 4 ---- src/main/java/cr0s/warpdrive/config/Dictionary.java | 6 +++--- src/main/java/cr0s/warpdrive/data/GlobalRegionManager.java | 1 + 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/java/cr0s/warpdrive/block/movement/TileEntityTransporterCore.java b/src/main/java/cr0s/warpdrive/block/movement/TileEntityTransporterCore.java index bfcae1f0..fb68c0fa 100644 --- a/src/main/java/cr0s/warpdrive/block/movement/TileEntityTransporterCore.java +++ b/src/main/java/cr0s/warpdrive/block/movement/TileEntityTransporterCore.java @@ -21,7 +21,6 @@ import cr0s.warpdrive.data.EnergyWrapper; import cr0s.warpdrive.data.EnumComponentType; import cr0s.warpdrive.data.EnumGlobalRegionType; import cr0s.warpdrive.data.EnumTransporterState; -import cr0s.warpdrive.data.ForceFieldRegistry; import cr0s.warpdrive.data.ForceFieldSetup; import cr0s.warpdrive.data.GlobalPosition; import cr0s.warpdrive.data.GlobalRegionManager; @@ -499,9 +498,6 @@ public class TileEntityTransporterCore extends TileEntityAbstractEnergyCoreOrCon if ( beamFrequency != parBeamFrequency && IBeamFrequency.isValid(parBeamFrequency) ) { final int beamFrequencyOld = beamFrequency; - if (hasWorld()) { - ForceFieldRegistry.removeFromRegistry(this); - } beamFrequency = parBeamFrequency; markDirtyParameters(); if (WarpDriveConfig.LOGGING_VIDEO_CHANNEL) { diff --git a/src/main/java/cr0s/warpdrive/config/Dictionary.java b/src/main/java/cr0s/warpdrive/config/Dictionary.java index 2c309a9f..b018d8c0 100644 --- a/src/main/java/cr0s/warpdrive/config/Dictionary.java +++ b/src/main/java/cr0s/warpdrive/config/Dictionary.java @@ -511,7 +511,7 @@ public class Dictionary { final String[] oreNames = OreDictionary.getOreNames(); for (final String oreName : oreNames) { final String lowerOreName = oreName.toLowerCase(); - if (oreName.length() > 4 && oreName.substring(0, 3).equals("ore")) { + if (oreName.length() > 4 && oreName.startsWith("ore")) { final List itemStacks = OreDictionary.getOres(oreName); for (final ItemStack itemStack : itemStacks) { BLOCKS_ORES.add(Block.getBlockFromItem(itemStack.getItem())); @@ -757,14 +757,14 @@ public class Dictionary { } @Nonnull - private static String getHashMessage(@Nonnull final HashSet hashSet) { + private static String getHashMessage(@Nonnull final HashSet hashSet) { final StringBuilder message = new StringBuilder(); for (final Object object : hashSet) { if (message.length() > 0) { message.append(", "); } if (object instanceof IForgeRegistryEntry) { - message.append(((IForgeRegistryEntry) object).getRegistryName()); + message.append(((IForgeRegistryEntry) object).getRegistryName()); } else if (object instanceof String) { message.append((String) object); } else { diff --git a/src/main/java/cr0s/warpdrive/data/GlobalRegionManager.java b/src/main/java/cr0s/warpdrive/data/GlobalRegionManager.java index e15983c9..e6763916 100644 --- a/src/main/java/cr0s/warpdrive/data/GlobalRegionManager.java +++ b/src/main/java/cr0s/warpdrive/data/GlobalRegionManager.java @@ -407,6 +407,7 @@ public class GlobalRegionManager { } } + @Nullable public static TileEntityShipCore getIntersectingShipCore(@Nonnull final TileEntityShipCore shipCore1) { cleanup();