diff --git a/game/client/src/main/java/net/minecraft/client/render/block/model/BlockModelWireRedstone.java b/game/client/src/main/java/net/minecraft/client/render/block/model/BlockModelWireRedstone.java index 1598a4d1e..739f76c45 100644 --- a/game/client/src/main/java/net/minecraft/client/render/block/model/BlockModelWireRedstone.java +++ b/game/client/src/main/java/net/minecraft/client/render/block/model/BlockModelWireRedstone.java @@ -4,9 +4,7 @@ import net.minecraft.client.render.tessellator.TessellatorGeneral; import net.minecraft.client.render.texture.stitcher.IconCoordinate; import net.minecraft.client.render.texture.stitcher.TextureRegistry; import net.minecraft.client.util.helper.Colors; -import net.minecraft.core.block.Block; -import net.minecraft.core.block.BlockLogic; -import net.minecraft.core.block.BlockLogicWireRedstone; +import net.minecraft.core.block.*; import net.minecraft.core.enums.LightLayer; import net.minecraft.core.util.helper.Color; import net.minecraft.core.util.helper.Side; @@ -15,6 +13,8 @@ import net.minecraft.core.world.pos.TilePos; import net.minecraft.core.world.pos.TilePosc; import org.jetbrains.annotations.NotNull; +import static net.minecraft.core.block.BlockLogicWireRedstone.isClimbableWall; + public class BlockModelWireRedstone extends BlockModelStandard { protected final IconCoordinate wireStraight = TextureRegistry.getTexture("minecraft:block/wire_redstone_straight"); protected final IconCoordinate wireCross = TextureRegistry.getTexture("minecraft:block/wire_redstone_cross"); @@ -40,30 +40,30 @@ public class BlockModelWireRedstone extends BlockModelStan TilePos queryPos = new TilePos(); - tessellator.setLightmapCoord2i(worldSource.getSavedLightValue(LightLayer.Sky, tilePos), Math.max(worldSource.getSavedLightValue(LightLayer.Block, tilePos), meta & 0xF)); + tessellator.setLightmapCoord2i(Math.max(worldSource.getSavedLightValue(LightLayer.Block, tilePos), meta & 0xF), worldSource.getSavedLightValue(LightLayer.Sky, tilePos)); tessellator.setColorOpaque3f(red, green, blue); - boolean west = BlockLogicWireRedstone.shouldConnectTo(worldSource, tilePos.west(queryPos), Side.WEST) || !worldSource.isBlockNormalCube(tilePos.west(queryPos)) && BlockLogicWireRedstone.shouldConnectToDiagonal(worldSource, tilePos.add(-1, -1, 0, queryPos), Side.NONE, Side.BOTTOM); - boolean east = BlockLogicWireRedstone.shouldConnectTo(worldSource, tilePos.east(queryPos), Side.EAST) || !worldSource.isBlockNormalCube(tilePos.east(queryPos)) && BlockLogicWireRedstone.shouldConnectToDiagonal(worldSource, tilePos.add(1, -1, 0, queryPos), Side.NONE, Side.BOTTOM); - boolean north = BlockLogicWireRedstone.shouldConnectTo(worldSource, tilePos.north(queryPos), Side.NORTH) || !worldSource.isBlockNormalCube(tilePos.north(queryPos)) && BlockLogicWireRedstone.shouldConnectToDiagonal(worldSource, tilePos.add(0, -1, -1, queryPos), Side.NONE, Side.BOTTOM); - boolean south = BlockLogicWireRedstone.shouldConnectTo(worldSource, tilePos.south(queryPos), Side.SOUTH) || !worldSource.isBlockNormalCube(tilePos.south(queryPos)) && BlockLogicWireRedstone.shouldConnectToDiagonal(worldSource, tilePos.add(0, -1, 1, queryPos), Side.NONE, Side.BOTTOM); + boolean west = BlockLogicWireRedstone.shouldConnectTo(worldSource, tilePos.west(queryPos), Side.WEST) || !isClimbableWall(worldSource, tilePos.west(queryPos), Side.WEST) && BlockLogicWireRedstone.shouldConnectToDiagonal(worldSource, tilePos.add(-1, -1, 0, queryPos), Side.WEST, Side.BOTTOM); + boolean east = BlockLogicWireRedstone.shouldConnectTo(worldSource, tilePos.east(queryPos), Side.EAST) || !isClimbableWall(worldSource, tilePos.east(queryPos), Side.EAST) && BlockLogicWireRedstone.shouldConnectToDiagonal(worldSource, tilePos.add(1, -1, 0, queryPos), Side.EAST, Side.BOTTOM); + boolean north = BlockLogicWireRedstone.shouldConnectTo(worldSource, tilePos.north(queryPos), Side.NORTH) || !isClimbableWall(worldSource, tilePos.north(queryPos), Side.NORTH) && BlockLogicWireRedstone.shouldConnectToDiagonal(worldSource, tilePos.add(0, -1, -1, queryPos), Side.NORTH, Side.BOTTOM); + boolean south = BlockLogicWireRedstone.shouldConnectTo(worldSource, tilePos.south(queryPos), Side.SOUTH) || !isClimbableWall(worldSource, tilePos.south(queryPos), Side.SOUTH) && BlockLogicWireRedstone.shouldConnectToDiagonal(worldSource, tilePos.add(0, -1, 1, queryPos), Side.SOUTH, Side.BOTTOM); boolean westUp = false; boolean eastUp = false; boolean northUp = false; boolean southUp = false; if (!worldSource.isBlockOpaqueCube(tilePos.up(queryPos))) { - if (worldSource.isBlockNormalCube(tilePos.west(queryPos)) && BlockLogicWireRedstone.shouldConnectToDiagonal(worldSource, tilePos.add(-1, 1, 0, queryPos), Side.NONE, Side.TOP)) { + if (BlockLogicWireRedstone.shouldConnectToDiagonal(worldSource, tilePos.add(-1, 1, 0, queryPos), Side.WEST, Side.TOP)) { west = true; westUp = true; } - if (worldSource.isBlockNormalCube(tilePos.east(queryPos)) && BlockLogicWireRedstone.shouldConnectToDiagonal(worldSource, tilePos.add(1, 1, 0, queryPos), Side.NONE, Side.TOP)) { + if (BlockLogicWireRedstone.shouldConnectToDiagonal(worldSource, tilePos.add(1, 1, 0, queryPos), Side.EAST, Side.TOP)) { east = true; eastUp = true; } - if (worldSource.isBlockNormalCube(tilePos.north(queryPos)) && BlockLogicWireRedstone.shouldConnectToDiagonal(worldSource, tilePos.add(0, 1, -1, queryPos), Side.NONE, Side.TOP)) { + if (BlockLogicWireRedstone.shouldConnectToDiagonal(worldSource, tilePos.add(0, 1, -1, queryPos), Side.NORTH, Side.TOP)) { north = true; northUp = true; } - if (worldSource.isBlockNormalCube(tilePos.south(queryPos)) && BlockLogicWireRedstone.shouldConnectToDiagonal(worldSource, tilePos.add(0, 1, 1, queryPos), Side.NONE, Side.TOP)) { + if (BlockLogicWireRedstone.shouldConnectToDiagonal(worldSource, tilePos.add(0, 1, 1, queryPos), Side.SOUTH, Side.TOP)) { south = true; southUp = true; } diff --git a/game/client/src/main/resources/assets/minecraft/textures/block/rubyglass/block.emiss.png b/game/client/src/main/resources/assets/minecraft/textures/block/rubyglass/block.emiss.png index bd13a0e2f..3bb31a38f 100644 Binary files a/game/client/src/main/resources/assets/minecraft/textures/block/rubyglass/block.emiss.png and b/game/client/src/main/resources/assets/minecraft/textures/block/rubyglass/block.emiss.png differ diff --git a/game/client/src/main/resources/assets/minecraft/textures/block/rubyglass/block.emiss.png.mcmeta b/game/client/src/main/resources/assets/minecraft/textures/block/rubyglass/block.emiss.png.mcmeta deleted file mode 100644 index 394983571..000000000 --- a/game/client/src/main/resources/assets/minecraft/textures/block/rubyglass/block.emiss.png.mcmeta +++ /dev/null @@ -1,19 +0,0 @@ -{ - "animation": { - "frametime": 1, - "frames": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11 - ] - } -} \ No newline at end of file diff --git a/game/client/src/main/resources/assets/minecraft/textures/block/rubyglass/block_pure.emiss.png b/game/client/src/main/resources/assets/minecraft/textures/block/rubyglass/block_pure.emiss.png index bd13a0e2f..ac0c8dc15 100644 Binary files a/game/client/src/main/resources/assets/minecraft/textures/block/rubyglass/block_pure.emiss.png and b/game/client/src/main/resources/assets/minecraft/textures/block/rubyglass/block_pure.emiss.png differ diff --git a/game/core/src/main/java/net/minecraft/core/block/BlockLogicWireRedstone.java b/game/core/src/main/java/net/minecraft/core/block/BlockLogicWireRedstone.java index ba5f48c33..149ddad2f 100644 --- a/game/core/src/main/java/net/minecraft/core/block/BlockLogicWireRedstone.java +++ b/game/core/src/main/java/net/minecraft/core/block/BlockLogicWireRedstone.java @@ -314,37 +314,33 @@ public class BlockLogicWireRedstone extends BlockLogic implements ISupportable { TilePos queryPos = new TilePos(); boolean negXShouldConnectTo = shouldConnectTo(source, tilePos.add(-1, 0, 0, queryPos), Side.WEST) || - !source.isBlockNormalCube(tilePos.add(-1, 0, 0, queryPos)) && - shouldConnectToDiagonal(source, tilePos.add(-1, -1, 0, queryPos), Side.NONE, Side.BOTTOM); + shouldConnectToDiagonal(source, tilePos.add(-1, -1, 0, queryPos), Side.WEST, Side.BOTTOM); boolean posXShouldConnectTo = shouldConnectTo(source, tilePos.add(1, 0, 0, queryPos), Side.EAST) || - !source.isBlockNormalCube(tilePos.add(1, 0, 0, queryPos)) && - shouldConnectToDiagonal(source, tilePos.add(1, -1, 0, queryPos), Side.NONE, Side.BOTTOM); + shouldConnectToDiagonal(source, tilePos.add(1, -1, 0, queryPos), Side.EAST, Side.BOTTOM); boolean negZShouldConnectTo = shouldConnectTo(source, tilePos.add(0, 0, -1, queryPos), Side.NORTH) || - !source.isBlockNormalCube(tilePos.add(0, 0, -1, queryPos)) && - shouldConnectToDiagonal(source, tilePos.add(0, -1, -1, queryPos), Side.NONE, Side.BOTTOM); + shouldConnectToDiagonal(source, tilePos.add(0, -1, -1, queryPos), Side.NORTH, Side.BOTTOM); boolean posZShouldConnectTo = shouldConnectTo(source, tilePos.add(0, 0, 1, queryPos), Side.SOUTH) || - !source.isBlockNormalCube(tilePos.add(0, 0, 1, queryPos)) && - shouldConnectToDiagonal(source, tilePos.add(0, -1, 1, queryPos), Side.NONE, Side.BOTTOM); + shouldConnectToDiagonal(source, tilePos.add(0, -1, 1, queryPos), Side.SOUTH, Side.BOTTOM); if (!source.isBlockNormalCube(tilePos.up(queryPos))) { - if (source.isBlockNormalCube(tilePos.add(-1, 0, 0, queryPos)) && shouldConnectToDiagonal(source, tilePos.add(-1, 1, 0, queryPos), Side.NONE, Side.TOP)) { - negXShouldConnectTo = true; - } - if (source.isBlockNormalCube(tilePos.add(1, 0, 0, queryPos)) && shouldConnectToDiagonal(source, tilePos.add(-1, 1, 0, queryPos), Side.NONE, Side.TOP)) { - posXShouldConnectTo = true; - } - if (source.isBlockNormalCube(tilePos.add(0, 0, -1, queryPos)) && shouldConnectToDiagonal(source, tilePos.add(-1, 1, 0, queryPos), Side.NONE, Side.TOP)) { - negZShouldConnectTo = true; - } - if (source.isBlockNormalCube(tilePos.add(0, 0, 1, queryPos)) && shouldConnectToDiagonal(source, tilePos.add(-1, 1, 0, queryPos), Side.NONE, Side.TOP)) { - posZShouldConnectTo = true; - } + if (isClimbableWall(source, tilePos.add(-1, 0, 0, queryPos), Side.WEST) && + shouldConnectToDiagonal(source, tilePos.add(-1, 1, 0, queryPos), Side.WEST, Side.TOP)) + {negXShouldConnectTo = true;} + if (isClimbableWall(source, tilePos.add(1, 0, 0, queryPos), Side.EAST) && + shouldConnectToDiagonal(source, tilePos.add(1, 1, 0, queryPos), Side.EAST, Side.TOP)) + {posXShouldConnectTo = true;} + if (isClimbableWall(source, tilePos.add(0, 0, -1, queryPos), Side.NORTH) && + shouldConnectToDiagonal(source, tilePos.add(0, 1, -1, queryPos), Side.NORTH, Side.TOP)) + {negZShouldConnectTo = true;} + if (isClimbableWall(source, tilePos.add(0, 0, 1, queryPos), Side.SOUTH) && + shouldConnectToDiagonal(source, tilePos.add(0, 1, 1, queryPos), Side.SOUTH, Side.TOP)) + {posZShouldConnectTo = true;} } // Make wire emit block updates when a redirection happens if (source instanceof World world) { @@ -436,7 +432,102 @@ public class BlockLogicWireRedstone extends BlockLogic implements ISupportable { if (!(side2 == Side.TOP || side2 == Side.BOTTOM)) return false; // Maybe some can generate a connection if placed below a block in the future? - return worldSource.getBlockType(tilePos) == Blocks.WIRE_REDSTONE; + if (worldSource.getBlockType(tilePos) != Blocks.WIRE_REDSTONE) { + return false; + } + + // Most of the code below is relevant to fixing the visual behavior + // of diagonal connections on both transparent and non-transparent blocks + // (now that it is done get me out of this class :) I don't want to touch it again) + + if (side2 == Side.BOTTOM) { + //top wire looking down at bottom + if (side1 != Side.NONE) { + TilePos wallTilePos = new TilePos(tilePos).add(side1.getOpposite()); + if (isBlockingConduit(worldSource, wallTilePos, side1)) return false; + + //transparent diagonal connection + if (!isSolidWallForWire(worldSource, wallTilePos, side1)) { + int bottomPower = worldSource.getBlockData(tilePos) & MASK_POWER; + TilePos topWirePos = new TilePos(wallTilePos).up(); + int topPower = worldSource.getBlockType(topWirePos) == Blocks.WIRE_REDSTONE ? worldSource.getBlockData(topWirePos) & MASK_POWER : 0; + + //connect if top is unpowered, OR if bottom has ANY power + return topPower == 0 || bottomPower > 0; + } + } else { + //fallback + for (Side fSide : new Side[]{Side.NORTH, Side.SOUTH, Side.EAST, Side.WEST}) { + TilePos wallTilePos = new TilePos(tilePos).add(fSide.getOpposite()); + if (worldSource.getBlockType(new TilePos(wallTilePos).up()) == Blocks.WIRE_REDSTONE) { + if (isBlockingConduit(worldSource, wallTilePos, fSide)) return false; + + if (!isSolidWallForWire(worldSource, wallTilePos, fSide)) { + int bottomPower = worldSource.getBlockData(tilePos) & MASK_POWER; + TilePos topWirePos = new TilePos(wallTilePos).up(); + int topPower = worldSource.getBlockData(topWirePos) & MASK_POWER; + + //connect if top is unpowered, OR if bottom has ANY power + if (!(topPower == 0 || bottomPower > 0)) return false; + } + } + } + } + } else { + //bottom wire is looking up at top + TilePos wallTilePos = new TilePos(tilePos).down(); + if (side1 != Side.NONE) { + if (isBlockingConduit(worldSource, wallTilePos, side1.getOpposite())) return false; + + //transparent diagonal connection + if (!isSolidWallForWire(worldSource, wallTilePos, side1.getOpposite())) { + TilePos bottomWireTilePos = new TilePos(wallTilePos).add(side1.getOpposite()); + int bottomPower = worldSource.getBlockData(bottomWireTilePos) & MASK_POWER; + int topPower = worldSource.getBlockData(tilePos) & MASK_POWER; + + //connect if top is unpowered, OR if bottom has ANY power + return topPower == 0 || bottomPower > 0; + } + + } else { + //fallback + for (Side fSide : new Side[]{Side.NORTH, Side.SOUTH, Side.EAST, Side.WEST}) { + TilePos bottomWirePos = new TilePos(wallTilePos).add(fSide); + if (worldSource.getBlockType(bottomWirePos) == Blocks.WIRE_REDSTONE) { + if (isBlockingConduit(worldSource, wallTilePos, fSide)) return false; + + if (!isSolidWallForWire(worldSource, wallTilePos, fSide)) { + int bottomPower = worldSource.getBlockData(bottomWirePos) & MASK_POWER; + int topPower = worldSource.getBlockData(tilePos) & MASK_POWER; + + //connect if top is unpowered, OR if bottom has ANY power + if (!(topPower == 0 || bottomPower > 0)) return false; + } + } + } + } + } + + return true; + } + + /** Helper to determine if a block acts as a solid cube for redstone climbing.
**/ + private static boolean isSolidWallForWire(@NotNull WorldSource world, @NotNull TilePos pos, @NotNull Side faceToCheck) { + if (world.isBlockNormalCube(pos)) return true; + //leave separate + return false; + } + + private static boolean isBlockingConduit(@NotNull WorldSource world, @NotNull TilePos pos, @NotNull Side openSide) { + //leave in preparation of conduit logic + return false; + } + + /** Determines if redstone dust is allowed to visually climb the side of a block. **/ + public static boolean isClimbableWall(@NotNull WorldSource world, @NotNull TilePos wallTilePos, @NotNull Side directionToWall) { + if (world.isBlockNormalCube(wallTilePos)) return true; + //leave separate + return false; } @Override diff --git a/game/core/src/main/java/net/minecraft/core/block/Blocks.java b/game/core/src/main/java/net/minecraft/core/block/Blocks.java index e209d4c4c..d1594da1b 100644 --- a/game/core/src/main/java/net/minecraft/core/block/Blocks.java +++ b/game/core/src/main/java/net/minecraft/core/block/Blocks.java @@ -1131,7 +1131,7 @@ public final class Blocks { .withTags(BlockTags.MINEABLE_BY_PICKAXE); public static final Block RUBYGLASS_COLUMN = register("rubyglass.column", "minecraft:block/rubyglass_column", 821, (b) -> new BlockLogicRubyglass(b)) - .withSound(BlockSounds.GLASS).withHardness(3F).withLightEmission(0.5F) + .withSound(BlockSounds.GLASS).withHardness(3F).withLightEmission(0.1F).withLightBlock(0) .withTags(BlockTags.MINEABLE_BY_PICKAXE) .withOverrideColor(MaterialColor.rubyglass); public static final Block BLOCK_RUBYGLASS = register("block.rubyglass", "minecraft:block/block_rubyglass", 822, (b) -> new BlockLogicTransparent(b, Materials.STONE)) @@ -1148,7 +1148,7 @@ public final class Blocks { .withOverrideColor(MaterialColor.rubyglass); public static final Block RUBYGLASS_NODE = register("rubyglass.node", "minecraft:block/rubyglass_node", 826, (b) -> new BlockLogicOreRubyglass(b)) - .withSound(BlockSounds.GLASS).withHardness(3F).withLightEmission(0.5F) + .withSound(BlockSounds.GLASS).withHardness(3F).withLightEmission(1.0F) .withTags(BlockTags.MINEABLE_BY_PICKAXE) .withOverrideColor(MaterialColor.rubyglass); diff --git a/game/core/src/main/java/net/minecraft/core/current/wire/WireHandler.java b/game/core/src/main/java/net/minecraft/core/current/wire/WireHandler.java index ccc694224..6884d9b05 100644 --- a/game/core/src/main/java/net/minecraft/core/current/wire/WireHandler.java +++ b/game/core/src/main/java/net/minecraft/core/current/wire/WireHandler.java @@ -5,6 +5,7 @@ import net.minecraft.core.block.Block; import net.minecraft.core.block.Blocks; import net.minecraft.core.current.util.BlockState; import net.minecraft.core.util.helper.Direction; +import net.minecraft.core.util.helper.Side; import net.minecraft.core.world.World; import net.minecraft.core.world.pos.TilePos; import net.minecraft.core.world.pos.TilePosc; @@ -740,20 +741,49 @@ public class WireHandler { * components and update the virtual power accordingly. */ private void findExternalPower(WireNode wire) { - // If the wire is removed or going to break, its power level should always be - // the minimum value. Thus external power need not be computed. - // In other cases external power need only be computed once. - if (wire.removed || wire.shouldBreak || wire.externalPower >= POWER_MIN) { + if (wire.removed || wire.shouldBreak || wire.externalPower >= POWER_MAX) { return; } - wire.externalPower = hasExternalPower(wire) ? BlockLogicWireRedstone.SIGNAL_MAX : BlockLogicWireRedstone.SIGNAL_MIN; + int maxExternalPower = POWER_MIN; + + for (int iDir = 0; iDir < Directions.ALL.length; iDir++) { + Node neighboringNode = getNeighbor(wire, iDir); + + if (neighboringNode.isWire()) { + continue; + } + + if (neighboringNode.isConductor() && hasDirectSignalTo(wire, neighboringNode, Directions.iOpposite(iDir))) { + maxExternalPower = POWER_MAX; + } + if (neighboringNode.isSignalSource() && neighboringNode.state.hasSignal(this.world, neighboringNode.pos, Directions.ALL[iDir])) { + maxExternalPower = POWER_MAX; + } + } + + wire.externalPower = maxExternalPower; if (wire.externalPower > wire.virtualPower) { wire.virtualPower = wire.externalPower; } } + private static @NotNull Side getSideFromDirection(int iDirection) { + Side wireSide = Side.NONE; + wireSide = switch (iDirection) { + case Directions.WEST -> Side.WEST; + case Directions.NORTH -> Side.NORTH; + case Directions.EAST -> Side.EAST; + case Directions.SOUTH -> Side.SOUTH; + case Directions.DOWN -> Side.BOTTOM; + case Directions.UP -> Side.TOP; + default -> wireSide; + }; + + return wireSide.getOpposite(); + } + /** * Determine whether the given wire receives a redstone signal from non-wire * components. diff --git a/game/core/src/main/java/net/minecraft/core/world/pos/TilePos.java b/game/core/src/main/java/net/minecraft/core/world/pos/TilePos.java index fac414c07..aedd08e22 100644 --- a/game/core/src/main/java/net/minecraft/core/world/pos/TilePos.java +++ b/game/core/src/main/java/net/minecraft/core/world/pos/TilePos.java @@ -4,6 +4,7 @@ import net.minecraft.core.entity.Entity; import net.minecraft.core.util.helper.Axis; import net.minecraft.core.util.helper.Direction; import net.minecraft.core.util.helper.MathHelper; +import net.minecraft.core.util.helper.Side; import net.minecraft.core.world.World; import net.minecraft.core.world.WorldSource; import net.minecraft.core.world.chunk.Chunk; @@ -136,6 +137,10 @@ public final class TilePos implements Externalizable, Cloneable, TilePosc { return add(dir.getOffsetX(), dir.getOffsetY(), dir.getOffsetZ(), dest); } + public @NotNull TilePos add(@NotNull Side side, @NotNull TilePos dest) { + return add(side.getOffsetX(), side.getOffsetY(), side.getOffsetZ(), dest); + } + public @NotNull TilePos add(int x, int y, int z) { return add(x, y, z, this); } @@ -148,6 +153,10 @@ public final class TilePos implements Externalizable, Cloneable, TilePosc { return add(dir, this); } + public @NotNull TilePos add(@NotNull Side side) { + return add(side, this); + } + @Override public @NotNull TilePos sub(int x, int y, int z, @NotNull TilePos dest) { return dest.set(this.x - x, this.y - y, this.z - z); @@ -163,6 +172,11 @@ public final class TilePos implements Externalizable, Cloneable, TilePosc { return sub(dir.getOffsetX(), dir.getOffsetY(), dir.getOffsetZ(), dest); } + @Override + public @NotNull TilePos sub(@NotNull Side side, @NotNull TilePos dest) { + return sub(side.getOffsetX(), side.getOffsetY(), side.getOffsetZ(), dest); + } + public @NotNull TilePos sub(int x, int y, int z) { return sub(x, y, z, this); } @@ -175,6 +189,10 @@ public final class TilePos implements Externalizable, Cloneable, TilePosc { return sub(dir, this); } + public @NotNull TilePos sub(@NotNull Side side) { + return sub(side, this); + } + @Override public double distance(@NotNull TilePosc pos) { return distance(pos.x(), pos.y(), pos.z()); diff --git a/game/core/src/main/java/net/minecraft/core/world/pos/TilePosc.java b/game/core/src/main/java/net/minecraft/core/world/pos/TilePosc.java index 20df452a5..d700240a4 100644 --- a/game/core/src/main/java/net/minecraft/core/world/pos/TilePosc.java +++ b/game/core/src/main/java/net/minecraft/core/world/pos/TilePosc.java @@ -3,6 +3,7 @@ package net.minecraft.core.world.pos; import net.minecraft.core.entity.Entity; import net.minecraft.core.util.helper.Axis; import net.minecraft.core.util.helper.Direction; +import net.minecraft.core.util.helper.Side; import net.minecraft.core.world.WorldSource; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -31,12 +32,16 @@ public interface TilePosc { @NotNull TilePos add(@NotNull Direction dir, @NotNull TilePos dest); + @NotNull TilePos add(@NotNull Side side, @NotNull TilePos dest); + @NotNull TilePos sub(int x, int y, int z, @NotNull TilePos dest); @NotNull TilePos sub(@NotNull Vector3ic v, @NotNull TilePos dest); @NotNull TilePos sub(@NotNull Direction dir, @NotNull TilePos dest); + @NotNull TilePos sub(@NotNull Side side, @NotNull TilePos dest); + double distance(@NotNull TilePosc pos); double distance(@NotNull Vector3fc v); diff --git a/game/core/src/main/resources/assets/minecraft/lang/en_US/item.lang b/game/core/src/main/resources/assets/minecraft/lang/en_US/item.lang index 0b340f245..739522bf8 100644 --- a/game/core/src/main/resources/assets/minecraft/lang/en_US/item.lang +++ b/game/core/src/main/resources/assets/minecraft/lang/en_US/item.lang @@ -494,7 +494,7 @@ item.dough.desc=Uncooked dough. Can be baked into bread. item.rubyglass.crystal.cracked.name=Rubyglass Shards item.rubyglass.crystal.cracked.desc=Cracked and full of impurities. But still aesthetically pleasing. item.rubyglass.crystal.pure.name=Rubyglass -item.rubyglass.crystal.pure.desc=A shard of charged Rubyglass crystal, brimming with energy. Perfectly intact and slightly translucent. +item.rubyglass.crystal.pure.desc=A shard of charged Rubyglass crystal, brimming with energy. item.sulfur.name=Sulfur item.sulfur.desc=Highly flammable and yellow. Packs a punch. diff --git a/game/core/src/main/resources/assets/minecraft/lang/en_US/tile.lang b/game/core/src/main/resources/assets/minecraft/lang/en_US/tile.lang index 48e858b23..711231fb9 100644 --- a/game/core/src/main/resources/assets/minecraft/lang/en_US/tile.lang +++ b/game/core/src/main/resources/assets/minecraft/lang/en_US/tile.lang @@ -1431,16 +1431,16 @@ tile.rope.name=Rope tile.rope.desc=Rope, rope, rope your boat. tile.rubyglass.column.name=Rubyglass Column -tile.rubyglass.column.desc=A column of tightly packed Rubyglass. Breaks into dust when broken, but can be reassembled. +tile.rubyglass.column.desc=A column of tightly packed Rubyglass. tile.rubyglass.node.name=Rubyglass Node -tile.rubyglass.node.desc=A dense outcrop of Rubyglass. Crystals harvested from this node are purer and more durable than usual. +tile.rubyglass.node.desc=A dense outcrop of Rubyglass. Crystals harvested from this node are purer and more powerful than usual. tile.block.rubyglass.name=Block of Rubyglass tile.block.rubyglass.desc=A translucent glass-like crystal brimming with energy. tile.rubyglass.sprout.name=Rubyglass Bud -tile.rubyglass.sprout.desc=A small bud of rubyglass, branching out in many directions. Can sprout from Crystalline Netherrack in the right conditions. +tile.rubyglass.sprout.desc=A small bud of rubyglass, branching out in many directions. tile.rubyglass.circuit.name=Rubyglass Circuit tile.rubyglass.circuit.desc=Netherrack etched with lines of rubyglass. It resonates with latent power. diff --git a/util/datagen/src/main/java/net/minecraft/datagen/WorkbenchGenerator.java b/util/datagen/src/main/java/net/minecraft/datagen/WorkbenchGenerator.java index aaea9061e..d663aa894 100644 --- a/util/datagen/src/main/java/net/minecraft/datagen/WorkbenchGenerator.java +++ b/util/datagen/src/main/java/net/minecraft/datagen/WorkbenchGenerator.java @@ -743,6 +743,7 @@ class WorkbenchGenerator { RecipeBuilder.Shapeless(CORE_NAMESPACE).addInput(Blocks.BLOCK_DIAMOND).create("block_of_diamond_to_diamond", new ItemStack(Items.DIAMOND, 9)); RecipeBuilder.Shapeless(CORE_NAMESPACE).addInput(Blocks.BLOCK_QUARTZ).create("block_of_quartz_to_quartz", new ItemStack(Items.QUARTZ, 9)); RecipeBuilder.Shapeless(CORE_NAMESPACE).addInput(Blocks.BLOCK_RUBYGLASS).create("block_of_rubyglass_to_rubyglass", new ItemStack(Items.RUBYGLASS_CRYSTAL, 9)); + RecipeBuilder.Shapeless(CORE_NAMESPACE).addInput(Blocks.BLOCK_SUGARCANE).create("block_of_sugarcane_to_sugarcane", new ItemStack(Items.SUGARCANE, 9)); RecipeBuilder.Shapeless(CORE_NAMESPACE).addInput(Blocks.BLOCK_COAL).create("block_of_coal_to_coal", new ItemStack(Items.COAL, 8, 0)); RecipeBuilder.Shapeless(CORE_NAMESPACE).addInput(Blocks.BLOCK_CHARCOAL).create("block_of_charcoal_to_charcoal", new ItemStack(Items.COAL, 8, 1));