2019-07-11 09:03:08 +02:00
|
|
|
package com.simibubi.create;
|
|
|
|
|
2019-08-10 01:00:36 +02:00
|
|
|
import com.simibubi.create.foundation.block.IWithoutBlockItem;
|
2019-07-23 12:54:53 +02:00
|
|
|
import com.simibubi.create.foundation.block.RenderUtilityBlock;
|
2019-08-06 18:13:33 +02:00
|
|
|
import com.simibubi.create.modules.kinetics.base.HalfAxisBlock;
|
|
|
|
import com.simibubi.create.modules.kinetics.generators.MotorBlock;
|
|
|
|
import com.simibubi.create.modules.kinetics.receivers.TurntableBlock;
|
|
|
|
import com.simibubi.create.modules.kinetics.relays.AxisBlock;
|
|
|
|
import com.simibubi.create.modules.kinetics.relays.AxisTunnelBlock;
|
2019-08-10 01:00:36 +02:00
|
|
|
import com.simibubi.create.modules.kinetics.relays.BeltBlock;
|
2019-08-06 18:13:33 +02:00
|
|
|
import com.simibubi.create.modules.kinetics.relays.CogWheelBlock;
|
|
|
|
import com.simibubi.create.modules.kinetics.relays.GearboxBlock;
|
|
|
|
import com.simibubi.create.modules.kinetics.relays.GearshifterBlock;
|
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;
|
|
|
|
import com.simibubi.create.modules.symmetry.block.CrossPlaneSymmetryBlock;
|
|
|
|
import com.simibubi.create.modules.symmetry.block.PlaneSymmetryBlock;
|
|
|
|
import com.simibubi.create.modules.symmetry.block.TriplePlaneSymmetryBlock;
|
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-07-11 09:03:08 +02:00
|
|
|
import net.minecraft.item.BlockItem;
|
|
|
|
import net.minecraft.item.Item;
|
|
|
|
import net.minecraftforge.registries.IForgeRegistry;
|
|
|
|
|
|
|
|
public enum AllBlocks {
|
|
|
|
|
2019-08-06 18:13:33 +02:00
|
|
|
// Schematics
|
2019-07-11 19:55:11 +02:00
|
|
|
SCHEMATICANNON(new SchematicannonBlock()),
|
2019-07-23 12:54:53 +02:00
|
|
|
SCHEMATICANNON_CONNECTOR(new RenderUtilityBlock()),
|
|
|
|
SCHEMATICANNON_PIPE(new RenderUtilityBlock()),
|
2019-07-13 12:55:28 +02:00
|
|
|
CREATIVE_CRATE(new CreativeCrateBlock()),
|
2019-07-11 19:55:11 +02:00
|
|
|
SCHEMATIC_TABLE(new SchematicTableBlock()),
|
2019-08-06 18:13:33 +02:00
|
|
|
|
|
|
|
// Kinetics
|
|
|
|
AXIS(new AxisBlock(Properties.from(Blocks.ANDESITE))),
|
|
|
|
GEAR(new CogWheelBlock(false)),
|
|
|
|
LARGE_GEAR(new CogWheelBlock(true)),
|
|
|
|
AXIS_TUNNEL(new AxisTunnelBlock()),
|
|
|
|
GEARSHIFTER(new GearshifterBlock()),
|
2019-08-10 01:00:36 +02:00
|
|
|
BELT(new BeltBlock()),
|
|
|
|
BELT_ANIMATION(new RenderUtilityBlock()),
|
2019-07-11 19:55:11 +02:00
|
|
|
|
2019-08-06 18:13:33 +02:00
|
|
|
TURNTABLE(new TurntableBlock()),
|
|
|
|
HALF_AXIS(new HalfAxisBlock()),
|
|
|
|
GEARBOX(new GearboxBlock()),
|
|
|
|
MOTOR(new MotorBlock()),
|
|
|
|
|
|
|
|
// Symmetry
|
2019-07-19 17:50:23 +02:00
|
|
|
SYMMETRY_PLANE(new PlaneSymmetryBlock()),
|
|
|
|
SYMMETRY_CROSSPLANE(new CrossPlaneSymmetryBlock()),
|
2019-08-06 18:13:33 +02:00
|
|
|
SYMMETRY_TRIPLEPLANE(new TriplePlaneSymmetryBlock()),
|
|
|
|
|
|
|
|
;
|
2019-07-11 09:03:08 +02:00
|
|
|
|
|
|
|
public Block block;
|
|
|
|
|
|
|
|
private AllBlocks(Block block) {
|
|
|
|
this.block = block;
|
|
|
|
this.block.setRegistryName(Create.ID, this.name().toLowerCase());
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void registerBlocks(IForgeRegistry<Block> registry) {
|
|
|
|
for (AllBlocks block : values()) {
|
|
|
|
registry.register(block.block);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void registerItemBlocks(IForgeRegistry<Item> registry) {
|
|
|
|
for (AllBlocks block : values()) {
|
2019-08-10 01:00:36 +02:00
|
|
|
if (block.get() instanceof IWithoutBlockItem)
|
2019-07-11 09:03:08 +02:00
|
|
|
continue;
|
|
|
|
|
|
|
|
registry.register(new BlockItem(block.get(), AllItems.standardProperties())
|
|
|
|
.setRegistryName(block.get().getRegistryName()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public Block get() {
|
|
|
|
return block;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean typeOf(BlockState state) {
|
|
|
|
return state.getBlock() == block;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|