Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/main/java/li/cil/oc2/common/CommonSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import li.cil.oc2.common.integration.IMC;
import li.cil.oc2.common.network.Network;
import li.cil.oc2.common.util.ServerScheduler;
import li.cil.oc2.common.vxlan.TunnelManager;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;

Expand All @@ -17,6 +16,5 @@ public static void handleSetupEvent(final FMLCommonSetupEvent event) {
Network.initialize();
RPCMethodParameterTypeAdapters.initialize();
ServerScheduler.initialize();
TunnelManager.initialize();
}
}
12 changes: 0 additions & 12 deletions src/main/java/li/cil/oc2/common/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public final class Config {
@Path("energy.blocks") public static int chargerEnergyStorage = 10000;
@Path("energy.blocks") public static int projectorEnergyPerTick = 20;
@Path("energy.blocks") public static int projectorEnergyStorage = 2000;
@Path("energy.blocks") public static int cardCageEnergyPerTick = 20;
@Path("energy.blocks") public static int cardCageEnergyStorage = 2000;

@Path("energy.entities") public static int robotEnergyPerTick = 5;
@Path("energy.entities") public static int robotEnergyStorage = 750000;
Expand All @@ -44,12 +42,6 @@ public final class Config {
@Path("admin.virtual_network") public static int ethernetFrameTimeToLive = 12;
@Path("admin.virtual_network") public static int hubEthernetFramesPerTick = 32;

@Path("vxlan") public static boolean enable = true;
@Path("vxlan") public static String remoteHost = "::1";
@Path("vxlan") public static int remotePort = 4789;
@Path("vxlan") public static String bindHost = "::1";
@Path("vxlan") public static int bindPort = 4789;

public static boolean computersUseEnergy() {
return computerEnergyPerTick > 0 && computerEnergyStorage > 0;
}
Expand All @@ -62,10 +54,6 @@ public static boolean projectorsUseEnergy() {
return projectorEnergyStorage > 0 && projectorEnergyPerTick > 0;
}

public static boolean cardCagesUseEnergy() {
return cardCageEnergyStorage > 0 && cardCageEnergyPerTick > 0;
}

public static boolean robotsUseEnergy() {
return robotEnergyPerTick > 0 && robotEnergyStorage > 0;
}
Expand Down
20 changes: 0 additions & 20 deletions src/main/java/li/cil/oc2/common/ConfigManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,8 @@ public final class ConfigManager {

static {
PARSERS.put(int.class, ConfigManager::parseIntField);
PARSERS.put(short.class, ConfigManager::parseShortField);
PARSERS.put(long.class, ConfigManager::parseLongField);
PARSERS.put(double.class, ConfigManager::parseDoubleField);
PARSERS.put(boolean.class, ConfigManager::parseBooleanField);
PARSERS.put(String.class, ConfigManager::parseStringField);
PARSERS.put(UUID.class, ConfigManager::parseUUIDField);
PARSERS.put(ResourceLocation.class, ConfigManager::parseResourceLocationField);
Expand Down Expand Up @@ -136,16 +134,6 @@ private static ConfigFieldPair<?> parseIntField(final Object instance, final Fie
return new ConfigFieldPair<>(field, configValue);
}

private static ConfigFieldPair<?> parseShortField(final Object instance, final Field field, final String path, final ForgeConfigSpec.Builder builder) throws IllegalAccessException {
final short defaultValue = field.getShort(instance);
final short minValue = (short) Math.max(getMin(field), Short.MIN_VALUE);
final short maxValue = (short) Math.min(getMax(field), Short.MAX_VALUE);

final ForgeConfigSpec.IntValue configValue = builder.defineInRange(path, defaultValue, minValue, maxValue);

return new ConfigFieldPair<>(field, configValue);
}

private static ConfigFieldPair<?> parseLongField(final Object instance, final Field field, final String path, final ForgeConfigSpec.Builder builder) throws IllegalAccessException {
final long defaultValue = field.getLong(instance);
final long minValue = (long) Math.max(getMin(field), Long.MIN_VALUE);
Expand Down Expand Up @@ -182,14 +170,6 @@ private static ConfigFieldPair<?> parseUUIDField(final Object instance, final Fi
return new ConfigFieldPair<>(field, configValue, UUID::fromString);
}

private static ConfigFieldPair<?> parseBooleanField(final Object instance, final Field field, final String path, final ForgeConfigSpec.Builder builder) throws IllegalAccessException {
final boolean defaultValue = (boolean) field.get(instance);

final ForgeConfigSpec.ConfigValue<Boolean> configValue = builder.define(path, defaultValue);

return new ConfigFieldPair<>(field, configValue);
}

private static ConfigFieldPair<?> parseResourceLocationField(final Object instance, final Field field, final String path, final ForgeConfigSpec.Builder builder) throws IllegalAccessException {
final ResourceLocation defaultValue = (ResourceLocation) field.get(instance);

Expand Down
1 change: 0 additions & 1 deletion src/main/java/li/cil/oc2/common/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public Main() {

ProviderRegistry.initialize();
DeviceTypes.initialize();

BlockDeviceDataRegistry.initialize();
FirmwareRegistry.initialize();

Expand Down
6 changes: 0 additions & 6 deletions src/main/java/li/cil/oc2/common/block/Blocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

package li.cil.oc2.common.block;

import li.cil.oc2.common.blockentity.VxlanBlockEntity;
import li.cil.oc2.common.util.RegistryUtils;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
Expand All @@ -23,12 +21,8 @@ public final class Blocks {
public static final RegistryObject<KeyboardBlock> KEYBOARD = BLOCKS.register("keyboard", KeyboardBlock::new);
public static final RegistryObject<NetworkConnectorBlock> NETWORK_CONNECTOR = BLOCKS.register("network_connector", NetworkConnectorBlock::new);
public static final RegistryObject<NetworkHubBlock> NETWORK_HUB = BLOCKS.register("network_hub", NetworkHubBlock::new);
public static final RegistryObject<NetworkSwitchBlock> NETWORK_SWITCH = BLOCKS.register("network_switch", NetworkSwitchBlock::new);
public static final RegistryObject<ProjectorBlock> PROJECTOR = BLOCKS.register("projector", ProjectorBlock::new);
public static final RegistryObject<RedstoneInterfaceBlock> REDSTONE_INTERFACE = BLOCKS.register("redstone_interface", RedstoneInterfaceBlock::new);
public static final RegistryObject<VxlanBlock> VXLAN_HUB = BLOCKS.register("vxlan_hub", VxlanBlock::new);
public static final RegistryObject<PciCardCageBlock> PCI_CARD_CAGE = BLOCKS.register("pci_card_cage", PciCardCageBlock::new);


///////////////////////////////////////////////////////////////////

Expand Down
61 changes: 0 additions & 61 deletions src/main/java/li/cil/oc2/common/block/NetworkSwitchBlock.java

This file was deleted.

100 changes: 0 additions & 100 deletions src/main/java/li/cil/oc2/common/block/PciCardCageBlock.java

This file was deleted.

70 changes: 0 additions & 70 deletions src/main/java/li/cil/oc2/common/block/VxlanBlock.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,8 @@ public final class BlockEntities {
public static final RegistryObject<BlockEntityType<KeyboardBlockEntity>> KEYBOARD = register(Blocks.KEYBOARD, KeyboardBlockEntity::new);
public static final RegistryObject<BlockEntityType<NetworkConnectorBlockEntity>> NETWORK_CONNECTOR = register(Blocks.NETWORK_CONNECTOR, NetworkConnectorBlockEntity::new);
public static final RegistryObject<BlockEntityType<NetworkHubBlockEntity>> NETWORK_HUB = register(Blocks.NETWORK_HUB, NetworkHubBlockEntity::new);
public static final RegistryObject<BlockEntityType<NetworkSwitchBlockEntity>> NETWORK_SWITCH = register(Blocks.NETWORK_SWITCH, NetworkSwitchBlockEntity::new);
public static final RegistryObject<BlockEntityType<ProjectorBlockEntity>> PROJECTOR = register(Blocks.PROJECTOR, ProjectorBlockEntity::new);
public static final RegistryObject<BlockEntityType<RedstoneInterfaceBlockEntity>> REDSTONE_INTERFACE = register(Blocks.REDSTONE_INTERFACE, RedstoneInterfaceBlockEntity::new);
public static final RegistryObject<BlockEntityType<VxlanBlockEntity>> VXLAN_HUB = register(Blocks.VXLAN_HUB, VxlanBlockEntity::new);
public static final RegistryObject<BlockEntityType<PciCardCageBlockEntity>> PCI_CARD_CAGE = register(Blocks.PCI_CARD_CAGE, PciCardCageBlockEntity::new);


///////////////////////////////////////////////////////////////////

Expand Down
Loading