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-10-15 22:22:19 +02:00
|
|
|
import com.simibubi.create.foundation.utility.Lang;
|
2020-03-28 02:27:43 +01:00
|
|
|
import com.simibubi.create.foundation.utility.data.ITaggable;
|
2020-01-20 13:41:41 +01:00
|
|
|
import com.simibubi.create.foundation.world.OxidizingBlock;
|
2019-09-12 10:00:15 +02:00
|
|
|
import com.simibubi.create.modules.IModule;
|
2020-01-21 01:52:23 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.CasingBlock;
|
2019-12-12 10:56:34 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.components.actors.DrillBlock;
|
2019-12-12 11:58:29 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.components.actors.HarvesterBlock;
|
2020-02-12 01:36:18 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.components.actors.PortableStorageInterfaceBlock;
|
2020-02-05 23:34:23 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.components.clock.CuckooClockBlock;
|
2020-02-15 18:54:23 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.components.contraptions.bearing.ClockworkBearingBlock;
|
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;
|
2020-02-15 18:54:23 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.components.contraptions.pulley.PulleyBlock;
|
2019-12-12 10:56:34 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.components.crafter.MechanicalCrafterBlock;
|
2020-01-28 20:35:46 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.components.crank.HandCrankBlock;
|
2019-12-12 10:56:34 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.components.crusher.CrushingWheelBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.components.crusher.CrushingWheelControllerBlock;
|
2020-01-23 22:23:00 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.components.deployer.DeployerBlock;
|
2019-12-12 10:56:34 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.components.fan.EncasedFanBlock;
|
2020-01-28 20:35:46 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.components.fan.NozzleBlock;
|
2020-02-05 12:36:22 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.components.flywheel.FlywheelBlock;
|
|
|
|
import com.simibubi.create.modules.contraptions.components.flywheel.engine.FurnaceEngineBlock;
|
2020-03-26 23:03:56 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.components.millstone.MillstoneBlock;
|
2019-12-12 10:56:34 +01:00
|
|
|
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;
|
2020-02-03 00:31:55 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.redstone.AnalogLeverBlock;
|
2019-08-17 00:57:36 +02:00
|
|
|
import com.simibubi.create.modules.contraptions.redstone.ContactBlock;
|
2020-02-28 22:17:40 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.relays.advanced.SpeedControllerBlock;
|
2020-03-11 21:40:55 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.relays.advanced.sequencer.SequencedGearshiftBlock;
|
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;
|
2020-02-03 00:31:55 +01:00
|
|
|
import com.simibubi.create.modules.contraptions.relays.encased.AdjustablePulleyBlock;
|
2019-12-12 10:56:34 +01:00
|
|
|
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;
|
2020-02-27 18:09:41 +01:00
|
|
|
import com.simibubi.create.modules.logistics.block.diodes.LatchBlock;
|
2019-09-13 18:36:18 +02:00
|
|
|
import com.simibubi.create.modules.logistics.block.diodes.PulseRepeaterBlock;
|
2020-02-27 18:09:41 +01:00
|
|
|
import com.simibubi.create.modules.logistics.block.diodes.ToggleLatchBlock;
|
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-11-17 21:25:59 +01:00
|
|
|
import com.simibubi.create.modules.palettes.CTGlassBlock;
|
2020-01-30 22:16:04 +01:00
|
|
|
import com.simibubi.create.modules.palettes.CTGlassPaneBlock;
|
2020-02-04 14:48:21 +01:00
|
|
|
import com.simibubi.create.modules.palettes.CTWindowBlock;
|
2019-09-24 14:40:01 +02:00
|
|
|
import com.simibubi.create.modules.palettes.GlassPaneBlock;
|
2020-01-30 22:16:04 +01:00
|
|
|
import com.simibubi.create.modules.palettes.HorizontalCTGlassBlock;
|
2020-01-13 21:59:26 +01:00
|
|
|
import com.simibubi.create.modules.palettes.LayeredCTBlock;
|
2020-02-07 19:25:38 +01:00
|
|
|
import com.simibubi.create.modules.palettes.ScoriaBlock;
|
2020-02-12 01:36:18 +01:00
|
|
|
import com.simibubi.create.modules.palettes.VerticalCTGlassBlock;
|
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;
|
2020-03-28 02:27:43 +01:00
|
|
|
import net.minecraft.util.ResourceLocation;
|
2019-09-13 18:36:18 +02:00
|
|
|
import net.minecraftforge.api.distmarker.Dist;
|
|
|
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
2020-01-20 13:41:41 +01:00
|
|
|
import net.minecraftforge.common.ToolType;
|
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;
|
|
|
|
|
2020-03-28 02:27:43 +01:00
|
|
|
import java.util.HashSet;
|
|
|
|
import java.util.Set;
|
|
|
|
|
2019-07-11 09:03:08 +02:00
|
|
|
public enum AllBlocks {
|
|
|
|
|
2019-09-12 10:00:15 +02:00
|
|
|
__SCHEMATICS__(),
|
2019-09-07 13:12:12 +02:00
|
|
|
SCHEMATICANNON(new SchematicannonBlock()),
|
|
|
|
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)),
|
|
|
|
ENCASED_SHAFT(new EncasedShaftBlock()),
|
2020-02-03 00:31:55 +01:00
|
|
|
GEARBOX(new GearboxBlock()),
|
2019-09-07 13:12:12 +02:00
|
|
|
CLUTCH(new ClutchBlock()),
|
|
|
|
GEARSHIFT(new GearshiftBlock()),
|
2020-02-03 00:31:55 +01:00
|
|
|
ENCASED_BELT(new EncasedBeltBlock()),
|
|
|
|
ADJUSTABLE_PULLEY(new AdjustablePulleyBlock()),
|
2019-09-07 13:12:12 +02:00
|
|
|
BELT(new BeltBlock()),
|
2020-02-08 20:02:14 +01:00
|
|
|
CREATIVE_MOTOR(new MotorBlock()),
|
2019-09-07 13:12:12 +02:00
|
|
|
WATER_WHEEL(new WaterWheelBlock()),
|
|
|
|
ENCASED_FAN(new EncasedFanBlock()),
|
2020-01-28 20:35:46 +01:00
|
|
|
NOZZLE(new NozzleBlock()),
|
2019-09-07 13:12:12 +02:00
|
|
|
TURNTABLE(new TurntableBlock()),
|
2020-01-28 20:35:46 +01:00
|
|
|
HAND_CRANK(new HandCrankBlock()),
|
2020-02-05 23:34:23 +01:00
|
|
|
CUCKOO_CLOCK(new CuckooClockBlock(false)),
|
|
|
|
MYSTERIOUS_CUCKOO_CLOCK(new CuckooClockBlock(true)),
|
2020-02-08 03:47:27 +01:00
|
|
|
|
2020-03-26 23:03:56 +01:00
|
|
|
MILLSTONE(new MillstoneBlock()),
|
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()),
|
2019-10-29 19:02:20 +01:00
|
|
|
MECHANICAL_MIXER(new MechanicalMixerBlock()),
|
|
|
|
BASIN(new BasinBlock()),
|
2019-12-09 22:58:06 +01:00
|
|
|
SPEED_GAUGE(new GaugeBlock(GaugeBlock.Type.SPEED)),
|
|
|
|
STRESS_GAUGE(new GaugeBlock(GaugeBlock.Type.STRESS)),
|
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()),
|
2020-02-15 18:54:23 +01:00
|
|
|
CLOCKWORK_BEARING(new ClockworkBearingBlock()),
|
|
|
|
ROPE_PULLEY(new PulleyBlock()),
|
|
|
|
ROPE(new PulleyBlock.RopeBlock()),
|
|
|
|
PULLEY_MAGNET(new PulleyBlock.MagnetBlock()),
|
2020-03-28 23:20:25 +01:00
|
|
|
CART_ASSEMBLER(new TaggedBlock(new CartAssemblerBlock()).withVanillaTags(ITaggable.TagType.BLOCK, "rails")),
|
2020-02-15 18:54:23 +01:00
|
|
|
MINECART_ANCHOR(new MinecartAnchorBlock()),
|
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 23:42:44 +02:00
|
|
|
SAW(new SawBlock()),
|
2019-09-07 13:12:12 +02:00
|
|
|
HARVESTER(new HarvesterBlock()),
|
2020-02-03 00:31:55 +01:00
|
|
|
DEPLOYER(new DeployerBlock()),
|
2020-02-12 01:36:18 +01:00
|
|
|
PORTABLE_STORAGE_INTERFACE(new PortableStorageInterfaceBlock()),
|
2020-02-03 00:31:55 +01:00
|
|
|
ANALOG_LEVER(new AnalogLeverBlock()),
|
2019-08-25 10:14:15 +02:00
|
|
|
|
2020-01-21 01:52:23 +01:00
|
|
|
ANDESITE_CASING(new CasingBlock("andesite_casing")),
|
|
|
|
COPPER_CASING(new CasingBlock("copper_casing")),
|
|
|
|
BRASS_CASING(new CasingBlock("crafter_top")),
|
|
|
|
|
2020-02-12 01:36:18 +01:00
|
|
|
MECHANICAL_CRAFTER(new MechanicalCrafterBlock()),
|
2020-03-11 21:40:55 +01:00
|
|
|
SEQUENCED_GEARSHIFT(new SequencedGearshiftBlock()),
|
2020-02-12 01:36:18 +01:00
|
|
|
FLYWHEEL(new FlywheelBlock()),
|
|
|
|
FURNACE_ENGINE(new FurnaceEngineBlock()),
|
2020-02-28 22:17:40 +01:00
|
|
|
ROTATION_SPEED_CONTROLLER(new SpeedControllerBlock()),
|
2020-03-23 17:04:09 +01: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()),
|
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()),
|
2020-01-28 14:41:05 +01:00
|
|
|
FLEXPULSEPEATER(new FlexpeaterBlock()),
|
2020-02-27 18:09:41 +01:00
|
|
|
REDSTONE_LATCH(new LatchBlock()),
|
|
|
|
TOGGLE_LATCH(new ToggleLatchBlock()),
|
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()),
|
2020-03-28 23:20:25 +01:00
|
|
|
COCOA_LOG(new TaggedBlock(new CocoaLogBlock()).withVanillaTags(ITaggable.TagType.BLOCK, "jungle_logs")),
|
2019-08-25 10:14:15 +02:00
|
|
|
|
2019-09-12 10:00:15 +02:00
|
|
|
__PALETTES__(),
|
2020-03-28 23:20:25 +01:00
|
|
|
TILED_GLASS(new TaggedBlock(new GlassBlock(Properties.from(Blocks.GLASS))).withVanillaTags(ITaggable.TagType.BLOCK, "impermeable").withForgeTags("glass")),
|
2020-01-30 22:16:04 +01:00
|
|
|
FRAMED_GLASS(new CTGlassBlock(AllCTs.FRAMED_GLASS, false)),
|
|
|
|
HORIZONTAL_FRAMED_GLASS(new HorizontalCTGlassBlock(AllCTs.HORIZONTAL_FRAMED_GLASS, AllCTs.FRAMED_GLASS, false)),
|
|
|
|
VERTICAL_FRAMED_GLASS(new VerticalCTGlassBlock(AllCTs.VERTICAL_FRAMED_GLASS, false)),
|
2020-02-03 00:31:55 +01:00
|
|
|
|
2020-02-04 14:48:21 +01:00
|
|
|
OAK_GLASS(new CTWindowBlock(AllCTs.OAK_GLASS, false)),
|
|
|
|
SPRUCE_GLASS(new CTWindowBlock(AllCTs.SPRUCE_GLASS, false)),
|
|
|
|
BIRCH_GLASS(new CTWindowBlock(AllCTs.BIRCH_GLASS, true)),
|
|
|
|
JUNGLE_GLASS(new CTWindowBlock(AllCTs.JUNGLE_GLASS, false)),
|
|
|
|
DARK_OAK_GLASS(new CTWindowBlock(AllCTs.DARK_OAK_GLASS, false)),
|
|
|
|
ACACIA_GLASS(new CTWindowBlock(AllCTs.ACACIA_GLASS, false)),
|
|
|
|
IRON_GLASS(new CTWindowBlock(AllCTs.IRON_GLASS, false)),
|
2020-02-03 00:31:55 +01:00
|
|
|
|
2020-03-28 23:20:25 +01:00
|
|
|
TILED_GLASS_PANE(new TaggedBlock(new GlassPaneBlock(Properties.from(Blocks.GLASS))).withForgeTags("glass_panes")),
|
2020-03-28 02:27:43 +01:00
|
|
|
FRAMED_GLASS_PANE(new CTGlassPaneBlock(FRAMED_GLASS.get())),
|
|
|
|
HORIZONTAL_FRAMED_GLASS_PANE(new CTGlassPaneBlock(HORIZONTAL_FRAMED_GLASS.get())),
|
|
|
|
VERTICAL_FRAMED_GLASS_PANE(new CTGlassPaneBlock(VERTICAL_FRAMED_GLASS.get())),
|
|
|
|
OAK_GLASS_PANE(new CTGlassPaneBlock(OAK_GLASS.get())),
|
|
|
|
SPRUCE_GLASS_PANE(new CTGlassPaneBlock(SPRUCE_GLASS.get())),
|
|
|
|
BIRCH_GLASS_PANE(new CTGlassPaneBlock(BIRCH_GLASS.get())),
|
|
|
|
JUNGLE_GLASS_PANE(new CTGlassPaneBlock(JUNGLE_GLASS.get())),
|
|
|
|
DARK_OAK_GLASS_PANE(new CTGlassPaneBlock(DARK_OAK_GLASS.get())),
|
|
|
|
ACACIA_GLASS_PANE(new CTGlassPaneBlock(ACACIA_GLASS.get())),
|
|
|
|
IRON_GLASS_PANE(new CTGlassPaneBlock(IRON_GLASS.get())),
|
2019-10-29 19:02:20 +01:00
|
|
|
|
2019-08-17 00:57:36 +02:00
|
|
|
GRANITE_BRICKS(new Block(Properties.from(Blocks.GRANITE))),
|
2020-01-30 22:16:04 +01:00
|
|
|
GRANITE_LAYERS(new LayeredCTBlock(Properties.from(Blocks.GRANITE), AllCTs.GRANITE_LAYERS, AllCTs.POLISHED_GRANITE)),
|
2020-01-21 01:52:23 +01:00
|
|
|
DIORITE_BRICKS(new Block(Properties.from(Blocks.DIORITE))),
|
2020-01-30 22:16:04 +01:00
|
|
|
DIORITE_LAYERS(new LayeredCTBlock(Properties.from(Blocks.DIORITE), AllCTs.DIORITE_LAYERS, AllCTs.POLISHED_DIORITE)),
|
2020-01-21 01:52:23 +01:00
|
|
|
ANDESITE_BRICKS(new Block(Properties.from(Blocks.ANDESITE))),
|
2020-01-30 22:16:04 +01:00
|
|
|
ANDESITE_LAYERS(
|
|
|
|
new LayeredCTBlock(Properties.from(Blocks.ANDESITE), AllCTs.ANDESITE_LAYERS, AllCTs.POLISHED_ANDESITE)),
|
2020-01-21 01:52:23 +01:00
|
|
|
|
2020-03-28 23:20:25 +01:00
|
|
|
GABBRO(new TaggedBlock(new Block(Properties.from(Blocks.GRANITE))).withForgeTags("stone"), ComesWith.STAIRS, ComesWith.SLAB, ComesWith.WALL),
|
|
|
|
POLISHED_GABBRO(new TaggedBlock(new Block(Properties.from(GABBRO.get()))).withForgeTags("stone")),
|
2020-03-28 02:27:43 +01:00
|
|
|
GABBRO_BRICKS(new Block(Properties.from(GABBRO.get())), ComesWith.STAIRS, ComesWith.WALL),
|
|
|
|
PAVED_GABBRO_BRICKS(new Block(Properties.from(GABBRO.get())), ComesWith.SLAB),
|
|
|
|
INDENTED_GABBRO(new Block(Properties.from(GABBRO.get())), ComesWith.SLAB),
|
|
|
|
SLIGHTLY_MOSSY_GABBRO_BRICKS(new Block(Properties.from(GABBRO.get()))),
|
|
|
|
MOSSY_GABBRO_BRICKS(new Block(Properties.from(GABBRO.get()))),
|
|
|
|
GABBRO_LAYERS(new LayeredCTBlock(Properties.from(GABBRO.get()), AllCTs.GABBRO_LAYERS, AllCTs.POLISHED_GABBRO)),
|
|
|
|
|
2020-03-28 23:20:25 +01:00
|
|
|
DOLOMITE(new TaggedBlock(new Block(Properties.from(Blocks.QUARTZ_BLOCK))).withForgeTags("stone"), ComesWith.STAIRS, ComesWith.SLAB, ComesWith.WALL),
|
2020-03-28 02:27:43 +01:00
|
|
|
DOLOMITE_BRICKS(new Block(Properties.from(DOLOMITE.get()))),
|
2020-03-28 23:20:25 +01:00
|
|
|
POLISHED_DOLOMITE(new TaggedBlock(new Block(Properties.from(DOLOMITE.get()))).withForgeTags("stone")),
|
2020-03-28 02:27:43 +01:00
|
|
|
DOLOMITE_PILLAR(new RotatedPillarBlock(Properties.from(DOLOMITE.get()))),
|
2020-02-08 03:47:27 +01:00
|
|
|
DOLOMITE_LAYERS(
|
2020-03-28 02:27:43 +01:00
|
|
|
new LayeredCTBlock(Properties.from(DOLOMITE.get()), AllCTs.DOLOMITE_LAYERS, AllCTs.POLISHED_DOLOMITE)),
|
2020-02-08 03:47:27 +01:00
|
|
|
|
2019-09-22 20:23:26 +02:00
|
|
|
LIMESAND(new FallingBlock(Properties.from(Blocks.SAND))),
|
2020-03-28 23:20:25 +01:00
|
|
|
LIMESTONE(new TaggedBlock(new Block(Properties.from(Blocks.SANDSTONE))).withForgeTags("stone"), ComesWith.STAIRS, ComesWith.SLAB, ComesWith.WALL),
|
2020-03-28 02:27:43 +01:00
|
|
|
LIMESTONE_BRICKS(new Block(Properties.from(LIMESTONE.get())), ComesWith.STAIRS, ComesWith.SLAB, ComesWith.WALL),
|
2020-03-28 23:20:25 +01:00
|
|
|
POLISHED_LIMESTONE(new TaggedBlock(new Block(Properties.from(LIMESTONE.get()))).withForgeTags("stone"), ComesWith.SLAB),
|
2020-03-28 02:27:43 +01:00
|
|
|
LIMESTONE_PILLAR(new RotatedPillarBlock(Properties.from(LIMESTONE.get()))),
|
2020-01-30 22:16:04 +01:00
|
|
|
LIMESTONE_LAYERS(
|
2020-03-28 02:27:43 +01:00
|
|
|
new LayeredCTBlock(Properties.from(LIMESTONE.get()), AllCTs.LIMESTONE_LAYERS, AllCTs.POLISHED_LIMESTONE)),
|
2020-03-28 23:20:25 +01:00
|
|
|
WEATHERED_LIMESTONE(new TaggedBlock(new Block(Properties.from(Blocks.ANDESITE))).withForgeTags("stone"), ComesWith.STAIRS, ComesWith.SLAB, ComesWith.WALL),
|
2020-03-28 02:27:43 +01:00
|
|
|
WEATHERED_LIMESTONE_BRICKS(new Block(Properties.from(WEATHERED_LIMESTONE.get())), ComesWith.STAIRS, ComesWith.SLAB,
|
2019-09-05 22:23:58 +02:00
|
|
|
ComesWith.WALL),
|
2020-03-28 23:20:25 +01:00
|
|
|
POLISHED_WEATHERED_LIMESTONE(new TaggedBlock(new Block(Properties.from(WEATHERED_LIMESTONE.get()))).withForgeTags("stone"), ComesWith.SLAB),
|
2020-03-28 02:27:43 +01:00
|
|
|
WEATHERED_LIMESTONE_PILLAR(new RotatedPillarBlock(Properties.from(WEATHERED_LIMESTONE.get()))),
|
|
|
|
WEATHERED_LIMESTONE_LAYERS(new LayeredCTBlock(Properties.from(WEATHERED_LIMESTONE.get()),
|
2020-01-30 22:16:04 +01:00
|
|
|
AllCTs.WEATHERED_LIMESTONE_LAYERS, AllCTs.POLISHED_WEATHERED_LIMESTONE)),
|
2019-08-25 10:14:15 +02:00
|
|
|
|
2020-02-08 03:47:27 +01:00
|
|
|
NATURAL_SCORIA(new ScoriaBlock()),
|
2020-03-28 23:20:25 +01:00
|
|
|
SCORIA(new TaggedBlock(new Block(Properties.from(Blocks.ANDESITE))).withForgeTags("stone"), ComesWith.STAIRS, ComesWith.SLAB, ComesWith.WALL),
|
|
|
|
POLISHED_SCORIA(new TaggedBlock(new Block(Properties.from(SCORIA.get()))).withForgeTags("stone"), ComesWith.SLAB),
|
2020-03-28 02:27:43 +01:00
|
|
|
SCORIA_BRICKS(new Block(Properties.from(SCORIA.get()))),
|
|
|
|
SCORIA_LAYERS(new LayeredCTBlock(Properties.from(SCORIA.get()), AllCTs.SCORIA_LAYERS, AllCTs.POLISHED_SCORIA)),
|
|
|
|
SCORIA_PILLAR(new RotatedPillarBlock(Properties.from(SCORIA.get()))),
|
2020-02-08 03:47:27 +01:00
|
|
|
|
|
|
|
DARK_SCORIA(new Block(Properties.from(Blocks.ANDESITE))),
|
2020-03-28 02:27:43 +01:00
|
|
|
POLISHED_DARK_SCORIA(new Block(Properties.from(DARK_SCORIA.get()))),
|
|
|
|
DARK_SCORIA_TILES(new Block(Properties.from(DARK_SCORIA.get())), ComesWith.STAIRS, ComesWith.SLAB),
|
|
|
|
DARK_SCORIA_BRICKS(new Block(Properties.from(DARK_SCORIA.get())), ComesWith.STAIRS, ComesWith.SLAB, ComesWith.WALL),
|
2019-12-05 23:42:01 +01:00
|
|
|
|
2020-01-14 20:48:43 +01:00
|
|
|
__MATERIALS__(),
|
2020-03-28 23:20:25 +01:00
|
|
|
COPPER_ORE(new TaggedBlock(new OxidizingBlock(Properties.from(Blocks.IRON_ORE), 1)).withForgeTags("ores/copper")),
|
|
|
|
ZINC_ORE(new TaggedBlock(new Block(Properties.from(Blocks.GOLD_ORE).harvestLevel(2).harvestTool(ToolType.PICKAXE))).withForgeTags("ores/zinc")),
|
|
|
|
COPPER_BLOCK(new TaggedBlock(new OxidizingBlock(Properties.from(Blocks.IRON_BLOCK), 1 / 32f)).withForgeTags("storage_blocks/copper")),
|
2020-03-23 17:04:09 +01:00
|
|
|
COPPER_SHINGLES(new OxidizingBlock(Properties.from(Blocks.IRON_BLOCK), 1 / 32f)),
|
2020-03-28 23:20:25 +01:00
|
|
|
ZINC_BLOCK(new TaggedBlock(new Block(Properties.from(Blocks.IRON_BLOCK))).withForgeTags("storage_blocks/zinc")),
|
|
|
|
BRASS_BLOCK(new TaggedBlock(new Block(Properties.from(Blocks.IRON_BLOCK))).withForgeTags("storage_blocks/brass")),
|
2020-01-15 21:56:53 +01:00
|
|
|
|
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 {
|
2020-03-28 23:20:25 +01:00
|
|
|
WALL, FENCE, FENCE_GATE, SLAB, STAIRS
|
2019-08-25 10:14:15 +02:00
|
|
|
}
|
|
|
|
|
2019-09-12 10:00:15 +02:00
|
|
|
private static class CategoryTracker {
|
|
|
|
static IModule currentModule;
|
|
|
|
}
|
|
|
|
|
2020-03-28 23:20:25 +01:00
|
|
|
private TaggedBlock taggedBlock;
|
|
|
|
public TaggedBlock[] alsoRegistered;
|
2019-09-12 10:00:15 +02:00
|
|
|
public IModule module;
|
|
|
|
|
2020-03-28 02:27:43 +01:00
|
|
|
AllBlocks() {
|
|
|
|
CategoryTracker.currentModule = () -> Lang.asId(name()).replaceAll("__", "");
|
2020-03-28 23:20:25 +01:00
|
|
|
taggedBlock = new TaggedBlock(null);
|
2020-03-28 02:27:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
AllBlocks(Block block, ComesWith... comesWith) {
|
2020-03-28 23:20:25 +01:00
|
|
|
this(new TaggedBlock(block), comesWith);
|
2019-09-12 10:00:15 +02:00
|
|
|
}
|
2019-07-11 09:03:08 +02:00
|
|
|
|
2020-03-28 23:20:25 +01:00
|
|
|
AllBlocks(TaggedBlock taggedBlockIn, ComesWith... comesWith){
|
2020-03-28 02:27:43 +01:00
|
|
|
this.taggedBlock = taggedBlockIn;
|
|
|
|
this.taggedBlock.getBlock().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
|
|
|
|
2020-03-28 02:27:43 +01:00
|
|
|
alsoRegistered = new TaggedBlock[comesWith.length];
|
2019-08-25 10:14:15 +02:00
|
|
|
for (int i = 0; i < comesWith.length; i++)
|
2020-03-28 02:27:43 +01:00
|
|
|
alsoRegistered[i] = makeRelatedBlock(taggedBlock.getBlock(), 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;
|
|
|
|
|
2020-03-28 02:27:43 +01:00
|
|
|
registry.register(block.get());
|
2020-03-28 23:20:25 +01:00
|
|
|
for (TaggedBlock extra : block.alsoRegistered)
|
2020-03-28 02:27:43 +01:00
|
|
|
registry.register(extra.block);
|
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);
|
2020-03-28 23:20:25 +01:00
|
|
|
for (TaggedBlock extra : block.alsoRegistered)
|
2020-03-28 02:27:43 +01:00
|
|
|
registerAsItem(registry, extra.block);
|
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) {
|
2020-03-28 23:20:25 +01:00
|
|
|
BlockItem blockItem;
|
2020-02-03 16:47:58 +01:00
|
|
|
Item.Properties standardItemProperties = AllItems.includeInItemGroup();
|
2019-10-29 19:02:20 +01:00
|
|
|
|
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() {
|
2020-03-28 02:27:43 +01:00
|
|
|
return taggedBlock.getBlock();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ITaggable<?> getTaggable() {
|
|
|
|
return taggedBlock;
|
2019-07-11 09:03:08 +02:00
|
|
|
}
|
|
|
|
|
2020-01-05 19:41:38 +01:00
|
|
|
public BlockState getDefault() {
|
2020-03-28 02:27:43 +01:00
|
|
|
return get().getDefaultState();
|
2020-01-05 19:41:38 +01:00
|
|
|
}
|
|
|
|
|
2019-07-11 09:03:08 +02:00
|
|
|
public boolean typeOf(BlockState state) {
|
2020-03-28 02:27:43 +01:00
|
|
|
return state.getBlock() == get();
|
2019-07-11 09:03:08 +02:00
|
|
|
}
|
|
|
|
|
2020-03-28 23:20:25 +01:00
|
|
|
private TaggedBlock makeRelatedBlock(Block block, ComesWith feature) {
|
2019-08-25 10:14:15 +02:00
|
|
|
Properties properties = Properties.from(block);
|
2020-03-28 23:20:25 +01:00
|
|
|
TaggedBlock featured;
|
2019-08-25 10:14:15 +02:00
|
|
|
|
|
|
|
switch (feature) {
|
|
|
|
case FENCE:
|
2020-03-28 23:20:25 +01:00
|
|
|
featured = new TaggedBlock(new FenceBlock(properties)).withVanillaTags(ITaggable.TagType.BLOCK, "fences");
|
2019-08-25 10:14:15 +02:00
|
|
|
break;
|
|
|
|
case SLAB:
|
2020-03-28 23:20:25 +01:00
|
|
|
featured = new TaggedBlock(new SlabBlock(properties)).withVanillaTags(ITaggable.TagType.BLOCK, "slabs");
|
2019-08-25 10:14:15 +02:00
|
|
|
break;
|
|
|
|
case STAIRS:
|
2020-03-28 23:20:25 +01:00
|
|
|
featured = new TaggedBlock(new ProperStairsBlock(block)).withVanillaTags(ITaggable.TagType.BLOCK, "stairs");
|
2019-08-25 10:14:15 +02:00
|
|
|
break;
|
|
|
|
case WALL:
|
2020-03-28 23:20:25 +01:00
|
|
|
featured = new TaggedBlock(new WallBlock(properties)).withVanillaTags(ITaggable.TagType.BLOCK, "walls");
|
2019-08-25 10:14:15 +02:00
|
|
|
break;
|
|
|
|
case FENCE_GATE:
|
2020-03-28 23:20:25 +01:00
|
|
|
featured = new TaggedBlock(new FenceGateBlock(properties));
|
2019-08-25 10:14:15 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2020-03-28 02:27:43 +01:00
|
|
|
featured.block.setRegistryName(Create.ID, block.getRegistryName().getPath() + "_" + Lang.asId(feature.name()));
|
|
|
|
return featured;
|
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()) {
|
2020-03-28 02:27:43 +01:00
|
|
|
if (block.get() instanceof IHaveColorHandler) {
|
|
|
|
blockColors.register(((IHaveColorHandler) block.get()).getColorHandler(), block.get());
|
2019-09-13 18:36:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-28 23:20:25 +01:00
|
|
|
public static class TaggedBlock implements ITaggable<TaggedBlock> {
|
2020-03-28 02:27:43 +01:00
|
|
|
//A wrapper around Block that allows for tags to be included. needed for datagen
|
|
|
|
|
|
|
|
private Set<ResourceLocation> tagSetBlock = new HashSet<>();
|
|
|
|
private Set<ResourceLocation> tagSetBlockItem = new HashSet<>();
|
2020-03-28 23:20:25 +01:00
|
|
|
private Block block;
|
2020-03-28 02:27:43 +01:00
|
|
|
|
2020-03-28 23:20:25 +01:00
|
|
|
public TaggedBlock(Block blockIn){
|
2020-03-28 02:27:43 +01:00
|
|
|
block = blockIn;
|
|
|
|
}
|
|
|
|
|
2020-03-28 23:20:25 +01:00
|
|
|
public Block getBlock() {
|
2020-03-28 02:27:43 +01:00
|
|
|
return block;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Set<ResourceLocation> getTagSet(TagType type) {
|
|
|
|
return type == TagType.BLOCK ? tagSetBlock : tagSetBlockItem;
|
|
|
|
}
|
|
|
|
}
|
2019-07-11 09:03:08 +02:00
|
|
|
}
|