diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 6fb5e38ba..78fe2c7e0 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -58,6 +58,7 @@ e7c1db7226df5858f1884f0cf328a733fec22c3d assets\create\blockstates\dolomite_cobb f63a5816d4bfe643aa098d03c3b54462dd06fe19 assets\create\blockstates\dolomite_cobblestone_wall.json 6d7f0c92ee978366d2b019e35cf2fc6a2e4de37d assets\create\blockstates\dolomite_pillar.json 7b1c40891b07c8f3238537625d9e25c8627e7333 assets\create\blockstates\encased_belt.json +7b2b836649e729feafa60972bf95e3afb2143131 assets\create\blockstates\encased_fan.json 373ac3c29b553322291599e93eac12000c4a87f8 assets\create\blockstates\encased_shaft.json a774e815376a67e2a2de44e39af0a1a0b4406932 assets\create\blockstates\fancy_andesite_bricks.json 180be26a75834cf9cdb881f969f77906e91cc36a assets\create\blockstates\fancy_andesite_bricks_slab.json @@ -245,6 +246,7 @@ d62b7908119fa4f51715a186d0882b388bb25cab assets\create\blockstates\spruce_window a2454400b1cf9889f70aebdc89c52a1be25f543c assets\create\blockstates\tiled_glass_pane.json 69dfe8afaa8eb6105dae9f76ab8b7847bf90b8c6 assets\create\blockstates\vertical_framed_glass.json c4db76b9d36cfb098df0d158cb6f8b82768ebe14 assets\create\blockstates\vertical_framed_glass_pane.json +d995547bcd71603ba7378d8998098e462030bfd0 assets\create\blockstates\water_wheel.json f182669f7547964f9f2ef67916568556870def7b assets\create\blockstates\weathered_limestone.json 27e6740834c0f673acc3531371512daa6dcab025 assets\create\blockstates\weathered_limestone_bricks.json abb74e4f4c2b9851670cb6ad794281b0f7be0f5a assets\create\blockstates\weathered_limestone_bricks_slab.json @@ -257,8 +259,8 @@ c60c3115fd6eeaa3a696428a87a74d184ab7d62d assets\create\blockstates\weathered_lim 7e2476ffff93d0eedee5314e5692fcbf5692bffc assets\create\blockstates\weathered_limestone_pillar.json 7f39521b211441f5c3e06d60c5978cebe16cacfb assets\create\blockstates\zinc_block.json b7181bcd8182b2f17088e5aa881f374c9c65470c assets\create\blockstates\zinc_ore.json -d013d73098481a23a125ddddae232fe74a2c951d assets\create\lang\en_ud.json -ebefb80bc3f6e70ee7ba6ed20c614b10c9187a3b assets\create\lang\en_us.json +350ccf4bf90982344b692676638a64756bd7643d assets\create\lang\en_ud.json +4534b8c0efe107d7afc925ed0616246b7c7ea7ff assets\create\lang\en_us.json 846200eb548d3bfa2e77b41039de159b4b6cfb45 assets\create\models\block\acacia_window.json 1930fa3a3c98d53dd19e4ee7f55bc27fd47aa281 assets\create\models\block\acacia_window_pane_noside.json 1763ea2c9b981d187f5031ba608f3d5d3be3986a assets\create\models\block\acacia_window_pane_noside_alt.json @@ -822,6 +824,7 @@ be7de1e1529fb2a2e842204136520a760676d4e9 assets\create\models\item\dolomite_cobb 6b03f2be8fa1e62a89d59859e7d40f9e45ab8b65 assets\create\models\item\dolomite_cobblestone_wall.json e974cd23a5456baef8b634f2d21fd8c3822931ab assets\create\models\item\dolomite_pillar.json f2d6b88c3174de01e16da555236727efc33b490c assets\create\models\item\encased_belt.json +250bd0716cc1f04b03892ab74eb0b3a0f32a6158 assets\create\models\item\encased_fan.json e0f9ad7e7d790e9e21a38fa57395fd3ff892359b assets\create\models\item\encased_shaft.json efcbd30ad7a7658c02a3dc3de5fa0f21d7f49b54 assets\create\models\item\fancy_andesite_bricks.json 7ccd312084128c356307c7ca6e52c65d0a18907b assets\create\models\item\fancy_andesite_bricks_slab.json @@ -1009,6 +1012,7 @@ b1d3d00ff05908feacad06a86800da96cc9bc65d assets\create\models\item\tiled_glass.j 8a2a81a8cbc52b6021e57107d79a32f73b82d8fe assets\create\models\item\tiled_glass_pane.json 32f49b724af10c8d7e2ed5a3c82280e83b75f789 assets\create\models\item\vertical_framed_glass.json 5e331da9d4086412f5722923e3008246ed286a00 assets\create\models\item\vertical_framed_glass_pane.json +ae20383b0b0806431d0fdd8ffdd16fe2b0cc61ad assets\create\models\item\water_wheel.json 1d097a315c2817d16c241c86f66bd48e5e52f4b4 assets\create\models\item\weathered_limestone.json fcc8ab312989ec485e2d86b856d81dbafaf0e930 assets\create\models\item\weathered_limestone_bricks.json 7e7abcb63aa5fc0dee50e116c93f8544768d4d95 assets\create\models\item\weathered_limestone_bricks_slab.json diff --git a/src/generated/resources/assets/create/blockstates/encased_fan.json b/src/generated/resources/assets/create/blockstates/encased_fan.json new file mode 100644 index 000000000..8ef6e2d1f --- /dev/null +++ b/src/generated/resources/assets/create/blockstates/encased_fan.json @@ -0,0 +1,30 @@ +{ + "variants": { + "facing=down": { + "model": "create:block/encased_fan/block", + "x": 180 + }, + "facing=up": { + "model": "create:block/encased_fan/block" + }, + "facing=north": { + "model": "create:block/encased_fan/block", + "x": 90 + }, + "facing=south": { + "model": "create:block/encased_fan/block", + "x": 90, + "y": 180 + }, + "facing=west": { + "model": "create:block/encased_fan/block", + "x": 90, + "y": 270 + }, + "facing=east": { + "model": "create:block/encased_fan/block", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/create/blockstates/water_wheel.json b/src/generated/resources/assets/create/blockstates/water_wheel.json new file mode 100644 index 000000000..c9b0731b7 --- /dev/null +++ b/src/generated/resources/assets/create/blockstates/water_wheel.json @@ -0,0 +1,23 @@ +{ + "variants": { + "facing=north": { + "model": "create:block/water_wheel", + "x": 90 + }, + "facing=south": { + "model": "create:block/water_wheel", + "x": 90, + "y": 180 + }, + "facing=west": { + "model": "create:block/water_wheel", + "x": 90, + "y": 270 + }, + "facing=east": { + "model": "create:block/water_wheel", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/create/lang/en_ud.json b/src/generated/resources/assets/create/lang/en_ud.json index 74ce8ce30..f62f63772 100644 --- a/src/generated/resources/assets/create/lang/en_ud.json +++ b/src/generated/resources/assets/create/lang/en_ud.json @@ -59,6 +59,7 @@ "block.create.dolomite_cobblestone_wall": "\u05DF\u05DF\u0250M \u01DDuo\u0287s\u01DD\u05DFqqo\u0186 \u01DD\u0287\u0131\u026Fo\u05DFo\u15E1", "block.create.dolomite_pillar": "\u0279\u0250\u05DF\u05DF\u0131\u0500 \u01DD\u0287\u0131\u026Fo\u05DFo\u15E1", "block.create.encased_belt": "\u0287\u05DF\u01DD\u15FA p\u01DDs\u0250\u0254u\u018E", + "block.create.encased_fan": "u\u0250\u2132 p\u01DDs\u0250\u0254u\u018E", "block.create.encased_shaft": "\u0287\u025F\u0250\u0265S p\u01DDs\u0250\u0254u\u018E", "block.create.fancy_andesite_bricks": "s\u029E\u0254\u0131\u0279\u15FA \u01DD\u0287\u0131s\u01DDpu\u2C6F \u028E\u0254u\u0250\u2132", "block.create.fancy_andesite_bricks_slab": "q\u0250\u05DFS s\u029E\u0254\u0131\u0279\u15FA \u01DD\u0287\u0131s\u01DDpu\u2C6F \u028E\u0254u\u0250\u2132", @@ -246,6 +247,7 @@ "block.create.tiled_glass_pane": "\u01DDu\u0250\u0500 ss\u0250\u05DF\u2141 p\u01DD\u05DF\u0131\u27D8", "block.create.vertical_framed_glass": "ss\u0250\u05DF\u2141 p\u01DD\u026F\u0250\u0279\u2132 \u05DF\u0250\u0254\u0131\u0287\u0279\u01DD\u039B", "block.create.vertical_framed_glass_pane": "\u01DDu\u0250\u0500 ss\u0250\u05DF\u2141 p\u01DD\u026F\u0250\u0279\u2132 \u05DF\u0250\u0254\u0131\u0287\u0279\u01DD\u039B", + "block.create.water_wheel": "\u05DF\u01DD\u01DD\u0265M \u0279\u01DD\u0287\u0250M", "block.create.weathered_limestone": "\u01DDuo\u0287s\u01DD\u026F\u0131\uA780 p\u01DD\u0279\u01DD\u0265\u0287\u0250\u01DDM", "block.create.weathered_limestone_bricks": "s\u029E\u0254\u0131\u0279\u15FA \u01DDuo\u0287s\u01DD\u026F\u0131\uA780 p\u01DD\u0279\u01DD\u0265\u0287\u0250\u01DDM", "block.create.weathered_limestone_bricks_slab": "q\u0250\u05DFS s\u029E\u0254\u0131\u0279\u15FA \u01DDuo\u0287s\u01DD\u026F\u0131\uA780 p\u01DD\u0279\u01DD\u0265\u0287\u0250\u01DDM", diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index 8d3498ad5..0ee79146d 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -59,6 +59,7 @@ "block.create.dolomite_cobblestone_wall": "Dolomite Cobblestone Wall", "block.create.dolomite_pillar": "Dolomite Pillar", "block.create.encased_belt": "Encased Belt", + "block.create.encased_fan": "Encased Fan", "block.create.encased_shaft": "Encased Shaft", "block.create.fancy_andesite_bricks": "Fancy Andesite Bricks", "block.create.fancy_andesite_bricks_slab": "Fancy Andesite Bricks Slab", @@ -246,6 +247,7 @@ "block.create.tiled_glass_pane": "Tiled Glass Pane", "block.create.vertical_framed_glass": "Vertical Framed Glass", "block.create.vertical_framed_glass_pane": "Vertical Framed Glass Pane", + "block.create.water_wheel": "Water Wheel", "block.create.weathered_limestone": "Weathered Limestone", "block.create.weathered_limestone_bricks": "Weathered Limestone Bricks", "block.create.weathered_limestone_bricks_slab": "Weathered Limestone Bricks Slab", diff --git a/src/generated/resources/assets/create/models/item/encased_fan.json b/src/generated/resources/assets/create/models/item/encased_fan.json new file mode 100644 index 000000000..10ea40d1a --- /dev/null +++ b/src/generated/resources/assets/create/models/item/encased_fan.json @@ -0,0 +1,3 @@ +{ + "parent": "create:block/encased_fan/item" +} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/item/water_wheel.json b/src/generated/resources/assets/create/models/item/water_wheel.json new file mode 100644 index 000000000..1fe80c21b --- /dev/null +++ b/src/generated/resources/assets/create/models/item/water_wheel.json @@ -0,0 +1,3 @@ +{ + "parent": "create:block/water_wheel" +} \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index 229e48aab..b50916405 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -31,7 +31,6 @@ import com.simibubi.create.modules.contraptions.components.crank.HandCrankBlock; 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.deployer.DeployerBlock; -import com.simibubi.create.modules.contraptions.components.fan.EncasedFanBlock; import com.simibubi.create.modules.contraptions.components.fan.NozzleBlock; import com.simibubi.create.modules.contraptions.components.flywheel.FlywheelBlock; import com.simibubi.create.modules.contraptions.components.flywheel.engine.FurnaceEngineBlock; @@ -41,7 +40,6 @@ import com.simibubi.create.modules.contraptions.components.mixer.MechanicalMixer 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; import com.simibubi.create.modules.contraptions.redstone.AnalogLeverBlock; import com.simibubi.create.modules.contraptions.redstone.ContactBlock; @@ -107,8 +105,8 @@ public enum AllBlocks implements NonNullSupplier { // ADJUSTABLE_PULLEY(AdjustablePulleyBlock::new), // BELT(BeltBlock::new, ComesWith.NO_BLOCKITEM), // CREATIVE_MOTOR(MotorBlock::new), - WATER_WHEEL(WaterWheelBlock::new), - ENCASED_FAN(EncasedFanBlock::new), +// WATER_WHEEL(WaterWheelBlock::new), +// ENCASED_FAN(EncasedFanBlock::new), NOZZLE(NozzleBlock::new), TURNTABLE(TurntableBlock::new), HAND_CRANK(HandCrankBlock::new), diff --git a/src/main/java/com/simibubi/create/AllBlocksNew.java b/src/main/java/com/simibubi/create/AllBlocksNew.java index 2a89d25b9..8a2e25e46 100644 --- a/src/main/java/com/simibubi/create/AllBlocksNew.java +++ b/src/main/java/com/simibubi/create/AllBlocksNew.java @@ -1,6 +1,7 @@ package com.simibubi.create; import static com.simibubi.create.foundation.utility.data.BlockStateGen.oxidizedBlockstate; +import static com.simibubi.create.foundation.utility.data.ModelGen.customItemModel; import static com.simibubi.create.foundation.utility.data.ModelGen.oxidizedItemModel; import static com.simibubi.create.modules.Sections.SCHEMATICS; @@ -10,8 +11,10 @@ import com.simibubi.create.foundation.utility.data.AssetLookup; import com.simibubi.create.foundation.utility.data.BlockStateGen; import com.simibubi.create.foundation.world.OxidizingBlock; import com.simibubi.create.modules.Sections; +import com.simibubi.create.modules.contraptions.components.fan.EncasedFanBlock; import com.simibubi.create.modules.contraptions.components.motor.MotorBlock; import com.simibubi.create.modules.contraptions.components.motor.MotorGenerator; +import com.simibubi.create.modules.contraptions.components.waterwheel.WaterWheelBlock; import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock; import com.simibubi.create.modules.contraptions.relays.belt.BeltGenerator; import com.simibubi.create.modules.contraptions.relays.elementary.CogWheelBlock; @@ -36,6 +39,7 @@ import net.minecraft.block.Block; import net.minecraft.block.Blocks; import net.minecraft.block.SoundType; import net.minecraft.block.material.MaterialColor; +import net.minecraft.client.renderer.RenderType; import net.minecraft.item.BlockItem; import net.minecraft.item.Item; import net.minecraft.tags.BlockTags; @@ -60,9 +64,7 @@ public class AllBlocksNew { REGISTRATE.block("schematicannon", SchematicannonBlock::new) .initialProperties(() -> Blocks.DISPENSER) .blockstate((ctx, prov) -> prov.simpleBlock(ctx.getEntry(), AssetLookup.partialBaseModel(ctx, prov))) - .item() - .model(AssetLookup::customItemModel) - .build() + .transform(customItemModel()) .register(); public static final BlockEntry SCHEMATIC_TABLE = @@ -106,33 +108,25 @@ public class AllBlocksNew { REGISTRATE.block("encased_shaft", EncasedShaftBlock::new) .initialProperties(SharedProperties::kinetic) .blockstate(BlockStateGen.axisBlockProvider(true)) - .item() - .model(AssetLookup::customItemModel) - .build() + .transform(customItemModel()) .register(); public static final BlockEntry GEARBOX = REGISTRATE.block("gearbox", GearboxBlock::new) .initialProperties(SharedProperties::kinetic) .blockstate(BlockStateGen.axisBlockProvider(true)) - .item() - .model(AssetLookup::customItemModel) - .build() + .transform(customItemModel()) .register(); public static final BlockEntry CLUTCH = REGISTRATE.block("clutch", ClutchBlock::new) .initialProperties(SharedProperties::kinetic) .blockstate((c, p) -> BlockStateGen.axisBlock(c, p, AssetLookup.forPowered(c, p))) - .item() - .model(AssetLookup::customItemModel) - .build() + .transform(customItemModel()) .register(); public static final BlockEntry GEARSHIFT = REGISTRATE.block("gearshift", GearshiftBlock::new) .initialProperties(SharedProperties::kinetic) .blockstate((c, p) -> BlockStateGen.axisBlock(c, p, AssetLookup.forPowered(c, p))) - .item() - .model(AssetLookup::customItemModel) - .build() + .transform(customItemModel()) .register(); public static final BlockEntry ENCASED_BELT = @@ -140,9 +134,7 @@ public class AllBlocksNew { .initialProperties(SharedProperties::kinetic) .blockstate((c, p) -> new EncasedBeltGenerator((state, suffix) -> p.models() .getExistingFile(p.modLoc("block/" + c.getName() + "/" + suffix))).generate(c, p)) - .item() - .model(AssetLookup::customItemModel) - .build() + .transform(customItemModel()) .register(); public static final BlockEntry ADJUSTABLE_PULLEY = @@ -170,9 +162,24 @@ public class AllBlocksNew { .initialProperties(SharedProperties::kinetic) .blockstate(new MotorGenerator()::generate) .transform(StressConfigDefaults.setCapacity(16384.0)) - .item() - .model(AssetLookup::customItemModel) - .build() + .transform(customItemModel()) + .register(); + + public static final BlockEntry WATER_WHEEL = REGISTRATE.block("water_wheel", WaterWheelBlock::new) + .initialProperties(SharedProperties::woodenKinetic) + .blockstate(BlockStateGen.horizontalWheelProvider(false)) + .addLayer(() -> RenderType::getCutoutMipped) + .transform(StressConfigDefaults.setCapacity(16.0)) + .simpleItem() + .register(); + + public static final BlockEntry ENCASED_FAN = REGISTRATE.block("encased_fan", EncasedFanBlock::new) + .initialProperties(SharedProperties::kinetic) + .blockstate(BlockStateGen.directionalBlockProvider(true)) + .addLayer(() -> RenderType::getCutoutMipped) + .transform(StressConfigDefaults.setCapacity(16.0)) + .transform(StressConfigDefaults.setImpact(2.0)) + .transform(customItemModel()) .register(); // Materials diff --git a/src/main/java/com/simibubi/create/AllTileEntities.java b/src/main/java/com/simibubi/create/AllTileEntities.java index 067a8cf32..a3bf6e11a 100644 --- a/src/main/java/com/simibubi/create/AllTileEntities.java +++ b/src/main/java/com/simibubi/create/AllTileEntities.java @@ -114,7 +114,7 @@ public enum AllTileEntities { TURNTABLE(TurntableTileEntity::new, AllBlocks.TURNTABLE), ENCASED_SHAFT(EncasedShaftTileEntity::new, AllBlocksNew.ENCASED_SHAFT, AllBlocksNew.ENCASED_BELT), ADJUSTABLE_PULLEY(AdjustablePulleyTileEntity::new, AllBlocksNew.ADJUSTABLE_PULLEY), - ENCASED_FAN(EncasedFanTileEntity::new, AllBlocks.ENCASED_FAN), + ENCASED_FAN(EncasedFanTileEntity::new, AllBlocksNew.ENCASED_FAN), NOZZLE(NozzleTileEntity::new, AllBlocks.NOZZLE), CLUTCH(ClutchTileEntity::new, AllBlocksNew.CLUTCH), GEARSHIFT(GearshiftTileEntity::new, AllBlocksNew.GEARSHIFT), @@ -138,7 +138,7 @@ public enum AllTileEntities { MILLSTONE(MillstoneTileEntity::new, AllBlocks.MILLSTONE), CRUSHING_WHEEL(CrushingWheelTileEntity::new, AllBlocks.CRUSHING_WHEEL), CRUSHING_WHEEL_CONTROLLER(CrushingWheelControllerTileEntity::new, AllBlocks.CRUSHING_WHEEL_CONTROLLER), - WATER_WHEEL(WaterWheelTileEntity::new, AllBlocks.WATER_WHEEL), + WATER_WHEEL(WaterWheelTileEntity::new, AllBlocksNew.WATER_WHEEL), MECHANICAL_PRESS(MechanicalPressTileEntity::new, AllBlocks.MECHANICAL_PRESS), MECHANICAL_MIXER(MechanicalMixerTileEntity::new, AllBlocks.MECHANICAL_MIXER), DEPLOYER(DeployerTileEntity::new, AllBlocks.DEPLOYER), diff --git a/src/main/java/com/simibubi/create/SharedProperties.java b/src/main/java/com/simibubi/create/SharedProperties.java index 3b4365dd5..20e9ee23f 100644 --- a/src/main/java/com/simibubi/create/SharedProperties.java +++ b/src/main/java/com/simibubi/create/SharedProperties.java @@ -14,5 +14,9 @@ public class SharedProperties { static Block kinetic() { return Blocks.ANDESITE; } + + static Block woodenKinetic() { + return Blocks.STRIPPED_SPRUCE_WOOD; + } } diff --git a/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java b/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java index 118c775ed..36dd65c61 100644 --- a/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java +++ b/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java @@ -5,6 +5,7 @@ import java.util.stream.Collectors; import com.google.common.base.Predicate; import com.simibubi.create.AllBlocks; +import com.simibubi.create.AllBlocksNew; import com.simibubi.create.AllItems; import com.simibubi.create.AllRecipes; import com.simibubi.create.Create; @@ -139,7 +140,7 @@ public class CreateJEI implements IModPlugin { @Override public void registerRecipeCatalysts(IRecipeCatalystRegistration registration) { - ItemStack fan = new ItemStack(AllBlocks.ENCASED_FAN.get()); + ItemStack fan = new ItemStack(AllBlocksNew.ENCASED_FAN.get()); ItemStack splashingFan = fan .copy() diff --git a/src/main/java/com/simibubi/create/compat/jei/category/ProcessingViaFanCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/ProcessingViaFanCategory.java index f5652d772..964c0168e 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/ProcessingViaFanCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/ProcessingViaFanCategory.java @@ -4,7 +4,7 @@ import java.util.Arrays; import com.mojang.blaze3d.systems.RenderSystem; import com.simibubi.create.AllBlockPartials; -import com.simibubi.create.AllBlocks; +import com.simibubi.create.AllBlocksNew; import com.simibubi.create.ScreenResources; import com.simibubi.create.compat.jei.category.animations.AnimatedKinetics; import com.simibubi.create.foundation.gui.GuiGameElement; @@ -56,13 +56,13 @@ public abstract class ProcessingViaFanCategory> extends Cre RenderSystem.rotatef(-12.5f, 1, 0, 0); RenderSystem.rotatef(22.5f, 0, 1, 0); int scale = 24; - + GuiGameElement.of(AllBlockPartials.ENCASED_FAN_INNER) .rotateBlock(180, 0, AnimatedKinetics.getCurrentAngle() * 16) .scale(scale) .render(); - GuiGameElement.of(AllBlocks.ENCASED_FAN.getDefault()) + GuiGameElement.of(AllBlocksNew.ENCASED_FAN.getDefaultState()) .rotateBlock(0, 180, 0) .atLocal(0, 0, 0) .scale(scale) diff --git a/src/main/java/com/simibubi/create/config/StressConfigDefaults.java b/src/main/java/com/simibubi/create/config/StressConfigDefaults.java index 56b724b39..13816d34d 100644 --- a/src/main/java/com/simibubi/create/config/StressConfigDefaults.java +++ b/src/main/java/com/simibubi/create/config/StressConfigDefaults.java @@ -47,11 +47,11 @@ public class StressConfigDefaults { return 1024; case MECHANICAL_BEARING: return 512; - case ENCASED_FAN: +// case ENCASED_FAN: case HAND_CRANK: return 32; - case WATER_WHEEL: - return 8; +// case WATER_WHEEL: +// return 8; default: return -1; } @@ -82,7 +82,7 @@ public class StressConfigDefaults { return 2; // case BELT: - case ENCASED_FAN: +// case ENCASED_FAN: case CUCKOO_CLOCK: return 1; diff --git a/src/main/java/com/simibubi/create/data/CreateAdvancements.java b/src/main/java/com/simibubi/create/data/CreateAdvancements.java index 308678e21..dacaab574 100644 --- a/src/main/java/com/simibubi/create/data/CreateAdvancements.java +++ b/src/main/java/com/simibubi/create/data/CreateAdvancements.java @@ -61,9 +61,9 @@ public class CreateAdvancements implements IDataProvider { kineticsBranch(t, andesite_alloy); - Advancement water_wheel = advancement("water_wheel", AllBlocks.WATER_WHEEL.get(), TaskType.NORMAL) + Advancement water_wheel = advancement("water_wheel", AllBlocksNew.WATER_WHEEL.get(), TaskType.NORMAL) .withParent(andesite_alloy) - .withCriterion("0", placeBlock(AllBlocks.WATER_WHEEL.get())) + .withCriterion("0", placeBlock(AllBlocksNew.WATER_WHEEL.get())) .withCriterion("1", AllTriggers.WATER_WHEEL.instance()) .register(t, id + ":water_wheel"); diff --git a/src/main/java/com/simibubi/create/foundation/utility/data/BlockStateGen.java b/src/main/java/com/simibubi/create/foundation/utility/data/BlockStateGen.java index 3d423ebe1..6ec70eba4 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/data/BlockStateGen.java +++ b/src/main/java/com/simibubi/create/foundation/utility/data/BlockStateGen.java @@ -20,12 +20,43 @@ import net.minecraftforge.client.model.generators.ModelFile; public class BlockStateGen { + // Functions + public static NonNullBiConsumer, RegistrateBlockstateProvider> axisBlockProvider( boolean customItem) { - return (c, p) -> BlockStateGen.axisBlock(c, p, - $ -> customItem ? AssetLookup.partialBaseModel(c, p) : AssetLookup.standardModel(c, p)); + return (c, p) -> BlockStateGen.axisBlock(c, p, getBlockModel(customItem, c, p)); } + public static NonNullBiConsumer, RegistrateBlockstateProvider> directionalBlockProvider( + boolean customItem) { + return (c, p) -> p.directionalBlock(c.get(), getBlockModel(customItem, c, p)); + } + + public static NonNullBiConsumer, RegistrateBlockstateProvider> horizontalWheelProvider( + boolean customItem) { + return (c, p) -> BlockStateGen.horizontalWheel(c, p, getBlockModel(customItem, c, p)); + } + + public static

NonNullUnaryOperator> oxidizedBlockstate() { + return b -> b.blockstate((ctx, prov) -> prov.getVariantBuilder(ctx.getEntry()) + .forAllStates(state -> { + String name = ModelGen.getOxidizedModel(ctx.getName(), state.get(OxidizingBlock.OXIDIZATION)); + return ConfiguredModel.builder() + .modelFile(prov.models() + .cubeAll(name, prov.modLoc(name))) + .build(); + })); + } + + // Utility + + private static Function getBlockModel(boolean customItem, + DataGenContext c, RegistrateBlockstateProvider p) { + return $ -> customItem ? AssetLookup.partialBaseModel(c, p) : AssetLookup.standardModel(c, p); + } + + // Generators + public static void axisBlock(DataGenContext ctx, RegistrateBlockstateProvider prov, Function modelFunc) { prov.getVariantBuilder(ctx.getEntry()) @@ -39,6 +70,17 @@ public class BlockStateGen { }); } + public static void horizontalWheel(DataGenContext ctx, + RegistrateBlockstateProvider prov, Function modelFunc) { + prov.getVariantBuilder(ctx.get()) + .forAllStates(state -> ConfiguredModel.builder() + .modelFile(modelFunc.apply(state)) + .rotationX(90) + .rotationY(((int) state.get(BlockStateProperties.HORIZONTAL_FACING) + .getHorizontalAngle() + 180) % 360) + .build()); + } + public static void cubeAll(DataGenContext ctx, RegistrateBlockstateProvider prov, String textureSubDir) { cubeAll(ctx, prov, textureSubDir, ctx.getName()); @@ -59,14 +101,4 @@ public class BlockStateGen { .build()); } - public static

NonNullUnaryOperator> oxidizedBlockstate() { - return b -> b.blockstate((ctx, prov) -> prov.getVariantBuilder(ctx.getEntry()) - .forAllStates(state -> { - String name = ModelGen.getOxidizedModel(ctx.getName(), state.get(OxidizingBlock.OXIDIZATION)); - return ConfiguredModel.builder() - .modelFile(prov.models().cubeAll(name, prov.modLoc(name))) - .build(); - })); - } - } diff --git a/src/main/java/com/simibubi/create/foundation/utility/data/ModelGen.java b/src/main/java/com/simibubi/create/foundation/utility/data/ModelGen.java index 04f1587bc..0e5ce0e89 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/data/ModelGen.java +++ b/src/main/java/com/simibubi/create/foundation/utility/data/ModelGen.java @@ -1,9 +1,11 @@ package com.simibubi.create.foundation.utility.data; import com.simibubi.create.Create; +import com.tterrag.registrate.builders.BlockBuilder; import com.tterrag.registrate.builders.ItemBuilder; import com.tterrag.registrate.providers.DataGenContext; import com.tterrag.registrate.util.nullness.NonNullFunction; +import com.tterrag.registrate.util.nullness.NonNullUnaryOperator; import net.minecraft.block.Block; import net.minecraft.item.BlockItem; @@ -14,23 +16,32 @@ import net.minecraftforge.client.model.generators.ModelFile; public class ModelGen { public static ModelFile createOvergrown(DataGenContext ctx, BlockStateProvider prov, - ResourceLocation block, ResourceLocation overlay) { + ResourceLocation block, ResourceLocation overlay) { return createOvergrown(ctx, prov, block, block, block, overlay); } public static ModelFile createOvergrown(DataGenContext ctx, BlockStateProvider prov, - ResourceLocation side, ResourceLocation top, ResourceLocation bottom, ResourceLocation overlay) { + ResourceLocation side, ResourceLocation top, ResourceLocation bottom, ResourceLocation overlay) { return prov.models() - .withExistingParent(ctx.getName(), new ResourceLocation(Create.ID, "block/overgrown")) - .texture("particle", side) - .texture("side", side) - .texture("top", top) - .texture("bottom", bottom) - .texture("overlay", overlay); + .withExistingParent(ctx.getName(), new ResourceLocation(Create.ID, "block/overgrown")) + .texture("particle", side) + .texture("side", side) + .texture("top", top) + .texture("bottom", bottom) + .texture("overlay", overlay); } public static

NonNullFunction, P> oxidizedItemModel() { - return b -> b.model((ctx, prov) -> prov.withExistingParent(ctx.getName(), prov.modLoc(ModelGen.getOxidizedModel(ctx.getName(), 0)))).build(); + return b -> b + .model((ctx, prov) -> prov.withExistingParent(ctx.getName(), + prov.modLoc(ModelGen.getOxidizedModel(ctx.getName(), 0)))) + .build(); + } + + public static NonNullUnaryOperator> customItemModel() { + return b -> b.item() + .model(AssetLookup::customItemModel) + .build(); } public static String getOxidizedModel(String name, int level) { diff --git a/src/main/java/com/simibubi/create/modules/contraptions/base/KineticTileEntityRenderer.java b/src/main/java/com/simibubi/create/modules/contraptions/base/KineticTileEntityRenderer.java index 769ca648c..316d803f3 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/base/KineticTileEntityRenderer.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/base/KineticTileEntityRenderer.java @@ -15,6 +15,7 @@ import com.simibubi.create.modules.contraptions.relays.elementary.CogWheelBlock; import net.minecraft.block.BlockState; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.RenderTypeLookup; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.util.Direction.Axis; @@ -34,18 +35,20 @@ public class KineticTileEntityRenderer extends SafeTileEntityRenderer { - public EncasedFanBlock() { - super(Properties.from(Blocks.ANDESITE)); + public EncasedFanBlock(Properties properties) { + super(properties); } @Override diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/fan/EncasedFanTileEntityRenderer.java b/src/main/java/com/simibubi/create/modules/contraptions/components/fan/EncasedFanTileEntityRenderer.java index 4fb55c9c2..553939520 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/fan/EncasedFanTileEntityRenderer.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/fan/EncasedFanTileEntityRenderer.java @@ -28,7 +28,7 @@ public class EncasedFanTileEntityRenderer extends KineticTileEntityRenderer { Direction direction = te.getBlockState().get(FACING); SuperByteBuffer superBuffer = AllBlockPartials.SHAFT_HALF.renderOnDirectional(te.getBlockState(), direction.getOpposite()); - IVertexBuilder vb = buffer.getBuffer(RenderType.getSolid()); + IVertexBuilder vb = buffer.getBuffer(RenderType.getCutoutMipped()); standardKineticRotationTransform(superBuffer, te).renderInto(ms, vb); float time = AnimationTickHolder.getRenderTick(); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/fan/NozzleBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/fan/NozzleBlock.java index 1b55e6c5a..e83290a91 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/fan/NozzleBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/fan/NozzleBlock.java @@ -1,6 +1,6 @@ package com.simibubi.create.modules.contraptions.components.fan; -import com.simibubi.create.AllBlocks; +import com.simibubi.create.AllBlocksNew; import com.simibubi.create.foundation.block.ProperDirectionalBlock; import com.simibubi.create.foundation.utility.AllShapes; import com.simibubi.create.modules.contraptions.IWrenchable; @@ -22,7 +22,7 @@ import net.minecraft.world.World; public class NozzleBlock extends ProperDirectionalBlock implements IWrenchable { public NozzleBlock() { - super(Properties.from(AllBlocks.ENCASED_FAN.get())); + super(Properties.from(AllBlocksNew.ENCASED_FAN.get())); } @Override @@ -72,7 +72,7 @@ public class NozzleBlock extends ProperDirectionalBlock implements IWrenchable { public boolean isValidPosition(BlockState state, IWorldReader worldIn, BlockPos pos) { Direction towardsFan = state.get(FACING).getOpposite(); BlockState fanState = worldIn.getBlockState(pos.offset(towardsFan)); - return AllBlocks.ENCASED_FAN.typeOf(fanState) + return AllBlocksNew.ENCASED_FAN.has(fanState) && fanState.get(EncasedFanBlock.FACING) == towardsFan.getOpposite(); } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/waterwheel/WaterWheelBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/waterwheel/WaterWheelBlock.java index 6bd0b3719..1c467b864 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/waterwheel/WaterWheelBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/waterwheel/WaterWheelBlock.java @@ -1,14 +1,14 @@ package com.simibubi.create.modules.contraptions.components.waterwheel; -import com.simibubi.create.AllBlocks; +import com.simibubi.create.AllBlocksNew; import com.simibubi.create.config.AllConfigs; import com.simibubi.create.foundation.advancement.AllTriggers; import com.simibubi.create.foundation.block.ITE; import com.simibubi.create.foundation.utility.WrappedWorld; import com.simibubi.create.modules.contraptions.base.HorizontalKineticBlock; +import net.minecraft.block.BlockRenderType; import net.minecraft.block.BlockState; -import net.minecraft.block.Blocks; import net.minecraft.fluid.Fluids; import net.minecraft.fluid.IFluidState; import net.minecraft.item.BlockItemUseContext; @@ -25,8 +25,8 @@ import net.minecraft.world.World; public class WaterWheelBlock extends HorizontalKineticBlock implements ITE { - public WaterWheelBlock() { - super(Properties.from(Blocks.STRIPPED_SPRUCE_WOOD)); + public WaterWheelBlock(Properties properties) { + super(properties); } @Override @@ -34,22 +34,22 @@ public class WaterWheelBlock extends HorizontalKineticBlock implements ITE