diff --git a/build.gradle b/build.gradle index 7074e9f38..74b4ddd38 100644 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ apply plugin: 'net.minecraftforge.gradle' apply plugin: 'eclipse' apply plugin: 'maven-publish' -version = 'mc1.15.2_v0.2.3' +version = 'mc1.15.2_v0.2.4' group = 'com.simibubi.create' archivesBaseName = 'create' diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index 44345194f..729e9b1ac 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -151,12 +151,14 @@ public class AllBlocks { public static final BlockEntry SHAFT = REGISTRATE.block("shaft", ShaftBlock::new) .initialProperties(SharedProperties::stone) + .transform(StressConfigDefaults.setNoImpact()) .blockstate(BlockStateGen.axisBlockProvider(false)) .simpleItem() .register(); public static final BlockEntry COGWHEEL = REGISTRATE.block("cogwheel", CogWheelBlock::small) .initialProperties(SharedProperties::stone) + .transform(StressConfigDefaults.setNoImpact()) .properties(p -> p.sound(SoundType.WOOD)) .blockstate(BlockStateGen.axisBlockProvider(false)) .item(CogwheelBlockItem::new) @@ -167,6 +169,7 @@ public class AllBlocks { REGISTRATE.block("large_cogwheel", CogWheelBlock::large) .initialProperties(SharedProperties::stone) .properties(p -> p.sound(SoundType.WOOD)) + .transform(StressConfigDefaults.setNoImpact()) .blockstate(BlockStateGen.axisBlockProvider(false)) .item(CogwheelBlockItem::new) .build() @@ -176,6 +179,7 @@ public class AllBlocks { REGISTRATE.block("encased_shaft", EncasedShaftBlock::new) .initialProperties(SharedProperties::stone) .properties(p -> p.nonOpaque()) + .transform(StressConfigDefaults.setNoImpact()) .blockstate(BlockStateGen.axisBlockProvider(true)) .item() .transform(customItemModel()) @@ -184,6 +188,7 @@ public class AllBlocks { public static final BlockEntry GEARBOX = REGISTRATE.block("gearbox", GearboxBlock::new) .initialProperties(SharedProperties::stone) .properties(p -> p.nonOpaque()) + .transform(StressConfigDefaults.setNoImpact()) .blockstate(BlockStateGen.axisBlockProvider(true)) .item() .transform(customItemModel()) @@ -192,6 +197,7 @@ public class AllBlocks { public static final BlockEntry CLUTCH = REGISTRATE.block("clutch", ClutchBlock::new) .initialProperties(SharedProperties::stone) .properties(p -> p.nonOpaque()) + .transform(StressConfigDefaults.setNoImpact()) .blockstate((c, p) -> BlockStateGen.axisBlock(c, p, AssetLookup.forPowered(c, p))) .item() .transform(customItemModel()) @@ -200,6 +206,7 @@ public class AllBlocks { public static final BlockEntry GEARSHIFT = REGISTRATE.block("gearshift", GearshiftBlock::new) .initialProperties(SharedProperties::stone) .properties(p -> p.nonOpaque()) + .transform(StressConfigDefaults.setNoImpact()) .blockstate((c, p) -> BlockStateGen.axisBlock(c, p, AssetLookup.forPowered(c, p))) .item() .transform(customItemModel()) @@ -209,6 +216,7 @@ public class AllBlocks { REGISTRATE.block("encased_belt", EncasedBeltBlock::new) .initialProperties(SharedProperties::stone) .properties(p -> p.nonOpaque()) + .transform(StressConfigDefaults.setNoImpact()) .blockstate((c, p) -> new EncasedBeltGenerator((state, suffix) -> p.models() .getExistingFile(p.modLoc("block/" + c.getName() + "/" + suffix))).generate(c, p)) .item() @@ -219,6 +227,7 @@ public class AllBlocks { REGISTRATE.block("adjustable_pulley", AdjustablePulleyBlock::new) .initialProperties(SharedProperties::stone) .properties(p -> p.nonOpaque()) + .transform(StressConfigDefaults.setNoImpact()) .blockstate((c, p) -> new EncasedBeltGenerator((state, suffix) -> { String powered = state.get(AdjustablePulleyBlock.POWERED) ? "_powered" : ""; return p.models() @@ -357,6 +366,7 @@ public class AllBlocks { public static final BlockEntry SPEEDOMETER = REGISTRATE.block("speedometer", GaugeBlock::speed) .initialProperties(SharedProperties::wooden) + .transform(StressConfigDefaults.setNoImpact()) .blockstate(new GaugeGenerator()::generate) .item() .transform(ModelGen.customItemModel("gauge", "_", "item")) @@ -364,6 +374,7 @@ public class AllBlocks { public static final BlockEntry STRESSOMETER = REGISTRATE.block("stressometer", GaugeBlock::stress) .initialProperties(SharedProperties::wooden) + .transform(StressConfigDefaults.setNoImpact()) .blockstate(new GaugeGenerator()::generate) .item() .transform(ModelGen.customItemModel("gauge", "_", "item")) @@ -554,6 +565,7 @@ public class AllBlocks { REGISTRATE.block("sequenced_gearshift", SequencedGearshiftBlock::new) .initialProperties(SharedProperties::stone) .properties(p -> p.nonOpaque()) + .transform(StressConfigDefaults.setNoImpact()) .blockstate(new SequencedGearshiftGenerator()::generate) .item() .transform(customItemModel()) @@ -562,6 +574,7 @@ public class AllBlocks { public static final BlockEntry FLYWHEEL = REGISTRATE.block("flywheel", FlywheelBlock::new) .initialProperties(SharedProperties::softMetal) .properties(p -> p.nonOpaque()) + .transform(StressConfigDefaults.setNoImpact()) .blockstate(new FlywheelGenerator()::generate) .item() .transform(customItemModel()) @@ -579,6 +592,7 @@ public class AllBlocks { public static final BlockEntry ROTATION_SPEED_CONTROLLER = REGISTRATE.block("rotation_speed_controller", SpeedControllerBlock::new) .initialProperties(SharedProperties::softMetal) + .transform(StressConfigDefaults.setNoImpact()) .blockstate(BlockStateGen.horizontalAxisBlockProvider(true)) .item() .transform(customItemModel()) diff --git a/src/main/java/com/simibubi/create/AllShapes.java b/src/main/java/com/simibubi/create/AllShapes.java index bddeb7caf..a780567e4 100644 --- a/src/main/java/com/simibubi/create/AllShapes.java +++ b/src/main/java/com/simibubi/create/AllShapes.java @@ -53,7 +53,7 @@ public class AllShapes { .forDirectional(), CRANK = shape(5, 0, 5, 11, 6, 11).add(1, 3, 1, 15, 8, 15) .forDirectional(), - CART_ASSEMBLER = shape(0,12,0,16,16,16).add(-2, 0, 1, 18, 14, 15) + CART_ASSEMBLER = shape(0, 12, 0, 16, 16, 16).add(-2, 0, 1, 18, 14, 15) .forHorizontalAxis(), STOCKPILE_SWITCH = shape(0, 0, 0, 16, 2, 16).add(1, 0, 1, 15, 16, 15) .add(0, 14, 0, 16, 16, 16) diff --git a/src/main/java/com/simibubi/create/Create.java b/src/main/java/com/simibubi/create/Create.java index 1761e4ae8..602c71053 100644 --- a/src/main/java/com/simibubi/create/Create.java +++ b/src/main/java/com/simibubi/create/Create.java @@ -38,7 +38,7 @@ public class Create { public static final String ID = "create"; public static final String NAME = "Create"; - public static final String VERSION = "0.2.3"; + public static final String VERSION = "0.2.4"; public static Logger logger = LogManager.getLogger(); public static ItemGroup baseCreativeTab = new CreateItemGroup(); @@ -54,7 +54,6 @@ public class Create { public Create() { IEventBus modEventBus = FMLJavaModLoadingContext.get() .getModEventBus(); - modEventBus.addListener(Create::init); AllBlocks.register(); AllItems.register(); @@ -62,18 +61,16 @@ public class Create { AllEntityTypes.register(); AllTileEntities.register(); + modEventBus.addListener(Create::init); modEventBus.addGenericListener(IRecipeSerializer.class, AllRecipeTypes::register); modEventBus.addGenericListener(ContainerType.class, AllContainerTypes::register); modEventBus.addGenericListener(ParticleType.class, AllParticleTypes::register); modEventBus.addGenericListener(SoundEvent.class, AllSoundEvents::register); modEventBus.addListener(AllConfigs::onLoad); modEventBus.addListener(AllConfigs::onReload); - - // Ensure registrate runs first modEventBus.addListener(EventPriority.LOWEST, this::gatherData); - - CreateClient.addListeners(modEventBus); - AllConfigs.registerClientCommon(); + CreateClient.addClientListeners(modEventBus); + AllConfigs.register(); } public static void init(final FMLCommonSetupEvent event) { @@ -84,9 +81,7 @@ public class Create { AllPackets.registerPackets(); AllTriggers.register(); - AllWorldFeatures.reload(); - AllConfigs.registerServer(); } public static void tick() { diff --git a/src/main/java/com/simibubi/create/CreateClient.java b/src/main/java/com/simibubi/create/CreateClient.java index ab8d286bc..c778543b3 100644 --- a/src/main/java/com/simibubi/create/CreateClient.java +++ b/src/main/java/com/simibubi/create/CreateClient.java @@ -61,7 +61,7 @@ public class CreateClient { private static CustomRenderedItems customRenderedItems; private static AllColorHandlers colorHandlers; - public static void addListeners(IEventBus modEventBus) { + public static void addClientListeners(IEventBus modEventBus) { DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> { modEventBus.addListener(CreateClient::clientInit); modEventBus.addListener(CreateClient::onModelBake); diff --git a/src/main/java/com/simibubi/create/content/palettes/AllPaletteBlocks.java b/src/main/java/com/simibubi/create/content/palettes/AllPaletteBlocks.java index ee5565f2f..538c715b7 100644 --- a/src/main/java/com/simibubi/create/content/palettes/AllPaletteBlocks.java +++ b/src/main/java/com/simibubi/create/content/palettes/AllPaletteBlocks.java @@ -108,34 +108,36 @@ public class AllPaletteBlocks { .register(); public static final BlockEntry LIMESTONE = - REGISTRATE.baseBlock("limestone", Block::new, () -> Blocks.SANDSTONE) + REGISTRATE.baseBlock("limestone", Block::new, () -> Blocks.SANDSTONE, true) .register(); public static final PalettesVariantEntry LIMESTONE_VARIANTS = new PalettesVariantEntry(PaletteStoneVariants.LIMESTONE, PaletteBlockPatterns.standardRange, LIMESTONE); public static final BlockEntry WEATHERED_LIMESTONE = - REGISTRATE.baseBlock("weathered_limestone", Block::new, () -> Blocks.SANDSTONE) + REGISTRATE.baseBlock("weathered_limestone", Block::new, () -> Blocks.SANDSTONE, true) .register(); public static final PalettesVariantEntry WEATHERED_LIMESTONE_VARIANTS = new PalettesVariantEntry( PaletteStoneVariants.WEATHERED_LIMESTONE, PaletteBlockPatterns.standardRange, WEATHERED_LIMESTONE); public static final BlockEntry DOLOMITE = - REGISTRATE.baseBlock("dolomite", Block::new, () -> Blocks.QUARTZ_BLOCK) + REGISTRATE.baseBlock("dolomite", Block::new, () -> Blocks.QUARTZ_BLOCK, true) .register(); public static final PalettesVariantEntry DOLOMITE_VARIANTS = new PalettesVariantEntry(PaletteStoneVariants.DOLOMITE, PaletteBlockPatterns.standardRange, DOLOMITE); - public static final BlockEntry GABBRO = REGISTRATE.baseBlock("gabbro", Block::new, () -> Blocks.ANDESITE) - .register(); + public static final BlockEntry GABBRO = + REGISTRATE.baseBlock("gabbro", Block::new, () -> Blocks.ANDESITE, true) + .register(); public static final PalettesVariantEntry GABBRO_VARIANTS = new PalettesVariantEntry(PaletteStoneVariants.GABBRO, PaletteBlockPatterns.standardRange, GABBRO); - public static final BlockEntry SCORIA = REGISTRATE.baseBlock("scoria", Block::new, () -> Blocks.ANDESITE) - .register(); + public static final BlockEntry SCORIA = + REGISTRATE.baseBlock("scoria", Block::new, () -> Blocks.ANDESITE, true) + .register(); public static final BlockEntry NATURAL_SCORIA = REGISTRATE.block("natural_scoria", Block::new) .initialProperties(() -> Blocks.ANDESITE) @@ -149,7 +151,7 @@ public class AllPaletteBlocks { new PalettesVariantEntry(PaletteStoneVariants.SCORIA, PaletteBlockPatterns.standardRange, SCORIA); public static final BlockEntry DARK_SCORIA = - REGISTRATE.baseBlock("dark_scoria", Block::new, () -> Blocks.ANDESITE) + REGISTRATE.baseBlock("dark_scoria", Block::new, () -> Blocks.ANDESITE, false) .register(); public static final PalettesVariantEntry DARK_SCORIA_VARIANTS = diff --git a/src/main/java/com/simibubi/create/foundation/config/AllConfigs.java b/src/main/java/com/simibubi/create/foundation/config/AllConfigs.java index 049bb3e38..996d9242b 100644 --- a/src/main/java/com/simibubi/create/foundation/config/AllConfigs.java +++ b/src/main/java/com/simibubi/create/foundation/config/AllConfigs.java @@ -33,28 +33,29 @@ public class AllConfigs { return config; } - public static void registerClientCommon() { + public static void register() { CLIENT = register(CClient::new, ModConfig.Type.CLIENT); COMMON = register(CCommon::new, ModConfig.Type.COMMON); - for (Entry pair : configs.entrySet()) - if (pair.getValue() != Type.SERVER) - ModLoadingContext.get().registerConfig(pair.getValue(), pair.getKey().specification); - } - - public static void registerServer() { SERVER = register(CServer::new, ModConfig.Type.SERVER); - ModLoadingContext.get().registerConfig(configs.get(SERVER), SERVER.specification); + + for (Entry pair : configs.entrySet()) + ModLoadingContext.get() + .registerConfig(pair.getValue(), pair.getKey().specification); } public static void onLoad(ModConfig.Loading event) { for (Entry pair : configs.entrySet()) - if (pair.getKey().specification == event.getConfig().getSpec()) - pair.getKey().onLoad(); + if (pair.getKey().specification == event.getConfig() + .getSpec()) + pair.getKey() + .onLoad(); } public static void onReload(ModConfig.Reloading event) { for (Entry pair : configs.entrySet()) - if (pair.getKey().specification == event.getConfig().getSpec()) - pair.getKey().onReload(); + if (pair.getKey().specification == event.getConfig() + .getSpec()) + pair.getKey() + .onReload(); } } diff --git a/src/main/java/com/simibubi/create/foundation/config/StressConfigDefaults.java b/src/main/java/com/simibubi/create/foundation/config/StressConfigDefaults.java index 525c08e71..d7fd7aef7 100644 --- a/src/main/java/com/simibubi/create/foundation/config/StressConfigDefaults.java +++ b/src/main/java/com/simibubi/create/foundation/config/StressConfigDefaults.java @@ -22,6 +22,10 @@ public class StressConfigDefaults { static Map registeredDefaultImpacts = new HashMap<>(); static Map registeredDefaultCapacities = new HashMap<>(); + public static NonNullUnaryOperator> setNoImpact() { + return setImpact(0); + } + public static NonNullUnaryOperator> setImpact(double impact) { return b -> { registeredDefaultImpacts.put(Create.asResource(b.getName()), impact); diff --git a/src/main/java/com/simibubi/create/foundation/data/CreateRegistrate.java b/src/main/java/com/simibubi/create/foundation/data/CreateRegistrate.java index eea64aad1..a5e75ace3 100644 --- a/src/main/java/com/simibubi/create/foundation/data/CreateRegistrate.java +++ b/src/main/java/com/simibubi/create/foundation/data/CreateRegistrate.java @@ -102,12 +102,13 @@ public class CreateRegistrate extends AbstractRegistrate { /* Palettes */ public BlockBuilder baseBlock(String name, - NonNullFunction factory, NonNullSupplier propertiesFrom) { + NonNullFunction factory, NonNullSupplier propertiesFrom, boolean TFworldGen) { return super.block(name, factory).initialProperties(propertiesFrom) .blockstate((c, p) -> { final String location = "block/palettes/" + c.getName() + "/plain"; p.simpleBlock(c.get(), p.models() .cubeAll(c.getName(), p.modLoc(location))); + // TODO tag with forge:stone; if TFWorldGen == true tag with forge:wg_stone aswell }) .simpleItem(); } diff --git a/src/main/resources/data/forge/tags/blocks/stone.json b/src/main/resources/data/forge/tags/blocks/stone.json new file mode 100644 index 000000000..2b4996602 --- /dev/null +++ b/src/main/resources/data/forge/tags/blocks/stone.json @@ -0,0 +1,17 @@ +{ + "replace": false, + "values": [ + "create:limestone", + "create:polished_limestone", + "create:weathered_limestone", + "create:polished_weathered_limestone", + "create:gabbro", + "create:polished_gabbro", + "create:dolomite", + "create:polished_dolomite", + "create:scoria", + "create:polished_scoria", + "create:dark_scoria", + "create:polished_dark_scoria" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/forge/tags/blocks/wg_stone.json b/src/main/resources/data/forge/tags/blocks/wg_stone.json new file mode 100644 index 000000000..d49e3fbd6 --- /dev/null +++ b/src/main/resources/data/forge/tags/blocks/wg_stone.json @@ -0,0 +1,10 @@ +{ + "replace": false, + "values": [ + "create:limestone", + "create:weathered_limestone", + "create:gabbro", + "create:dolomite", + "create:natural_scoria" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/forge/tags/items/stone.json b/src/main/resources/data/forge/tags/items/stone.json new file mode 100644 index 000000000..2b4996602 --- /dev/null +++ b/src/main/resources/data/forge/tags/items/stone.json @@ -0,0 +1,17 @@ +{ + "replace": false, + "values": [ + "create:limestone", + "create:polished_limestone", + "create:weathered_limestone", + "create:polished_weathered_limestone", + "create:gabbro", + "create:polished_gabbro", + "create:dolomite", + "create:polished_dolomite", + "create:scoria", + "create:polished_scoria", + "create:dark_scoria", + "create:polished_dark_scoria" + ] +} \ No newline at end of file