Re-add the Detector
This commit is contained in:
@@ -47,6 +47,7 @@ public class ClientSetup {
|
||||
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "network_receiver"), (base, registry) -> new FullbrightBakedModel(base, new ResourceLocation(RS.ID, "block/network_receiver/cutouts/connected")));
|
||||
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "network_transmitter"), (base, registry) -> new FullbrightBakedModel(base, new ResourceLocation(RS.ID, "block/network_transmitter/cutouts/connected")));
|
||||
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "relay"), (base, registry) -> new FullbrightBakedModel(base, new ResourceLocation(RS.ID, "block/relay/cutouts/connected")));
|
||||
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "detector"), (base, registry) -> new FullbrightBakedModel(base, new ResourceLocation(RS.ID, "block/detector/cutouts/on")));
|
||||
|
||||
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "disk_drive"), (base, registry) -> new FullbrightBakedModel(
|
||||
new DiskDriveBakedModel(
|
||||
@@ -61,7 +62,6 @@ public class ClientSetup {
|
||||
|
||||
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "pattern"), (base, registry) -> new PatternBakedModel(base));
|
||||
|
||||
|
||||
ModelLoader.addSpecialModel(new ResourceLocation(RS.ID + ":block/disks/disk"));
|
||||
ModelLoader.addSpecialModel(new ResourceLocation(RS.ID + ":block/disks/disk_near_capacity"));
|
||||
ModelLoader.addSpecialModel(new ResourceLocation(RS.ID + ":block/disks/disk_full"));
|
||||
@@ -112,6 +112,7 @@ public class ClientSetup {
|
||||
ScreenManager.registerFactory(RSContainers.EXPORTER, ExporterScreen::new);
|
||||
ScreenManager.registerFactory(RSContainers.NETWORK_TRANSMITTER, NetworkTransmitterScreen::new);
|
||||
ScreenManager.registerFactory(RSContainers.RELAY, RelayScreen::new);
|
||||
ScreenManager.registerFactory(RSContainers.DETECTOR, DetectorScreen::new);
|
||||
|
||||
ClientRegistry.registerKeyBinding(RSKeyBindings.FOCUS_SEARCH_BAR);
|
||||
ClientRegistry.registerKeyBinding(RSKeyBindings.CLEAR_GRID_CRAFTING_MATRIX);
|
||||
|
||||
@@ -121,6 +121,7 @@ public final class RS {
|
||||
API.instance().getNetworkNodeRegistry().add(NetworkReceiverNetworkNode.ID, (tag, world, pos) -> readAndReturn(tag, new NetworkReceiverNetworkNode(world, pos)));
|
||||
API.instance().getNetworkNodeRegistry().add(NetworkTransmitterNetworkNode.ID, (tag, world, pos) -> readAndReturn(tag, new NetworkTransmitterNetworkNode(world, pos)));
|
||||
API.instance().getNetworkNodeRegistry().add(RelayNetworkNode.ID, (tag, world, pos) -> readAndReturn(tag, new RelayNetworkNode(world, pos)));
|
||||
API.instance().getNetworkNodeRegistry().add(DetectorNetworkNode.ID, (tag, world, pos) -> readAndReturn(tag, new DetectorNetworkNode(world, pos)));
|
||||
|
||||
API.instance().getGridManager().add(GridBlockGridFactory.ID, new GridBlockGridFactory());
|
||||
|
||||
@@ -168,6 +169,7 @@ public final class RS {
|
||||
e.getRegistry().register(new NetworkReceiverBlock());
|
||||
e.getRegistry().register(new NetworkTransmitterBlock());
|
||||
e.getRegistry().register(new RelayBlock());
|
||||
e.getRegistry().register(new DetectorBlock());
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -199,6 +201,7 @@ public final class RS {
|
||||
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(NetworkReceiverTile::new, RSBlocks.NETWORK_RECEIVER).build(null).setRegistryName(RS.ID, "network_receiver")));
|
||||
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(NetworkTransmitterTile::new, RSBlocks.NETWORK_TRANSMITTER).build(null).setRegistryName(RS.ID, "network_transmitter")));
|
||||
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(RelayTile::new, RSBlocks.RELAY).build(null).setRegistryName(RS.ID, "relay")));
|
||||
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(DetectorTile::new, RSBlocks.DETECTOR).build(null).setRegistryName(RS.ID, "detector")));
|
||||
}
|
||||
|
||||
private <T extends TileEntity> TileEntityType<T> registerTileDataParameters(TileEntityType<T> t) {
|
||||
@@ -222,6 +225,7 @@ public final class RS {
|
||||
e.getRegistry().register(IForgeContainerType.create(new PositionalTileContainerFactory<ExporterContainer, ExporterTile>((windowId, inv, tile) -> new ExporterContainer(tile, inv.player, windowId))).setRegistryName(RS.ID, "exporter"));
|
||||
e.getRegistry().register(IForgeContainerType.create(new PositionalTileContainerFactory<NetworkTransmitterContainer, NetworkTransmitterTile>((windowId, inv, tile) -> new NetworkTransmitterContainer(tile, inv.player, windowId))).setRegistryName(RS.ID, "network_transmitter"));
|
||||
e.getRegistry().register(IForgeContainerType.create(new PositionalTileContainerFactory<RelayContainer, RelayTile>((windowId, inv, tile) -> new RelayContainer(tile, inv.player, windowId))).setRegistryName(RS.ID, "relay"));
|
||||
e.getRegistry().register(IForgeContainerType.create(new PositionalTileContainerFactory<DetectorContainer, DetectorTile>((windowId, inv, tile) -> new DetectorContainer(tile, inv.player, windowId))).setRegistryName(RS.ID, "detector"));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -295,6 +299,7 @@ public final class RS {
|
||||
e.getRegistry().register(BlockUtils.createBlockItemFor(RSBlocks.NETWORK_RECEIVER));
|
||||
e.getRegistry().register(BlockUtils.createBlockItemFor(RSBlocks.NETWORK_TRANSMITTER));
|
||||
e.getRegistry().register(BlockUtils.createBlockItemFor(RSBlocks.RELAY));
|
||||
e.getRegistry().register(BlockUtils.createBlockItemFor(RSBlocks.DETECTOR));
|
||||
}
|
||||
|
||||
/* TODO
|
||||
|
||||
@@ -6,48 +6,30 @@ import net.minecraftforge.registries.ObjectHolder;
|
||||
public final class RSBlocks {
|
||||
@ObjectHolder(RS.ID + ":importer")
|
||||
public static final ImporterBlock IMPORTER = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":exporter")
|
||||
public static final ExporterBlock EXPORTER = null;
|
||||
|
||||
public static final BlockDetector DETECTOR = new BlockDetector();
|
||||
public static final BlockDestructor DESTRUCTOR = new BlockDestructor();
|
||||
public static final BlockConstructor CONSTRUCTOR = new BlockConstructor();
|
||||
|
||||
@ObjectHolder(RS.ID + ":detector")
|
||||
public static final DetectorBlock DETECTOR = null;
|
||||
@ObjectHolder(RS.ID + ":relay")
|
||||
public static final RelayBlock RELAY = null;
|
||||
|
||||
public static final BlockInterface INTERFACE = new BlockInterface();
|
||||
public static final BlockCraftingMonitor CRAFTING_MONITOR = new BlockCraftingMonitor();
|
||||
public static final BlockWirelessTransmitter WIRELESS_TRANSMITTER = new BlockWirelessTransmitter();
|
||||
public static final BlockCrafter CRAFTER = new BlockCrafter();
|
||||
|
||||
@ObjectHolder(RS.ID + ":network_transmitter")
|
||||
public static final NetworkTransmitterBlock NETWORK_TRANSMITTER = null;
|
||||
@ObjectHolder(RS.ID + ":network_receiver")
|
||||
public static final NetworkReceiverBlock NETWORK_RECEIVER = null;
|
||||
|
||||
public static final BlockFluidInterface FLUID_INTERFACE = new BlockFluidInterface();
|
||||
public static final BlockDiskManipulator DISK_MANIPULATOR = new BlockDiskManipulator();
|
||||
public static final BlockSecurityManager SECURITY_MANAGER = new BlockSecurityManager();
|
||||
|
||||
@ObjectHolder(RS.ID + ":quartz_enriched_iron_block")
|
||||
public static final QuartzEnrichedIronBlock QUARTZ_ENRICHED_IRON = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":machine_casing")
|
||||
public static final MachineCasingBlock MACHINE_CASING = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":controller")
|
||||
public static final ControllerBlock CONTROLLER = null;
|
||||
@ObjectHolder(RS.ID + ":creative_controller")
|
||||
public static final ControllerBlock CREATIVE_CONTROLLER = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":cable")
|
||||
public static final CableBlock CABLE = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":disk_drive")
|
||||
public static final DiskDriveBlock DISK_DRIVE = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":external_storage")
|
||||
public static final ExternalStorageBlock EXTERNAL_STORAGE = null;
|
||||
@ObjectHolder(RS.ID + ":grid")
|
||||
public static final GridBlock GRID = null;
|
||||
@ObjectHolder(RS.ID + ":crafting_grid")
|
||||
@@ -56,7 +38,6 @@ public final class RSBlocks {
|
||||
public static final GridBlock PATTERN_GRID = null;
|
||||
@ObjectHolder(RS.ID + ":fluid_grid")
|
||||
public static final GridBlock FLUID_GRID = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":1k_storage_block")
|
||||
public static final StorageBlock ONE_K_STORAGE_BLOCK = null;
|
||||
@ObjectHolder(RS.ID + ":4k_storage_block")
|
||||
@@ -67,7 +48,6 @@ public final class RSBlocks {
|
||||
public static final StorageBlock SIXTY_FOUR_K_STORAGE_BLOCK = null;
|
||||
@ObjectHolder(RS.ID + ":creative_storage_block")
|
||||
public static final StorageBlock CREATIVE_STORAGE_BLOCK = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":64k_fluid_storage_block")
|
||||
public static final FluidStorageBlock SIXTY_FOUR_K_FLUID_STORAGE_BLOCK = null;
|
||||
@ObjectHolder(RS.ID + ":256k_fluid_storage_block")
|
||||
@@ -79,9 +59,15 @@ public final class RSBlocks {
|
||||
@ObjectHolder(RS.ID + ":creative_fluid_storage_block")
|
||||
public static final FluidStorageBlock CREATIVE_FLUID_STORAGE_BLOCK = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":external_storage")
|
||||
public static final ExternalStorageBlock EXTERNAL_STORAGE = null;
|
||||
|
||||
public static final BlockDestructor DESTRUCTOR = new BlockDestructor();
|
||||
public static final BlockConstructor CONSTRUCTOR = new BlockConstructor();
|
||||
public static final BlockInterface INTERFACE = new BlockInterface();
|
||||
public static final BlockCraftingMonitor CRAFTING_MONITOR = new BlockCraftingMonitor();
|
||||
public static final BlockWirelessTransmitter WIRELESS_TRANSMITTER = new BlockWirelessTransmitter();
|
||||
public static final BlockCrafter CRAFTER = new BlockCrafter();
|
||||
public static final BlockFluidInterface FLUID_INTERFACE = new BlockFluidInterface();
|
||||
public static final BlockDiskManipulator DISK_MANIPULATOR = new BlockDiskManipulator();
|
||||
public static final BlockSecurityManager SECURITY_MANAGER = new BlockSecurityManager();
|
||||
public static final BlockStorageMonitor STORAGE_MONITOR = new BlockStorageMonitor();
|
||||
public static final BlockPortableGrid PORTABLE_GRID = new BlockPortableGrid();
|
||||
public static final BlockCrafterManager CRAFTER_MANAGER = new BlockCrafterManager();
|
||||
|
||||
@@ -5,14 +5,30 @@ import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
|
||||
public final class RSContainers {
|
||||
//@ObjectHolder(RS.ID + ":constructor")
|
||||
public static final ContainerType<ConstructorContainer> CONSTRUCTOR = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":controller")
|
||||
public static final ContainerType<ControllerContainer> CONTROLLER = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":grid")
|
||||
public static final ContainerType<GridContainer> GRID = null;
|
||||
@ObjectHolder(RS.ID + ":detector")
|
||||
public static final ContainerType<DetectorContainer> DETECTOR = null;
|
||||
@ObjectHolder(RS.ID + ":exporter")
|
||||
public static final ContainerType<ExporterContainer> EXPORTER = null;
|
||||
@ObjectHolder(RS.ID + ":external_storage")
|
||||
public static final ContainerType<ExternalStorageContainer> EXTERNAL_STORAGE = null;
|
||||
@ObjectHolder(RS.ID + ":filter")
|
||||
public static final ContainerType<FilterContainer> FILTER = null;
|
||||
@ObjectHolder(RS.ID + ":importer")
|
||||
public static final ContainerType<ImporterContainer> IMPORTER = null;
|
||||
@ObjectHolder(RS.ID + ":network_transmitter")
|
||||
public static final ContainerType<NetworkTransmitterContainer> NETWORK_TRANSMITTER = null;
|
||||
@ObjectHolder(RS.ID + ":relay")
|
||||
public static final ContainerType<RelayContainer> RELAY = null;
|
||||
@ObjectHolder(RS.ID + ":disk_drive")
|
||||
public static final ContainerType<DiskDriveContainer> DISK_DRIVE = null;
|
||||
@ObjectHolder(RS.ID + ":storage_block")
|
||||
public static final ContainerType<StorageContainer> STORAGE_BLOCK = null;
|
||||
@ObjectHolder(RS.ID + ":fluid_storage_block")
|
||||
public static final ContainerType<FluidStorageContainer> FLUID_STORAGE_BLOCK = null;
|
||||
|
||||
//@ObjectHolder(RS.ID + ":crafter")
|
||||
public static final ContainerType<CrafterContainer> CRAFTER = null;
|
||||
@@ -22,47 +38,16 @@ public final class RSContainers {
|
||||
public static final ContainerType<CraftingMonitorContainer> CRAFTING_MONITOR = null;
|
||||
//@ObjectHolder(RS.ID + ":destructor")
|
||||
public static final ContainerType<DestructorContainer> DESTRUCTOR = null;
|
||||
//@ObjectHolder(RS.ID + ":detector")
|
||||
public static final ContainerType<DetectorContainer> DETECTOR = null;
|
||||
|
||||
//@ObjectHolder(RS.ID + ":constructor")
|
||||
public static final ContainerType<ConstructorContainer> CONSTRUCTOR = null;
|
||||
//@ObjectHolder(RS.ID + ":disk_manipulator")
|
||||
public static final ContainerType<DiskManipulatorContainer> DISK_MANIPULATOR = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":exporter")
|
||||
public static final ContainerType<ExporterContainer> EXPORTER = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":external_storage")
|
||||
public static final ContainerType<ExternalStorageContainer> EXTERNAL_STORAGE = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":filter")
|
||||
public static final ContainerType<FilterContainer> FILTER = null;
|
||||
|
||||
//@ObjectHolder(RS.ID + ":fluid_interface")
|
||||
public static final ContainerType<FluidInterfaceContainer> FLUID_INTERFACE = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":importer")
|
||||
public static final ContainerType<ImporterContainer> IMPORTER = null;
|
||||
|
||||
//@ObjectHolder(RS.ID + ":interface")
|
||||
public static final ContainerType<ImporterContainer> INTERFACE = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":network_transmitter")
|
||||
public static final ContainerType<NetworkTransmitterContainer> NETWORK_TRANSMITTER = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":relay")
|
||||
public static final ContainerType<RelayContainer> RELAY = null;
|
||||
|
||||
//@ObjectHolder(RS.ID + ":security_manager")
|
||||
public static final ContainerType<SecurityManagerContainer> SECURITY_MANAGER = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":disk_drive")
|
||||
public static final ContainerType<DiskDriveContainer> DISK_DRIVE = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":storage_block")
|
||||
public static final ContainerType<StorageContainer> STORAGE_BLOCK = null;
|
||||
@ObjectHolder(RS.ID + ":fluid_storage_block")
|
||||
public static final ContainerType<FluidStorageContainer> FLUID_STORAGE_BLOCK = null;
|
||||
|
||||
//@ObjectHolder(RS.ID + ":storage_monitor")
|
||||
public static final ContainerType<StorageMonitorContainer> STORAGE_MONITOR = null;
|
||||
//@ObjectHolder(RS.ID + ":wireless_transmitter")
|
||||
|
||||
@@ -8,7 +8,6 @@ public class RSOldConfig {
|
||||
public int craftingMonitorUsage;
|
||||
public int crafterManagerUsage;
|
||||
public int destructorUsage;
|
||||
public int detectorUsage;
|
||||
public int interfaceUsage;
|
||||
public int fluidInterfaceUsage;
|
||||
public int wirelessTransmitterUsage;
|
||||
@@ -76,7 +75,6 @@ public class RSOldConfig {
|
||||
craftingMonitorUsage = config.getInt("craftingMonitor", ENERGY, 2, 0, Integer.MAX_VALUE, "The energy used by Crafting Monitors");
|
||||
crafterManagerUsage = config.getInt("crafterManager", ENERGY, 4, 0, Integer.MAX_VALUE, "The energy used by Crafter Managers");
|
||||
destructorUsage = config.getInt("destructor", ENERGY, 1, 0, Integer.MAX_VALUE, "The energy used by Destructors");
|
||||
detectorUsage = config.getInt("detector", ENERGY, 2, 0, Integer.MAX_VALUE, "The energy used by Detectors");
|
||||
interfaceUsage = config.getInt("interface", ENERGY, 3, 0, Integer.MAX_VALUE, "The energy used by Interfaces");
|
||||
fluidInterfaceUsage = config.getInt("fluidInterface", ENERGY, 3, 0, Integer.MAX_VALUE, "The energy used by Fluid Interfaces");
|
||||
wirelessTransmitterUsage = config.getInt("wirelessTransmitter", ENERGY, 8, 0, Integer.MAX_VALUE, "The energy used by Wireless Transmitters");
|
||||
|
||||
@@ -8,41 +8,18 @@ import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
|
||||
public class RSTiles {
|
||||
//@ObjectHolder(RS.ID + ":constructor")
|
||||
public static final TileEntityType<TileConstructor> CONSTRUCTOR = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":controller")
|
||||
public static final TileEntityType<ControllerTile> CONTROLLER = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":creative_controller")
|
||||
public static final TileEntityType<ControllerTile> CREATIVE_CONTROLLER = null;
|
||||
|
||||
//@ObjectHolder(RS.ID + ":crafter")
|
||||
public static final TileEntityType<TileCrafter> CRAFTER = null;
|
||||
//@ObjectHolder(RS.ID + ":crafter_manager")
|
||||
public static final TileEntityType<TileCrafter> CRAFTER_MANAGER = null;
|
||||
//@ObjectHolder(RS.ID + ":crafting_monitor")
|
||||
public static final TileEntityType<TileCraftingMonitor> CRAFTING_MONITOR = null;
|
||||
//@ObjectHolder(RS.ID + ":destructor")
|
||||
public static final TileEntityType<TileDestructor> DESTRUCTOR = null;
|
||||
//@ObjectHolder(RS.ID + ":detector")
|
||||
public static final TileEntityType<TileDetector> DETECTOR = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":detector")
|
||||
public static final TileEntityType<DetectorTile> DETECTOR = null;
|
||||
@ObjectHolder(RS.ID + ":disk_drive")
|
||||
public static final TileEntityType<DiskDriveTile> DISK_DRIVE = null;
|
||||
|
||||
//@ObjectHolder(RS.ID + ":disk_manipulator")
|
||||
public static final TileEntityType<TileDiskManipulator> DISK_MANIPULATOR = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":exporter")
|
||||
public static final TileEntityType<ExporterTile> EXPORTER = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":external_storage")
|
||||
public static final TileEntityType<ExternalStorageTile> EXTERNAL_STORAGE = null;
|
||||
|
||||
//@ObjectHolder(RS.ID + ":fluid_interface")
|
||||
public static final TileEntityType<TileFluidInterface> FLUID_INTERFACE = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":grid")
|
||||
public static final TileEntityType<GridTile> GRID = null;
|
||||
@ObjectHolder(RS.ID + ":crafting_grid")
|
||||
@@ -51,31 +28,16 @@ public class RSTiles {
|
||||
public static final TileEntityType<GridTile> PATTERN_GRID = null;
|
||||
@ObjectHolder(RS.ID + ":fluid_grid")
|
||||
public static final TileEntityType<GridTile> FLUID_GRID = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":importer")
|
||||
public static final TileEntityType<ImporterTile> IMPORTER = null;
|
||||
|
||||
//@ObjectHolder(RS.ID + ":interface")
|
||||
public static final TileEntityType<ImporterTile> INTERFACE = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":network_transmitter")
|
||||
public static final TileEntityType<NetworkTransmitterTile> NETWORK_TRANSMITTER = null;
|
||||
@ObjectHolder(RS.ID + ":network_receiver")
|
||||
public static final TileEntityType<NetworkReceiverTile> NETWORK_RECEIVER = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":relay")
|
||||
public static final TileEntityType<RelayTile> RELAY = null;
|
||||
|
||||
//@ObjectHolder(RS.ID + ":security_manager")
|
||||
public static final TileEntityType<TileSecurityManager> SECURITY_MANAGER = null;
|
||||
//@ObjectHolder(RS.ID + ":storage_monitor")
|
||||
public static final TileEntityType<TileStorageMonitor> STORAGE_MONITOR = null;
|
||||
//@ObjectHolder(RS.ID + ":wireless_transmitter")
|
||||
public static final TileEntityType<TileSecurityManager> WIRELESS_TRANSMITTER = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":cable")
|
||||
public static final TileEntityType<CableTile> CABLE = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":1k_storage_block")
|
||||
public static final TileEntityType<StorageTile> ONE_K_STORAGE_BLOCK = null;
|
||||
@ObjectHolder(RS.ID + ":4k_storage_block")
|
||||
@@ -86,7 +48,6 @@ public class RSTiles {
|
||||
public static final TileEntityType<StorageTile> SIXTY_FOUR_K_STORAGE_BLOCK = null;
|
||||
@ObjectHolder(RS.ID + ":creative_storage_block")
|
||||
public static final TileEntityType<StorageTile> CREATIVE_STORAGE_BLOCK = null;
|
||||
|
||||
@ObjectHolder(RS.ID + ":64k_fluid_storage_block")
|
||||
public static final TileEntityType<FluidStorageTile> SIXTY_FOUR_K_FLUID_STORAGE_BLOCK = null;
|
||||
@ObjectHolder(RS.ID + ":256k_fluid_storage_block")
|
||||
@@ -100,4 +61,26 @@ public class RSTiles {
|
||||
|
||||
//@ObjectHolder(RS.ID + ":portable_grid")
|
||||
public static final TileEntityType<TilePortableGrid> PORTABLE_GRID = null;
|
||||
//@ObjectHolder(RS.ID + ":security_manager")
|
||||
public static final TileEntityType<TileSecurityManager> SECURITY_MANAGER = null;
|
||||
//@ObjectHolder(RS.ID + ":storage_monitor")
|
||||
public static final TileEntityType<TileStorageMonitor> STORAGE_MONITOR = null;
|
||||
//@ObjectHolder(RS.ID + ":wireless_transmitter")
|
||||
public static final TileEntityType<TileSecurityManager> WIRELESS_TRANSMITTER = null;
|
||||
//@ObjectHolder(RS.ID + ":interface")
|
||||
public static final TileEntityType<ImporterTile> INTERFACE = null;
|
||||
//@ObjectHolder(RS.ID + ":fluid_interface")
|
||||
public static final TileEntityType<TileFluidInterface> FLUID_INTERFACE = null;
|
||||
//@ObjectHolder(RS.ID + ":disk_manipulator")
|
||||
public static final TileEntityType<TileDiskManipulator> DISK_MANIPULATOR = null;
|
||||
//@ObjectHolder(RS.ID + ":crafter")
|
||||
public static final TileEntityType<TileCrafter> CRAFTER = null;
|
||||
//@ObjectHolder(RS.ID + ":crafter_manager")
|
||||
public static final TileEntityType<TileCrafter> CRAFTER_MANAGER = null;
|
||||
//@ObjectHolder(RS.ID + ":crafting_monitor")
|
||||
public static final TileEntityType<TileCraftingMonitor> CRAFTING_MONITOR = null;
|
||||
//@ObjectHolder(RS.ID + ":destructor")
|
||||
public static final TileEntityType<TileDestructor> DESTRUCTOR = null;
|
||||
//@ObjectHolder(RS.ID + ":constructor")
|
||||
public static final TileEntityType<TileConstructor> CONSTRUCTOR = null;
|
||||
}
|
||||
|
||||
@@ -4,16 +4,16 @@ import com.raoulvdberge.refinedstorage.RS;
|
||||
import com.raoulvdberge.refinedstorage.RSBlocks;
|
||||
import com.raoulvdberge.refinedstorage.api.network.INetwork;
|
||||
import com.raoulvdberge.refinedstorage.api.util.IComparer;
|
||||
import com.raoulvdberge.refinedstorage.block.DetectorBlock;
|
||||
import com.raoulvdberge.refinedstorage.inventory.fluid.FluidInventory;
|
||||
import com.raoulvdberge.refinedstorage.inventory.item.BaseItemHandler;
|
||||
import com.raoulvdberge.refinedstorage.inventory.listener.NetworkNodeFluidInventoryListener;
|
||||
import com.raoulvdberge.refinedstorage.inventory.listener.NetworkNodeInventoryListener;
|
||||
import com.raoulvdberge.refinedstorage.tile.TileDetector;
|
||||
import com.raoulvdberge.refinedstorage.tile.DetectorTile;
|
||||
import com.raoulvdberge.refinedstorage.tile.config.IComparable;
|
||||
import com.raoulvdberge.refinedstorage.tile.config.IType;
|
||||
import com.raoulvdberge.refinedstorage.tile.config.RedstoneMode;
|
||||
import com.raoulvdberge.refinedstorage.util.StackUtils;
|
||||
import com.raoulvdberge.refinedstorage.util.WorldUtils;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -23,7 +23,7 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
|
||||
public class NetworkNodeDetector extends NetworkNode implements IComparable, IType {
|
||||
public class DetectorNetworkNode extends NetworkNode implements IComparable, IType {
|
||||
public static final ResourceLocation ID = new ResourceLocation(RS.ID, "detector");
|
||||
|
||||
private static final int SPEED = 5;
|
||||
@@ -49,13 +49,13 @@ public class NetworkNodeDetector extends NetworkNode implements IComparable, ITy
|
||||
private boolean powered = false;
|
||||
private boolean wasPowered;
|
||||
|
||||
public NetworkNodeDetector(World world, BlockPos pos) {
|
||||
public DetectorNetworkNode(World world, BlockPos pos) {
|
||||
super(world, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyUsage() {
|
||||
return RS.INSTANCE.config.detectorUsage;
|
||||
return RS.SERVER_CONFIG.getDetector().getUsage();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -65,9 +65,8 @@ public class NetworkNodeDetector extends NetworkNode implements IComparable, ITy
|
||||
if (powered != wasPowered) {
|
||||
wasPowered = powered;
|
||||
|
||||
world.setBlockState(pos, world.getBlockState(pos).with(DetectorBlock.POWERED, powered));
|
||||
world.notifyNeighborsOfStateChange(pos, RSBlocks.DETECTOR);
|
||||
|
||||
WorldUtils.updateBlock(world, pos);
|
||||
}
|
||||
|
||||
if (canUpdate() && ticks % SPEED == 0) {
|
||||
@@ -222,7 +221,7 @@ public class NetworkNodeDetector extends NetworkNode implements IComparable, ITy
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return world.isRemote ? TileDetector.TYPE.getValue() : type;
|
||||
return world.isRemote ? DetectorTile.TYPE.getValue() : type;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1,82 +0,0 @@
|
||||
package com.raoulvdberge.refinedstorage.block;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.block.info.BlockInfoBuilder;
|
||||
import com.raoulvdberge.refinedstorage.tile.TileDetector;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
|
||||
public class BlockDetector extends BlockNode {
|
||||
private static final BooleanProperty POWERED = BooleanProperty.create("powered");
|
||||
|
||||
public BlockDetector() {
|
||||
super(BlockInfoBuilder.forId("detector").tileEntity(TileDetector::new).create());
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void registerModels(IModelRegistration modelRegistration) {
|
||||
modelRegistration.setModel(this, 0, new ModelResourceLocation(info.getId(), "inventory"));
|
||||
|
||||
modelRegistration.addBakedModelOverride(info.getId(), base -> new BakedModelFullbright(base, RS.ID + ":blocks/detector/cutouts/on"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return createBlockStateBuilder()
|
||||
.add(POWERED)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getActualState(BlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return super.getActualState(state, world, pos)
|
||||
.withProperty(POWERED, ((TileDetector) world.getTileEntity(pos)).getNode().isPowered());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CollisionGroup> getCollisions(TileEntity tile, BlockState state) {
|
||||
return Collections.singletonList(ConstantsDetector.COLLISION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, BlockState state, PlayerEntity player, EnumHand hand, Direction side, float hitX, float hitY, float hitZ) {
|
||||
return openNetworkGui(RSGui.DETECTOR, player, world, pos, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public int getWeakPower(BlockState state, IBlockAccess world, BlockPos pos, Direction side) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
return (tile instanceof TileDetector && ((TileDetector) tile).getNode().isPowered()) ? 15 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean canProvidePower(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean isOpaqueCube(BlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean isFullCube(BlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, BlockState state, BlockPos pos, Direction face) {
|
||||
return BlockFaceShape.UNDEFINED;
|
||||
}*/
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.raoulvdberge.refinedstorage.block;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.RS;
|
||||
import com.raoulvdberge.refinedstorage.container.DetectorContainer;
|
||||
import com.raoulvdberge.refinedstorage.container.factory.PositionalTileContainerProvider;
|
||||
import com.raoulvdberge.refinedstorage.tile.DetectorTile;
|
||||
import com.raoulvdberge.refinedstorage.util.BlockUtils;
|
||||
import com.raoulvdberge.refinedstorage.util.NetworkUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.network.NetworkHooks;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class DetectorBlock extends NodeBlock {
|
||||
public static final BooleanProperty POWERED = BooleanProperty.create("powered");
|
||||
|
||||
private static final VoxelShape SHAPE = makeCuboidShape(0, 0, 0, 16, 5, 16);
|
||||
|
||||
public DetectorBlock() {
|
||||
super(BlockUtils.DEFAULT_ROCK_PROPERTIES);
|
||||
|
||||
this.setRegistryName(RS.ID, "detector");
|
||||
this.setDefaultState(this.getStateContainer().getBaseState().with(POWERED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
super.fillStateContainer(builder);
|
||||
|
||||
builder.add(POWERED);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
|
||||
return SHAPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean canProvidePower(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public int getWeakPower(BlockState state, IBlockReader world, BlockPos pos, Direction side) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
return (tile instanceof DetectorTile && ((DetectorTile) tile).getNode().isPowered()) ? 15 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (!world.isRemote) {
|
||||
return NetworkUtils.attemptModify(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui(
|
||||
(ServerPlayerEntity) player,
|
||||
new PositionalTileContainerProvider<DetectorTile>(
|
||||
new TranslationTextComponent("gui.refinedstorage.detector"),
|
||||
(tile, windowId, inventory, p) -> new DetectorContainer(tile, player, windowId),
|
||||
pos
|
||||
),
|
||||
pos
|
||||
));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
return new DetectorTile();
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@ public class ServerConfig {
|
||||
private NetworkReceiver networkReceiver;
|
||||
private NetworkTransmitter networkTransmitter;
|
||||
private Relay relay;
|
||||
private Detector detector;
|
||||
private Upgrades upgrades;
|
||||
|
||||
public ServerConfig() {
|
||||
@@ -33,6 +34,7 @@ public class ServerConfig {
|
||||
networkReceiver = new NetworkReceiver();
|
||||
networkTransmitter = new NetworkTransmitter();
|
||||
relay = new Relay();
|
||||
detector = new Detector();
|
||||
upgrades = new Upgrades();
|
||||
|
||||
spec = builder.build();
|
||||
@@ -90,6 +92,10 @@ public class ServerConfig {
|
||||
return relay;
|
||||
}
|
||||
|
||||
public Detector getDetector() {
|
||||
return detector;
|
||||
}
|
||||
|
||||
public ForgeConfigSpec getSpec() {
|
||||
return spec;
|
||||
}
|
||||
@@ -433,4 +439,20 @@ public class ServerConfig {
|
||||
return usage.get();
|
||||
}
|
||||
}
|
||||
|
||||
public class Detector {
|
||||
private final ForgeConfigSpec.IntValue usage;
|
||||
|
||||
public Detector() {
|
||||
builder.push("detector");
|
||||
|
||||
usage = builder.comment("The energy used by the Detector").defineInRange("usage", 2, 0, Integer.MAX_VALUE);
|
||||
|
||||
builder.pop();
|
||||
}
|
||||
|
||||
public int getUsage() {
|
||||
return usage.get();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,12 +3,12 @@ package com.raoulvdberge.refinedstorage.container;
|
||||
import com.raoulvdberge.refinedstorage.RSContainers;
|
||||
import com.raoulvdberge.refinedstorage.container.slot.filter.FilterSlot;
|
||||
import com.raoulvdberge.refinedstorage.container.slot.filter.FluidFilterSlot;
|
||||
import com.raoulvdberge.refinedstorage.tile.TileDetector;
|
||||
import com.raoulvdberge.refinedstorage.tile.DetectorTile;
|
||||
import com.raoulvdberge.refinedstorage.tile.config.IType;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
|
||||
public class DetectorContainer extends BaseContainer {
|
||||
public DetectorContainer(TileDetector detector, PlayerEntity player, int windowId) {
|
||||
public DetectorContainer(DetectorTile detector, PlayerEntity player, int windowId) {
|
||||
super(RSContainers.DETECTOR, detector, player, windowId);
|
||||
|
||||
addSlot(new FilterSlot(detector.getNode().getItemFilters(), 0, 107, 20).setEnableHandler(() -> detector.getNode().getType() == IType.ITEMS));
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.raoulvdberge.refinedstorage.render.constants;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.render.collision.CollisionGroup;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
|
||||
public final class ConstantsDetector {
|
||||
public static final CollisionGroup COLLISION = new CollisionGroup().addItem(new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 5D / 16D, 1.0D));
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.raoulvdberge.refinedstorage.screen;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.RS;
|
||||
import com.raoulvdberge.refinedstorage.container.DetectorContainer;
|
||||
import com.raoulvdberge.refinedstorage.screen.widget.sidebutton.DetectorModeSideButton;
|
||||
import com.raoulvdberge.refinedstorage.screen.widget.sidebutton.ExactModeSideButton;
|
||||
import com.raoulvdberge.refinedstorage.screen.widget.sidebutton.TypeSideButton;
|
||||
import com.raoulvdberge.refinedstorage.tile.DetectorTile;
|
||||
import com.raoulvdberge.refinedstorage.tile.data.TileDataManager;
|
||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
public class DetectorScreen extends BaseScreen<DetectorContainer> {
|
||||
private TextFieldWidget amountField;
|
||||
|
||||
public DetectorScreen(DetectorContainer container, PlayerInventory inventory, ITextComponent title) {
|
||||
super(container, 176, 137, inventory, title);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(int x, int y) {
|
||||
addSideButton(new TypeSideButton(this, DetectorTile.TYPE));
|
||||
|
||||
addSideButton(new DetectorModeSideButton(this));
|
||||
|
||||
addSideButton(new ExactModeSideButton(this, DetectorTile.COMPARE));
|
||||
|
||||
amountField = new TextFieldWidget(font, x + 41 + 1, y + 23 + 1, 50, font.FONT_HEIGHT, "");
|
||||
amountField.setText(String.valueOf(DetectorTile.AMOUNT.getValue()));
|
||||
amountField.setEnableBackgroundDrawing(false);
|
||||
amountField.setVisible(true);
|
||||
amountField.setCanLoseFocus(true);
|
||||
amountField.setFocused2(false);
|
||||
amountField.setTextColor(16777215);
|
||||
amountField.func_212954_a(value -> {
|
||||
try {
|
||||
int result = Integer.parseInt(value);
|
||||
|
||||
TileDataManager.setParameter(DetectorTile.AMOUNT, result);
|
||||
} catch (NumberFormatException e) {
|
||||
// NO OP
|
||||
}
|
||||
});
|
||||
|
||||
addButton(amountField);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(int x, int y) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderBackground(int x, int y, int mouseX, int mouseY) {
|
||||
bindTexture(RS.ID, "gui/detector.png");
|
||||
|
||||
blit(x, y, 0, 0, xSize, ySize);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderForeground(int mouseX, int mouseY) {
|
||||
renderString(7, 7, title.getFormattedText());
|
||||
renderString(7, 43, I18n.format("container.inventory"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean keyPressed(int key, int scanCode, int modifiers) {
|
||||
if (key == GLFW.GLFW_KEY_ESCAPE) {
|
||||
minecraft.player.closeScreen();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (amountField.keyPressed(key, scanCode, modifiers) || amountField.func_212955_f()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.keyPressed(key, scanCode, modifiers);
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
package com.raoulvdberge.refinedstorage.screen;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.RS;
|
||||
import com.raoulvdberge.refinedstorage.container.DetectorContainer;
|
||||
import com.raoulvdberge.refinedstorage.screen.widget.sidebutton.DetectorModeSideButton;
|
||||
import com.raoulvdberge.refinedstorage.screen.widget.sidebutton.ExactModeSideButton;
|
||||
import com.raoulvdberge.refinedstorage.screen.widget.sidebutton.TypeSideButton;
|
||||
import com.raoulvdberge.refinedstorage.tile.TileDetector;
|
||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
|
||||
public class GuiDetector extends BaseScreen<DetectorContainer> {
|
||||
private TextFieldWidget amount;
|
||||
|
||||
public GuiDetector(DetectorContainer container, PlayerInventory inventory) {
|
||||
super(container, 176, 137, inventory, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(int x, int y) {
|
||||
addSideButton(new TypeSideButton(this, TileDetector.TYPE));
|
||||
|
||||
addSideButton(new DetectorModeSideButton(this));
|
||||
|
||||
addSideButton(new ExactModeSideButton(this, TileDetector.COMPARE));
|
||||
|
||||
amount = new TextFieldWidget(font, x + 41 + 1, y + 23 + 1, 50, font.FONT_HEIGHT, "");
|
||||
amount.setText(String.valueOf(TileDetector.AMOUNT.getValue()));
|
||||
amount.setEnableBackgroundDrawing(false);
|
||||
amount.setVisible(true);
|
||||
amount.setTextColor(16777215);
|
||||
amount.setCanLoseFocus(true);
|
||||
amount.setFocused2(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(int x, int y) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderBackground(int x, int y, int mouseX, int mouseY) {
|
||||
bindTexture(RS.ID, "gui/detector.png");
|
||||
|
||||
blit(x, y, 0, 0, xSize, ySize);
|
||||
|
||||
amount.renderButton(0, 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderForeground(int mouseX, int mouseY) {
|
||||
renderString(7, 7, I18n.format("gui.refinedstorage:detector"));
|
||||
renderString(7, 43, I18n.format("container.inventory"));
|
||||
}
|
||||
|
||||
/* TODO
|
||||
@Override
|
||||
protected void keyTyped(char character, int keyCode) throws IOException {
|
||||
if (!checkHotbarKeys(keyCode) && amount.textboxKeyTyped(character, keyCode)) {
|
||||
Integer result = Ints.tryParse(amount.getText());
|
||||
|
||||
if (result != null) {
|
||||
TileDataManager.setParameter(TileDetector.AMOUNT, result);
|
||||
}
|
||||
} else {
|
||||
super.keyTyped(character, keyCode);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
|
||||
super.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
|
||||
amount.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
}*/
|
||||
|
||||
public TextFieldWidget getAmount() {
|
||||
return amount;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.raoulvdberge.refinedstorage.screen.widget.sidebutton;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeDetector;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.network.node.DetectorNetworkNode;
|
||||
import com.raoulvdberge.refinedstorage.screen.BaseScreen;
|
||||
import com.raoulvdberge.refinedstorage.tile.TileDetector;
|
||||
import com.raoulvdberge.refinedstorage.tile.DetectorTile;
|
||||
import com.raoulvdberge.refinedstorage.tile.data.TileDataManager;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
@@ -14,26 +14,26 @@ public class DetectorModeSideButton extends SideButton {
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return I18n.format("sidebutton.refinedstorage.detector.mode") + "\n" + TextFormatting.GRAY + I18n.format("sidebutton.refinedstorage.detector.mode." + TileDetector.MODE.getValue());
|
||||
return I18n.format("sidebutton.refinedstorage.detector.mode") + "\n" + TextFormatting.GRAY + I18n.format("sidebutton.refinedstorage.detector.mode." + DetectorTile.MODE.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderButtonIcon(int x, int y) {
|
||||
screen.blit(x, y, TileDetector.MODE.getValue() * 16, 176, 16, 16);
|
||||
screen.blit(x, y, DetectorTile.MODE.getValue() * 16, 176, 16, 16);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPress() {
|
||||
int mode = TileDetector.MODE.getValue();
|
||||
int mode = DetectorTile.MODE.getValue();
|
||||
|
||||
if (mode == NetworkNodeDetector.MODE_EQUAL) {
|
||||
mode = NetworkNodeDetector.MODE_ABOVE;
|
||||
} else if (mode == NetworkNodeDetector.MODE_ABOVE) {
|
||||
mode = NetworkNodeDetector.MODE_UNDER;
|
||||
} else if (mode == NetworkNodeDetector.MODE_UNDER) {
|
||||
mode = NetworkNodeDetector.MODE_EQUAL;
|
||||
if (mode == DetectorNetworkNode.MODE_EQUAL) {
|
||||
mode = DetectorNetworkNode.MODE_ABOVE;
|
||||
} else if (mode == DetectorNetworkNode.MODE_ABOVE) {
|
||||
mode = DetectorNetworkNode.MODE_UNDER;
|
||||
} else if (mode == DetectorNetworkNode.MODE_UNDER) {
|
||||
mode = DetectorNetworkNode.MODE_EQUAL;
|
||||
}
|
||||
|
||||
TileDataManager.setParameter(TileDetector.MODE, mode);
|
||||
TileDataManager.setParameter(DetectorTile.MODE, mode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package com.raoulvdberge.refinedstorage.tile;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.RSTiles;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeDetector;
|
||||
import com.raoulvdberge.refinedstorage.screen.BaseScreen;
|
||||
import com.raoulvdberge.refinedstorage.screen.GuiDetector;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.network.node.DetectorNetworkNode;
|
||||
import com.raoulvdberge.refinedstorage.tile.config.IComparable;
|
||||
import com.raoulvdberge.refinedstorage.tile.config.IType;
|
||||
import com.raoulvdberge.refinedstorage.tile.data.TileDataParameter;
|
||||
@@ -14,25 +12,25 @@ import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class TileDetector extends NetworkNodeTile<NetworkNodeDetector> {
|
||||
private static final String NBT_POWERED = "Powered";
|
||||
|
||||
public static final TileDataParameter<Integer, TileDetector> COMPARE = IComparable.createParameter();
|
||||
public static final TileDataParameter<Integer, TileDetector> TYPE = IType.createParameter();
|
||||
public static final TileDataParameter<Integer, TileDetector> MODE = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> t.getNode().getMode(), (t, v) -> {
|
||||
if (v == NetworkNodeDetector.MODE_UNDER || v == NetworkNodeDetector.MODE_EQUAL || v == NetworkNodeDetector.MODE_ABOVE) {
|
||||
public class DetectorTile extends NetworkNodeTile<DetectorNetworkNode> {
|
||||
public static final TileDataParameter<Integer, DetectorTile> COMPARE = IComparable.createParameter();
|
||||
public static final TileDataParameter<Integer, DetectorTile> TYPE = IType.createParameter();
|
||||
public static final TileDataParameter<Integer, DetectorTile> MODE = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> t.getNode().getMode(), (t, v) -> {
|
||||
if (v == DetectorNetworkNode.MODE_UNDER || v == DetectorNetworkNode.MODE_EQUAL || v == DetectorNetworkNode.MODE_ABOVE) {
|
||||
t.getNode().setMode(v);
|
||||
t.getNode().markDirty();
|
||||
}
|
||||
});
|
||||
public static final TileDataParameter<Integer, TileDetector> AMOUNT = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> t.getNode().getAmount(), (t, v) -> {
|
||||
public static final TileDataParameter<Integer, DetectorTile> AMOUNT = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> t.getNode().getAmount(), (t, v) -> {
|
||||
t.getNode().setAmount(v);
|
||||
t.getNode().markDirty();
|
||||
}, (initial, p) -> BaseScreen.executeLater(GuiDetector.class, detector -> detector.getAmount().setText(String.valueOf(p))));
|
||||
});
|
||||
|
||||
public TileDetector() {
|
||||
private static final String NBT_POWERED = "Powered";
|
||||
|
||||
public DetectorTile() {
|
||||
super(RSTiles.DETECTOR);
|
||||
|
||||
|
||||
dataManager.addWatchedParameter(COMPARE);
|
||||
dataManager.addWatchedParameter(TYPE);
|
||||
dataManager.addWatchedParameter(MODE);
|
||||
@@ -57,7 +55,7 @@ public class TileDetector extends NetworkNodeTile<NetworkNodeDetector> {
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public NetworkNodeDetector createNode(World world, BlockPos pos) {
|
||||
return new NetworkNodeDetector(world, pos);
|
||||
public DetectorNetworkNode createNode(World world, BlockPos pos) {
|
||||
return new DetectorNetworkNode(world, pos);
|
||||
}
|
||||
}
|
||||
@@ -25,11 +25,10 @@ public abstract class NetworkNodeTile<N extends NetworkNode> extends BaseTile im
|
||||
public static final TileDataParameter<Integer, NetworkNodeTile> REDSTONE_MODE = RedstoneMode.createParameter();
|
||||
|
||||
private N clientNode;
|
||||
private N removedNode;
|
||||
|
||||
private LazyOptional<INetworkNodeProxy<N>> networkNodeProxy = LazyOptional.of(() -> this);
|
||||
|
||||
private N removedNode;
|
||||
|
||||
public NetworkNodeTile(TileEntityType<?> tileType) {
|
||||
super(tileType);
|
||||
|
||||
|
||||
@@ -1,29 +1,10 @@
|
||||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"textures": {
|
||||
"side": "refinedstorage:blocks/detector/side",
|
||||
"bottom": "refinedstorage:blocks/detector/bottom",
|
||||
"top": "refinedstorage:blocks/detector/top",
|
||||
"torch": "refinedstorage:blocks/detector/cutouts/off",
|
||||
"particle": "refinedstorage:blocks/detector/side"
|
||||
},
|
||||
"model": "refinedstorage:detector"
|
||||
},
|
||||
"variants": {
|
||||
"inventory": [
|
||||
{
|
||||
"transform": "forge:default-block"
|
||||
}
|
||||
],
|
||||
"powered": {
|
||||
"true": {
|
||||
"textures": {
|
||||
"torch": "refinedstorage:blocks/detector/cutouts/on"
|
||||
}
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
"powered=true": {
|
||||
"model": "refinedstorage:block/detector_on"
|
||||
},
|
||||
"powered=false": {
|
||||
"model": "refinedstorage:block/detector_off"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
"gui.refinedstorage.external_storage": "External Storage",
|
||||
"gui.refinedstorage.importer": "Importer",
|
||||
"gui.refinedstorage.exporter": "Exporter",
|
||||
"gui.refinedstorage:detector": "Detector",
|
||||
"gui.refinedstorage.detector": "Detector",
|
||||
"gui.refinedstorage:destructor": "Destructor",
|
||||
"gui.refinedstorage:constructor": "Constructor",
|
||||
"gui.refinedstorage.relay": "Relay",
|
||||
@@ -185,7 +185,7 @@
|
||||
"block.refinedstorage.external_storage": "External Storage",
|
||||
"block.refinedstorage.importer": "Importer",
|
||||
"block.refinedstorage.exporter": "Exporter",
|
||||
"block.refinedstorage:detector": "Detector",
|
||||
"block.refinedstorage.detector": "Detector",
|
||||
"block.refinedstorage.machine_casing": "Machine Casing",
|
||||
"block.refinedstorage:destructor": "Destructor",
|
||||
"block.refinedstorage:constructor": "Constructor",
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
{
|
||||
"credit": "Made with Blockbench",
|
||||
"parent": "block/cube",
|
||||
"textures": {
|
||||
"side": "refinedstorage:block/detector/side",
|
||||
"bottom": "refinedstorage:block/detector/bottom",
|
||||
"top": "refinedstorage:block/detector/top",
|
||||
"particle": "refinedstorage:block/detector/side"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Handle",
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "refinedstorage:block/detector",
|
||||
"textures": {
|
||||
"torch": "refinedstorage:block/detector/cutouts/off"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "refinedstorage:block/detector",
|
||||
"textures": {
|
||||
"torch": "refinedstorage:block/detector/cutouts/on"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "refinedstorage:block/detector_off"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"rolls": 1,
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "refinedstorage:detector"
|
||||
}
|
||||
],
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -19,7 +19,7 @@
|
||||
"item": "refinedstorage:machine_casing"
|
||||
},
|
||||
"P": {
|
||||
"item": "#improved_processor"
|
||||
"item": "refinedstorage:improved_processor"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
Reference in New Issue
Block a user