diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 478b1896f..616d2aee9 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -147,7 +147,8 @@ jobs: CHANGELOG.txt - name: Update badge - uses: schneegans/dynamic-badges-action@v1.6.0 + continue-on-error: true + uses: schneegans/dynamic-badges-action@v1.7.0 with: auth: ${{ secrets.GIST_SECRET }} gistID: 3ef501bc64c896a86fd706dfea8ba367 diff --git a/expansion/src/main/generated/.cache/b71c44817acda374fc60c60d51d7f5eec540e17e b/expansion/src/main/generated/.cache/b71c44817acda374fc60c60d51d7f5eec540e17e index 7051cc6f2..a3c85e494 100644 --- a/expansion/src/main/generated/.cache/b71c44817acda374fc60c60d51d7f5eec540e17e +++ b/expansion/src/main/generated/.cache/b71c44817acda374fc60c60d51d7f5eec540e17e @@ -1,13 +1,13 @@ -// 1.20.1 2024-07-17T09:25:42.185311 Block States: projectred_expansion +// 1.20.1 2024-08-05T10:07:41.167181 Block States: projectred_expansion b697bf3bc54738e649092c6b88cbb4fd9b3da8a3 assets/projectred_expansion/blockstates/auto_crafter.json 1d92e2503aa76e8cf9e908f7afa248a291fcf387 assets/projectred_expansion/blockstates/battery_box.json 325a4ac57dbf6f6f049812d1442992b5f7368d21 assets/projectred_expansion/blockstates/block_breaker.json ac22e2b26c326b40d94951ed7a69b7b994f14aca assets/projectred_expansion/blockstates/charging_bench.json 2742c5200239a1933b73b45885d8d5fe0ec5ed3d assets/projectred_expansion/blockstates/deployer.json fe88677fa2e1cf270a91e8e1ac1f8b598786949f assets/projectred_expansion/blockstates/fire_starter.json -8a3420edbfb56d655cb85fd209b893aab7af3509 assets/projectred_expansion/blockstates/frame.json +e285658b615ec1141d09ddb523656ad8dcd0c634 assets/projectred_expansion/blockstates/frame.json 2ea35b8dcec2486da65f2464436c04aba36624b1 assets/projectred_expansion/blockstates/frame_actuator.json -8a3420edbfb56d655cb85fd209b893aab7af3509 assets/projectred_expansion/blockstates/frame_motor.json +da1694043a21b0b85aa2918f534786f5e0de0cb7 assets/projectred_expansion/blockstates/frame_motor.json 97acab0b18004d35a03674349f4c14542707ad66 assets/projectred_expansion/blockstates/project_bench.json 99538255fa8dddf3c50e280e1e4d9f7d3248231c assets/projectred_expansion/blockstates/transposer.json 37c0bb69db6a7bdf44866469f4d8e0a69d22d137 assets/projectred_expansion/models/block/auto_crafter.json @@ -33,7 +33,8 @@ d34961059b05c1caf2059ffba539b5ffc38c36a5 assets/projectred_expansion/models/bloc 9dbba6f59658244da05c4cdeaeb1691deef902d8 assets/projectred_expansion/models/block/frame_actuator.json 9130fd3156286ec9bcc1e958be94505d47cf1e36 assets/projectred_expansion/models/block/frame_actuator_state1.json 441616b7dbe0c0ec337ad807c7214514c45979dc assets/projectred_expansion/models/block/frame_actuator_state2.json -e528d8951b6212aff0082c9db8204f8b2c490fd4 assets/projectred_expansion/models/block/programmatically_rendered_block.json +176677c516b3203abbf46daed70cbcfcca83eab5 assets/projectred_expansion/models/block/frame_motor_programmatically_rendered.json +cf74edee7186e05fd24bd7fae56c2e23d1bd1de4 assets/projectred_expansion/models/block/frame_programmatically_rendered.json 645544cf14d5ca7f1577a11532a3321c06a51e18 assets/projectred_expansion/models/block/project_bench.json 17e1cc736c14625f137dbe9d5871e07d4eb85e73 assets/projectred_expansion/models/block/transposer.json 6bbf26b37dd2a946ced5c52327c3e4c860918566 assets/projectred_expansion/models/block/transposer_active.json diff --git a/expansion/src/main/generated/assets/projectred_expansion/blockstates/auto_crafter.json b/expansion/src/main/generated/assets/projectred_expansion/blockstates/auto_crafter.json index dd4b79ff2..01f2d098e 100644 --- a/expansion/src/main/generated/assets/projectred_expansion/blockstates/auto_crafter.json +++ b/expansion/src/main/generated/assets/projectred_expansion/blockstates/auto_crafter.json @@ -7,7 +7,7 @@ "model": "projectred_expansion:block/auto_crafter_state1" }, "charged=false,rotation=1,working=false": { - "model": "projectred_expansion:block/auto_crafter", + "model": "projectred_expansion:block/auto_crafter",ch "y": 90 }, "charged=false,rotation=1,working=true": { diff --git a/expansion/src/main/generated/assets/projectred_expansion/blockstates/frame.json b/expansion/src/main/generated/assets/projectred_expansion/blockstates/frame.json index b96f14235..5164d0d7e 100644 --- a/expansion/src/main/generated/assets/projectred_expansion/blockstates/frame.json +++ b/expansion/src/main/generated/assets/projectred_expansion/blockstates/frame.json @@ -1,7 +1,7 @@ { "variants": { "": { - "model": "projectred_expansion:block/programmatically_rendered_block" + "model": "projectred_expansion:block/frame_programmatically_rendered" } } } \ No newline at end of file diff --git a/expansion/src/main/generated/assets/projectred_expansion/blockstates/frame_motor.json b/expansion/src/main/generated/assets/projectred_expansion/blockstates/frame_motor.json index b96f14235..ca40c7631 100644 --- a/expansion/src/main/generated/assets/projectred_expansion/blockstates/frame_motor.json +++ b/expansion/src/main/generated/assets/projectred_expansion/blockstates/frame_motor.json @@ -1,7 +1,7 @@ { "variants": { "": { - "model": "projectred_expansion:block/programmatically_rendered_block" + "model": "projectred_expansion:block/frame_motor_programmatically_rendered" } } } \ No newline at end of file diff --git a/expansion/src/main/generated/assets/projectred_expansion/models/block/frame_motor_programmatically_rendered.json b/expansion/src/main/generated/assets/projectred_expansion/models/block/frame_motor_programmatically_rendered.json new file mode 100644 index 000000000..198e4d0da --- /dev/null +++ b/expansion/src/main/generated/assets/projectred_expansion/models/block/frame_motor_programmatically_rendered.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "projectred_expansion:block/frame_motor_top" + } +} \ No newline at end of file diff --git a/expansion/src/main/generated/assets/projectred_expansion/models/block/frame_programmatically_rendered.json b/expansion/src/main/generated/assets/projectred_expansion/models/block/frame_programmatically_rendered.json new file mode 100644 index 000000000..1c699b71e --- /dev/null +++ b/expansion/src/main/generated/assets/projectred_expansion/models/block/frame_programmatically_rendered.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "projectred_expansion:block/frame" + } +} \ No newline at end of file diff --git a/expansion/src/main/generated/assets/projectred_expansion/models/block/programmatically_rendered_block.json b/expansion/src/main/generated/assets/projectred_expansion/models/block/programmatically_rendered_block.json deleted file mode 100644 index c4c69a16a..000000000 --- a/expansion/src/main/generated/assets/projectred_expansion/models/block/programmatically_rendered_block.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "minecraft:block/block" -} \ No newline at end of file diff --git a/expansion/src/main/java/mrtjp/projectred/expansion/block/FrameBlock.java b/expansion/src/main/java/mrtjp/projectred/expansion/block/FrameBlock.java index a14c44eef..97888b08a 100644 --- a/expansion/src/main/java/mrtjp/projectred/expansion/block/FrameBlock.java +++ b/expansion/src/main/java/mrtjp/projectred/expansion/block/FrameBlock.java @@ -1,14 +1,12 @@ package mrtjp.projectred.expansion.block; import codechicken.lib.raytracer.VoxelShapeCache; -import codechicken.lib.render.particle.CustomParticleHandler; import codechicken.lib.vec.*; import com.google.common.collect.ImmutableSet; import mrtjp.projectred.api.Frame; import mrtjp.projectred.expansion.client.FrameModelRenderer; import mrtjp.projectred.expansion.client.FrameModelVerts; import mrtjp.projectred.lib.ModelVoxelShape; -import net.minecraft.client.particle.ParticleEngine; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.level.BlockGetter; @@ -18,18 +16,13 @@ import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.MapColor; -import net.minecraft.world.phys.BlockHitResult; -import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import net.minecraftforge.client.extensions.common.IClientBlockExtensions; import net.minecraftforge.fml.DistExecutor; -import java.util.Collections; import java.util.LinkedList; import java.util.List; -import java.util.function.Consumer; public class FrameBlock extends Block implements Frame { @@ -43,36 +36,6 @@ public FrameBlock() { .dynamicShape()); // To prevent early caching before modelVerts can be loaded } - @Override - public void initializeClient(Consumer consumer) { - consumer.accept(new IClientBlockExtensions() { - @Override - public boolean addHitEffects(BlockState state, Level level, HitResult hit, ParticleEngine engine) { - if (!(hit instanceof BlockHitResult blockHit)) { - return false; - } - CustomParticleHandler.addBlockHitEffects( - level, - Cuboid6.full.copy().add(blockHit.getBlockPos()), - blockHit.getDirection(), - FrameModelRenderer.getFrameIcon(), - engine - ); - return true; - } - - @Override - public boolean addDestroyEffects(BlockState state, Level level, BlockPos pos, ParticleEngine engine) { - CustomParticleHandler.addBlockDestroyEffects( - level, - Cuboid6.full.copy().add(pos), - Collections.singletonList(FrameModelRenderer.getFrameIcon()), - engine); - return true; - } - }); - } - //region Frame @Override public boolean canGrab(Level w, BlockPos pos, Direction side) { diff --git a/expansion/src/main/java/mrtjp/projectred/expansion/block/FrameMotorBlock.java b/expansion/src/main/java/mrtjp/projectred/expansion/block/FrameMotorBlock.java index 718c21f2c..4290a4502 100644 --- a/expansion/src/main/java/mrtjp/projectred/expansion/block/FrameMotorBlock.java +++ b/expansion/src/main/java/mrtjp/projectred/expansion/block/FrameMotorBlock.java @@ -1,63 +1,24 @@ package mrtjp.projectred.expansion.block; -import codechicken.lib.render.particle.CustomParticleHandler; -import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Rotation; import mrtjp.projectred.core.block.ProjectRedBlock; -import mrtjp.projectred.expansion.client.FrameMotorBlockRenderer; import mrtjp.projectred.expansion.init.ExpansionBlocks; import mrtjp.projectred.expansion.tile.FrameMotorTile; -import net.minecraft.client.particle.ParticleEngine; import net.minecraft.core.BlockPos; import net.minecraft.world.item.context.BlockPlaceContext; -import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; -import net.minecraft.world.phys.BlockHitResult; -import net.minecraft.world.phys.HitResult; -import net.minecraftforge.client.extensions.common.IClientBlockExtensions; import org.jetbrains.annotations.Nullable; -import java.util.Collections; -import java.util.function.Consumer; - public class FrameMotorBlock extends ProjectRedBlock { public FrameMotorBlock() { super(STONE_PROPERTIES); } - @Override - public void initializeClient(Consumer consumer) { - consumer.accept(new IClientBlockExtensions() { - @Override - public boolean addHitEffects(BlockState state, Level level, HitResult hit, ParticleEngine engine) { - if (!(hit instanceof BlockHitResult blockHit)) return false; - CustomParticleHandler.addBlockHitEffects( - level, - Cuboid6.full.copy().add(blockHit.getBlockPos()), - blockHit.getDirection(), - FrameMotorBlockRenderer.getParticleIcon(state, blockHit.getDirection().ordinal()), - engine - ); - return true; - } - - @Override - public boolean addDestroyEffects(BlockState state, Level level, BlockPos pos, ParticleEngine engine) { - CustomParticleHandler.addBlockDestroyEffects( - level, - Cuboid6.full.copy().add(pos), - Collections.singletonList(FrameMotorBlockRenderer.getParticleIcon(state, 0)), - engine); - return true; - } - }); - } - @Nullable @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { diff --git a/expansion/src/main/java/mrtjp/projectred/expansion/data/ExpansionBlockStateModelProvider.java b/expansion/src/main/java/mrtjp/projectred/expansion/data/ExpansionBlockStateModelProvider.java index a94b0092b..960d4ec14 100644 --- a/expansion/src/main/java/mrtjp/projectred/expansion/data/ExpansionBlockStateModelProvider.java +++ b/expansion/src/main/java/mrtjp/projectred/expansion/data/ExpansionBlockStateModelProvider.java @@ -36,10 +36,18 @@ protected void registerStatesAndModels() { addSideAndTopActiveModel(BLOCK_BREAKER_BLOCK.get()); addSidedOppositeMatchingFacesDeviceBlock(DEPLOYER_BLOCK.get()); - // Advanced models rendered programmatically. Tied to dummy model to suppress warnings. - ModelFile dummy = models().withExistingParent("programmatically_rendered_block", "block"); - simpleBlock(FRAME_BLOCK.get(), dummy); - simpleBlock(FRAME_MOTOR_BLOCK.get(), dummy); + // Advanced models rendered programmatically. Only Particle info provided by model file + addProgrammaticWithParticleTexture(FRAME_BLOCK.get(), ""); + addProgrammaticWithParticleTexture(FRAME_MOTOR_BLOCK.get(), "_top"); + } + + private void addProgrammaticWithParticleTexture(Block block, String texSuffix) { + String blockName = ForgeRegistries.BLOCKS.getKey(block).getPath(); + String texName = blockName + texSuffix; + ModelFile dummy = models() + .withExistingParent(blockName + "_programmatically_rendered", "block") + .texture("particle", "block/" + texName); + simpleBlock(block, dummy); } private void addRotatableOppositeMatchingFacesBlock(Block block) { diff --git a/exploration/src/main/java/mrtjp/projectred/exploration/world/gen/MarbleCaveWorldCarver.java b/exploration/src/main/java/mrtjp/projectred/exploration/world/gen/MarbleCaveWorldCarver.java index 9bd54705b..5e6579305 100644 --- a/exploration/src/main/java/mrtjp/projectred/exploration/world/gen/MarbleCaveWorldCarver.java +++ b/exploration/src/main/java/mrtjp/projectred/exploration/world/gen/MarbleCaveWorldCarver.java @@ -27,8 +27,12 @@ public MarbleCaveWorldCarver(Codec codec) { @Override protected boolean canReplaceBlock(CaveCarverConfiguration pConfig, BlockState pState) { - // We must be able to carve the target wall type since we fill around every carved block - return super.canReplaceBlock(pConfig, pState) || pState.is(MARBLE_BLOCK.get()); + // We must be able to carve the target wall type since we fill around every carved block. + // + // Air check is workaround for mods improperly adding air block tags to minecraft:overworld_carver_replaceables + // which causes marble caves to generate in the sky. + // https://github.com/MrTJP/ProjectRed/issues/1874 + return !pState.isAir() && (super.canReplaceBlock(pConfig, pState) || pState.is(MARBLE_BLOCK.get())); } @Override diff --git a/fabrication/src/main/java/mrtjp/projectred/fabrication/engine/gates/MultiplexerGateTile.java b/fabrication/src/main/java/mrtjp/projectred/fabrication/engine/gates/MultiplexerGateTile.java index bb6f59c75..3a704893c 100644 --- a/fabrication/src/main/java/mrtjp/projectred/fabrication/engine/gates/MultiplexerGateTile.java +++ b/fabrication/src/main/java/mrtjp/projectred/fabrication/engine/gates/MultiplexerGateTile.java @@ -29,13 +29,13 @@ public static class MultiplexerGate implements ICGate { @Override public void compute(ICSimulation ic, int[] inputs, int[] outputs) { - boolean in0 = ic.getRegByteVal(inputs[0]) != 0; - boolean in1 = ic.getRegByteVal(inputs[1]) != 0; - boolean in2 = ic.getRegByteVal(inputs[2]) != 0; + boolean in0 = ic.getRegByteVal(inputs[0]) != 0; // Right + boolean in1 = ic.getRegByteVal(inputs[1]) != 0; // Bottom + boolean in2 = ic.getRegByteVal(inputs[2]) != 0; // Left - ic.queueRegByteVal(outputs[0], in0 ? - (byte) (in1 ? 1 : 0) : - (byte) (in2 ? 1 : 0)); + ic.queueRegByteVal(outputs[0], in1 ? + (byte) (in2 ? 1 : 0) : + (byte) (in0 ? 1 : 0)); } } }