2019-07-11 09:03:08 +02:00
|
|
|
package com.simibubi.create;
|
|
|
|
|
2019-12-22 01:31:40 +01:00
|
|
|
import com.simibubi.create.foundation.block.IHaveColorHandler;
|
|
|
|
import com.simibubi.create.foundation.block.IHaveCustomBlockItem;
|
|
|
|
import com.simibubi.create.foundation.block.IHaveNoBlockItem;
|
2019-08-25 10:14:15 +02:00
|
|
|
import com.simibubi.create.foundation.block.ProperStairsBlock;
|
2019-08-17 00:57:36 +02:00
|
|
|
import com.simibubi.create.foundation.block.RenderUtilityAxisBlock;
|
2019-07-23 12:54:53 +02:00
|
|
|
import com.simibubi.create.foundation.block.RenderUtilityBlock;
|
2019-11-30 00:27:03 +01:00
|
|
|
import com.simibubi.create.foundation.block.RenderUtilityDirectionalBlock;
|
2019-10-15 22:22:19 +02:00
|
|
|
import com.simibubi.create.foundation.utility.Lang;
|
2019-09-12 10:00:15 +02:00
|
|
|
import com.simibubi.create.modules.IModule;
|
2019-12-12 10:56:34 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.components.actors.DrillBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.components.actors.DrillBlock.DrillHeadBlock;
|
2019-12-12 11:58:29 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.components.actors.HarvesterBlock;
|
2019-12-12 10:56:34 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.components.actors.HarvesterBlock.HarvesterBladeBlock;
|
2019-12-12 11:58:29 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.components.contraptions.bearing.MechanicalBearingBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.components.contraptions.chassis.LinearChassisBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.components.contraptions.chassis.RadialChassisBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.components.contraptions.mounted.CartAssemblerBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.components.contraptions.mounted.CartAssemblerBlock.MinecartAnchorBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.components.contraptions.piston.MechanicalPistonBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.components.contraptions.piston.MechanicalPistonHeadBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.components.contraptions.piston.PistonPoleBlock;
|
2019-12-12 10:56:34 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.components.crafter.MechanicalCrafterBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.components.crusher.CrushingWheelBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.components.crusher.CrushingWheelControllerBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.components.fan.EncasedFanBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.components.mixer.MechanicalMixerBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.components.motor.MotorBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.components.press.MechanicalPressBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.components.saw.SawBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.components.turntable.TurntableBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.components.waterwheel.WaterWheelBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.processing.BasinBlock;
|
2019-08-17 00:57:36 +02:00
|
|
|
import com.simibubi.create.modules.contraptions.redstone.ContactBlock;
|
2019-08-31 08:37:57 +02:00
|
|
|
import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock;
|
2019-11-29 10:06:03 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.relays.belt.BeltTunnelBlock;
|
2019-12-12 10:56:34 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.relays.elementary.CogWheelBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.relays.elementary.ShaftBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.relays.elementary.ShaftHalfBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.relays.encased.ClutchBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.relays.encased.EncasedBeltBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.relays.encased.EncasedShaftBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.relays.encased.GearshiftBlock;
|
2019-12-09 22:58:06 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.relays.gauge.GaugeBlock;
|
2019-12-12 10:56:34 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.relays.gearbox.GearboxBlock;
|
2019-09-24 14:40:01 +02:00
|
|
|
import com.simibubi.create.modules.curiosities.partialWindows.WindowInABlockBlock;
|
2019-09-14 18:21:30 +02:00
|
|
|
import com.simibubi.create.modules.curiosities.symmetry.block.CrossPlaneSymmetryBlock;
|
|
|
|
import com.simibubi.create.modules.curiosities.symmetry.block.PlaneSymmetryBlock;
|
|
|
|
import com.simibubi.create.modules.curiosities.symmetry.block.TriplePlaneSymmetryBlock;
|
2019-08-18 17:02:29 +02:00
|
|
|
import com.simibubi.create.modules.gardens.CocoaLogBlock;
|
2020-01-05 19:41:38 +01:00
|
|
|
import com.simibubi.create.modules.logistics.block.RedstoneLinkBlock;
|
2019-08-27 17:35:34 +02:00
|
|
|
import com.simibubi.create.modules.logistics.block.StockswitchBlock;
|
2020-01-05 19:41:38 +01:00
|
|
|
import com.simibubi.create.modules.logistics.block.belts.BeltObserverBlock;
|
|
|
|
import com.simibubi.create.modules.logistics.block.belts.FunnelBlock;
|
2019-09-13 18:36:18 +02:00
|
|
|
import com.simibubi.create.modules.logistics.block.diodes.FlexpeaterBlock;
|
|
|
|
import com.simibubi.create.modules.logistics.block.diodes.PulseRepeaterBlock;
|
2020-01-05 19:41:38 +01:00
|
|
|
import com.simibubi.create.modules.logistics.block.extractor.ExtractorBlock;
|
|
|
|
import com.simibubi.create.modules.logistics.block.extractor.LinkedExtractorBlock;
|
2019-10-05 19:00:43 +02:00
|
|
|
import com.simibubi.create.modules.logistics.block.inventories.FlexcrateBlock;
|
2020-01-05 19:41:38 +01:00
|
|
|
import com.simibubi.create.modules.logistics.block.transposer.LinkedTransposerBlock;
|
|
|
|
import com.simibubi.create.modules.logistics.block.transposer.TransposerBlock;
|
2019-10-05 19:00:43 +02:00
|
|
|
import com.simibubi.create.modules.logistics.management.base.LogisticalControllerBlock;
|
|
|
|
import com.simibubi.create.modules.logistics.management.base.LogisticalControllerBlock.LogisticalControllerIndicatorBlock;
|
2020-01-05 19:41:38 +01:00
|
|
|
import com.simibubi.create.modules.logistics.management.base.NewLogisticalCasingBlock;
|
2019-10-05 19:00:43 +02:00
|
|
|
import com.simibubi.create.modules.logistics.management.index.LogisticalIndexBlock;
|
2019-10-11 05:56:32 +02:00
|
|
|
import com.simibubi.create.modules.logistics.transport.villager.LogisticiansTableBlock;
|
|
|
|
import com.simibubi.create.modules.logistics.transport.villager.PackageFunnelBlock;
|
2019-11-17 21:25:59 +01:00
|
|
|
import com.simibubi.create.modules.palettes.CTGlassBlock;
|
2019-09-24 14:40:01 +02:00
|
|
|
import com.simibubi.create.modules.palettes.GlassPaneBlock;
|
2019-12-05 23:42:01 +01:00
|
|
|
import com.simibubi.create.modules.palettes.VolcanicRockBlock;
|
2019-07-23 12:54:53 +02:00
|
|
|
import com.simibubi.create.modules.schematics.block.CreativeCrateBlock;
|
|
|
|
import com.simibubi.create.modules.schematics.block.SchematicTableBlock;
|
|
|
|
import com.simibubi.create.modules.schematics.block.SchematicannonBlock;
|
2019-07-11 09:03:08 +02:00
|
|
|
|
|
|
|
import net.minecraft.block.Block;
|
2019-08-06 18:13:33 +02:00
|
|
|
import net.minecraft.block.Block.Properties;
|
2019-07-11 09:03:08 +02:00
|
|
|
import net.minecraft.block.BlockState;
|
2019-08-06 18:13:33 +02:00
|
|
|
import net.minecraft.block.Blocks;
|
2019-09-22 20:23:26 +02:00
|
|
|
import net.minecraft.block.FallingBlock;
|
2019-08-25 10:14:15 +02:00
|
|
|
import net.minecraft.block.FenceBlock;
|
|
|
|
import net.minecraft.block.FenceGateBlock;
|
2019-09-24 14:40:01 +02:00
|
|
|
import net.minecraft.block.GlassBlock;
|
2019-08-17 00:57:36 +02:00
|
|
|
import net.minecraft.block.RotatedPillarBlock;
|
2019-08-25 10:14:15 +02:00
|
|
|
import net.minecraft.block.SlabBlock;
|
|
|
|
import net.minecraft.block.WallBlock;
|
2019-09-13 18:36:18 +02:00
|
|
|
import net.minecraft.client.Minecraft;
|
|
|
|
import net.minecraft.client.renderer.color.BlockColors;
|
2019-07-11 09:03:08 +02:00
|
|
|
import net.minecraft.item.BlockItem;
|
|
|
|
import net.minecraft.item.Item;
|
2019-09-13 18:36:18 +02:00
|
|
|
import net.minecraftforge.api.distmarker.Dist;
|
|
|
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
2019-12-05 23:42:01 +01:00
|
|
|
import net.minecraftforge.event.RegistryEvent;
|
2019-07-11 09:03:08 +02:00
|
|
|
import net.minecraftforge.registries.IForgeRegistry;
|
|
|
|
|
|
|
|
public enum AllBlocks {
|
|
|
|
|
2019-09-12 10:00:15 +02:00
|
|
|
__SCHEMATICS__(),
|
2019-09-07 13:12:12 +02:00
|
|
|
SCHEMATICANNON(new SchematicannonBlock()),
|
|
|
|
SCHEMATICANNON_CONNECTOR(new RenderUtilityBlock()),
|
|
|
|
SCHEMATICANNON_PIPE(new RenderUtilityBlock()),
|
|
|
|
CREATIVE_CRATE(new CreativeCrateBlock()),
|
2019-07-11 19:55:11 +02:00
|
|
|
SCHEMATIC_TABLE(new SchematicTableBlock()),
|
2019-08-06 18:13:33 +02:00
|
|
|
|
2019-09-12 10:00:15 +02:00
|
|
|
__CONTRAPTIONS__(),
|
2019-09-07 13:12:12 +02:00
|
|
|
SHAFT(new ShaftBlock(Properties.from(Blocks.ANDESITE))),
|
|
|
|
COGWHEEL(new CogWheelBlock(false)),
|
|
|
|
LARGE_COGWHEEL(new CogWheelBlock(true)),
|
2019-10-29 19:02:20 +01:00
|
|
|
SHAFTLESS_COGWHEEL(new RenderUtilityAxisBlock()),
|
2019-09-07 13:12:12 +02:00
|
|
|
ENCASED_SHAFT(new EncasedShaftBlock()),
|
|
|
|
ENCASED_BELT(new EncasedBeltBlock()),
|
|
|
|
CLUTCH(new ClutchBlock()),
|
|
|
|
GEARSHIFT(new GearshiftBlock()),
|
|
|
|
GEARBOX(new GearboxBlock()),
|
|
|
|
BELT(new BeltBlock()),
|
|
|
|
BELT_PULLEY(new RenderUtilityAxisBlock()),
|
2019-08-10 01:00:36 +02:00
|
|
|
BELT_ANIMATION(new RenderUtilityBlock()),
|
2019-09-07 13:12:12 +02:00
|
|
|
MOTOR(new MotorBlock()),
|
|
|
|
WATER_WHEEL(new WaterWheelBlock()),
|
|
|
|
ENCASED_FAN(new EncasedFanBlock()),
|
2019-12-12 07:38:44 +01:00
|
|
|
ENCASED_FAN_INNER(new RenderUtilityDirectionalBlock()),
|
2019-09-07 13:12:12 +02:00
|
|
|
TURNTABLE(new TurntableBlock()),
|
|
|
|
SHAFT_HALF(new ShaftHalfBlock()),
|
2019-10-29 19:02:20 +01:00
|
|
|
|
2019-09-07 13:12:12 +02:00
|
|
|
CRUSHING_WHEEL(new CrushingWheelBlock()),
|
2019-08-22 15:52:15 +02:00
|
|
|
CRUSHING_WHEEL_CONTROLLER(new CrushingWheelControllerBlock()),
|
2019-09-13 18:36:18 +02:00
|
|
|
MECHANICAL_PRESS(new MechanicalPressBlock()),
|
|
|
|
MECHANICAL_PRESS_HEAD(new MechanicalPressBlock.Head()),
|
2019-10-29 19:02:20 +01:00
|
|
|
MECHANICAL_MIXER(new MechanicalMixerBlock()),
|
|
|
|
MECHANICAL_MIXER_POLE(new RenderUtilityBlock()),
|
|
|
|
MECHANICAL_MIXER_HEAD(new RenderUtilityBlock()),
|
|
|
|
BASIN(new BasinBlock()),
|
2019-11-29 10:06:03 +01:00
|
|
|
MECHANICAL_CRAFTER(new MechanicalCrafterBlock()),
|
2019-11-30 00:27:03 +01:00
|
|
|
MECHANICAL_CRAFTER_LID(new RenderUtilityDirectionalBlock()),
|
|
|
|
MECHANICAL_CRAFTER_ARROW(new RenderUtilityDirectionalBlock()),
|
|
|
|
MECHANICAL_CRAFTER_BELT_FRAME(new RenderUtilityDirectionalBlock()),
|
|
|
|
MECHANICAL_CRAFTER_BELT(new RenderUtilityDirectionalBlock()),
|
2019-12-09 22:58:06 +01:00
|
|
|
SPEED_GAUGE(new GaugeBlock(GaugeBlock.Type.SPEED)),
|
|
|
|
STRESS_GAUGE(new GaugeBlock(GaugeBlock.Type.STRESS)),
|
|
|
|
GAUGE_DIAL(new RenderUtilityBlock()),
|
|
|
|
GAUGE_INDICATOR(new RenderUtilityBlock()),
|
|
|
|
GAUGE_HEAD(new GaugeBlock.Head()),
|
2019-12-05 23:42:01 +01:00
|
|
|
|
2019-09-07 13:12:12 +02:00
|
|
|
MECHANICAL_PISTON(new MechanicalPistonBlock(false)),
|
|
|
|
STICKY_MECHANICAL_PISTON(new MechanicalPistonBlock(true)),
|
|
|
|
MECHANICAL_PISTON_HEAD(new MechanicalPistonHeadBlock()),
|
|
|
|
PISTON_POLE(new PistonPoleBlock()),
|
|
|
|
MECHANICAL_BEARING(new MechanicalBearingBlock()),
|
|
|
|
MECHANICAL_BEARING_TOP(new ShaftHalfBlock()),
|
2019-12-05 23:42:01 +01:00
|
|
|
TRANSLATION_CHASSIS(new LinearChassisBlock()),
|
|
|
|
TRANSLATION_CHASSIS_SECONDARY(new LinearChassisBlock()),
|
|
|
|
ROTATION_CHASSIS(new RadialChassisBlock()),
|
2019-09-07 13:12:12 +02:00
|
|
|
DRILL(new DrillBlock()),
|
2019-10-19 15:42:42 +02:00
|
|
|
DRILL_HEAD(new DrillHeadBlock()),
|
2019-10-19 23:42:44 +02:00
|
|
|
SAW(new SawBlock()),
|
2019-09-07 13:12:12 +02:00
|
|
|
HARVESTER(new HarvesterBlock()),
|
2019-10-19 15:42:42 +02:00
|
|
|
HARVESTER_BLADE(new HarvesterBladeBlock()),
|
2019-10-27 14:15:39 +01:00
|
|
|
CART_ASSEMBLER(new CartAssemblerBlock()),
|
|
|
|
MINECART_ANCHOR(new MinecartAnchorBlock()),
|
2019-08-25 10:14:15 +02:00
|
|
|
|
2019-09-12 10:00:15 +02:00
|
|
|
__LOGISTICS__(),
|
2019-09-07 13:12:12 +02:00
|
|
|
CONTACT(new ContactBlock()),
|
2020-01-05 19:41:38 +01:00
|
|
|
REDSTONE_BRIDGE(new RedstoneLinkBlock()),
|
2019-09-07 13:12:12 +02:00
|
|
|
STOCKSWITCH(new StockswitchBlock()),
|
|
|
|
FLEXCRATE(new FlexcrateBlock()),
|
|
|
|
EXTRACTOR(new ExtractorBlock()),
|
2020-01-05 19:41:38 +01:00
|
|
|
VERTICAL_EXTRACTOR(new ExtractorBlock.Vertical()),
|
2019-09-07 13:12:12 +02:00
|
|
|
LINKED_EXTRACTOR(new LinkedExtractorBlock()),
|
2020-01-05 19:41:38 +01:00
|
|
|
VERTICAL_LINKED_EXTRACTOR(new LinkedExtractorBlock.Vertical()),
|
|
|
|
TRANSPOSER(new TransposerBlock()),
|
|
|
|
VERTICAL_TRANSPOSER(new TransposerBlock.Vertical()),
|
|
|
|
LINKED_TRANSPOSER(new LinkedTransposerBlock()),
|
|
|
|
VERTICAL_LINKED_TRANSPOSER(new LinkedTransposerBlock.Vertical()),
|
|
|
|
BELT_FUNNEL(new FunnelBlock()),
|
|
|
|
VERTICAL_FUNNEL(new FunnelBlock.Vertical()),
|
2019-11-29 10:06:03 +01:00
|
|
|
BELT_TUNNEL(new BeltTunnelBlock()),
|
|
|
|
BELT_TUNNEL_FLAP(new RenderUtilityBlock()),
|
2020-01-05 19:41:38 +01:00
|
|
|
ENTITY_DETECTOR(new BeltObserverBlock()),
|
2019-09-07 13:12:12 +02:00
|
|
|
PULSE_REPEATER(new PulseRepeaterBlock()),
|
2019-09-13 18:36:18 +02:00
|
|
|
FLEXPEATER(new FlexpeaterBlock()),
|
|
|
|
FLEXPEATER_INDICATOR(new RenderUtilityBlock()),
|
2020-01-05 19:41:38 +01:00
|
|
|
LOGISTICAL_CASING(new NewLogisticalCasingBlock()),
|
2019-10-05 19:00:43 +02:00
|
|
|
LOGISTICAL_CONTROLLER(new LogisticalControllerBlock()),
|
|
|
|
LOGISTICAL_CONTROLLER_INDICATOR(new LogisticalControllerIndicatorBlock()),
|
|
|
|
LOGISTICAL_INDEX(new LogisticalIndexBlock()),
|
2019-10-11 05:56:32 +02:00
|
|
|
PACKAGE_FUNNEL(new PackageFunnelBlock()),
|
|
|
|
LOGISTICIANS_TABLE(new LogisticiansTableBlock()),
|
|
|
|
LOGISTICIANS_TABLE_INDICATOR(new RenderUtilityBlock()),
|
2019-08-25 10:14:15 +02:00
|
|
|
|
2019-09-12 10:00:15 +02:00
|
|
|
__CURIOSITIES__(),
|
2019-09-07 13:12:12 +02:00
|
|
|
SYMMETRY_PLANE(new PlaneSymmetryBlock()),
|
|
|
|
SYMMETRY_CROSSPLANE(new CrossPlaneSymmetryBlock()),
|
2019-08-06 18:13:33 +02:00
|
|
|
SYMMETRY_TRIPLEPLANE(new TriplePlaneSymmetryBlock()),
|
2019-09-24 14:40:01 +02:00
|
|
|
WINDOW_IN_A_BLOCK(new WindowInABlockBlock()),
|
2019-08-25 10:14:15 +02:00
|
|
|
|
2019-09-12 10:00:15 +02:00
|
|
|
__GARDENS__(),
|
2019-08-18 17:02:29 +02:00
|
|
|
COCOA_LOG(new CocoaLogBlock()),
|
2019-08-25 10:14:15 +02:00
|
|
|
|
2019-09-12 10:00:15 +02:00
|
|
|
__PALETTES__(),
|
2019-09-24 14:40:01 +02:00
|
|
|
TILED_GLASS(new GlassBlock(Properties.from(Blocks.GLASS))),
|
|
|
|
TILED_GLASS_PANE(new GlassPaneBlock(Properties.from(Blocks.GLASS))),
|
2019-11-17 21:25:59 +01:00
|
|
|
FRAMED_GLASS(new CTGlassBlock(true)),
|
2019-10-29 19:02:20 +01:00
|
|
|
|
2019-08-17 00:57:36 +02:00
|
|
|
ANDESITE_BRICKS(new Block(Properties.from(Blocks.ANDESITE))),
|
|
|
|
DIORITE_BRICKS(new Block(Properties.from(Blocks.DIORITE))),
|
|
|
|
GRANITE_BRICKS(new Block(Properties.from(Blocks.GRANITE))),
|
2019-09-09 18:18:32 +02:00
|
|
|
GABBRO(new Block(Properties.from(Blocks.GRANITE)), ComesWith.STAIRS, ComesWith.SLAB, ComesWith.WALL),
|
2019-09-07 13:12:12 +02:00
|
|
|
POLISHED_GABBRO(new Block(Properties.from(GABBRO.block))),
|
2019-09-05 22:23:58 +02:00
|
|
|
GABBRO_BRICKS(new Block(Properties.from(GABBRO.block)), ComesWith.STAIRS, ComesWith.WALL),
|
|
|
|
PAVED_GABBRO_BRICKS(new Block(Properties.from(GABBRO.block)), ComesWith.SLAB),
|
|
|
|
INDENTED_GABBRO(new Block(Properties.from(GABBRO.block)), ComesWith.SLAB),
|
2019-08-25 10:14:15 +02:00
|
|
|
SLIGHTLY_MOSSY_GABBRO_BRICKS(new Block(Properties.from(GABBRO.block))),
|
|
|
|
MOSSY_GABBRO_BRICKS(new Block(Properties.from(GABBRO.block))),
|
2019-09-22 20:23:26 +02:00
|
|
|
LIMESAND(new FallingBlock(Properties.from(Blocks.SAND))),
|
2019-09-09 18:18:32 +02:00
|
|
|
LIMESTONE(new Block(Properties.from(Blocks.SANDSTONE)), ComesWith.STAIRS, ComesWith.SLAB, ComesWith.WALL),
|
2019-09-05 22:23:58 +02:00
|
|
|
LIMESTONE_BRICKS(new Block(Properties.from(LIMESTONE.block)), ComesWith.STAIRS, ComesWith.SLAB, ComesWith.WALL),
|
|
|
|
POLISHED_LIMESTONE(new Block(Properties.from(LIMESTONE.block)), ComesWith.SLAB),
|
2019-08-17 00:57:36 +02:00
|
|
|
LIMESTONE_PILLAR(new RotatedPillarBlock(Properties.from(LIMESTONE.block))),
|
2019-09-09 18:18:32 +02:00
|
|
|
WEATHERED_LIMESTONE(new Block(Properties.from(Blocks.ANDESITE)), ComesWith.STAIRS, ComesWith.SLAB, ComesWith.WALL),
|
2019-12-22 01:31:40 +01:00
|
|
|
WEATHERED_LIMESTONE_BRICKS(
|
|
|
|
new Block(Properties.from(WEATHERED_LIMESTONE.block)),
|
|
|
|
ComesWith.STAIRS,
|
|
|
|
ComesWith.SLAB,
|
2019-09-05 22:23:58 +02:00
|
|
|
ComesWith.WALL),
|
2019-09-10 12:09:48 +02:00
|
|
|
POLISHED_WEATHERED_LIMESTONE(new Block(Properties.from(WEATHERED_LIMESTONE.block)), ComesWith.SLAB),
|
2019-09-05 22:23:58 +02:00
|
|
|
WEATHERED_LIMESTONE_PILLAR(new RotatedPillarBlock(Properties.from(WEATHERED_LIMESTONE.block))),
|
|
|
|
DOLOMITE(new Block(Properties.from(Blocks.QUARTZ_BLOCK)), ComesWith.STAIRS, ComesWith.SLAB, ComesWith.WALL),
|
2019-08-17 00:57:36 +02:00
|
|
|
DOLOMITE_BRICKS(new Block(Properties.from(DOLOMITE.block))),
|
|
|
|
POLISHED_DOLOMITE(new Block(Properties.from(DOLOMITE.block))),
|
|
|
|
DOLOMITE_PILLAR(new RotatedPillarBlock(Properties.from(DOLOMITE.block))),
|
2019-08-25 10:14:15 +02:00
|
|
|
|
2019-12-05 23:42:01 +01:00
|
|
|
VOLCANIC_ROCK(new VolcanicRockBlock()),
|
|
|
|
|
2019-08-06 18:13:33 +02:00
|
|
|
;
|
2019-07-11 09:03:08 +02:00
|
|
|
|
2019-08-25 10:14:15 +02:00
|
|
|
private enum ComesWith {
|
|
|
|
WALL, FENCE, FENCE_GATE, SLAB, STAIRS;
|
|
|
|
}
|
|
|
|
|
2019-09-12 10:00:15 +02:00
|
|
|
private static class CategoryTracker {
|
|
|
|
static IModule currentModule;
|
|
|
|
}
|
|
|
|
|
2019-07-11 09:03:08 +02:00
|
|
|
public Block block;
|
2019-08-25 10:14:15 +02:00
|
|
|
public Block[] alsoRegistered;
|
2019-09-12 10:00:15 +02:00
|
|
|
public IModule module;
|
|
|
|
|
|
|
|
private AllBlocks() {
|
|
|
|
CategoryTracker.currentModule = new IModule() {
|
|
|
|
@Override
|
|
|
|
public String getModuleName() {
|
2019-10-15 22:22:19 +02:00
|
|
|
return Lang.asId(name()).replaceAll("__", "");
|
2019-09-12 10:00:15 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2019-07-11 09:03:08 +02:00
|
|
|
|
2019-08-25 10:14:15 +02:00
|
|
|
private AllBlocks(Block block, ComesWith... comesWith) {
|
2019-07-11 09:03:08 +02:00
|
|
|
this.block = block;
|
2019-10-15 22:22:19 +02:00
|
|
|
this.block.setRegistryName(Create.ID, Lang.asId(name()));
|
2019-09-12 10:00:15 +02:00
|
|
|
this.module = CategoryTracker.currentModule;
|
2019-08-25 10:14:15 +02:00
|
|
|
|
|
|
|
alsoRegistered = new Block[comesWith.length];
|
|
|
|
for (int i = 0; i < comesWith.length; i++)
|
|
|
|
alsoRegistered[i] = makeRelatedBlock(block, comesWith[i]);
|
2019-07-11 09:03:08 +02:00
|
|
|
}
|
|
|
|
|
2019-12-05 23:42:01 +01:00
|
|
|
public static void register(RegistryEvent.Register<Block> event) {
|
|
|
|
IForgeRegistry<Block> registry = event.getRegistry();
|
|
|
|
|
2019-07-11 09:03:08 +02:00
|
|
|
for (AllBlocks block : values()) {
|
2019-09-12 10:00:15 +02:00
|
|
|
if (block.get() == null)
|
|
|
|
continue;
|
|
|
|
|
2019-07-11 09:03:08 +02:00
|
|
|
registry.register(block.block);
|
2019-08-25 10:14:15 +02:00
|
|
|
for (Block extra : block.alsoRegistered)
|
|
|
|
registry.register(extra);
|
2019-07-11 09:03:08 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void registerItemBlocks(IForgeRegistry<Item> registry) {
|
|
|
|
for (AllBlocks block : values()) {
|
2020-01-05 19:41:38 +01:00
|
|
|
Block def = block.get();
|
|
|
|
if (def == null)
|
2019-09-12 10:00:15 +02:00
|
|
|
continue;
|
2020-01-05 19:41:38 +01:00
|
|
|
if (def instanceof IHaveNoBlockItem && !((IHaveNoBlockItem) def).hasBlockItem())
|
2019-07-11 09:03:08 +02:00
|
|
|
continue;
|
|
|
|
|
2020-01-05 19:41:38 +01:00
|
|
|
registerAsItem(registry, def);
|
2019-08-25 10:14:15 +02:00
|
|
|
for (Block extra : block.alsoRegistered)
|
|
|
|
registerAsItem(registry, extra);
|
2019-07-11 09:03:08 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-08-25 10:14:15 +02:00
|
|
|
private static void registerAsItem(IForgeRegistry<Item> registry, Block blockIn) {
|
2019-10-29 19:02:20 +01:00
|
|
|
BlockItem blockItem = null;
|
|
|
|
net.minecraft.item.Item.Properties standardItemProperties = AllItems.standardItemProperties();
|
|
|
|
|
2019-12-22 01:31:40 +01:00
|
|
|
if (blockIn instanceof IHaveCustomBlockItem)
|
|
|
|
blockItem = ((IHaveCustomBlockItem) blockIn).getCustomItem(standardItemProperties);
|
2019-10-29 19:02:20 +01:00
|
|
|
else
|
|
|
|
blockItem = new BlockItem(blockIn, standardItemProperties);
|
2019-11-17 21:25:59 +01:00
|
|
|
|
2019-10-29 19:02:20 +01:00
|
|
|
registry.register(blockItem.setRegistryName(blockIn.getRegistryName()));
|
2019-08-25 10:14:15 +02:00
|
|
|
}
|
|
|
|
|
2019-07-11 09:03:08 +02:00
|
|
|
public Block get() {
|
|
|
|
return block;
|
|
|
|
}
|
|
|
|
|
2020-01-05 19:41:38 +01:00
|
|
|
public BlockState getDefault() {
|
|
|
|
return block.getDefaultState();
|
|
|
|
}
|
|
|
|
|
2019-07-11 09:03:08 +02:00
|
|
|
public boolean typeOf(BlockState state) {
|
|
|
|
return state.getBlock() == block;
|
|
|
|
}
|
|
|
|
|
2019-08-25 10:14:15 +02:00
|
|
|
private Block makeRelatedBlock(Block block, ComesWith feature) {
|
|
|
|
Properties properties = Properties.from(block);
|
|
|
|
Block featured = null;
|
|
|
|
|
|
|
|
switch (feature) {
|
|
|
|
case FENCE:
|
|
|
|
featured = new FenceBlock(properties);
|
|
|
|
break;
|
|
|
|
case SLAB:
|
|
|
|
featured = new SlabBlock(properties);
|
|
|
|
break;
|
|
|
|
case STAIRS:
|
|
|
|
featured = new ProperStairsBlock(block);
|
|
|
|
break;
|
|
|
|
case WALL:
|
|
|
|
featured = new WallBlock(properties);
|
|
|
|
break;
|
|
|
|
case FENCE_GATE:
|
|
|
|
featured = new FenceGateBlock(properties);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2019-10-29 19:02:20 +01:00
|
|
|
return featured.setRegistryName(Create.ID, block.getRegistryName().getPath() + "_" + Lang.asId(feature.name()));
|
2019-08-25 10:14:15 +02:00
|
|
|
}
|
|
|
|
|
2019-09-13 18:36:18 +02:00
|
|
|
@OnlyIn(Dist.CLIENT)
|
|
|
|
public static void registerColorHandlers() {
|
|
|
|
BlockColors blockColors = Minecraft.getInstance().getBlockColors();
|
|
|
|
for (AllBlocks block : values()) {
|
2019-12-22 01:31:40 +01:00
|
|
|
if (block.block instanceof IHaveColorHandler) {
|
|
|
|
blockColors.register(((IHaveColorHandler) block.block).getColorHandler(), block.block);
|
2019-09-13 18:36:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-11 09:03:08 +02:00
|
|
|
}
|