Colored Network Blocks (#2682)

* add color property to blocks

* add colors to almost all cutouts
add model generation for the blocks
add new models

* fix creative controller model
add item models

* fixed controller drops
fixed diskmanipulator item model

* added colored wireless antenna and detector
fixed sidedness in onBlockActivated

* cleanup

* remove wireless transmitter tooltip as it is no longer accurate

* Move Blocks and Items into DeferredRegistries

* fix issues and registration order

* formatting changes

* change colored blocks from blockstate to block

* fix some formatting

* remove files that can be generated.

* remove more files that can be generated.

* fix most requested changes

* remove string manipulation

* fix tag loop

* register colored variants last.

* fix datagen

* fix controller replacing TE

* add loottables and generation

* add dynamic translation for colored blocks

* readd missing files
delete generated file

* fix name, and recipe unlock triggers

* rename controller trigger

* set light_blue as default color
clean up displaynames

* refactor to avoid string manipulation in BlockModelGenerator

* Move Maps into custom class

* remove unused generic

* fix requested changes

* move recoloring from BlockUtils to ColorMap

* fix translation

* use getTranslatedName()

* fix relay,transmitter,receiver item models
fix controller and crafter loottables
This commit is contained in:
Darkere
2020-09-25 00:02:16 +02:00
committed by GitHub
parent f7870b6611
commit 14e63c07ca
2116 changed files with 32578 additions and 1195 deletions

View File

@@ -3,14 +3,13 @@ package com.refinedmods.refinedstorage;
import com.refinedmods.refinedstorage.apiimpl.API;
import com.refinedmods.refinedstorage.config.ClientConfig;
import com.refinedmods.refinedstorage.config.ServerConfig;
import com.refinedmods.refinedstorage.datageneration.DataGenerators;
import com.refinedmods.refinedstorage.item.group.MainItemGroup;
import com.refinedmods.refinedstorage.network.NetworkHandler;
import com.refinedmods.refinedstorage.setup.ClientSetup;
import com.refinedmods.refinedstorage.setup.CommonSetup;
import com.refinedmods.refinedstorage.setup.ServerSetup;
import net.minecraft.block.Block;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.tileentity.TileEntityType;
@@ -42,11 +41,13 @@ public final class RS {
CommonSetup commonSetup = new CommonSetup();
RSBlocks.register();
RSItems.register();
RSLootFunctions.register();
FMLJavaModLoadingContext.get().getModEventBus().addListener(commonSetup::onCommonSetup);
FMLJavaModLoadingContext.get().getModEventBus().addGenericListener(TileEntityType.class, commonSetup::onRegisterTiles);
FMLJavaModLoadingContext.get().getModEventBus().addGenericListener(IRecipeSerializer.class, commonSetup::onRegisterRecipeSerializers);
FMLJavaModLoadingContext.get().getModEventBus().addGenericListener(ContainerType.class, commonSetup::onRegisterContainers);
FMLJavaModLoadingContext.get().getModEventBus().register(new DataGenerators());
API.deliver();
}

View File

@@ -6,13 +6,16 @@ import com.refinedmods.refinedstorage.apiimpl.storage.FluidStorageType;
import com.refinedmods.refinedstorage.apiimpl.storage.ItemStorageType;
import com.refinedmods.refinedstorage.block.*;
import com.refinedmods.refinedstorage.item.blockitem.PortableGridBlockItem;
import com.refinedmods.refinedstorage.util.ColorMap;
import net.minecraft.block.Block;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public final class RSBlocks {
@@ -20,48 +23,56 @@ public final class RSBlocks {
public static final RegistryObject<ImporterBlock> IMPORTER;
public static final RegistryObject<ExporterBlock> EXPORTER;
public static final RegistryObject<DetectorBlock> DETECTOR;
public static final RegistryObject<RelayBlock> RELAY;
public static final RegistryObject<NetworkTransmitterBlock> NETWORK_TRANSMITTER;
public static final RegistryObject<NetworkReceiverBlock> NETWORK_RECEIVER;
public static final RegistryObject<QuartzEnrichedIronBlock> QUARTZ_ENRICHED_IRON;
public static final RegistryObject<MachineCasingBlock> MACHINE_CASING;
public static final RegistryObject<ControllerBlock> CONTROLLER;
public static final RegistryObject<ControllerBlock> CREATIVE_CONTROLLER;
public static final RegistryObject<CableBlock> CABLE;
public static final RegistryObject<DiskDriveBlock> DISK_DRIVE;
public static final RegistryObject<ExternalStorageBlock> EXTERNAL_STORAGE;
public static final RegistryObject<GridBlock> GRID;
public static final RegistryObject<GridBlock> CRAFTING_GRID;
public static final RegistryObject<GridBlock> PATTERN_GRID;
public static final RegistryObject<GridBlock> FLUID_GRID;
public static final Map<ItemStorageType, RegistryObject<StorageBlock>> STORAGE_BLOCKS = new HashMap<>();
public static final Map<FluidStorageType, RegistryObject<FluidStorageBlock>> FLUID_STORAGE_BLOCKS = new HashMap<>();
public static final RegistryObject<SecurityManagerBlock> SECURITY_MANAGER;
public static final RegistryObject<InterfaceBlock> INTERFACE;
public static final RegistryObject<FluidInterfaceBlock> FLUID_INTERFACE;
public static final RegistryObject<WirelessTransmitterBlock> WIRELESS_TRANSMITTER;
public static final RegistryObject<StorageMonitorBlock> STORAGE_MONITOR;
public static final RegistryObject<ConstructorBlock> CONSTRUCTOR;
public static final RegistryObject<DestructorBlock> DESTRUCTOR;
public static final RegistryObject<DiskManipulatorBlock> DISK_MANIPULATOR;
public static final RegistryObject<PortableGridBlock> PORTABLE_GRID;
public static final RegistryObject<PortableGridBlock> CREATIVE_PORTABLE_GRID;
public static final RegistryObject<CrafterBlock> CRAFTER;
public static final RegistryObject<CrafterManagerBlock> CRAFTER_MANAGER;
public static final RegistryObject<CraftingMonitorBlock> CRAFTING_MONITOR;
public static final ColorMap<CrafterBlock> CRAFTER = new ColorMap<>(BLOCKS);
public static final ColorMap<RelayBlock> RELAY = new ColorMap<>(BLOCKS);
public static final ColorMap<NetworkTransmitterBlock> NETWORK_TRANSMITTER = new ColorMap<>(BLOCKS);
public static final ColorMap<NetworkReceiverBlock> NETWORK_RECEIVER = new ColorMap<>(BLOCKS);
public static final ColorMap<ControllerBlock> CONTROLLER = new ColorMap<>(BLOCKS);
public static final ColorMap<ControllerBlock> CREATIVE_CONTROLLER = new ColorMap<>(BLOCKS);
public static final ColorMap<GridBlock> GRID = new ColorMap<>(BLOCKS);
public static final ColorMap<GridBlock> CRAFTING_GRID = new ColorMap<>(BLOCKS);
public static final ColorMap<GridBlock> PATTERN_GRID = new ColorMap<>(BLOCKS);
public static final ColorMap<GridBlock> FLUID_GRID = new ColorMap<>(BLOCKS);
public static final ColorMap<SecurityManagerBlock> SECURITY_MANAGER = new ColorMap<>(BLOCKS);
public static final ColorMap<WirelessTransmitterBlock> WIRELESS_TRANSMITTER = new ColorMap<>(BLOCKS);
public static final ColorMap<DiskManipulatorBlock> DISK_MANIPULATOR = new ColorMap<>(BLOCKS);
public static final ColorMap<CrafterManagerBlock> CRAFTER_MANAGER = new ColorMap<>(BLOCKS);
public static final ColorMap<CraftingMonitorBlock> CRAFTING_MONITOR = new ColorMap<>(BLOCKS);
public static final ColorMap<DetectorBlock> DETECTOR = new ColorMap<>(BLOCKS);
public static final List<RegistryObject<? extends Block>> COLORED_BLOCKS = new ArrayList<>();
static {
QUARTZ_ENRICHED_IRON = BLOCKS.register("quartz_enriched_iron_block", QuartzEnrichedIronBlock::new);
CONTROLLER = BLOCKS.register("controller", () -> new ControllerBlock(NetworkType.NORMAL));
CREATIVE_CONTROLLER = BLOCKS.register("creative_controller", () -> new ControllerBlock(NetworkType.CREATIVE));
MACHINE_CASING = BLOCKS.register("machine_casing", MachineCasingBlock::new);
CABLE = BLOCKS.register("cable", CableBlock::new);
DISK_DRIVE = BLOCKS.register("disk_drive", DiskDriveBlock::new);
GRID = BLOCKS.register("grid", () -> new GridBlock(GridType.NORMAL));
CRAFTING_GRID = BLOCKS.register(GridType.CRAFTING.getString() + "_grid", () -> new GridBlock(GridType.CRAFTING));
PATTERN_GRID = BLOCKS.register(GridType.PATTERN.getString() + "_grid", () -> new GridBlock(GridType.PATTERN));
FLUID_GRID = BLOCKS.register(GridType.FLUID.getString() + "_grid", () -> new GridBlock(GridType.FLUID));
EXTERNAL_STORAGE = BLOCKS.register("external_storage", ExternalStorageBlock::new);
IMPORTER = BLOCKS.register("importer", ImporterBlock::new);
EXPORTER = BLOCKS.register("exporter", ExporterBlock::new);
INTERFACE = BLOCKS.register("interface", InterfaceBlock::new);
FLUID_INTERFACE = BLOCKS.register("fluid_interface", FluidInterfaceBlock::new);
STORAGE_MONITOR = BLOCKS.register("storage_monitor", StorageMonitorBlock::new);
CONSTRUCTOR = BLOCKS.register("constructor", ConstructorBlock::new);
DESTRUCTOR = BLOCKS.register("destructor", DestructorBlock::new);
CREATIVE_PORTABLE_GRID = BLOCKS.register("creative_portable_grid", () -> new PortableGridBlock(PortableGridBlockItem.Type.CREATIVE));
PORTABLE_GRID = BLOCKS.register("portable_grid", () -> new PortableGridBlock(PortableGridBlockItem.Type.NORMAL));
for (ItemStorageType type : ItemStorageType.values()) {
STORAGE_BLOCKS.put(type, BLOCKS.register(type.getName() + "_storage_block", () -> new StorageBlock(type)));
@@ -71,26 +82,22 @@ public final class RSBlocks {
FLUID_STORAGE_BLOCKS.put(type, BLOCKS.register(type.getName() + "_fluid_storage_block", () -> new FluidStorageBlock(type)));
}
EXTERNAL_STORAGE = BLOCKS.register("external_storage", ExternalStorageBlock::new);
IMPORTER = BLOCKS.register("importer", ImporterBlock::new);
EXPORTER = BLOCKS.register("exporter", ExporterBlock::new);
NETWORK_RECEIVER = BLOCKS.register("network_receiver", NetworkReceiverBlock::new);
NETWORK_TRANSMITTER = BLOCKS.register("network_transmitter", NetworkTransmitterBlock::new);
RELAY = BLOCKS.register("relay", RelayBlock::new);
DETECTOR = BLOCKS.register("detector", DetectorBlock::new);
SECURITY_MANAGER = BLOCKS.register("security_manager", SecurityManagerBlock::new);
INTERFACE = BLOCKS.register("interface", InterfaceBlock::new);
FLUID_INTERFACE = BLOCKS.register("fluid_interface", FluidInterfaceBlock::new);
WIRELESS_TRANSMITTER = BLOCKS.register("wireless_transmitter", WirelessTransmitterBlock::new);
STORAGE_MONITOR = BLOCKS.register("storage_monitor", StorageMonitorBlock::new);
CONSTRUCTOR = BLOCKS.register("constructor", ConstructorBlock::new);
DESTRUCTOR = BLOCKS.register("destructor", DestructorBlock::new);
DISK_MANIPULATOR = BLOCKS.register("disk_manipulator", DiskManipulatorBlock::new);
CREATIVE_PORTABLE_GRID = BLOCKS.register("creative_portable_grid", () -> new PortableGridBlock(PortableGridBlockItem.Type.CREATIVE));
PORTABLE_GRID = BLOCKS.register("portable_grid", () -> new PortableGridBlock(PortableGridBlockItem.Type.NORMAL));
CRAFTER = BLOCKS.register("crafter", CrafterBlock::new);
CRAFTER_MANAGER = BLOCKS.register("crafter_manager", CrafterManagerBlock::new);
CRAFTING_MONITOR = BLOCKS.register("crafting_monitor", CraftingMonitorBlock::new);
GRID.registerBlocks("grid", () -> new GridBlock(GridType.NORMAL));
CRAFTING_GRID.registerBlocks(GridType.CRAFTING.getString() + "_grid", () -> new GridBlock(GridType.CRAFTING));
PATTERN_GRID.registerBlocks(GridType.PATTERN.getString() + "_grid", () -> new GridBlock(GridType.PATTERN));
FLUID_GRID.registerBlocks(GridType.FLUID.getString() + "_grid", () -> new GridBlock(GridType.FLUID));
CONTROLLER.registerBlocks("controller", () -> new ControllerBlock(NetworkType.NORMAL));
CREATIVE_CONTROLLER.registerBlocks("creative_controller", () -> new ControllerBlock(NetworkType.CREATIVE));
NETWORK_RECEIVER.registerBlocks("network_receiver", NetworkReceiverBlock::new);
NETWORK_TRANSMITTER.registerBlocks("network_transmitter", NetworkTransmitterBlock::new);
RELAY.registerBlocks("relay", RelayBlock::new);
SECURITY_MANAGER.registerBlocks("security_manager", SecurityManagerBlock::new);
WIRELESS_TRANSMITTER.registerBlocks("wireless_transmitter", WirelessTransmitterBlock::new);
DISK_MANIPULATOR.registerBlocks("disk_manipulator", DiskManipulatorBlock::new);
CRAFTER.registerBlocks("crafter", CrafterBlock::new);
CRAFTER_MANAGER.registerBlocks("crafter_manager", CrafterManagerBlock::new);
CRAFTING_MONITOR.registerBlocks("crafting_monitor", CraftingMonitorBlock::new);
DETECTOR.registerBlocks("detector", DetectorBlock::new);
}
public static void register() {

View File

@@ -5,18 +5,25 @@ import com.refinedmods.refinedstorage.apiimpl.storage.ItemStorageType;
import com.refinedmods.refinedstorage.block.BaseBlock;
import com.refinedmods.refinedstorage.item.*;
import com.refinedmods.refinedstorage.item.blockitem.*;
import com.refinedmods.refinedstorage.util.ColorMap;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.tags.ItemTags;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraftforge.common.Tags;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public final class RSItems {
private static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, RS.ID);
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, RS.ID);
public static final RegistryObject<QuartzEnrichedIronItem> QUARTZ_ENRICHED_IRON;
public static final RegistryObject<SiliconItem> SILICON;
@@ -27,8 +34,6 @@ public final class RSItems {
public static final RegistryObject<StorageHousingItem> STORAGE_HOUSING;
public static final RegistryObject<NetworkCardItem> NETWORK_CARD;
public static final RegistryObject<SecurityCardItem> SECURITY_CARD;
public static final RegistryObject<ControllerBlockItem> CONTROLLER;
public static final RegistryObject<ControllerBlockItem> CREATIVE_CONTROLLER;
public static final RegistryObject<CoreItem> CONSTRUCTION_CORE;
public static final RegistryObject<CoreItem> DESTRUCTION_CORE;
public static final RegistryObject<WirelessGridItem> WIRELESS_GRID;
@@ -39,6 +44,7 @@ public final class RSItems {
public static final RegistryObject<PortableGridBlockItem> CREATIVE_PORTABLE_GRID;
public static final RegistryObject<WirelessCraftingMonitorItem> WIRELESS_CRAFTING_MONITOR;
public static final RegistryObject<WirelessCraftingMonitorItem> CREATIVE_WIRELESS_CRAFTING_MONITOR;
public static final RegistryObject<BlockItem> MACHINE_CASING;
public static final Map<ProcessorItem.Type, RegistryObject<ProcessorItem>> PROCESSORS = new HashMap<>();
@@ -52,6 +58,27 @@ public final class RSItems {
public static final Map<UpgradeItem.Type, RegistryObject<UpgradeItem>> UPGRADE_ITEMS = new HashMap<>();
public static final Map<Tags.IOptionalNamedTag<Item>, ColorMap<BlockItem>> COLORED_ITEM_TAGS = new HashMap<>();
private static final List<Runnable> LATE_REGISTRATION = new ArrayList<>();
public static final ColorMap<BlockItem> CRAFTER = new ColorMap<>(ITEMS, LATE_REGISTRATION, COLORED_ITEM_TAGS);
public static final ColorMap<BlockItem> RELAY = new ColorMap<>(ITEMS, LATE_REGISTRATION, COLORED_ITEM_TAGS);
public static final ColorMap<BlockItem> NETWORK_TRANSMITTER = new ColorMap<>(ITEMS, LATE_REGISTRATION, COLORED_ITEM_TAGS);
public static final ColorMap<BlockItem> NETWORK_RECEIVER = new ColorMap<>(ITEMS, LATE_REGISTRATION, COLORED_ITEM_TAGS);
public static final ColorMap<BlockItem> CONTROLLER = new ColorMap<>(ITEMS, LATE_REGISTRATION, COLORED_ITEM_TAGS);
public static final ColorMap<BlockItem> CREATIVE_CONTROLLER = new ColorMap<>(ITEMS, LATE_REGISTRATION, COLORED_ITEM_TAGS);
public static final ColorMap<BlockItem> GRID = new ColorMap<>(ITEMS, LATE_REGISTRATION, COLORED_ITEM_TAGS);
public static final ColorMap<BlockItem> CRAFTING_GRID = new ColorMap<>(ITEMS, LATE_REGISTRATION, COLORED_ITEM_TAGS);
public static final ColorMap<BlockItem> PATTERN_GRID = new ColorMap<>(ITEMS, LATE_REGISTRATION, COLORED_ITEM_TAGS);
public static final ColorMap<BlockItem> FLUID_GRID = new ColorMap<>(ITEMS, LATE_REGISTRATION, COLORED_ITEM_TAGS);
public static final ColorMap<BlockItem> SECURITY_MANAGER = new ColorMap<>(ITEMS, LATE_REGISTRATION, COLORED_ITEM_TAGS);
public static final ColorMap<BlockItem> WIRELESS_TRANSMITTER = new ColorMap<>(ITEMS, LATE_REGISTRATION, COLORED_ITEM_TAGS);
public static final ColorMap<BlockItem> DISK_MANIPULATOR = new ColorMap<>(ITEMS, LATE_REGISTRATION, COLORED_ITEM_TAGS);
public static final ColorMap<BlockItem> CRAFTER_MANAGER = new ColorMap<>(ITEMS, LATE_REGISTRATION, COLORED_ITEM_TAGS);
public static final ColorMap<BlockItem> CRAFTING_MONITOR = new ColorMap<>(ITEMS, LATE_REGISTRATION, COLORED_ITEM_TAGS);
public static final ColorMap<BlockItem> DETECTOR = new ColorMap<>(ITEMS, LATE_REGISTRATION, COLORED_ITEM_TAGS);
static {
CONSTRUCTION_CORE = ITEMS.register("construction_core", CoreItem::new);
DESTRUCTION_CORE = ITEMS.register("destruction_core", CoreItem::new);
@@ -94,16 +121,10 @@ public final class RSItems {
PORTABLE_GRID = ITEMS.register("portable_grid", () -> new PortableGridBlockItem(PortableGridBlockItem.Type.NORMAL));
CREATIVE_PORTABLE_GRID = ITEMS.register("creative_portable_grid", () -> new PortableGridBlockItem(PortableGridBlockItem.Type.CREATIVE));
createBlockItemFor(RSBlocks.QUARTZ_ENRICHED_IRON);
CONTROLLER = ITEMS.register(RSBlocks.CONTROLLER.getId().getPath(), () -> new ControllerBlockItem(RSBlocks.CONTROLLER.get()));
CREATIVE_CONTROLLER = ITEMS.register(RSBlocks.CREATIVE_CONTROLLER.getId().getPath(), () -> new ControllerBlockItem(RSBlocks.CREATIVE_CONTROLLER.get()));
createBlockItemFor(RSBlocks.MACHINE_CASING);
createBlockItemFor(RSBlocks.CABLE);
createBlockItemFor(RSBlocks.DISK_DRIVE);
createBlockItemFor(RSBlocks.GRID);
createBlockItemFor(RSBlocks.CRAFTING_GRID);
createBlockItemFor(RSBlocks.PATTERN_GRID);
createBlockItemFor(RSBlocks.FLUID_GRID);
registerBlockItemFor(RSBlocks.QUARTZ_ENRICHED_IRON);
MACHINE_CASING = registerBlockItemFor(RSBlocks.MACHINE_CASING);
registerBlockItemFor(RSBlocks.CABLE);
registerBlockItemFor(RSBlocks.DISK_DRIVE);
for (ItemStorageType type : ItemStorageType.values()) {
STORAGE_BLOCKS.put(type, ITEMS.register(RSBlocks.STORAGE_BLOCKS.get(type).getId().getPath(), () -> new StorageBlockItem(RSBlocks.STORAGE_BLOCKS.get(type).get())));
@@ -113,24 +134,48 @@ public final class RSItems {
FLUID_STORAGE_BLOCKS.put(type, ITEMS.register(RSBlocks.FLUID_STORAGE_BLOCKS.get(type).getId().getPath(), () -> new FluidStorageBlockItem(RSBlocks.FLUID_STORAGE_BLOCKS.get(type).get())));
}
createBlockItemFor(RSBlocks.EXTERNAL_STORAGE);
createBlockItemFor(RSBlocks.IMPORTER);
createBlockItemFor(RSBlocks.EXPORTER);
createBlockItemFor(RSBlocks.NETWORK_RECEIVER);
createBlockItemFor(RSBlocks.NETWORK_TRANSMITTER);
createBlockItemFor(RSBlocks.RELAY);
createBlockItemFor(RSBlocks.DETECTOR);
createBlockItemFor(RSBlocks.SECURITY_MANAGER);
createBlockItemFor(RSBlocks.INTERFACE);
createBlockItemFor(RSBlocks.FLUID_INTERFACE);
createBlockItemFor(RSBlocks.WIRELESS_TRANSMITTER);
createBlockItemFor(RSBlocks.STORAGE_MONITOR);
createBlockItemFor(RSBlocks.CONSTRUCTOR);
createBlockItemFor(RSBlocks.DESTRUCTOR);
createBlockItemFor(RSBlocks.DISK_MANIPULATOR);
createBlockItemFor(RSBlocks.CRAFTER);
createBlockItemFor(RSBlocks.CRAFTER_MANAGER);
createBlockItemFor(RSBlocks.CRAFTING_MONITOR);
registerBlockItemFor(RSBlocks.EXTERNAL_STORAGE);
registerBlockItemFor(RSBlocks.IMPORTER);
registerBlockItemFor(RSBlocks.EXPORTER);
registerBlockItemFor(RSBlocks.INTERFACE);
registerBlockItemFor(RSBlocks.FLUID_INTERFACE);
registerBlockItemFor(RSBlocks.STORAGE_MONITOR);
registerBlockItemFor(RSBlocks.CONSTRUCTOR);
registerBlockItemFor(RSBlocks.DESTRUCTOR);
CONTROLLER.put(ColorMap.DEFAULT_COLOR, ITEMS.register(RSBlocks.CONTROLLER.get(ColorMap.DEFAULT_COLOR).getId().getPath(), () -> new ControllerBlockItem(RSBlocks.CONTROLLER.get(ColorMap.DEFAULT_COLOR).get(), ColorMap.DEFAULT_COLOR, RSBlocks.CONTROLLER.get(ColorMap.DEFAULT_COLOR).get().getTranslatedName())));
CREATIVE_CONTROLLER.put(ColorMap.DEFAULT_COLOR, ITEMS.register(RSBlocks.CREATIVE_CONTROLLER.get(ColorMap.DEFAULT_COLOR).getId().getPath(), () -> new ControllerBlockItem(RSBlocks.CREATIVE_CONTROLLER.get(ColorMap.DEFAULT_COLOR).get(), ColorMap.DEFAULT_COLOR, RSBlocks.CREATIVE_CONTROLLER.get(ColorMap.DEFAULT_COLOR).get().getTranslatedName())));
COLORED_ITEM_TAGS.put(ItemTags.createOptional(new ResourceLocation(RS.ID, CONTROLLER.get(ColorMap.DEFAULT_COLOR).getId().getPath())), CONTROLLER);
LATE_REGISTRATION.add(() -> {
RSBlocks.CONTROLLER.forEach((color, block) -> {
if (color != ColorMap.DEFAULT_COLOR) {
CONTROLLER.put(color, ITEMS.register(RSBlocks.CONTROLLER.get(color).getId().getPath(), () -> new ControllerBlockItem(RSBlocks.CONTROLLER.get(color).get(), color, new TranslationTextComponent(RSBlocks.CONTROLLER.get(ColorMap.DEFAULT_COLOR).get().getTranslationKey()))));
}
});
RSBlocks.CREATIVE_CONTROLLER.forEach((color, block) -> {
if (color != ColorMap.DEFAULT_COLOR) {
CREATIVE_CONTROLLER.put(color, ITEMS.register(RSBlocks.CREATIVE_CONTROLLER.get(color).getId().getPath(), () -> new ControllerBlockItem(RSBlocks.CREATIVE_CONTROLLER.get(color).get(), color, new TranslationTextComponent(RSBlocks.CREATIVE_CONTROLLER.get(ColorMap.DEFAULT_COLOR).get().getTranslationKey()))));
}
});
});
GRID.registerItemsFromBlocks(RSBlocks.GRID);
CRAFTING_GRID.registerItemsFromBlocks(RSBlocks.CRAFTING_GRID);
PATTERN_GRID.registerItemsFromBlocks(RSBlocks.PATTERN_GRID);
FLUID_GRID.registerItemsFromBlocks(RSBlocks.FLUID_GRID);
NETWORK_RECEIVER.registerItemsFromBlocks(RSBlocks.NETWORK_RECEIVER);
NETWORK_TRANSMITTER.registerItemsFromBlocks(RSBlocks.NETWORK_TRANSMITTER);
RELAY.registerItemsFromBlocks(RSBlocks.RELAY);
DETECTOR.registerItemsFromBlocks(RSBlocks.DETECTOR);
SECURITY_MANAGER.registerItemsFromBlocks(RSBlocks.SECURITY_MANAGER);
WIRELESS_TRANSMITTER.registerItemsFromBlocks(RSBlocks.WIRELESS_TRANSMITTER);
DISK_MANIPULATOR.registerItemsFromBlocks(RSBlocks.DISK_MANIPULATOR);
CRAFTER.registerItemsFromBlocks(RSBlocks.CRAFTER);
CRAFTER_MANAGER.registerItemsFromBlocks(RSBlocks.CRAFTER_MANAGER);
CRAFTING_MONITOR.registerItemsFromBlocks(RSBlocks.CRAFTING_MONITOR);
WIRELESS_GRID = ITEMS.register("wireless_grid", () -> new WirelessGridItem(WirelessGridItem.Type.NORMAL));
CREATIVE_WIRELESS_GRID = ITEMS.register("creative_wireless_grid", () -> new WirelessGridItem(WirelessGridItem.Type.CREATIVE));
@@ -138,9 +183,11 @@ public final class RSItems {
CREATIVE_WIRELESS_FLUID_GRID = ITEMS.register("creative_wireless_fluid_grid", () -> new WirelessFluidGridItem(WirelessFluidGridItem.Type.CREATIVE));
WIRELESS_CRAFTING_MONITOR = ITEMS.register("wireless_crafting_monitor", () -> new WirelessCraftingMonitorItem(WirelessCraftingMonitorItem.Type.NORMAL));
CREATIVE_WIRELESS_CRAFTING_MONITOR = ITEMS.register("creative_wireless_crafting_monitor", () -> new WirelessCraftingMonitorItem(WirelessCraftingMonitorItem.Type.CREATIVE));
LATE_REGISTRATION.forEach(Runnable::run);
}
private static <T extends BaseBlock> RegistryObject<BlockItem> createBlockItemFor(RegistryObject<T> block) {
private static <T extends BaseBlock> RegistryObject<BlockItem> registerBlockItemFor(RegistryObject<T> block) {
return ITEMS.register(block.getId().getPath(), () -> new BaseBlockItem(block.get(), new Item.Properties().group(RS.MAIN_GROUP)));
}

View File

@@ -1,7 +1,6 @@
package com.refinedmods.refinedstorage.apiimpl.network.node;
import com.refinedmods.refinedstorage.RS;
import com.refinedmods.refinedstorage.RSBlocks;
import com.refinedmods.refinedstorage.api.network.INetwork;
import com.refinedmods.refinedstorage.api.util.IComparer;
import com.refinedmods.refinedstorage.block.DetectorBlock;
@@ -65,7 +64,7 @@ public class DetectorNetworkNode extends NetworkNode implements IComparable, ITy
wasPowered = powered;
world.setBlockState(pos, world.getBlockState(pos).with(DetectorBlock.POWERED, powered));
world.notifyNeighborsOfStateChange(pos, RSBlocks.DETECTOR.get());
world.notifyNeighborsOfStateChange(pos, world.getBlockState(pos).getBlock());
}
if (canUpdate() && ticks % SPEED == 0) {

View File

@@ -0,0 +1,21 @@
package com.refinedmods.refinedstorage.block;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public class ColoredNetworkBlock extends NetworkNodeBlock {
public ColoredNetworkBlock(Properties props) {
super(props);
}
@Override
public void onReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean isMoving) {
if (state.getBlock().getClass().equals(newState.getBlock().getClass())) {
return;
}
super.onReplaced(state, world, pos, newState, isMoving);
}
}

View File

@@ -1,6 +1,6 @@
package com.refinedmods.refinedstorage.block;
import com.refinedmods.refinedstorage.RS;
import com.refinedmods.refinedstorage.RSBlocks;
import com.refinedmods.refinedstorage.api.network.INetwork;
import com.refinedmods.refinedstorage.api.network.NetworkType;
import com.refinedmods.refinedstorage.apiimpl.API;
@@ -17,6 +17,7 @@ import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.inventory.container.Container;
import net.minecraft.inventory.container.INamedContainerProvider;
import net.minecraft.item.DyeColor;
import net.minecraft.item.ItemStack;
import net.minecraft.state.EnumProperty;
import net.minecraft.state.StateContainer;
@@ -124,6 +125,22 @@ public class ControllerBlock extends BaseBlock {
@Override
@SuppressWarnings("deprecation")
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
ActionResultType result = super.onBlockActivated(state, world, pos, player, hand, hit);
if (result != ActionResultType.PASS) {
return result;
}
DyeColor color = DyeColor.getColor(player.getHeldItem(hand));
BlockState newState = type == NetworkType.CREATIVE ?
RSBlocks.CREATIVE_CONTROLLER.get(color).get().getDefaultState().with(ENERGY_TYPE, state.get(ENERGY_TYPE)) :
RSBlocks.CONTROLLER.get(color).get().getDefaultState().with(ENERGY_TYPE, state.get(ENERGY_TYPE));
ActionResultType colorResult = RSBlocks.CONTROLLER.setBlockState(newState, player.getHeldItem(hand), world, pos, player);
if (colorResult != ActionResultType.PASS) {
return colorResult;
}
if (!world.isRemote) {
return NetworkUtils.attemptModify(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui(
(ServerPlayerEntity) player,
@@ -144,4 +161,12 @@ public class ControllerBlock extends BaseBlock {
return ActionResultType.SUCCESS;
}
@Override
public void onReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean isMoving) {
if (newState.getBlock() instanceof ControllerBlock) {
return;
}
super.onReplaced(state, world, pos, newState, isMoving);
}
}

View File

@@ -1,6 +1,6 @@
package com.refinedmods.refinedstorage.block;
import com.refinedmods.refinedstorage.RS;
import com.refinedmods.refinedstorage.RSBlocks;
import com.refinedmods.refinedstorage.api.network.security.Permission;
import com.refinedmods.refinedstorage.container.CrafterContainer;
import com.refinedmods.refinedstorage.container.factory.PositionalTileContainerProvider;
@@ -23,7 +23,7 @@ import net.minecraftforge.fml.network.NetworkHooks;
import javax.annotation.Nullable;
public class CrafterBlock extends NetworkNodeBlock {
public class CrafterBlock extends ColoredNetworkBlock {
public CrafterBlock() {
super(BlockUtils.DEFAULT_ROCK_PROPERTIES);
}
@@ -55,7 +55,12 @@ public class CrafterBlock extends NetworkNodeBlock {
@Override
@SuppressWarnings("deprecation")
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
ActionResultType result = RSBlocks.CRAFTER.changeBlockColor(state, player.getHeldItem(hand), world, pos, player);
if (result != ActionResultType.PASS) {
return result;
}
if (!world.isRemote) {
return NetworkUtils.attempt(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui(
(ServerPlayerEntity) player,

View File

@@ -1,6 +1,6 @@
package com.refinedmods.refinedstorage.block;
import com.refinedmods.refinedstorage.RS;
import com.refinedmods.refinedstorage.RSBlocks;
import com.refinedmods.refinedstorage.api.network.security.Permission;
import com.refinedmods.refinedstorage.container.factory.CrafterManagerContainerProvider;
import com.refinedmods.refinedstorage.tile.CrafterManagerTile;
@@ -20,7 +20,7 @@ import net.minecraftforge.fml.network.NetworkHooks;
import javax.annotation.Nullable;
public class CrafterManagerBlock extends NetworkNodeBlock {
public class CrafterManagerBlock extends ColoredNetworkBlock {
public CrafterManagerBlock() {
super(BlockUtils.DEFAULT_ROCK_PROPERTIES);
}
@@ -38,7 +38,12 @@ public class CrafterManagerBlock extends NetworkNodeBlock {
@Override
@SuppressWarnings("deprecation")
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
ActionResultType result = RSBlocks.CRAFTER_MANAGER.changeBlockColor(state, player.getHeldItem(hand), world, pos, player);
if (result != ActionResultType.PASS) {
return result;
}
if (!world.isRemote) {
return NetworkUtils.attempt(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui(
(ServerPlayerEntity) player,

View File

@@ -1,6 +1,6 @@
package com.refinedmods.refinedstorage.block;
import com.refinedmods.refinedstorage.RS;
import com.refinedmods.refinedstorage.RSBlocks;
import com.refinedmods.refinedstorage.RSContainers;
import com.refinedmods.refinedstorage.api.network.security.Permission;
import com.refinedmods.refinedstorage.container.factory.CraftingMonitorContainerProvider;
@@ -21,7 +21,7 @@ import net.minecraftforge.fml.network.NetworkHooks;
import javax.annotation.Nullable;
public class CraftingMonitorBlock extends NetworkNodeBlock {
public class CraftingMonitorBlock extends ColoredNetworkBlock {
public CraftingMonitorBlock() {
super(BlockUtils.DEFAULT_ROCK_PROPERTIES);
}
@@ -39,7 +39,12 @@ public class CraftingMonitorBlock extends NetworkNodeBlock {
@Override
@SuppressWarnings("deprecation")
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
ActionResultType result = RSBlocks.CRAFTING_MONITOR.changeBlockColor(state, player.getHeldItem(hand), world, pos, player);
if (result != ActionResultType.PASS) {
return result;
}
if (!world.isRemote) {
CraftingMonitorTile tile = (CraftingMonitorTile) world.getTileEntity(pos);

View File

@@ -1,6 +1,6 @@
package com.refinedmods.refinedstorage.block;
import com.refinedmods.refinedstorage.RS;
import com.refinedmods.refinedstorage.RSBlocks;
import com.refinedmods.refinedstorage.container.DetectorContainer;
import com.refinedmods.refinedstorage.container.factory.PositionalTileContainerProvider;
import com.refinedmods.refinedstorage.tile.DetectorTile;
@@ -27,7 +27,7 @@ import net.minecraftforge.fml.network.NetworkHooks;
import javax.annotation.Nullable;
public class DetectorBlock extends NetworkNodeBlock {
public class DetectorBlock extends ColoredNetworkBlock {
public static final BooleanProperty POWERED = BooleanProperty.create("powered");
private static final VoxelShape SHAPE = makeCuboidShape(0, 0, 0, 16, 5, 16);
@@ -67,7 +67,12 @@ public class DetectorBlock extends NetworkNodeBlock {
@Override
@SuppressWarnings("deprecation")
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
ActionResultType result = RSBlocks.DETECTOR.changeBlockColor(state, player.getHeldItem(hand), world, pos, player);
if (result != ActionResultType.PASS) {
return result;
}
if (!world.isRemote) {
return NetworkUtils.attemptModify(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui(
(ServerPlayerEntity) player,

View File

@@ -1,6 +1,6 @@
package com.refinedmods.refinedstorage.block;
import com.refinedmods.refinedstorage.RS;
import com.refinedmods.refinedstorage.RSBlocks;
import com.refinedmods.refinedstorage.container.DiskManipulatorContainer;
import com.refinedmods.refinedstorage.container.factory.PositionalTileContainerProvider;
import com.refinedmods.refinedstorage.tile.DiskManipulatorTile;
@@ -21,7 +21,7 @@ import net.minecraftforge.fml.network.NetworkHooks;
import javax.annotation.Nullable;
public class DiskManipulatorBlock extends NetworkNodeBlock {
public class DiskManipulatorBlock extends ColoredNetworkBlock {
public DiskManipulatorBlock() {
super(BlockUtils.DEFAULT_ROCK_PROPERTIES);
}
@@ -35,6 +35,11 @@ public class DiskManipulatorBlock extends NetworkNodeBlock {
@Override
@SuppressWarnings("deprecation")
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult rayTraceResult) {
ActionResultType result = RSBlocks.DISK_MANIPULATOR.changeBlockColor(state, player.getHeldItem(hand), world, pos, player);
if (result != ActionResultType.PASS) {
return result;
}
if (!world.isRemote) {
return NetworkUtils.attemptModify(world, pos, rayTraceResult.getFace(), player, () -> NetworkHooks.openGui(
(ServerPlayerEntity) player,

View File

@@ -1,10 +1,12 @@
package com.refinedmods.refinedstorage.block;
import com.refinedmods.refinedstorage.RSBlocks;
import com.refinedmods.refinedstorage.api.network.grid.GridType;
import com.refinedmods.refinedstorage.apiimpl.API;
import com.refinedmods.refinedstorage.apiimpl.network.grid.factory.GridBlockGridFactory;
import com.refinedmods.refinedstorage.tile.grid.GridTile;
import com.refinedmods.refinedstorage.util.BlockUtils;
import com.refinedmods.refinedstorage.util.ColorMap;
import com.refinedmods.refinedstorage.util.NetworkUtils;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
@@ -12,7 +14,6 @@ import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Hand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.world.IBlockReader;
@@ -20,7 +21,7 @@ import net.minecraft.world.World;
import javax.annotation.Nullable;
public class GridBlock extends NetworkNodeBlock {
public class GridBlock extends ColoredNetworkBlock {
private final GridType type;
public GridBlock(GridType type) {
@@ -47,7 +48,30 @@ public class GridBlock extends NetworkNodeBlock {
@Override
@SuppressWarnings("deprecation")
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
ColorMap<GridBlock> map;
switch (type) {
case FLUID:
map = RSBlocks.FLUID_GRID;
break;
case NORMAL:
map = RSBlocks.GRID;
break;
case CRAFTING:
map = RSBlocks.CRAFTING_GRID;
break;
case PATTERN:
map = RSBlocks.PATTERN_GRID;
break;
default:
throw new IllegalStateException("Unexpected value: " + type);
}
ActionResultType result = map.changeBlockColor(state, player.getHeldItem(hand), world, pos, player);
if (result != ActionResultType.PASS) {
return result;
}
if (!world.isRemote) {
return NetworkUtils.attemptModify(world, pos, hit.getFace(), player, () -> API.instance().getGridManager().openGrid(GridBlockGridFactory.ID, (ServerPlayerEntity) player, pos));
}

View File

@@ -1,14 +1,21 @@
package com.refinedmods.refinedstorage.block;
import com.refinedmods.refinedstorage.RSBlocks;
import com.refinedmods.refinedstorage.tile.NetworkReceiverTile;
import com.refinedmods.refinedstorage.util.BlockUtils;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import javax.annotation.Nullable;
public class NetworkReceiverBlock extends NetworkNodeBlock {
public class NetworkReceiverBlock extends ColoredNetworkBlock {
public NetworkReceiverBlock() {
super(BlockUtils.DEFAULT_ROCK_PROPERTIES);
}
@@ -23,4 +30,9 @@ public class NetworkReceiverBlock extends NetworkNodeBlock {
public boolean hasConnectedState() {
return true;
}
@Override
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
return RSBlocks.NETWORK_RECEIVER.changeBlockColor(state, player.getHeldItem(hand), world, pos, player);
}
}

View File

@@ -1,5 +1,6 @@
package com.refinedmods.refinedstorage.block;
import com.refinedmods.refinedstorage.RSBlocks;
import com.refinedmods.refinedstorage.container.NetworkTransmitterContainer;
import com.refinedmods.refinedstorage.container.factory.PositionalTileContainerProvider;
import com.refinedmods.refinedstorage.tile.NetworkTransmitterTile;
@@ -20,7 +21,7 @@ import net.minecraftforge.fml.network.NetworkHooks;
import javax.annotation.Nullable;
public class NetworkTransmitterBlock extends NetworkNodeBlock {
public class NetworkTransmitterBlock extends ColoredNetworkBlock {
public NetworkTransmitterBlock() {
super(BlockUtils.DEFAULT_ROCK_PROPERTIES);
}
@@ -33,7 +34,12 @@ public class NetworkTransmitterBlock extends NetworkNodeBlock {
@Override
@SuppressWarnings("deprecation")
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
ActionResultType result = RSBlocks.NETWORK_TRANSMITTER.changeBlockColor(state, player.getHeldItem(hand), world, pos, player);
if (result != ActionResultType.PASS) {
return result;
}
if (!world.isRemote) {
return NetworkUtils.attemptModify(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui(
(ServerPlayerEntity) player,

View File

@@ -1,5 +1,6 @@
package com.refinedmods.refinedstorage.block;
import com.refinedmods.refinedstorage.RSBlocks;
import com.refinedmods.refinedstorage.container.RelayContainer;
import com.refinedmods.refinedstorage.container.factory.PositionalTileContainerProvider;
import com.refinedmods.refinedstorage.tile.RelayTile;
@@ -20,7 +21,7 @@ import net.minecraftforge.fml.network.NetworkHooks;
import javax.annotation.Nullable;
public class RelayBlock extends NetworkNodeBlock {
public class RelayBlock extends ColoredNetworkBlock {
public RelayBlock() {
super(BlockUtils.DEFAULT_ROCK_PROPERTIES);
}
@@ -33,7 +34,12 @@ public class RelayBlock extends NetworkNodeBlock {
@Override
@SuppressWarnings("deprecation")
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
ActionResultType result = RSBlocks.RELAY.changeBlockColor(state, player.getHeldItem(hand), world, pos, player);
if (result != ActionResultType.PASS) {
return result;
}
if (!world.isRemote) {
return NetworkUtils.attemptModify(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui(
(ServerPlayerEntity) player,

View File

@@ -1,5 +1,6 @@
package com.refinedmods.refinedstorage.block;
import com.refinedmods.refinedstorage.RSBlocks;
import com.refinedmods.refinedstorage.api.network.security.Permission;
import com.refinedmods.refinedstorage.container.SecurityManagerContainer;
import com.refinedmods.refinedstorage.container.factory.PositionalTileContainerProvider;
@@ -21,7 +22,7 @@ import net.minecraftforge.fml.network.NetworkHooks;
import javax.annotation.Nullable;
public class SecurityManagerBlock extends NetworkNodeBlock {
public class SecurityManagerBlock extends ColoredNetworkBlock {
public SecurityManagerBlock() {
super(BlockUtils.DEFAULT_ROCK_PROPERTIES);
}
@@ -33,7 +34,12 @@ public class SecurityManagerBlock extends NetworkNodeBlock {
@Override
@SuppressWarnings("deprecation")
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
ActionResultType result = RSBlocks.SECURITY_MANAGER.changeBlockColor(state, player.getHeldItem(hand), world, pos, player);
if (result != ActionResultType.PASS) {
return result;
}
if (!world.isRemote) {
Runnable action = () -> NetworkHooks.openGui(
(ServerPlayerEntity) player,

View File

@@ -1,5 +1,6 @@
package com.refinedmods.refinedstorage.block;
import com.refinedmods.refinedstorage.RSBlocks;
import com.refinedmods.refinedstorage.container.WirelessTransmitterContainer;
import com.refinedmods.refinedstorage.container.factory.PositionalTileContainerProvider;
import com.refinedmods.refinedstorage.tile.WirelessTransmitterTile;
@@ -23,7 +24,7 @@ import net.minecraftforge.fml.network.NetworkHooks;
import javax.annotation.Nullable;
public class WirelessTransmitterBlock extends NetworkNodeBlock {
public class WirelessTransmitterBlock extends ColoredNetworkBlock {
private static final VoxelShape SHAPE_DOWN = makeCuboidShape(6.0D, 0.0D, 6.0D, 10.0D, 10.0D, 10.0D);
private static final VoxelShape SHAPE_UP = makeCuboidShape(6.0D, 6.0D, 6.0D, 10.0D, 16.0D, 10.0D);
private static final VoxelShape SHAPE_EAST = makeCuboidShape(6.0D, 6.0D, 6.0D, 16.0D, 10.0D, 10.0D);
@@ -74,7 +75,12 @@ public class WirelessTransmitterBlock extends NetworkNodeBlock {
@Override
@SuppressWarnings("deprecation")
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
ActionResultType result = RSBlocks.WIRELESS_TRANSMITTER.changeBlockColor(state, player.getHeldItem(hand), world, pos, player);
if (result != ActionResultType.PASS) {
return result;
}
if (!world.isRemote) {
return NetworkUtils.attemptModify(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui(
(ServerPlayerEntity) player,

View File

@@ -0,0 +1,299 @@
package com.refinedmods.refinedstorage.datageneration;
import com.refinedmods.refinedstorage.RS;
import com.refinedmods.refinedstorage.RSBlocks;
import com.refinedmods.refinedstorage.block.ControllerBlock;
import com.refinedmods.refinedstorage.block.DetectorBlock;
import com.refinedmods.refinedstorage.block.NetworkNodeBlock;
import com.refinedmods.refinedstorage.util.ColorMap;
import net.minecraft.block.Block;
import net.minecraft.data.DataGenerator;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.generators.BlockStateProvider;
import net.minecraftforge.client.model.generators.ModelFile;
import net.minecraftforge.common.data.ExistingFileHelper;
public class BlockModelGenerator extends BlockStateProvider {
private static final ResourceLocation BOTTOM = new ResourceLocation(RS.ID, "block/bottom");
private final BlockModels models;
public BlockModelGenerator(DataGenerator generator, String id, ExistingFileHelper existingFileHelper) {
super(generator, id, existingFileHelper);
models = new BlockModels(this);
}
@Override
protected void registerStatesAndModels() {
genNorthCutoutModels(RSBlocks.GRID);
genNorthCutoutModels(RSBlocks.CRAFTING_GRID);
genNorthCutoutModels(RSBlocks.PATTERN_GRID);
genNorthCutoutModels(RSBlocks.FLUID_GRID);
genNorthCutoutModels(RSBlocks.CRAFTING_MONITOR);
genNorthCutoutModels(RSBlocks.CRAFTER_MANAGER);
genNorthCutoutModels(RSBlocks.DISK_MANIPULATOR);
genControllerModels(RSBlocks.CONTROLLER);
genControllerModels(RSBlocks.CREATIVE_CONTROLLER);
genCrafterModels();
genCubeAllCutoutModels(RSBlocks.RELAY);
genCubeAllCutoutModels(RSBlocks.NETWORK_TRANSMITTER);
genCubeAllCutoutModels(RSBlocks.NETWORK_RECEIVER);
genSecurityManagerModels();
genDetectorModels();
genWirelessTransmitterModels();
}
private void genWirelessTransmitterModels() {
RSBlocks.WIRELESS_TRANSMITTER.forEach((color, registryObject) -> {
Block block = registryObject.get();
String folderName = RSBlocks.WIRELESS_TRANSMITTER.get(ColorMap.DEFAULT_COLOR).getId().getPath();
models.wirelessTransmitterBlock(block, state -> {
if (!state.get(NetworkNodeBlock.CONNECTED)) {
return models.createWirelessTransmitterModel(
"block/" + folderName + "/disconnected",
resourceLocation(folderName, "cutouts/disconnected")
);
} else {
ModelFile model = models.createWirelessTransmitterModel(
"block/" + folderName + "/" + color,
resourceLocation(folderName, "cutouts/" + color)
);
simpleBlockItem(block, model);
return model;
}
}, 0);
});
}
private void genDetectorModels() {
RSBlocks.DETECTOR.forEach((color, registryObject) -> {
Block block = registryObject.get();
String folderName = RSBlocks.DETECTOR.get(ColorMap.DEFAULT_COLOR).getId().getPath();
models.simpleBlockStateModel(block, state -> {
if (!state.get(DetectorBlock.POWERED)) {
return models.createDetectorModel(
"block/" + folderName + "/off",
resourceLocation(folderName, "cutouts/off")
);
} else {
ModelFile model = models.createDetectorModel(
"block/" + folderName + "/" + color,
resourceLocation(folderName, "cutouts/" + color)
);
simpleBlockItem(block, model);
return model;
}
});
});
}
private void genSecurityManagerModels() {
RSBlocks.SECURITY_MANAGER.forEach((color, registryObject) -> {
Block block = registryObject.get();
String folderName = RSBlocks.SECURITY_MANAGER.get(ColorMap.DEFAULT_COLOR).getId().getPath();
models.horizontalRSBlock(block, state -> {
if (!state.get(NetworkNodeBlock.CONNECTED)) {
return models.createCubeCutoutModel(
"block/" + folderName + "/disconnected",
BOTTOM,
BOTTOM,
resourceLocation(folderName, "top"),
resourceLocation(folderName, "cutouts/top_disconnected"),
resourceLocation(folderName, "right"),
resourceLocation(folderName, "cutouts/right_disconnected"),
resourceLocation(folderName, "left"),
resourceLocation(folderName, "cutouts/left_disconnected"),
resourceLocation(folderName, "front"),
resourceLocation(folderName, "cutouts/front_disconnected"),
resourceLocation(folderName, "back"),
resourceLocation(folderName, "cutouts/back_disconnected")
);
} else {
ModelFile model = models.createCubeCutoutModel(
"block/" + folderName + "/" + color,
BOTTOM,
BOTTOM,
resourceLocation(folderName, "top"),
resourceLocation(folderName, "cutouts/top" + "_" + color),
resourceLocation(folderName, "right"),
resourceLocation(folderName, "cutouts/right" + "_" + color),
resourceLocation(folderName, "left"),
resourceLocation(folderName, "cutouts/left" + "_" + color),
resourceLocation(folderName, "front"),
resourceLocation(folderName, "cutouts/front" + "_" + color),
resourceLocation(folderName, "back"),
resourceLocation(folderName, "cutouts/back" + "_" + color)
);
simpleBlockItem(block, model);
return model;
}
}, 180);
});
}
private <T extends Block> void genCubeAllCutoutModels(ColorMap<T> blockMap) {
blockMap.forEach((color, registryObject) -> {
Block block = registryObject.get();
String folderName = blockMap.get(ColorMap.DEFAULT_COLOR).getId().getPath();
models.simpleBlockStateModel(block, state -> {
if (!state.get(NetworkNodeBlock.CONNECTED)) {
return models.createCubeAllCutoutModel(
"block/" + folderName + "/disconnected",
resourceLocation(folderName, folderName),
resourceLocation(folderName, folderName),
resourceLocation(folderName, "cutouts/disconnected")
);
} else {
ModelFile model = models.createCubeAllCutoutModel(
"block/" + folderName + "/" + color,
resourceLocation(folderName, folderName),
resourceLocation(folderName, folderName),
resourceLocation(folderName, "cutouts/" + color)
);
simpleBlockItem(block, model);
return model;
}
});
});
}
private void genCrafterModels() {
RSBlocks.CRAFTER.forEach((color, registryObject) -> {
Block block = registryObject.get();
String folderName = RSBlocks.CRAFTER.get(ColorMap.DEFAULT_COLOR).getId().getPath();
models.anyDirectionalRSBlock(block, state -> {
if (!state.get(NetworkNodeBlock.CONNECTED)) {
return models.createCubeCutoutModel(
"block/" + folderName + "/disconnected",
BOTTOM,
BOTTOM,
resourceLocation(folderName, "top"),
resourceLocation(folderName, "cutouts/top_disconnected"),
resourceLocation(folderName, "side"),
resourceLocation(folderName, "cutouts/side_disconnected"),
resourceLocation(folderName, "side"),
resourceLocation(folderName, "cutouts/side_disconnected"),
resourceLocation(folderName, "side"),
resourceLocation(folderName, "cutouts/side_disconnected"),
resourceLocation(folderName, "side"),
resourceLocation(folderName, "cutouts/side_disconnected")
);
} else {
ModelFile model = models.createCubeCutoutModel(
"block/" + folderName + "/" + color,
BOTTOM,
BOTTOM,
resourceLocation(folderName, "top"),
resourceLocation(folderName, "cutouts/top_" + color),
resourceLocation(folderName, "side"),
resourceLocation(folderName, "cutouts/side_" + color),
resourceLocation(folderName, "side"),
resourceLocation(folderName, "cutouts/side_" + color),
resourceLocation(folderName, "side"),
resourceLocation(folderName, "cutouts/side_" + color),
resourceLocation(folderName, "side"),
resourceLocation(folderName, "cutouts/side_" + color)
);
simpleBlockItem(block, model);
return model;
}
}, 180);
});
}
private <T extends Block> void genControllerModels(ColorMap<T> blockMap) {
blockMap.forEach((color, registryObject) -> {
Block block = registryObject.get();
String folderName = RSBlocks.CONTROLLER.get(ColorMap.DEFAULT_COLOR).getId().getPath();
models.simpleBlockStateModel(block, state -> {
if (state.get(ControllerBlock.ENERGY_TYPE).equals(ControllerBlock.EnergyType.OFF)) {
return models.createCubeAllCutoutModel(
"block/" + folderName + "/off",
resourceLocation(folderName, "off"),
resourceLocation(folderName, "off"),
resourceLocation(folderName, "cutouts/off")
);
} else if (state.get(ControllerBlock.ENERGY_TYPE).equals(ControllerBlock.EnergyType.NEARLY_OFF)) {
return models.createControllerNearlyCutoutModel(
"block/" + folderName + "/nearly_off",
resourceLocation(folderName, "off"),
resourceLocation(folderName, "on"),
resourceLocation(folderName, "cutouts/nearly_off"),
resourceLocation(folderName, "cutouts/nearly_off_gray")
);
} else if (state.get(ControllerBlock.ENERGY_TYPE).equals(ControllerBlock.EnergyType.NEARLY_ON)) {
return models.createControllerNearlyCutoutModel(
"block/" + folderName + "/nearly_on",
resourceLocation(folderName, "off"),
resourceLocation(folderName, "on"),
resourceLocation(folderName, "cutouts/nearly_on"),
resourceLocation(folderName, "cutouts/nearly_on_gray")
);
} else {
ModelFile model = models.createCubeAllCutoutModel(
"block/" + folderName + "/" + color,
resourceLocation(folderName, "off"),
resourceLocation(folderName, "on"),
resourceLocation(folderName, "cutouts/" + color)
);
simpleBlockItem(block, model);
return model;
}
});
});
}
private <T extends Block> void genNorthCutoutModels(ColorMap<T> blockMap) {
blockMap.forEach((color, registryObject) -> {
Block block = registryObject.get();
String folderName = blockMap.get(ColorMap.DEFAULT_COLOR).getId().getPath();
models.horizontalRSBlock(block, state -> {
if (!state.get(NetworkNodeBlock.CONNECTED)) {
return models.createCubeNorthCutoutModel(
"block/" + folderName + "/disconnected",
BOTTOM,
resourceLocation(folderName, "top"),
resourceLocation(folderName, "front"),
resourceLocation(folderName, "back"),
resourceLocation(folderName, "right"),
resourceLocation(folderName, "left"),
resourceLocation(folderName, "right"),
resourceLocation(folderName, "cutouts/disconnected")
);
} else {
ModelFile model = models.createCubeNorthCutoutModel(
"block/" + folderName + "/" + color,
BOTTOM,
resourceLocation(folderName, "top"),
resourceLocation(folderName, "front"),
resourceLocation(folderName, "back"),
resourceLocation(folderName, "right"),
resourceLocation(folderName, "left"),
resourceLocation(folderName, "right"),
resourceLocation(folderName, "cutouts/" + color)
);
simpleBlockItem(block, model);
return model;
}
}, 180);
});
}
private ResourceLocation resourceLocation(String folderName, String name) {
return new ResourceLocation(RS.ID, "block/" + folderName + "/" + name);
}
}

View File

@@ -0,0 +1,112 @@
package com.refinedmods.refinedstorage.datageneration;
import com.refinedmods.refinedstorage.RS;
import com.refinedmods.refinedstorage.block.BlockDirection;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.generators.BlockModelBuilder;
import net.minecraftforge.client.model.generators.ConfiguredModel;
import net.minecraftforge.client.model.generators.ModelFile;
import java.util.function.Function;
public class BlockModels {
private final BlockModelGenerator generator;
public BlockModels(BlockModelGenerator blockModelGenerator) {
this.generator = blockModelGenerator;
}
public void simpleBlockStateModel(Block block, Function<BlockState, ModelFile> model) {
generator.getVariantBuilder(block).forAllStates(state -> ConfiguredModel.builder().modelFile(model.apply(state)).build());
}
public void anyDirectionalRSBlock(Block block, Function<BlockState, ModelFile> modelFunc, int angleOffset) {
generator.getVariantBuilder(block)
.forAllStates(state -> {
Direction dir = state.get(BlockDirection.ANY.getProperty());
return ConfiguredModel.builder()
.modelFile(modelFunc.apply(state))
.rotationX(dir == Direction.DOWN ? 180 : dir.getAxis().isHorizontal() ? 90 : 0)
.rotationY(dir.getAxis().isVertical() ? 0 : (((int) dir.getHorizontalAngle()) + angleOffset) % 360)
.build();
});
}
public void wirelessTransmitterBlock(Block block, Function<BlockState, ModelFile> modelFunc, int angleOffset) {
generator.getVariantBuilder(block)
.forAllStates(state -> {
Direction dir = state.get(BlockDirection.ANY.getProperty());
return ConfiguredModel.builder()
.modelFile(modelFunc.apply(state))
.rotationX(dir.getAxis() == Direction.Axis.Y ? (dir == Direction.UP ? 180 : 0) : dir.getAxis().isHorizontal() ? 90 : 0)
.rotationY(dir.getAxis().isVertical() ? 0 : (((int) dir.getHorizontalAngle()) + angleOffset) % 360)
.build();
});
}
public void horizontalRSBlock(Block block, Function<BlockState, ModelFile> modelFunc, int angleOffset) {
generator.getVariantBuilder(block)
.forAllStates(state -> ConfiguredModel.builder()
.modelFile(modelFunc.apply(state))
.rotationY(((int) state.get(BlockDirection.HORIZONTAL.getProperty()).getHorizontalAngle() + angleOffset) % 360)
.build()
);
}
public BlockModelBuilder createDetectorModel(String name, ResourceLocation torch) {
return generator.models().withExistingParent(name, new ResourceLocation(RS.ID, "detector"))
.texture("torch", torch);
}
public BlockModelBuilder createWirelessTransmitterModel(String name, ResourceLocation cutout) {
return generator.models().withExistingParent(name, new ResourceLocation(RS.ID, "wireless_transmitter"))
.texture("cutout", cutout);
}
public BlockModelBuilder createCubeCutoutModel(String name, ResourceLocation down, ResourceLocation downCutout, ResourceLocation up, ResourceLocation upCutout, ResourceLocation east, ResourceLocation eastCutout, ResourceLocation west, ResourceLocation westCutout, ResourceLocation north, ResourceLocation northCutout, ResourceLocation south, ResourceLocation southCutout) {
return generator.models().withExistingParent(name, new ResourceLocation(RS.ID, "cube_cutout"))
.texture("particle", north)
.texture("east", east)
.texture("south", south)
.texture("west", west)
.texture("up", up)
.texture("down", down)
.texture("north", north)
.texture("cutout_down", downCutout)
.texture("cutout_east", eastCutout)
.texture("cutout_west", westCutout)
.texture("cutout_south", southCutout)
.texture("cutout_north", northCutout)
.texture("cutout_up", upCutout);
}
public BlockModelBuilder createControllerNearlyCutoutModel(String name, ResourceLocation particle, ResourceLocation all, ResourceLocation cutout_gray, ResourceLocation cutout) {
return generator.models().withExistingParent(name, new ResourceLocation(RS.ID, "block/controller_nearly"))
.texture("particle", particle)
.texture("all", all)
.texture("cutout_gray", cutout_gray)
.texture("cutout", cutout);
}
public BlockModelBuilder createCubeAllCutoutModel(String name, ResourceLocation particle, ResourceLocation all, ResourceLocation cutout) {
return generator.models().withExistingParent(name, new ResourceLocation(RS.ID, "cube_all_cutout"))
.texture("particle", particle)
.texture("all", all)
.texture("cutout", cutout);
}
public BlockModelBuilder createCubeNorthCutoutModel(String name, ResourceLocation down, ResourceLocation up, ResourceLocation north, ResourceLocation south, ResourceLocation east, ResourceLocation west, ResourceLocation particle, ResourceLocation cutout) {
return generator.models().withExistingParent(name, new ResourceLocation(RS.ID, "cube_north_cutout"))
.texture("particle", particle)
.texture("east", east)
.texture("south", south)
.texture("west", west)
.texture("up", up)
.texture("down", down)
.texture("north", north)
.texture("cutout", cutout);
}
}

View File

@@ -0,0 +1,25 @@
package com.refinedmods.refinedstorage.datageneration;
import com.refinedmods.refinedstorage.RS;
import net.minecraft.data.BlockTagsProvider;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.event.lifecycle.GatherDataEvent;
public class DataGenerators {
@SubscribeEvent
public void runDataGeneration(GatherDataEvent event) {
if (event.includeClient()) {
event.getGenerator().addProvider(new BlockModelGenerator(event.getGenerator(), RS.ID, event.getExistingFileHelper()));
}
if (event.includeServer()) {
event.getGenerator().addProvider(new RecipeGenerator(event.getGenerator()));
event.getGenerator().addProvider(new TagGenerator(
event.getGenerator(),
new BlockTagsProvider(event.getGenerator(), RS.ID, event.getExistingFileHelper()),
RS.ID,
event.getExistingFileHelper())
);
event.getGenerator().addProvider(new LootTableGenerator(event.getGenerator()));
}
}
}

View File

@@ -0,0 +1,80 @@
package com.refinedmods.refinedstorage.datageneration;
import com.google.common.collect.ImmutableList;
import com.mojang.datafixers.util.Pair;
import com.refinedmods.refinedstorage.RSBlocks;
import com.refinedmods.refinedstorage.loottable.ControllerLootFunction;
import com.refinedmods.refinedstorage.loottable.CrafterLootFunction;
import net.minecraft.block.Block;
import net.minecraft.data.DataGenerator;
import net.minecraft.data.LootTableProvider;
import net.minecraft.data.loot.BlockLootTables;
import net.minecraft.loot.*;
import net.minecraft.loot.conditions.SurvivesExplosion;
import net.minecraft.loot.functions.ILootFunction;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.RegistryObject;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Supplier;
import java.util.stream.Collectors;
public class LootTableGenerator extends LootTableProvider {
public LootTableGenerator(DataGenerator dataGeneratorIn) {
super(dataGeneratorIn);
}
@Override
protected List<Pair<Supplier<Consumer<BiConsumer<ResourceLocation, LootTable.Builder>>>, LootParameterSet>> getTables() {
return ImmutableList.of(Pair.of(RSBlockLootTables::new, LootParameterSets.BLOCK));
}
@Override
protected void validate(Map<ResourceLocation, LootTable> map, ValidationTracker validationtracker) {
//NO OP
}
@Override
public String getName() {
return "Refined Storage Loot Tables";
}
private static class RSBlockLootTables extends BlockLootTables {
@Override
protected void addTables() {
RSBlocks.CONTROLLER.values().forEach(block -> genBlockItemLootTableWithFunction(block.get(), ControllerLootFunction.builder()));
RSBlocks.CREATIVE_CONTROLLER.values().forEach(block -> registerDropSelfLootTable(block.get()));
RSBlocks.CRAFTER.values().forEach(block -> genBlockItemLootTableWithFunction(block.get(), CrafterLootFunction.builder()));
RSBlocks.GRID.values().forEach(block -> registerDropSelfLootTable(block.get()));
RSBlocks.CRAFTING_GRID.values().forEach(block -> registerDropSelfLootTable(block.get()));
RSBlocks.FLUID_GRID.values().forEach(block -> registerDropSelfLootTable(block.get()));
RSBlocks.PATTERN_GRID.values().forEach(block -> registerDropSelfLootTable(block.get()));
RSBlocks.SECURITY_MANAGER.values().forEach(block -> registerDropSelfLootTable(block.get()));
RSBlocks.WIRELESS_TRANSMITTER.values().forEach(block -> registerDropSelfLootTable(block.get()));
RSBlocks.RELAY.values().forEach(block -> registerDropSelfLootTable(block.get()));
RSBlocks.NETWORK_TRANSMITTER.values().forEach(block -> registerDropSelfLootTable(block.get()));
RSBlocks.NETWORK_RECEIVER.values().forEach(block -> registerDropSelfLootTable(block.get()));
RSBlocks.DISK_MANIPULATOR.values().forEach(block -> registerDropSelfLootTable(block.get()));
RSBlocks.CRAFTING_MONITOR.values().forEach(block -> registerDropSelfLootTable(block.get()));
RSBlocks.CRAFTER_MANAGER.values().forEach(block -> registerDropSelfLootTable(block.get()));
RSBlocks.DETECTOR.values().forEach(block -> registerDropSelfLootTable(block.get()));
}
@Override
protected Iterable<Block> getKnownBlocks() {
return RSBlocks.COLORED_BLOCKS.stream().map(RegistryObject::get).collect(Collectors.toList());
}
private void genBlockItemLootTableWithFunction(Block block, ILootFunction.IBuilder builder) {
registerLootTable(block, LootTable.builder().addLootPool(
LootPool.builder()
.rolls(ConstantRange.of(1))
.addEntry(ItemLootEntry.builder(block)
.acceptFunction(builder))
.acceptCondition(SurvivesExplosion.builder())));
}
}
}

View File

@@ -0,0 +1,67 @@
package com.refinedmods.refinedstorage.datageneration;
import com.refinedmods.refinedstorage.RS;
import com.refinedmods.refinedstorage.RSItems;
import com.refinedmods.refinedstorage.item.ProcessorItem;
import com.refinedmods.refinedstorage.util.ColorMap;
import net.minecraft.advancements.criterion.InventoryChangeTrigger;
import net.minecraft.data.DataGenerator;
import net.minecraft.data.IFinishedRecipe;
import net.minecraft.data.RecipeProvider;
import net.minecraft.data.ShapelessRecipeBuilder;
import net.minecraft.item.Items;
import net.minecraft.tags.ItemTags;
import net.minecraft.util.ResourceLocation;
import java.util.function.Consumer;
public class RecipeGenerator extends RecipeProvider {
public RecipeGenerator(DataGenerator generator) {
super(generator);
}
@Override
protected void registerRecipes(Consumer<IFinishedRecipe> consumer) {
//Tag + Color -> Colored Block
RSItems.COLORED_ITEM_TAGS.forEach((tag, map) -> {
map.forEach((color, item) -> {
ShapelessRecipeBuilder.shapelessRecipe(item.get())
.addIngredient(tag)
.addIngredient(color.getTag())
.setGroup(RS.ID)
.addCriterion("refinedstorage:controller", InventoryChangeTrigger.Instance.forItems(RSItems.CONTROLLER.get(ColorMap.DEFAULT_COLOR).get()))
.build(consumer, new ResourceLocation(RS.ID, "coloring_recipes/" + item.getId().getPath()));
});
});
//Crafting Grid
RSItems.CRAFTING_GRID.forEach((color, item) -> {
ShapelessRecipeBuilder.shapelessRecipe(item.get())
.addIngredient(RSItems.GRID.get(color).get())
.addIngredient(RSItems.PROCESSORS.get(ProcessorItem.Type.ADVANCED).get())
.addIngredient(ItemTags.makeWrapperTag("refinedstorage:crafting_tables"))
.addCriterion("refinedstorage:grid", InventoryChangeTrigger.Instance.forItems(RSItems.GRID.get(ColorMap.DEFAULT_COLOR).get()))
.build(consumer, new ResourceLocation(RS.ID, "crafting_grid/" + item.getId().getPath()));
});
//Fluid Grid
RSItems.FLUID_GRID.forEach((color, item) -> {
ShapelessRecipeBuilder.shapelessRecipe(item.get())
.addIngredient(RSItems.GRID.get(color).get())
.addIngredient(RSItems.PROCESSORS.get(ProcessorItem.Type.ADVANCED).get())
.addIngredient(Items.BUCKET)
.addCriterion("refinedstorage:grid", InventoryChangeTrigger.Instance.forItems(RSItems.GRID.get(ColorMap.DEFAULT_COLOR).get()))
.build(consumer, new ResourceLocation(RS.ID, "fluid_grid/" + item.getId().getPath()));
});
//Pattern Grid
RSItems.PATTERN_GRID.forEach((color, item) -> {
ShapelessRecipeBuilder.shapelessRecipe(item.get())
.addIngredient(RSItems.GRID.get(color).get())
.addIngredient(RSItems.PROCESSORS.get(ProcessorItem.Type.ADVANCED).get())
.addIngredient(RSItems.PATTERN.get())
.addCriterion("refinedstorage:grid", InventoryChangeTrigger.Instance.forItems(RSItems.GRID.get(ColorMap.DEFAULT_COLOR).get()))
.build(consumer, new ResourceLocation(RS.ID, "pattern_grid/" + item.getId().getPath()));
});
}
}

View File

@@ -0,0 +1,24 @@
package com.refinedmods.refinedstorage.datageneration;
import com.refinedmods.refinedstorage.RSItems;
import net.minecraft.data.BlockTagsProvider;
import net.minecraft.data.DataGenerator;
import net.minecraft.data.ItemTagsProvider;
import net.minecraftforge.common.data.ExistingFileHelper;
import javax.annotation.Nullable;
public class TagGenerator extends ItemTagsProvider {
public TagGenerator(DataGenerator dataGenerator, BlockTagsProvider blockTagProvider, String modId, @Nullable ExistingFileHelper existingFileHelper) {
super(dataGenerator, blockTagProvider, modId, existingFileHelper);
}
@Override
protected void registerTags() {
RSItems.COLORED_ITEM_TAGS.forEach((tag, map) -> {
map.values().forEach(item -> {
getOrCreateBuilder(tag).add(item.get());
});
});
}
}

View File

@@ -1,7 +1,7 @@
package com.refinedmods.refinedstorage.item;
import com.refinedmods.refinedstorage.RS;
import com.refinedmods.refinedstorage.RSBlocks;
import com.refinedmods.refinedstorage.block.NetworkReceiverBlock;
import com.refinedmods.refinedstorage.render.Styles;
import net.minecraft.block.Block;
import net.minecraft.client.util.ITooltipFlag;
@@ -35,7 +35,7 @@ public class NetworkCardItem extends Item {
public ActionResultType onItemUse(ItemUseContext ctx) {
Block block = ctx.getWorld().getBlockState(ctx.getPos()).getBlock();
if (block == RSBlocks.NETWORK_RECEIVER.get()) {
if (block instanceof NetworkReceiverBlock) {
CompoundNBT tag = new CompoundNBT();
tag.putInt(NBT_RECEIVER_X, ctx.getPos().getX());

View File

@@ -0,0 +1,28 @@
package com.refinedmods.refinedstorage.item.blockitem;
import com.refinedmods.refinedstorage.block.BaseBlock;
import com.refinedmods.refinedstorage.util.ColorMap;
import net.minecraft.item.DyeColor;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TranslationTextComponent;
public class ColoredBlockItem extends BaseBlockItem {
private final ITextComponent displayName;
public ColoredBlockItem(BaseBlock block, Properties builder, DyeColor color, ITextComponent displayName) {
super(block, builder);
if (color != ColorMap.DEFAULT_COLOR) {
this.displayName = new TranslationTextComponent("color.minecraft." + color.getTranslationKey()).appendString(" ").append(displayName);
} else {
this.displayName = displayName;
}
}
@Override
public ITextComponent getDisplayName(ItemStack stack) {
return displayName;
}
}

View File

@@ -3,10 +3,29 @@ package com.refinedmods.refinedstorage.item.blockitem;
import com.refinedmods.refinedstorage.RS;
import com.refinedmods.refinedstorage.api.network.NetworkType;
import com.refinedmods.refinedstorage.block.ControllerBlock;
import com.refinedmods.refinedstorage.util.ColorMap;
import net.minecraft.item.DyeColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TranslationTextComponent;
public class ControllerBlockItem extends EnergyBlockItem {
public ControllerBlockItem(ControllerBlock block) {
private final ITextComponent displayName;
public ControllerBlockItem(ControllerBlock block, DyeColor color, ITextComponent displayName) {
super(block, new Item.Properties().group(RS.MAIN_GROUP).maxStackSize(1), block.getType() == NetworkType.CREATIVE, () -> RS.SERVER_CONFIG.getController().getCapacity());
if (color != ColorMap.DEFAULT_COLOR) {
this.displayName = new TranslationTextComponent("color.minecraft." + color.getTranslationKey()).appendString(" ").append(displayName);
} else {
this.displayName = displayName;
}
}
@Override
public ITextComponent getDisplayName(ItemStack stack) {
return displayName;
}
}

View File

@@ -2,6 +2,7 @@ package com.refinedmods.refinedstorage.item.group;
import com.refinedmods.refinedstorage.RS;
import com.refinedmods.refinedstorage.RSBlocks;
import com.refinedmods.refinedstorage.util.ColorMap;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
@@ -12,6 +13,6 @@ public class MainItemGroup extends ItemGroup {
@Override
public ItemStack createIcon() {
return new ItemStack(RSBlocks.CREATIVE_CONTROLLER.get());
return new ItemStack(RSBlocks.CREATIVE_CONTROLLER.get(ColorMap.DEFAULT_COLOR).get());
}
}

View File

@@ -37,6 +37,10 @@ public class ControllerLootFunction extends LootFunction {
return RSLootFunctions.CONTROLLER;
}
public static LootFunction.Builder<?> builder() {
return builder(ControllerLootFunction::new);
}
public static class Serializer extends LootFunction.Serializer<ControllerLootFunction> {
@Override
public ControllerLootFunction deserialize(JsonObject object, JsonDeserializationContext deserializationContext, ILootCondition[] conditions) {

View File

@@ -39,6 +39,10 @@ public class CrafterLootFunction extends LootFunction {
return RSLootFunctions.CRAFTER;
}
public static LootFunction.Builder<?> builder() {
return builder(CrafterLootFunction::new);
}
public static class Serializer extends LootFunction.Serializer<CrafterLootFunction> {
@Override
public CrafterLootFunction deserialize(JsonObject object, JsonDeserializationContext deserializationContext, ILootCondition[] conditions) {

View File

@@ -7,6 +7,7 @@ import com.refinedmods.refinedstorage.RSBlocks;
import com.refinedmods.refinedstorage.apiimpl.network.node.DiskState;
import com.refinedmods.refinedstorage.block.DiskManipulatorBlock;
import com.refinedmods.refinedstorage.tile.DiskManipulatorTile;
import com.refinedmods.refinedstorage.util.ColorMap;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.model.IBakedModel;
@@ -78,7 +79,7 @@ public class DiskManipulatorBakedModel extends DelegateBakedModel {
@Override
@SuppressWarnings("deprecation")
public List<BakedQuad> load(CacheKey key) {
Direction facing = key.state.get(RSBlocks.DISK_MANIPULATOR.get().getDirection().getProperty());
Direction facing = key.state.get(RSBlocks.DISK_MANIPULATOR.get(ColorMap.DEFAULT_COLOR).get().getDirection().getProperty());
boolean connected = key.state.get(DiskManipulatorBlock.CONNECTED);
List<BakedQuad> quads = new ArrayList<>(QuadTransformer.getTransformedQuads(
@@ -117,7 +118,7 @@ public class DiskManipulatorBakedModel extends DelegateBakedModel {
});
public DiskManipulatorBakedModel(IBakedModel baseConnected, IBakedModel baseDisconnected, IBakedModel disk, IBakedModel diskNearCapacity, IBakedModel diskFull, IBakedModel diskDisconnected) {
super(baseDisconnected);
super(baseConnected);
this.baseConnected = baseConnected;
this.baseDisconnected = baseDisconnected;

View File

@@ -16,6 +16,7 @@ import com.refinedmods.refinedstorage.render.tesr.StorageMonitorTileRenderer;
import com.refinedmods.refinedstorage.screen.*;
import com.refinedmods.refinedstorage.screen.factory.CrafterManagerScreenFactory;
import com.refinedmods.refinedstorage.screen.factory.GridScreenFactory;
import com.refinedmods.refinedstorage.util.ColorMap;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScreenManager;
import net.minecraft.client.gui.screen.Screen;
@@ -23,6 +24,7 @@ import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.RenderTypeLookup;
import net.minecraft.inventory.container.Container;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.DyeColor;
import net.minecraft.item.ItemModelsProperties;
import net.minecraft.resources.IReloadableResourceManager;
import net.minecraft.resources.IResourceManager;
@@ -35,6 +37,9 @@ import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import java.util.Arrays;
import java.util.function.BiConsumer;
public class ClientSetup {
private final BakedModelOverrideRegistry bakedModelOverrideRegistry = new BakedModelOverrideRegistry();
@@ -47,38 +52,39 @@ public class ClientSetup {
}
}
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "controller"), (base, registry) -> new FullbrightBakedModel(
forEachColorApply("controller", (name, color) -> bakedModelOverrideRegistry.add(name, (base, registry) -> new FullbrightBakedModel(
base,
true,
new ResourceLocation(RS.ID, "block/controller/cutouts/" + color),
new ResourceLocation(RS.ID, "block/controller/cutouts/nearly_off"),
new ResourceLocation(RS.ID, "block/controller/cutouts/nearly_on"),
new ResourceLocation(RS.ID, "block/controller/cutouts/on")
new ResourceLocation(RS.ID, "block/controller/cutouts/nearly_on"))
));
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "creative_controller"), (base, registry) -> new FullbrightBakedModel(
forEachColorApply("creative_controller", (name, color) -> bakedModelOverrideRegistry.add(name, (base, registry) -> new FullbrightBakedModel(
base,
true,
new ResourceLocation(RS.ID, "block/controller/cutouts/" + color),
new ResourceLocation(RS.ID, "block/controller/cutouts/nearly_off"),
new ResourceLocation(RS.ID, "block/controller/cutouts/nearly_on"),
new ResourceLocation(RS.ID, "block/controller/cutouts/on")
new ResourceLocation(RS.ID, "block/controller/cutouts/nearly_on"))
));
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "grid"), (base, registry) -> new FullbrightBakedModel(base, true, new ResourceLocation(RS.ID, "block/grid/cutouts/front_connected")));
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "crafting_grid"), (base, registry) -> new FullbrightBakedModel(base, true, new ResourceLocation(RS.ID, "block/grid/cutouts/crafting_front_connected")));
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "pattern_grid"), (base, registry) -> new FullbrightBakedModel(base, true, new ResourceLocation(RS.ID, "block/grid/cutouts/pattern_front_connected")));
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "fluid_grid"), (base, registry) -> new FullbrightBakedModel(base, true, new ResourceLocation(RS.ID, "block/grid/cutouts/fluid_front_connected")));
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "network_receiver"), (base, registry) -> new FullbrightBakedModel(base, true, new ResourceLocation(RS.ID, "block/network_receiver/cutouts/connected")));
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "network_transmitter"), (base, registry) -> new FullbrightBakedModel(base, true, new ResourceLocation(RS.ID, "block/network_transmitter/cutouts/connected")));
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "relay"), (base, registry) -> new FullbrightBakedModel(base, true, new ResourceLocation(RS.ID, "block/relay/cutouts/connected")));
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "detector"), (base, registry) -> new FullbrightBakedModel(base, true, new ResourceLocation(RS.ID, "block/detector/cutouts/on")));
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "security_manager"), (base, registry) -> new FullbrightBakedModel(
forEachColorApply("grid", (name, color) -> bakedModelOverrideRegistry.add(name, (base, registry) -> new FullbrightBakedModel(base, true, getColoredModel(color, "block/grid/cutouts/"))));
forEachColorApply("crafting_grid", (name, color) -> bakedModelOverrideRegistry.add(name, (base, registry) -> new FullbrightBakedModel(base, true, getColoredModel(color, "block/crafting_grid/cutouts/"))));
forEachColorApply("pattern_grid", (name, color) -> bakedModelOverrideRegistry.add(name, (base, registry) -> new FullbrightBakedModel(base, true, getColoredModel(color, "block/pattern_grid/cutouts/"))));
forEachColorApply("fluid_grid", (name, color) -> bakedModelOverrideRegistry.add(name, (base, registry) -> new FullbrightBakedModel(base, true, getColoredModel(color, "block/fluid_grid/cutouts/"))));
forEachColorApply("network_receiver", (name, color) -> bakedModelOverrideRegistry.add(name, (base, registry) -> new FullbrightBakedModel(base, true, getColoredModel(color, "block/network_receiver/cutouts/"))));
forEachColorApply("network_transmitter", (name, color) -> bakedModelOverrideRegistry.add(name, (base, registry) -> new FullbrightBakedModel(base, true, getColoredModel(color, "block/network_transmitter/cutouts/"))));
forEachColorApply("relay", (name, color) -> bakedModelOverrideRegistry.add(name, (base, registry) -> new FullbrightBakedModel(base, true, getColoredModel(color, "block/relay/cutouts/"))));
forEachColorApply("detector", (name, color) -> bakedModelOverrideRegistry.add(name, (base, registry) -> new FullbrightBakedModel(base, true, getColoredModel(color, "block/detector/cutouts/"))));
forEachColorApply("security_manager", (name, color) -> bakedModelOverrideRegistry.add(name, (base, registry) -> new FullbrightBakedModel(
base,
true,
new ResourceLocation(RS.ID, "block/security_manager/cutouts/top_connected"),
new ResourceLocation(RS.ID, "block/security_manager/cutouts/front_connected"),
new ResourceLocation(RS.ID, "block/security_manager/cutouts/left_connected"),
new ResourceLocation(RS.ID, "block/security_manager/cutouts/back_connected"),
new ResourceLocation(RS.ID, "block/security_manager/cutouts/right_connected")
));
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "wireless_transmitter"), (base, registry) -> new FullbrightBakedModel(base, true, new ResourceLocation(RS.ID, "block/wireless_transmitter/cutouts/connected")));
getMultipleColoredModels(color, "block/security_manager/cutouts/top_",
"block/security_manager/cutouts/front_",
"block/security_manager/cutouts/left_",
"block/security_manager/cutouts/back_",
"block/security_manager/cutouts/right_")
)));
forEachColorApply("wireless_transmitter", (name, color) -> bakedModelOverrideRegistry.add(name, (base, registry) -> new FullbrightBakedModel(base, true, getColoredModel(color, "block/wireless_transmitter/cutouts/"))));
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "constructor"), (base, registry) -> new FullbrightBakedModel(base, true, new ResourceLocation(RS.ID, "block/constructor/cutouts/connected")));
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "destructor"), (base, registry) -> new FullbrightBakedModel(base, true, new ResourceLocation(RS.ID, "block/destructor/cutouts/connected")));
@@ -94,19 +100,18 @@ public class ClientSetup {
new ResourceLocation(RS.ID, "block/disks/leds")
));
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "disk_manipulator"), (base, registry) -> new FullbrightBakedModel(
forEachColorApply("disk_manipulator", (name, color) -> bakedModelOverrideRegistry.add(name, (base, registry) -> new FullbrightBakedModel(
new DiskManipulatorBakedModel(
registry.get(new ResourceLocation(RS.ID + ":block/disk_manipulator_connected")),
registry.get(new ResourceLocation(RS.ID + ":block/disk_manipulator_disconnected")),
base,
registry.get(new ResourceLocation(RS.ID + ":block/disk_manipulator/disconnected")),
registry.get(new ResourceLocation(RS.ID + ":block/disks/disk")),
registry.get(new ResourceLocation(RS.ID + ":block/disks/disk_near_capacity")),
registry.get(new ResourceLocation(RS.ID + ":block/disks/disk_full")),
registry.get(new ResourceLocation(RS.ID + ":block/disks/disk_disconnected"))
),
false,
new ResourceLocation(RS.ID, "block/disk_manipulator/cutouts/connected"),
new ResourceLocation(RS.ID, "block/disks/leds")
));
new ResourceLocation(RS.ID, "block/disks/leds"), new ResourceLocation(RS.ID, "block/disk_manipulator/cutouts/" + color)
)));
for (String portableGridName : new String[]{"portable_grid", "creative_portable_grid"}) {
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, portableGridName), (base, registry) -> new FullbrightBakedModel(
@@ -123,18 +128,14 @@ public class ClientSetup {
));
}
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "crafter"), (base, registry) -> new FullbrightBakedModel(
forEachColorApply("crafter", (name, color) -> bakedModelOverrideRegistry.add(name, (base, registry) -> new FullbrightBakedModel(
base,
true,
new ResourceLocation(RS.ID, "block/crafter/cutouts/side_connected"),
new ResourceLocation(RS.ID, "block/crafter/cutouts/side_connected_90"),
new ResourceLocation(RS.ID, "block/crafter/cutouts/side_connected_180"),
new ResourceLocation(RS.ID, "block/crafter/cutouts/side_connected_270"),
new ResourceLocation(RS.ID, "block/crafter/cutouts/front_connected")
));
getMultipleColoredModels(color, "block/crafter/cutouts/side_", "block/crafter/cutouts/top_")
)));
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "crafter_manager"), (base, registry) -> new FullbrightBakedModel(base, true, new ResourceLocation(RS.ID, "block/crafter_manager/cutouts/front_connected")));
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "crafting_monitor"), (base, registry) -> new FullbrightBakedModel(base, true, new ResourceLocation(RS.ID, "block/crafting_monitor/cutouts/front_connected")));
forEachColorApply("crafter_manager", (name, color) -> bakedModelOverrideRegistry.add(name, (base, registry) -> new FullbrightBakedModel(base, true, getColoredModel(color, "block/crafter_manager/cutouts/"))));
forEachColorApply("crafting_monitor", (name, color) -> bakedModelOverrideRegistry.add(name, (base, registry) -> new FullbrightBakedModel(base, true, getColoredModel(color, "block/crafting_monitor/cutouts/"))));
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "pattern"), (base, registry) -> new PatternBakedModel(base));
@@ -143,9 +144,11 @@ public class ClientSetup {
ModelLoader.addSpecialModel(new ResourceLocation(RS.ID + ":block/disks/disk_full"));
ModelLoader.addSpecialModel(new ResourceLocation(RS.ID + ":block/disks/disk_disconnected"));
ModelLoader.addSpecialModel(new ResourceLocation(RS.ID + ":block/disk_manipulator_disconnected"));
ModelLoader.addSpecialModel(new ResourceLocation(RS.ID + ":block/disk_manipulator_connected"));
ModelLoader.addSpecialModel(new ResourceLocation(RS.ID + ":block/disk_manipulator/disconnected"));
for (DyeColor color : DyeColor.values()) {
ModelLoader.addSpecialModel(new ResourceLocation(RS.ID + ":block/disk_manipulator/" + color));
}
ModelLoader.addSpecialModel(new ResourceLocation(RS.ID + ":block/portable_grid_connected"));
ModelLoader.addSpecialModel(new ResourceLocation(RS.ID + ":block/portable_grid_disconnected"));
@@ -188,6 +191,21 @@ public class ClientSetup {
});
}
private ResourceLocation[] getMultipleColoredModels(DyeColor color, String... paths) {
return Arrays.stream(paths).map(path -> getColoredModel(color, path)).toArray(ResourceLocation[]::new);
}
private ResourceLocation getColoredModel(DyeColor color, String path) {
return new ResourceLocation(RS.ID, path + color);
}
private void forEachColorApply(String name, BiConsumer<ResourceLocation, DyeColor> consumer) {
for (DyeColor color : DyeColor.values()) {
String prefix = color == ColorMap.DEFAULT_COLOR ? "" : color + "_";
consumer.accept(new ResourceLocation(RS.ID, prefix + name), color);
}
}
@SubscribeEvent
public void onClientSetup(FMLClientSetupEvent e) {
MinecraftForge.EVENT_BUS.register(new KeyInputListener());
@@ -224,23 +242,23 @@ public class ClientSetup {
ClientRegistry.registerKeyBinding(RSKeyBindings.OPEN_WIRELESS_CRAFTING_MONITOR);
ClientRegistry.registerKeyBinding(RSKeyBindings.OPEN_PORTABLE_GRID);
RenderTypeLookup.setRenderLayer(RSBlocks.CONTROLLER.get(), RenderType.getCutout());
RenderTypeLookup.setRenderLayer(RSBlocks.CREATIVE_CONTROLLER.get(), RenderType.getCutout());
RSBlocks.CONTROLLER.values().forEach(block -> RenderTypeLookup.setRenderLayer(block.get(), RenderType.getCutout()));
RSBlocks.CREATIVE_CONTROLLER.values().forEach(block -> RenderTypeLookup.setRenderLayer(block.get(), RenderType.getCutout()));
RSBlocks.CRAFTER.values().forEach(block -> RenderTypeLookup.setRenderLayer(block.get(), RenderType.getCutout()));
RSBlocks.CRAFTER_MANAGER.values().forEach(block -> RenderTypeLookup.setRenderLayer(block.get(), RenderType.getCutout()));
RSBlocks.CRAFTING_MONITOR.values().forEach(block -> RenderTypeLookup.setRenderLayer(block.get(), RenderType.getCutout()));
RSBlocks.DETECTOR.values().forEach(block -> RenderTypeLookup.setRenderLayer(block.get(), RenderType.getCutout()));
RSBlocks.DISK_MANIPULATOR.values().forEach(block -> RenderTypeLookup.setRenderLayer(block.get(), RenderType.getCutout()));
RSBlocks.GRID.values().forEach(block -> RenderTypeLookup.setRenderLayer(block.get(), RenderType.getCutout()));
RSBlocks.CRAFTING_GRID.values().forEach(block -> RenderTypeLookup.setRenderLayer(block.get(), RenderType.getCutout()));
RSBlocks.PATTERN_GRID.values().forEach(block -> RenderTypeLookup.setRenderLayer(block.get(), RenderType.getCutout()));
RSBlocks.FLUID_GRID.values().forEach(block -> RenderTypeLookup.setRenderLayer(block.get(), RenderType.getCutout()));
RSBlocks.NETWORK_RECEIVER.values().forEach(block -> RenderTypeLookup.setRenderLayer(block.get(), RenderType.getCutout()));
RSBlocks.NETWORK_TRANSMITTER.values().forEach(block -> RenderTypeLookup.setRenderLayer(block.get(), RenderType.getCutout()));
RSBlocks.RELAY.values().forEach(block -> RenderTypeLookup.setRenderLayer(block.get(), RenderType.getCutout()));
RSBlocks.SECURITY_MANAGER.values().forEach(block -> RenderTypeLookup.setRenderLayer(block.get(), RenderType.getCutout()));
RSBlocks.WIRELESS_TRANSMITTER.values().forEach(block -> RenderTypeLookup.setRenderLayer(block.get(), RenderType.getCutout()));
RenderTypeLookup.setRenderLayer(RSBlocks.CABLE.get(), RenderType.getCutout());
RenderTypeLookup.setRenderLayer(RSBlocks.CRAFTER.get(), RenderType.getCutout());
RenderTypeLookup.setRenderLayer(RSBlocks.CRAFTER_MANAGER.get(), RenderType.getCutout());
RenderTypeLookup.setRenderLayer(RSBlocks.CRAFTING_MONITOR.get(), RenderType.getCutout());
RenderTypeLookup.setRenderLayer(RSBlocks.DETECTOR.get(), RenderType.getCutout());
RenderTypeLookup.setRenderLayer(RSBlocks.DISK_MANIPULATOR.get(), RenderType.getCutout());
RenderTypeLookup.setRenderLayer(RSBlocks.GRID.get(), RenderType.getCutout());
RenderTypeLookup.setRenderLayer(RSBlocks.CRAFTING_GRID.get(), RenderType.getCutout());
RenderTypeLookup.setRenderLayer(RSBlocks.PATTERN_GRID.get(), RenderType.getCutout());
RenderTypeLookup.setRenderLayer(RSBlocks.FLUID_GRID.get(), RenderType.getCutout());
RenderTypeLookup.setRenderLayer(RSBlocks.NETWORK_RECEIVER.get(), RenderType.getCutout());
RenderTypeLookup.setRenderLayer(RSBlocks.NETWORK_TRANSMITTER.get(), RenderType.getCutout());
RenderTypeLookup.setRenderLayer(RSBlocks.RELAY.get(), RenderType.getCutout());
RenderTypeLookup.setRenderLayer(RSBlocks.SECURITY_MANAGER.get(), RenderType.getCutout());
RenderTypeLookup.setRenderLayer(RSBlocks.WIRELESS_TRANSMITTER.get(), RenderType.getCutout());
RenderTypeLookup.setRenderLayer(RSBlocks.IMPORTER.get(), RenderType.getCutout());
RenderTypeLookup.setRenderLayer(RSBlocks.EXPORTER.get(), RenderType.getCutout());
RenderTypeLookup.setRenderLayer(RSBlocks.EXTERNAL_STORAGE.get(), RenderType.getCutout());
@@ -253,8 +271,8 @@ public class ClientSetup {
ItemModelsProperties.func_239418_a_(RSItems.SECURITY_CARD.get(), new ResourceLocation("active"), new SecurityCardItemPropertyGetter());
ItemModelsProperties.func_239418_a_(RSItems.CONTROLLER.get(), new ResourceLocation("energy_type"), new ControllerItemPropertyGetter());
ItemModelsProperties.func_239418_a_(RSItems.CREATIVE_CONTROLLER.get(), new ResourceLocation("energy_type"), new ControllerItemPropertyGetter());
RSItems.CONTROLLER.values().forEach(controller -> ItemModelsProperties.func_239418_a_(controller.get(), new ResourceLocation("energy_type"), new ControllerItemPropertyGetter()));
RSItems.CREATIVE_CONTROLLER.values().forEach(controller -> ItemModelsProperties.func_239418_a_(controller.get(), new ResourceLocation("energy_type"), new ControllerItemPropertyGetter()));
ItemModelsProperties.func_239418_a_(RSItems.WIRELESS_CRAFTING_MONITOR.get(), new ResourceLocation("connected"), new NetworkItemPropertyGetter());
ItemModelsProperties.func_239418_a_(RSItems.CREATIVE_WIRELESS_CRAFTING_MONITOR.get(), new ResourceLocation("connected"), new NetworkItemPropertyGetter());

View File

@@ -2,7 +2,6 @@ package com.refinedmods.refinedstorage.setup;
import com.refinedmods.refinedstorage.RS;
import com.refinedmods.refinedstorage.RSBlocks;
import com.refinedmods.refinedstorage.RSLootFunctions;
import com.refinedmods.refinedstorage.api.network.NetworkType;
import com.refinedmods.refinedstorage.api.network.grid.GridType;
import com.refinedmods.refinedstorage.api.network.node.INetworkNode;
@@ -35,17 +34,14 @@ import com.refinedmods.refinedstorage.container.*;
import com.refinedmods.refinedstorage.container.factory.*;
import com.refinedmods.refinedstorage.integration.craftingtweaks.CraftingTweaksIntegration;
import com.refinedmods.refinedstorage.integration.inventorysorter.InventorySorterIntegration;
import com.refinedmods.refinedstorage.item.*;
import com.refinedmods.refinedstorage.item.blockitem.*;
import com.refinedmods.refinedstorage.item.blockitem.PortableGridBlockItem;
import com.refinedmods.refinedstorage.recipe.UpgradeWithEnchantedBookRecipeSerializer;
import com.refinedmods.refinedstorage.tile.*;
import com.refinedmods.refinedstorage.tile.craftingmonitor.CraftingMonitorTile;
import com.refinedmods.refinedstorage.tile.data.TileDataManager;
import com.refinedmods.refinedstorage.tile.grid.GridTile;
import com.refinedmods.refinedstorage.tile.grid.portable.PortableGridTile;
import com.refinedmods.refinedstorage.util.BlockUtils;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.Item;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntity;
@@ -67,8 +63,6 @@ public class CommonSetup {
MinecraftForge.EVENT_BUS.register(new NetworkListener());
MinecraftForge.EVENT_BUS.register(new BlockListener());
RSLootFunctions.register();
API.instance().getStorageDiskRegistry().add(ItemStorageDiskFactory.ID, new ItemStorageDiskFactory());
API.instance().getStorageDiskRegistry().add(FluidStorageDiskFactory.ID, new FluidStorageDiskFactory());
@@ -151,14 +145,14 @@ public class CommonSetup {
@SubscribeEvent
public void onRegisterTiles(RegistryEvent.Register<TileEntityType<?>> e) {
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(() -> new ControllerTile(NetworkType.NORMAL), RSBlocks.CONTROLLER.get()).build(null).setRegistryName(RS.ID, "controller")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(() -> new ControllerTile(NetworkType.CREATIVE), RSBlocks.CREATIVE_CONTROLLER.get()).build(null).setRegistryName(RS.ID, "creative_controller")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(() -> new ControllerTile(NetworkType.NORMAL), RSBlocks.CONTROLLER.getBlocks()).build(null).setRegistryName(RS.ID, "controller")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(() -> new ControllerTile(NetworkType.CREATIVE), RSBlocks.CREATIVE_CONTROLLER.getBlocks()).build(null).setRegistryName(RS.ID, "creative_controller")));
e.getRegistry().register(TileEntityType.Builder.create(CableTile::new, RSBlocks.CABLE.get()).build(null).setRegistryName(RS.ID, "cable"));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(DiskDriveTile::new, RSBlocks.DISK_DRIVE.get()).build(null).setRegistryName(RS.ID, "disk_drive")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(() -> new GridTile(GridType.NORMAL), RSBlocks.GRID.get()).build(null).setRegistryName(RS.ID, "grid")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(() -> new GridTile(GridType.CRAFTING), RSBlocks.CRAFTING_GRID.get()).build(null).setRegistryName(RS.ID, "crafting_grid")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(() -> new GridTile(GridType.PATTERN), RSBlocks.PATTERN_GRID.get()).build(null).setRegistryName(RS.ID, "pattern_grid")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(() -> new GridTile(GridType.FLUID), RSBlocks.FLUID_GRID.get()).build(null).setRegistryName(RS.ID, "fluid_grid")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(() -> new GridTile(GridType.NORMAL), RSBlocks.GRID.getBlocks()).build(null).setRegistryName(RS.ID, "grid")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(() -> new GridTile(GridType.CRAFTING), RSBlocks.CRAFTING_GRID.getBlocks()).build(null).setRegistryName(RS.ID, "crafting_grid")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(() -> new GridTile(GridType.PATTERN), RSBlocks.PATTERN_GRID.getBlocks()).build(null).setRegistryName(RS.ID, "pattern_grid")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(() -> new GridTile(GridType.FLUID), RSBlocks.FLUID_GRID.getBlocks()).build(null).setRegistryName(RS.ID, "fluid_grid")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(() -> new StorageTile(ItemStorageType.ONE_K), RSBlocks.STORAGE_BLOCKS.get(ItemStorageType.ONE_K).get()).build(null).setRegistryName(RS.ID, "1k_storage_block")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(() -> new StorageTile(ItemStorageType.FOUR_K), RSBlocks.STORAGE_BLOCKS.get(ItemStorageType.FOUR_K).get()).build(null).setRegistryName(RS.ID, "4k_storage_block")));
@@ -175,21 +169,21 @@ public class CommonSetup {
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(ExternalStorageTile::new, RSBlocks.EXTERNAL_STORAGE.get()).build(null).setRegistryName(RS.ID, "external_storage")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(ImporterTile::new, RSBlocks.IMPORTER.get()).build(null).setRegistryName(RS.ID, "importer")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(ExporterTile::new, RSBlocks.EXPORTER.get()).build(null).setRegistryName(RS.ID, "exporter")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(NetworkReceiverTile::new, RSBlocks.NETWORK_RECEIVER.get()).build(null).setRegistryName(RS.ID, "network_receiver")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(NetworkTransmitterTile::new, RSBlocks.NETWORK_TRANSMITTER.get()).build(null).setRegistryName(RS.ID, "network_transmitter")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(RelayTile::new, RSBlocks.RELAY.get()).build(null).setRegistryName(RS.ID, "relay")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(DetectorTile::new, RSBlocks.DETECTOR.get()).build(null).setRegistryName(RS.ID, "detector")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(SecurityManagerTile::new, RSBlocks.SECURITY_MANAGER.get()).build(null).setRegistryName(RS.ID, "security_manager")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(NetworkReceiverTile::new, RSBlocks.NETWORK_RECEIVER.getBlocks()).build(null).setRegistryName(RS.ID, "network_receiver")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(NetworkTransmitterTile::new, RSBlocks.NETWORK_TRANSMITTER.getBlocks()).build(null).setRegistryName(RS.ID, "network_transmitter")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(RelayTile::new, RSBlocks.RELAY.getBlocks()).build(null).setRegistryName(RS.ID, "relay")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(DetectorTile::new, RSBlocks.DETECTOR.getBlocks()).build(null).setRegistryName(RS.ID, "detector")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(SecurityManagerTile::new, RSBlocks.SECURITY_MANAGER.getBlocks()).build(null).setRegistryName(RS.ID, "security_manager")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(InterfaceTile::new, RSBlocks.INTERFACE.get()).build(null).setRegistryName(RS.ID, "interface")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(FluidInterfaceTile::new, RSBlocks.FLUID_INTERFACE.get()).build(null).setRegistryName(RS.ID, "fluid_interface")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(WirelessTransmitterTile::new, RSBlocks.WIRELESS_TRANSMITTER.get()).build(null).setRegistryName(RS.ID, "wireless_transmitter")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(WirelessTransmitterTile::new, RSBlocks.WIRELESS_TRANSMITTER.getBlocks()).build(null).setRegistryName(RS.ID, "wireless_transmitter")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(StorageMonitorTile::new, RSBlocks.STORAGE_MONITOR.get()).build(null).setRegistryName(RS.ID, "storage_monitor")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(ConstructorTile::new, RSBlocks.CONSTRUCTOR.get()).build(null).setRegistryName(RS.ID, "constructor")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(DestructorTile::new, RSBlocks.DESTRUCTOR.get()).build(null).setRegistryName(RS.ID, "destructor")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(DiskManipulatorTile::new, RSBlocks.DISK_MANIPULATOR.get()).build(null).setRegistryName(RS.ID, "disk_manipulator")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(CrafterTile::new, RSBlocks.CRAFTER.get()).build(null).setRegistryName(RS.ID, "crafter")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(CrafterManagerTile::new, RSBlocks.CRAFTER_MANAGER.get()).build(null).setRegistryName(RS.ID, "crafter_manager")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(CraftingMonitorTile::new, RSBlocks.CRAFTING_MONITOR.get()).build(null).setRegistryName(RS.ID, "crafting_monitor")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(DiskManipulatorTile::new, RSBlocks.DISK_MANIPULATOR.getBlocks()).build(null).setRegistryName(RS.ID, "disk_manipulator")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(CrafterTile::new, RSBlocks.CRAFTER.getBlocks()).build(null).setRegistryName(RS.ID, "crafter")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(CrafterManagerTile::new, RSBlocks.CRAFTER_MANAGER.getBlocks()).build(null).setRegistryName(RS.ID, "crafter_manager")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(CraftingMonitorTile::new, RSBlocks.CRAFTING_MONITOR.getBlocks()).build(null).setRegistryName(RS.ID, "crafting_monitor")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(() -> new PortableGridTile(PortableGridBlockItem.Type.CREATIVE), RSBlocks.CREATIVE_PORTABLE_GRID.get()).build(null).setRegistryName(RS.ID, "creative_portable_grid")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(() -> new PortableGridTile(PortableGridBlockItem.Type.NORMAL), RSBlocks.PORTABLE_GRID.get()).build(null).setRegistryName(RS.ID, "portable_grid")));

View File

@@ -3,8 +3,11 @@ package com.refinedmods.refinedstorage.util;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.item.DyeColor;
public class BlockUtils {
public static final Block.Properties DEFAULT_ROCK_PROPERTIES = Block.Properties.create(Material.ROCK).hardnessAndResistance(1.9F).sound(SoundType.STONE);
public static final Block.Properties DEFAULT_GLASS_PROPERTIES = Block.Properties.create(Material.GLASS).sound(SoundType.GLASS).hardnessAndResistance(0.35F);
public static final DyeColor DEFAULT_COLOR = DyeColor.LIGHT_BLUE;
}

View File

@@ -0,0 +1,122 @@
package com.refinedmods.refinedstorage.util;
import com.refinedmods.refinedstorage.RS;
import com.refinedmods.refinedstorage.RSBlocks;
import com.refinedmods.refinedstorage.RSItems;
import com.refinedmods.refinedstorage.block.BaseBlock;
import com.refinedmods.refinedstorage.block.NetworkNodeBlock;
import com.refinedmods.refinedstorage.item.blockitem.ColoredBlockItem;
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.item.BlockItem;
import net.minecraft.item.DyeColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tags.ItemTags;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.GameType;
import net.minecraft.world.World;
import net.minecraftforge.common.Tags;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.IForgeRegistryEntry;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.Supplier;
public class ColorMap<T extends IForgeRegistryEntry<? super T>> {
public static final DyeColor DEFAULT_COLOR = DyeColor.LIGHT_BLUE;
private final Map<DyeColor, RegistryObject<T>> colorMap = new HashMap<>();
private DeferredRegister<Item> itemRegister = null;
private DeferredRegister<Block> blockRegister = null;
private List<Runnable> lateRegistration = null;
private Map<Tags.IOptionalNamedTag<Item>, ColorMap<BlockItem>> itemTags = null;
public ColorMap(DeferredRegister<Block> blockRegister) {
this.blockRegister = blockRegister;
}
public ColorMap(DeferredRegister<Item> itemRegister, List<Runnable> lateRegistration, Map<Tags.IOptionalNamedTag<Item>, ColorMap<BlockItem>> itemTags) {
this.itemRegister = itemRegister;
this.lateRegistration = lateRegistration;
this.itemTags = itemTags;
}
public RegistryObject<T> get(DyeColor color) {
return colorMap.get(color);
}
public Collection<RegistryObject<T>> values() {
return colorMap.values();
}
public void put(DyeColor color, RegistryObject<T> object) {
colorMap.put(color, object);
}
public void forEach(BiConsumer<DyeColor, RegistryObject<T>> consumer) {
colorMap.forEach(consumer);
}
public Block[] getBlocks() {
return colorMap.values().stream().map(RegistryObject::get).toArray(Block[]::new);
}
public <S extends Block> void registerBlocks(String name, Supplier<S> blockFactory) {
for (DyeColor color : DyeColor.values()) {
String prefix = color != DEFAULT_COLOR ? color + "_" : "";
RegistryObject<S> block = blockRegister.register(prefix + name, blockFactory);
colorMap.put(color, (RegistryObject<T>) block);
RSBlocks.COLORED_BLOCKS.add(block);
}
}
public <S extends BaseBlock> void registerItemsFromBlocks(ColorMap<S> blockMap) {
RegistryObject<S> originalBlock = blockMap.get(DEFAULT_COLOR);
colorMap.put(DEFAULT_COLOR, registerBlockItemFor(originalBlock, DEFAULT_COLOR, originalBlock));
lateRegistration.add(() -> blockMap.forEach((color, block) -> {
if (color != DEFAULT_COLOR) {
colorMap.put(color, registerBlockItemFor(block, color, originalBlock));
}
}));
RSItems.COLORED_ITEM_TAGS.put(ItemTags.createOptional(new ResourceLocation(RS.ID, blockMap.get(DEFAULT_COLOR).getId().getPath())), (ColorMap<BlockItem>) this);
}
private <S extends BaseBlock> RegistryObject<T> registerBlockItemFor(RegistryObject<S> block, DyeColor color, RegistryObject<S> translationBlock) {
return (RegistryObject<T>) itemRegister.register(block.getId().getPath(), () -> new ColoredBlockItem(block.get(), new Item.Properties().group(RS.MAIN_GROUP), color, translationBlock.get().getTranslatedName()));
}
public <S extends BaseBlock> ActionResultType changeBlockColor(BlockState state, ItemStack heldItem, World world, BlockPos pos, PlayerEntity player) {
DyeColor color = DyeColor.getColor(heldItem);
if (color == null) {
return ActionResultType.PASS;
}
return setBlockState(getNewState((RegistryObject<S>) colorMap.get(color), state), heldItem, world, pos, player);
}
private <S extends BaseBlock> BlockState getNewState(RegistryObject<S> block, BlockState state) {
return block.get().getDefaultState()
.with(NetworkNodeBlock.CONNECTED, state.get(NetworkNodeBlock.CONNECTED))
.with(block.get().getDirection().getProperty(), state.get(block.get().getDirection().getProperty()));
}
public ActionResultType setBlockState(BlockState newState, ItemStack heldItem, World world, BlockPos pos, PlayerEntity player) {
if (!world.isRemote) {
world.setBlockState(pos, newState);
if (((ServerPlayerEntity) player).interactionManager.getGameType() != GameType.CREATIVE) {
heldItem.shrink(1);
}
}
return ActionResultType.SUCCESS;
}
}

View File

View File

@@ -1,16 +0,0 @@
{
"variants": {
"energy_type=off": {
"model": "refinedstorage:block/controller/controller_off"
},
"energy_type=nearly_off": {
"model": "refinedstorage:block/controller/controller_nearly_off"
},
"energy_type=nearly_on": {
"model": "refinedstorage:block/controller/controller_nearly_on"
},
"energy_type=on": {
"model": "refinedstorage:block/controller/controller_on"
}
}
}

View File

@@ -1,52 +0,0 @@
{
"variants": {
"connected=false,direction=north": {
"model": "refinedstorage:block/crafter/disconnected/north",
"uvlock": true
},
"connected=false,direction=east": {
"model": "refinedstorage:block/crafter/disconnected/east",
"uvlock": true
},
"connected=false,direction=south": {
"model": "refinedstorage:block/crafter/disconnected/south",
"uvlock": true
},
"connected=false,direction=west": {
"model": "refinedstorage:block/crafter/disconnected/west",
"uvlock": true
},
"connected=false,direction=up": {
"model": "refinedstorage:block/crafter/disconnected/up",
"uvlock": true
},
"connected=false,direction=down": {
"model": "refinedstorage:block/crafter/disconnected/down",
"uvlock": true
},
"connected=true,direction=north": {
"model": "refinedstorage:block/crafter/connected/north",
"uvlock": true
},
"connected=true,direction=east": {
"model": "refinedstorage:block/crafter/connected/east",
"uvlock": true
},
"connected=true,direction=south": {
"model": "refinedstorage:block/crafter/connected/south",
"uvlock": true
},
"connected=true,direction=west": {
"model": "refinedstorage:block/crafter/connected/west",
"uvlock": true
},
"connected=true,direction=up": {
"model": "refinedstorage:block/crafter/connected/up",
"uvlock": true
},
"connected=true,direction=down": {
"model": "refinedstorage:block/crafter/connected/down",
"uvlock": true
}
}
}

View File

@@ -1,36 +0,0 @@
{
"variants": {
"connected=true,direction=north": {
"model": "refinedstorage:block/crafter_manager_connected",
"y": 0
},
"connected=true,direction=east": {
"model": "refinedstorage:block/crafter_manager_connected",
"y": 90
},
"connected=true,direction=south": {
"model": "refinedstorage:block/crafter_manager_connected",
"y": 180
},
"connected=true,direction=west": {
"model": "refinedstorage:block/crafter_manager_connected",
"y": 270
},
"connected=false,direction=north": {
"model": "refinedstorage:block/crafter_manager_disconnected",
"y": 0
},
"connected=false,direction=east": {
"model": "refinedstorage:block/crafter_manager_disconnected",
"y": 90
},
"connected=false,direction=south": {
"model": "refinedstorage:block/crafter_manager_disconnected",
"y": 180
},
"connected=false,direction=west": {
"model": "refinedstorage:block/crafter_manager_disconnected",
"y": 270
}
}
}

View File

@@ -1,36 +0,0 @@
{
"variants": {
"connected=true,direction=north": {
"model": "refinedstorage:block/grid/crafting/connected",
"y": 0
},
"connected=true,direction=east": {
"model": "refinedstorage:block/grid/crafting/connected",
"y": 90
},
"connected=true,direction=south": {
"model": "refinedstorage:block/grid/crafting/connected",
"y": 180
},
"connected=true,direction=west": {
"model": "refinedstorage:block/grid/crafting/connected",
"y": 270
},
"connected=false,direction=north": {
"model": "refinedstorage:block/grid/crafting/disconnected",
"y": 0
},
"connected=false,direction=east": {
"model": "refinedstorage:block/grid/crafting/disconnected",
"y": 90
},
"connected=false,direction=south": {
"model": "refinedstorage:block/grid/crafting/disconnected",
"y": 180
},
"connected=false,direction=west": {
"model": "refinedstorage:block/grid/crafting/disconnected",
"y": 270
}
}
}

View File

@@ -1,36 +0,0 @@
{
"variants": {
"connected=true,direction=north": {
"model": "refinedstorage:block/crafting_monitor_connected",
"y": 0
},
"connected=true,direction=east": {
"model": "refinedstorage:block/crafting_monitor_connected",
"y": 90
},
"connected=true,direction=south": {
"model": "refinedstorage:block/crafting_monitor_connected",
"y": 180
},
"connected=true,direction=west": {
"model": "refinedstorage:block/crafting_monitor_connected",
"y": 270
},
"connected=false,direction=north": {
"model": "refinedstorage:block/crafting_monitor_disconnected",
"y": 0
},
"connected=false,direction=east": {
"model": "refinedstorage:block/crafting_monitor_disconnected",
"y": 90
},
"connected=false,direction=south": {
"model": "refinedstorage:block/crafting_monitor_disconnected",
"y": 180
},
"connected=false,direction=west": {
"model": "refinedstorage:block/crafting_monitor_disconnected",
"y": 270
}
}
}

View File

@@ -1,16 +0,0 @@
{
"variants": {
"energy_type=off": {
"model": "refinedstorage:block/controller/controller_off"
},
"energy_type=nearly_off": {
"model": "refinedstorage:block/controller/controller_nearly_off"
},
"energy_type=nearly_on": {
"model": "refinedstorage:block/controller/controller_nearly_on"
},
"energy_type=on": {
"model": "refinedstorage:block/controller/controller_on"
}
}
}

View File

View File

@@ -1,10 +0,0 @@
{
"variants": {
"powered=true": {
"model": "refinedstorage:block/detector_on"
},
"powered=false": {
"model": "refinedstorage:block/detector_off"
}
}
}

View File

View File

@@ -1,7 +0,0 @@
{
"variants": {
"": {
"model": "refinedstorage:block/disk_manipulator_disconnected"
}
}
}

View File

View File

@@ -1,36 +0,0 @@
{
"variants": {
"connected=true,direction=north": {
"model": "refinedstorage:block/grid/fluid/connected",
"y": 0
},
"connected=true,direction=east": {
"model": "refinedstorage:block/grid/fluid/connected",
"y": 90
},
"connected=true,direction=south": {
"model": "refinedstorage:block/grid/fluid/connected",
"y": 180
},
"connected=true,direction=west": {
"model": "refinedstorage:block/grid/fluid/connected",
"y": 270
},
"connected=false,direction=north": {
"model": "refinedstorage:block/grid/fluid/disconnected",
"y": 0
},
"connected=false,direction=east": {
"model": "refinedstorage:block/grid/fluid/disconnected",
"y": 90
},
"connected=false,direction=south": {
"model": "refinedstorage:block/grid/fluid/disconnected",
"y": 180
},
"connected=false,direction=west": {
"model": "refinedstorage:block/grid/fluid/disconnected",
"y": 270
}
}
}

View File

@@ -1,36 +0,0 @@
{
"variants": {
"connected=true,direction=north": {
"model": "refinedstorage:block/grid/normal/connected",
"y": 0
},
"connected=true,direction=east": {
"model": "refinedstorage:block/grid/normal/connected",
"y": 90
},
"connected=true,direction=south": {
"model": "refinedstorage:block/grid/normal/connected",
"y": 180
},
"connected=true,direction=west": {
"model": "refinedstorage:block/grid/normal/connected",
"y": 270
},
"connected=false,direction=north": {
"model": "refinedstorage:block/grid/normal/disconnected",
"y": 0
},
"connected=false,direction=east": {
"model": "refinedstorage:block/grid/normal/disconnected",
"y": 90
},
"connected=false,direction=south": {
"model": "refinedstorage:block/grid/normal/disconnected",
"y": 180
},
"connected=false,direction=west": {
"model": "refinedstorage:block/grid/normal/disconnected",
"y": 270
}
}
}

View File

View File

@@ -1,10 +0,0 @@
{
"variants": {
"connected=true": {
"model": "refinedstorage:block/network_receiver_connected"
},
"connected=false": {
"model": "refinedstorage:block/network_receiver_disconnected"
}
}
}

View File

@@ -1,10 +0,0 @@
{
"variants": {
"connected=true": {
"model": "refinedstorage:block/network_transmitter_connected"
},
"connected=false": {
"model": "refinedstorage:block/network_transmitter_disconnected"
}
}
}

View File

@@ -1,36 +0,0 @@
{
"variants": {
"connected=true,direction=north": {
"model": "refinedstorage:block/grid/pattern/connected",
"y": 0
},
"connected=true,direction=east": {
"model": "refinedstorage:block/grid/pattern/connected",
"y": 90
},
"connected=true,direction=south": {
"model": "refinedstorage:block/grid/pattern/connected",
"y": 180
},
"connected=true,direction=west": {
"model": "refinedstorage:block/grid/pattern/connected",
"y": 270
},
"connected=false,direction=north": {
"model": "refinedstorage:block/grid/pattern/disconnected",
"y": 0
},
"connected=false,direction=east": {
"model": "refinedstorage:block/grid/pattern/disconnected",
"y": 90
},
"connected=false,direction=south": {
"model": "refinedstorage:block/grid/pattern/disconnected",
"y": 180
},
"connected=false,direction=west": {
"model": "refinedstorage:block/grid/pattern/disconnected",
"y": 270
}
}
}

View File

@@ -1,10 +0,0 @@
{
"variants": {
"connected=true": {
"model": "refinedstorage:block/relay_connected"
},
"connected=false": {
"model": "refinedstorage:block/relay_disconnected"
}
}
}

View File

@@ -1,36 +0,0 @@
{
"variants": {
"connected=true,direction=north": {
"model": "refinedstorage:block/security_manager_connected",
"y": 0
},
"connected=true,direction=east": {
"model": "refinedstorage:block/security_manager_connected",
"y": 90
},
"connected=true,direction=south": {
"model": "refinedstorage:block/security_manager_connected",
"y": 180
},
"connected=true,direction=west": {
"model": "refinedstorage:block/security_manager_connected",
"y": 270
},
"connected=false,direction=north": {
"model": "refinedstorage:block/security_manager_disconnected",
"y": 0
},
"connected=false,direction=east": {
"model": "refinedstorage:block/security_manager_disconnected",
"y": 90
},
"connected=false,direction=south": {
"model": "refinedstorage:block/security_manager_disconnected",
"y": 180
},
"connected=false,direction=west": {
"model": "refinedstorage:block/security_manager_disconnected",
"y": 270
}
}
}

View File

@@ -1,54 +0,0 @@
{
"variants": {
"connected=true,direction=north": {
"model": "refinedstorage:block/wireless_transmitter_connected",
"x": 270
},
"connected=true,direction=east": {
"model": "refinedstorage:block/wireless_transmitter_connected",
"x": 270,
"y": 90
},
"connected=true,direction=south": {
"model": "refinedstorage:block/wireless_transmitter_connected",
"x": 90
},
"connected=true,direction=west": {
"model": "refinedstorage:block/wireless_transmitter_connected",
"x": 90,
"y": 90
},
"connected=true,direction=up": {
"model": "refinedstorage:block/wireless_transmitter_connected",
"x": 180
},
"connected=true,direction=down": {
"model": "refinedstorage:block/wireless_transmitter_connected"
},
"connected=false,direction=north": {
"model": "refinedstorage:block/wireless_transmitter_disconnected",
"x": 270
},
"connected=false,direction=east": {
"model": "refinedstorage:block/wireless_transmitter_disconnected",
"x": 270,
"y": 90
},
"connected=false,direction=south": {
"model": "refinedstorage:block/wireless_transmitter_disconnected",
"x": 90
},
"connected=false,direction=west": {
"model": "refinedstorage:block/wireless_transmitter_disconnected",
"x": 90,
"y": 90
},
"connected=false,direction=up": {
"model": "refinedstorage:block/wireless_transmitter_disconnected",
"x": 180
},
"connected=false,direction=down": {
"model": "refinedstorage:block/wireless_transmitter_disconnected"
}
}
}

View File

@@ -201,16 +201,12 @@
"sidebutton.refinedstorage.detector.mode.0": "Emit signal when under the amount",
"sidebutton.refinedstorage.detector.mode.1": "Emit signal when on the amount",
"sidebutton.refinedstorage.detector.mode.2": "Emit signal when above the amount",
"sidebutton.refinedstorage.constructor.drop": "Drop blocks instead of placing",
"sidebutton.refinedstorage.destructor.pickup": "Pickup items instead of breaking",
"sidebutton.refinedstorage.access_type": "Access type",
"sidebutton.refinedstorage.access_type.0": "Insert and extract",
"sidebutton.refinedstorage.access_type.1": "Insert only",
"sidebutton.refinedstorage.access_type.2": "Extract only",
"block.refinedstorage.controller": "Controller",
"block.refinedstorage.creative_controller": "Creative Controller",
"block.refinedstorage.cable": "Cable",
@@ -252,7 +248,6 @@
"block.refinedstorage.creative_portable_grid": "Creative Portable Grid",
"block.refinedstorage.portable_grid.tooltip": "Sneak to place in the world.",
"block.refinedstorage.crafter_manager": "Crafter Manager",
"item.refinedstorage.1k_storage_disk": "1k Storage Disk",
"item.refinedstorage.4k_storage_disk": "4k Storage Disk",
"item.refinedstorage.16k_storage_disk": "16k Storage Disk",

View File

@@ -1,9 +0,0 @@
{
"parent": "refinedstorage:block/controller/controller_nearly",
"textures": {
"particle": "refinedstorage:block/controller/controller_off",
"all": "refinedstorage:block/controller/controller",
"cutout": "refinedstorage:block/controller/cutouts/nearly_off",
"cutout_gray": "refinedstorage:block/controller/cutouts/nearly_off_gray"
}
}

View File

@@ -1,9 +0,0 @@
{
"parent": "refinedstorage:block/controller/controller_nearly",
"textures": {
"particle": "refinedstorage:block/controller/controller_off",
"all": "refinedstorage:block/controller/controller",
"cutout": "refinedstorage:block/controller/cutouts/nearly_on",
"cutout_gray": "refinedstorage:block/controller/cutouts/nearly_on_gray"
}
}

View File

@@ -1,8 +0,0 @@
{
"parent": "refinedstorage:block/cube_all_cutout",
"textures": {
"particle": "refinedstorage:block/controller/controller_off",
"all": "refinedstorage:block/controller/controller_off",
"cutout": "refinedstorage:block/controller/cutouts/off"
}
}

View File

@@ -1,8 +0,0 @@
{
"parent": "refinedstorage:block/cube_all_cutout",
"textures": {
"particle": "refinedstorage:block/controller/controller_off",
"all": "refinedstorage:block/controller/controller",
"cutout": "refinedstorage:block/controller/cutouts/on"
}
}

View File

@@ -1,18 +0,0 @@
{
"parent": "refinedstorage:block/cube_cutout",
"textures": {
"particle": "refinedstorage:block/crafter/side",
"down": "refinedstorage:block/crafter/front",
"up": "refinedstorage:block/crafter/bottom",
"north": "refinedstorage:block/crafter/side_180",
"east": "refinedstorage:block/crafter/side_180",
"south": "refinedstorage:block/crafter/side_180",
"west": "refinedstorage:block/crafter/side_180",
"cutout_down": "refinedstorage:block/crafter/cutouts/front_connected",
"cutout_up": "refinedstorage:block/crafter/bottom",
"cutout_north": "refinedstorage:block/crafter/cutouts/side_connected_180",
"cutout_east": "refinedstorage:block/crafter/cutouts/side_connected_180",
"cutout_south": "refinedstorage:block/crafter/cutouts/side_connected_180",
"cutout_west": "refinedstorage:block/crafter/cutouts/side_connected_180"
}
}

View File

@@ -1,18 +0,0 @@
{
"parent": "refinedstorage:block/cube_cutout",
"textures": {
"particle": "refinedstorage:block/crafter/side",
"down": "refinedstorage:block/crafter/side_90",
"up": "refinedstorage:block/crafter/side_90",
"north": "refinedstorage:block/crafter/side_270",
"east": "refinedstorage:block/crafter/front",
"south": "refinedstorage:block/crafter/side_90",
"west": "refinedstorage:block/crafter/bottom",
"cutout_down": "refinedstorage:block/crafter/cutouts/side_connected_90",
"cutout_up": "refinedstorage:block/crafter/cutouts/side_connected_90",
"cutout_north": "refinedstorage:block/crafter/cutouts/side_connected_270",
"cutout_east": "refinedstorage:block/crafter/cutouts/front_connected",
"cutout_south": "refinedstorage:block/crafter/cutouts/side_connected_90",
"cutout_west": "refinedstorage:block/crafter/bottom"
}
}

View File

@@ -1,18 +0,0 @@
{
"parent": "refinedstorage:block/cube_cutout",
"textures": {
"particle": "refinedstorage:block/crafter/side",
"down": "refinedstorage:block/crafter/side_180",
"up": "refinedstorage:block/crafter/side",
"north": "refinedstorage:block/crafter/front",
"east": "refinedstorage:block/crafter/side_90",
"south": "refinedstorage:block/crafter/bottom",
"west": "refinedstorage:block/crafter/side_270",
"cutout_down": "refinedstorage:block/crafter/cutouts/side_connected_180",
"cutout_up": "refinedstorage:block/crafter/cutouts/side_connected",
"cutout_north": "refinedstorage:block/crafter/cutouts/front_connected",
"cutout_east": "refinedstorage:block/crafter/cutouts/side_connected_90",
"cutout_south": "refinedstorage:block/crafter/bottom",
"cutout_west": "refinedstorage:block/crafter/cutouts/side_connected_270"
}
}

View File

@@ -1,18 +0,0 @@
{
"parent": "refinedstorage:block/cube_cutout",
"textures": {
"particle": "refinedstorage:block/crafter/side",
"down": "refinedstorage:block/crafter/side",
"up": "refinedstorage:block/crafter/side_180",
"north": "refinedstorage:block/crafter/bottom",
"east": "refinedstorage:block/crafter/side_270",
"south": "refinedstorage:block/crafter/front",
"west": "refinedstorage:block/crafter/side_90",
"cutout_down": "refinedstorage:block/crafter/cutouts/side_connected",
"cutout_up": "refinedstorage:block/crafter/cutouts/side_connected_180",
"cutout_north": "refinedstorage:block/crafter/bottom",
"cutout_east": "refinedstorage:block/crafter/cutouts/side_connected_270",
"cutout_south": "refinedstorage:block/crafter/cutouts/front_connected",
"cutout_west": "refinedstorage:block/crafter/cutouts/side_connected_90"
}
}

View File

@@ -1,18 +0,0 @@
{
"parent": "refinedstorage:block/cube_cutout",
"textures": {
"particle": "refinedstorage:block/crafter/side",
"down": "refinedstorage:block/crafter/bottom",
"up": "refinedstorage:block/crafter/front",
"north": "refinedstorage:block/crafter/side",
"east": "refinedstorage:block/crafter/side",
"south": "refinedstorage:block/crafter/side",
"west": "refinedstorage:block/crafter/side",
"cutout_down": "refinedstorage:block/crafter/bottom",
"cutout_up": "refinedstorage:block/crafter/cutouts/front_connected",
"cutout_north": "refinedstorage:block/crafter/cutouts/side_connected",
"cutout_east": "refinedstorage:block/crafter/cutouts/side_connected",
"cutout_south": "refinedstorage:block/crafter/cutouts/side_connected",
"cutout_west": "refinedstorage:block/crafter/cutouts/side_connected"
}
}

View File

@@ -1,18 +0,0 @@
{
"parent": "refinedstorage:block/cube_cutout",
"textures": {
"particle": "refinedstorage:block/crafter/side",
"down": "refinedstorage:block/crafter/side_270",
"up": "refinedstorage:block/crafter/side_270",
"north": "refinedstorage:block/crafter/side_90",
"east": "refinedstorage:block/crafter/bottom",
"south": "refinedstorage:block/crafter/side_270",
"west": "refinedstorage:block/crafter/front",
"cutout_down": "refinedstorage:block/crafter/cutouts/side_connected_270",
"cutout_up": "refinedstorage:block/crafter/cutouts/side_connected_270",
"cutout_north": "refinedstorage:block/crafter/cutouts/side_connected_90",
"cutout_east": "refinedstorage:block/crafter/bottom",
"cutout_south": "refinedstorage:block/crafter/cutouts/side_connected_270",
"cutout_west": "refinedstorage:block/crafter/cutouts/front_connected"
}
}

View File

@@ -1,18 +0,0 @@
{
"parent": "refinedstorage:block/cube_cutout",
"textures": {
"particle": "refinedstorage:block/crafter/side",
"down": "refinedstorage:block/crafter/front",
"up": "refinedstorage:block/crafter/bottom",
"north": "refinedstorage:block/crafter/side_180",
"east": "refinedstorage:block/crafter/side_180",
"south": "refinedstorage:block/crafter/side_180",
"west": "refinedstorage:block/crafter/side_180",
"cutout_down": "refinedstorage:block/crafter/cutouts/front_disconnected",
"cutout_up": "refinedstorage:block/crafter/bottom",
"cutout_north": "refinedstorage:block/crafter/cutouts/side_disconnected_180",
"cutout_east": "refinedstorage:block/crafter/cutouts/side_disconnected_180",
"cutout_south": "refinedstorage:block/crafter/cutouts/side_disconnected_180",
"cutout_west": "refinedstorage:block/crafter/cutouts/side_disconnected_180"
}
}

View File

@@ -1,18 +0,0 @@
{
"parent": "refinedstorage:block/cube_cutout",
"textures": {
"particle": "refinedstorage:block/crafter/side",
"down": "refinedstorage:block/crafter/side_90",
"up": "refinedstorage:block/crafter/side_90",
"north": "refinedstorage:block/crafter/side_270",
"east": "refinedstorage:block/crafter/front",
"south": "refinedstorage:block/crafter/side_90",
"west": "refinedstorage:block/crafter/bottom",
"cutout_down": "refinedstorage:block/crafter/cutouts/side_disconnected_90",
"cutout_up": "refinedstorage:block/crafter/cutouts/side_disconnected_90",
"cutout_north": "refinedstorage:block/crafter/cutouts/side_disconnected_270",
"cutout_east": "refinedstorage:block/crafter/cutouts/front_disconnected",
"cutout_south": "refinedstorage:block/crafter/cutouts/side_disconnected_90",
"cutout_west": "refinedstorage:block/crafter/bottom"
}
}

View File

@@ -1,18 +0,0 @@
{
"parent": "refinedstorage:block/cube_cutout",
"textures": {
"particle": "refinedstorage:block/crafter/side",
"down": "refinedstorage:block/crafter/side_180",
"up": "refinedstorage:block/crafter/side",
"north": "refinedstorage:block/crafter/front",
"east": "refinedstorage:block/crafter/side_90",
"south": "refinedstorage:block/crafter/bottom",
"west": "refinedstorage:block/crafter/side_270",
"cutout_down": "refinedstorage:block/crafter/cutouts/side_disconnected_180",
"cutout_up": "refinedstorage:block/crafter/cutouts/side_disconnected",
"cutout_north": "refinedstorage:block/crafter/cutouts/front_disconnected",
"cutout_east": "refinedstorage:block/crafter/cutouts/side_disconnected_90",
"cutout_south": "refinedstorage:block/crafter/bottom",
"cutout_west": "refinedstorage:block/crafter/cutouts/side_disconnected_270"
}
}

View File

@@ -1,18 +0,0 @@
{
"parent": "refinedstorage:block/cube_cutout",
"textures": {
"particle": "refinedstorage:block/crafter/side",
"down": "refinedstorage:block/crafter/side",
"up": "refinedstorage:block/crafter/side_180",
"north": "refinedstorage:block/crafter/bottom",
"east": "refinedstorage:block/crafter/side_270",
"south": "refinedstorage:block/crafter/front",
"west": "refinedstorage:block/crafter/side_90",
"cutout_down": "refinedstorage:block/crafter/cutouts/side_disconnected",
"cutout_up": "refinedstorage:block/crafter/cutouts/side_disconnected_180",
"cutout_north": "refinedstorage:block/crafter/bottom",
"cutout_east": "refinedstorage:block/crafter/cutouts/side_disconnected_270",
"cutout_south": "refinedstorage:block/crafter/cutouts/front_disconnected",
"cutout_west": "refinedstorage:block/crafter/cutouts/side_disconnected_90"
}
}

View File

@@ -1,18 +0,0 @@
{
"parent": "refinedstorage:block/cube_cutout",
"textures": {
"particle": "refinedstorage:block/crafter/side",
"down": "refinedstorage:block/crafter/bottom",
"up": "refinedstorage:block/crafter/front",
"north": "refinedstorage:block/crafter/side",
"east": "refinedstorage:block/crafter/side",
"south": "refinedstorage:block/crafter/side",
"west": "refinedstorage:block/crafter/side",
"cutout_down": "refinedstorage:block/crafter/bottom",
"cutout_up": "refinedstorage:block/crafter/cutouts/front_disconnected",
"cutout_north": "refinedstorage:block/crafter/cutouts/side_disconnected",
"cutout_east": "refinedstorage:block/crafter/cutouts/side_disconnected",
"cutout_south": "refinedstorage:block/crafter/cutouts/side_disconnected",
"cutout_west": "refinedstorage:block/crafter/cutouts/side_disconnected"
}
}

View File

@@ -1,18 +0,0 @@
{
"parent": "refinedstorage:block/cube_cutout",
"textures": {
"particle": "refinedstorage:block/crafter/side",
"down": "refinedstorage:block/crafter/side_270",
"up": "refinedstorage:block/crafter/side_270",
"north": "refinedstorage:block/crafter/side_90",
"east": "refinedstorage:block/crafter/bottom",
"south": "refinedstorage:block/crafter/side_270",
"west": "refinedstorage:block/crafter/front",
"cutout_down": "refinedstorage:block/crafter/cutouts/side_disconnected_270",
"cutout_up": "refinedstorage:block/crafter/cutouts/side_disconnected_270",
"cutout_north": "refinedstorage:block/crafter/cutouts/side_disconnected_90",
"cutout_east": "refinedstorage:block/crafter/bottom",
"cutout_south": "refinedstorage:block/crafter/cutouts/side_disconnected_270",
"cutout_west": "refinedstorage:block/crafter/cutouts/front_disconnected"
}
}

View File

@@ -1,12 +0,0 @@
{
"parent": "refinedstorage:block/cube_north_cutout",
"textures": {
"particle": "refinedstorage:block/side",
"north": "refinedstorage:block/crafter_manager/front",
"east": "refinedstorage:block/crafter_manager/left",
"south": "refinedstorage:block/crafter_manager/back",
"west": "refinedstorage:block/crafter_manager/right",
"up": "refinedstorage:block/crafter_manager/top",
"down": "refinedstorage:block/bottom"
}
}

View File

@@ -1,6 +0,0 @@
{
"parent": "refinedstorage:block/crafter_manager",
"textures": {
"cutout": "refinedstorage:block/crafter_manager/cutouts/front_connected"
}
}

View File

@@ -1,6 +0,0 @@
{
"parent": "refinedstorage:block/crafter_manager",
"textures": {
"cutout": "refinedstorage:block/crafter_manager/cutouts/front_disconnected"
}
}

View File

@@ -1,12 +0,0 @@
{
"parent": "refinedstorage:block/cube_north_cutout",
"textures": {
"particle": "refinedstorage:block/crafting_monitor/front",
"north": "refinedstorage:block/crafting_monitor/front",
"east": "refinedstorage:block/crafting_monitor/left",
"south": "refinedstorage:block/crafting_monitor/back",
"west": "refinedstorage:block/crafting_monitor/right",
"up": "refinedstorage:block/crafting_monitor/top",
"down": "refinedstorage:block/bottom"
}
}

View File

@@ -1,6 +0,0 @@
{
"parent": "refinedstorage:block/crafting_monitor",
"textures": {
"cutout": "refinedstorage:block/crafting_monitor/cutouts/front_connected"
}
}

View File

@@ -1,6 +0,0 @@
{
"parent": "refinedstorage:block/crafting_monitor",
"textures": {
"cutout": "refinedstorage:block/crafting_monitor/cutouts/front_disconnected"
}
}

View File

@@ -1,6 +0,0 @@
{
"parent": "refinedstorage:block/detector",
"textures": {
"torch": "refinedstorage:block/detector/cutouts/off"
}
}

View File

@@ -1,6 +0,0 @@
{
"parent": "refinedstorage:block/detector",
"textures": {
"torch": "refinedstorage:block/detector/cutouts/on"
}
}

View File

@@ -1,13 +0,0 @@
{
"parent": "refinedstorage:block/cube_north_cutout",
"textures": {
"particle": "refinedstorage:block/disk_manipulator/disk_manipulator",
"north": "refinedstorage:block/disk_manipulator/disk_manipulator",
"east": "refinedstorage:block/side",
"south": "refinedstorage:block/side",
"west": "refinedstorage:block/side",
"up": "refinedstorage:block/side",
"down": "refinedstorage:block/side",
"cutout": "refinedstorage:block/disk_manipulator/cutouts/connected"
}
}

View File

@@ -1,13 +0,0 @@
{
"parent": "refinedstorage:block/cube_north_cutout",
"textures": {
"particle": "refinedstorage:block/disk_manipulator/disk_manipulator",
"north": "refinedstorage:block/disk_manipulator/disk_manipulator",
"east": "refinedstorage:block/side",
"south": "refinedstorage:block/side",
"west": "refinedstorage:block/side",
"up": "refinedstorage:block/side",
"down": "refinedstorage:block/side",
"cutout": "refinedstorage:block/disk_manipulator/cutouts/disconnected"
}
}

View File

@@ -1,13 +0,0 @@
{
"parent": "refinedstorage:block/cube_north_cutout",
"textures": {
"particle": "refinedstorage:block/side",
"east": "refinedstorage:block/grid/left",
"south": "refinedstorage:block/grid/back",
"west": "refinedstorage:block/grid/right",
"up": "refinedstorage:block/grid/top",
"down": "refinedstorage:block/bottom",
"north": "refinedstorage:block/grid/front",
"cutout": "refinedstorage:block/grid/cutouts/crafting_front_connected"
}
}

View File

@@ -1,13 +0,0 @@
{
"parent": "refinedstorage:block/cube_north_cutout",
"textures": {
"particle": "refinedstorage:block/side",
"east": "refinedstorage:block/grid/left",
"south": "refinedstorage:block/grid/back",
"west": "refinedstorage:block/grid/right",
"up": "refinedstorage:block/grid/top",
"down": "refinedstorage:block/bottom",
"north": "refinedstorage:block/grid/front",
"cutout": "refinedstorage:block/grid/cutouts/crafting_front_disconnected"
}
}

View File

@@ -1,13 +0,0 @@
{
"parent": "refinedstorage:block/cube_north_cutout",
"textures": {
"particle": "refinedstorage:block/side",
"east": "refinedstorage:block/grid/fluid_left",
"south": "refinedstorage:block/grid/back",
"west": "refinedstorage:block/grid/fluid_right",
"up": "refinedstorage:block/grid/fluid_top",
"down": "refinedstorage:block/bottom",
"north": "refinedstorage:block/grid/fluid_front",
"cutout": "refinedstorage:block/grid/cutouts/fluid_front_connected"
}
}

View File

@@ -1,13 +0,0 @@
{
"parent": "refinedstorage:block/cube_north_cutout",
"textures": {
"particle": "refinedstorage:block/side",
"east": "refinedstorage:block/grid/fluid_left",
"south": "refinedstorage:block/grid/back",
"west": "refinedstorage:block/grid/fluid_right",
"up": "refinedstorage:block/grid/fluid_top",
"down": "refinedstorage:block/bottom",
"north": "refinedstorage:block/grid/fluid_front",
"cutout": "refinedstorage:block/grid/cutouts/fluid_front_disconnected"
}
}

View File

@@ -1,13 +0,0 @@
{
"parent": "refinedstorage:block/cube_north_cutout",
"textures": {
"particle": "refinedstorage:block/side",
"east": "refinedstorage:block/grid/left",
"south": "refinedstorage:block/grid/back",
"west": "refinedstorage:block/grid/right",
"up": "refinedstorage:block/grid/top",
"down": "refinedstorage:block/bottom",
"north": "refinedstorage:block/grid/front",
"cutout": "refinedstorage:block/grid/cutouts/front_connected"
}
}

View File

@@ -1,13 +0,0 @@
{
"parent": "refinedstorage:block/cube_north_cutout",
"textures": {
"particle": "refinedstorage:block/side",
"east": "refinedstorage:block/grid/left",
"south": "refinedstorage:block/grid/back",
"west": "refinedstorage:block/grid/right",
"up": "refinedstorage:block/grid/top",
"down": "refinedstorage:block/bottom",
"north": "refinedstorage:block/grid/front",
"cutout": "refinedstorage:block/grid/cutouts/front_disconnected"
}
}

View File

@@ -1,13 +0,0 @@
{
"parent": "refinedstorage:block/cube_north_cutout",
"textures": {
"particle": "refinedstorage:block/side",
"east": "refinedstorage:block/grid/left",
"south": "refinedstorage:block/grid/back",
"west": "refinedstorage:block/grid/right",
"up": "refinedstorage:block/grid/top",
"down": "refinedstorage:block/bottom",
"north": "refinedstorage:block/grid/front",
"cutout": "refinedstorage:block/grid/cutouts/pattern_front_connected"
}
}

View File

@@ -1,13 +0,0 @@
{
"parent": "refinedstorage:block/cube_north_cutout",
"textures": {
"particle": "refinedstorage:block/side",
"east": "refinedstorage:block/grid/left",
"south": "refinedstorage:block/grid/back",
"west": "refinedstorage:block/grid/right",
"up": "refinedstorage:block/grid/top",
"down": "refinedstorage:block/bottom",
"north": "refinedstorage:block/grid/front",
"cutout": "refinedstorage:block/grid/cutouts/pattern_front_disconnected"
}
}

View File

@@ -1,8 +0,0 @@
{
"parent": "refinedstorage:block/cube_all_cutout",
"textures": {
"particle": "refinedstorage:block/network_receiver/network_receiver",
"all": "refinedstorage:block/network_receiver/network_receiver",
"cutout": "refinedstorage:block/network_receiver/cutouts/connected"
}
}

View File

@@ -1,8 +0,0 @@
{
"parent": "refinedstorage:block/cube_all_cutout",
"textures": {
"particle": "refinedstorage:block/network_receiver/network_receiver",
"all": "refinedstorage:block/network_receiver/network_receiver",
"cutout": "refinedstorage:block/network_receiver/cutouts/disconnected"
}
}

View File

@@ -1,8 +0,0 @@
{
"parent": "refinedstorage:block/cube_all_cutout",
"textures": {
"particle": "refinedstorage:block/network_transmitter/network_transmitter",
"all": "refinedstorage:block/network_transmitter/network_transmitter",
"cutout": "refinedstorage:block/network_transmitter/cutouts/connected"
}
}

View File

@@ -1,8 +0,0 @@
{
"parent": "refinedstorage:block/cube_all_cutout",
"textures": {
"particle": "refinedstorage:block/network_transmitter/network_transmitter",
"all": "refinedstorage:block/network_transmitter/network_transmitter",
"cutout": "refinedstorage:block/network_transmitter/cutouts/disconnected"
}
}

Some files were not shown because too many files have changed in this diff Show More