Code cleanup

This commit is contained in:
LemADEC 2021-02-02 02:18:54 +01:00
parent f2c930727d
commit a45d4bd5bc
3 changed files with 4 additions and 7 deletions

View file

@ -21,7 +21,6 @@ import cr0s.warpdrive.data.EnergyWrapper;
import cr0s.warpdrive.data.EnumComponentType; import cr0s.warpdrive.data.EnumComponentType;
import cr0s.warpdrive.data.EnumGlobalRegionType; import cr0s.warpdrive.data.EnumGlobalRegionType;
import cr0s.warpdrive.data.EnumTransporterState; import cr0s.warpdrive.data.EnumTransporterState;
import cr0s.warpdrive.data.ForceFieldRegistry;
import cr0s.warpdrive.data.ForceFieldSetup; import cr0s.warpdrive.data.ForceFieldSetup;
import cr0s.warpdrive.data.GlobalPosition; import cr0s.warpdrive.data.GlobalPosition;
import cr0s.warpdrive.data.GlobalRegionManager; import cr0s.warpdrive.data.GlobalRegionManager;
@ -499,9 +498,6 @@ public class TileEntityTransporterCore extends TileEntityAbstractEnergyCoreOrCon
if ( beamFrequency != parBeamFrequency if ( beamFrequency != parBeamFrequency
&& IBeamFrequency.isValid(parBeamFrequency) ) { && IBeamFrequency.isValid(parBeamFrequency) ) {
final int beamFrequencyOld = beamFrequency; final int beamFrequencyOld = beamFrequency;
if (hasWorld()) {
ForceFieldRegistry.removeFromRegistry(this);
}
beamFrequency = parBeamFrequency; beamFrequency = parBeamFrequency;
markDirtyParameters(); markDirtyParameters();
if (WarpDriveConfig.LOGGING_VIDEO_CHANNEL) { if (WarpDriveConfig.LOGGING_VIDEO_CHANNEL) {

View file

@ -511,7 +511,7 @@ public class Dictionary {
final String[] oreNames = OreDictionary.getOreNames(); final String[] oreNames = OreDictionary.getOreNames();
for (final String oreName : oreNames) { for (final String oreName : oreNames) {
final String lowerOreName = oreName.toLowerCase(); final String lowerOreName = oreName.toLowerCase();
if (oreName.length() > 4 && oreName.substring(0, 3).equals("ore")) { if (oreName.length() > 4 && oreName.startsWith("ore")) {
final List<ItemStack> itemStacks = OreDictionary.getOres(oreName); final List<ItemStack> itemStacks = OreDictionary.getOres(oreName);
for (final ItemStack itemStack : itemStacks) { for (final ItemStack itemStack : itemStacks) {
BLOCKS_ORES.add(Block.getBlockFromItem(itemStack.getItem())); BLOCKS_ORES.add(Block.getBlockFromItem(itemStack.getItem()));
@ -757,14 +757,14 @@ public class Dictionary {
} }
@Nonnull @Nonnull
private static String getHashMessage(@Nonnull final HashSet hashSet) { private static String getHashMessage(@Nonnull final HashSet<?> hashSet) {
final StringBuilder message = new StringBuilder(); final StringBuilder message = new StringBuilder();
for (final Object object : hashSet) { for (final Object object : hashSet) {
if (message.length() > 0) { if (message.length() > 0) {
message.append(", "); message.append(", ");
} }
if (object instanceof IForgeRegistryEntry) { if (object instanceof IForgeRegistryEntry) {
message.append(((IForgeRegistryEntry) object).getRegistryName()); message.append(((IForgeRegistryEntry<?>) object).getRegistryName());
} else if (object instanceof String) { } else if (object instanceof String) {
message.append((String) object); message.append((String) object);
} else { } else {

View file

@ -407,6 +407,7 @@ public class GlobalRegionManager {
} }
} }
@Nullable
public static TileEntityShipCore getIntersectingShipCore(@Nonnull final TileEntityShipCore shipCore1) { public static TileEntityShipCore getIntersectingShipCore(@Nonnull final TileEntityShipCore shipCore1) {
cleanup(); cleanup();