Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ dependencies {
implementation("net.fabricmc.fabric-api:fabric-api:${project.property("fabric_version")}")
implementation("com.sk89q.worldedit:worldedit-fabric-mc${project.property("worldedit_version")}")
implementation("fi.dy.masa.malilib:malilib-fabric-${project.property("malilib_version")}")
implementation("net.kr1v:malilib-api:${project.property("malilib_api_version")}")
implementation("net.kr1v:malilib-api:${project.property("malilib_api_version")}") {
exclude(group = "fi.dy.masa.malilib") // avoid pulling in malilib-api's pinned (possibly stale) transitive malilib-fabric version
}
}
annotationProcessor("net.kr1v:malilib-api-processor:1.0.0")
}
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ stonecutter {
centralScript = "build.gradle.kts"

create(rootProject) {
versions("1.21.4", "1.21.5", "1.21.8", "1.21.10", "1.21.11", "26.1.2")
versions("1.21.4", "1.21.5", "1.21.8", "1.21.10", "1.21.11", "26.1.2", "26.3")
vcsVersion = "1.21.11"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ public void resetToDefault() {
@Override
protected boolean onMouseClickedImpl(/*? if >=1.21.10 {*/net.minecraft.client.input.MouseButtonEvent click, boolean doubleClick/*? } else {*//*int mouseX, int mouseY, int mouseButton*//*? }*/) {
super.onMouseClickedImpl(/*? if >=1.21.10 {*/click, doubleClick/*? } else {*//*mouseX, mouseY, mouseButton*//*? }*/);
GuiBase.openGui(new GuiMacroEditor(Component.nullToEmpty(configMacro.macroName), configMacro, Minecraft.getInstance().screen));
// The current screen moved off Minecraft directly and onto its Gui/HUD holder in 26.3.
//? if >=26.3 {
GuiBase.openGui(new GuiMacroEditor(Component.nullToEmpty(configMacro.macroName), configMacro, Minecraft.getInstance().gui.screen()));
//? } else
//GuiBase.openGui(new GuiMacroEditor(Component.nullToEmpty(configMacro.macroName), configMacro, Minecraft.getInstance().screen));
return true;
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package tools.redstone.redstonetools.features.toggleable;

import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.brigadier.CommandDispatcher;
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
Expand Down Expand Up @@ -133,8 +134,24 @@ public static BlockHitResult findAirPlaceBlockHit(Player playerEntity) {
if (blockState == null)
return;

/* render block outline */
Camera camera = client.gameRenderer.getMainCamera();
/*
* Render the block outline.
*
* Three rendering eras are threaded through this block:
* - <1.21.10: WorldRenderContext + a VertexConsumer, entity/camera position passed
* as raw doubles into the renderHitOutline mixin invoker.
* - 1.21.10-26.2: same VertexConsumer + mixin invoker approach, but the outline is
* described by a BlockOutlineRenderState instead of raw block/state args.
* - >=26.3: Mojang replaced the VertexConsumer/mixin approach with a submit-node
* pipeline. The context now hands out a PoseStack directly plus a
* SubmitNodeCollector that draws shapes itself, so there is no VertexConsumer, no
* mixin invoker (WorldRendererInvoker.invokeRenderHitOutline no longer exists), and
* no BlockOutlineRenderState needed - see the final `//? } else {` branch below.
*/
//? if >=26.3 {
Camera camera = client.gameRenderer.mainCamera();
//? } else
//Camera camera = client.gameRenderer.getMainCamera();
Vec3 camPos = camera
//? if <=1.21.5 {
/*.getPosition();
Expand All @@ -146,14 +163,15 @@ public static BlockHitResult findAirPlaceBlockHit(Player playerEntity) {

//? if <26.1 {
VertexConsumer consumer = context.consumers().getBuffer(
//? } else
//VertexConsumer consumer = context.bufferSource().getBuffer(
//? if <=1.21.10 {
/*RenderType.lines()
*///?} else {
RenderTypes.lines()
//?}
);
//? } else if <26.3 {
/*VertexConsumer consumer = context.bufferSource().getBuffer(RenderTypes.lines());
*///?}

//? if <1.21.10 {
/*((WorldRendererInvoker) context.worldRenderer()).invokeRenderHitOutline(
Expand All @@ -165,7 +183,7 @@ public static BlockHitResult findAirPlaceBlockHit(Player playerEntity) {
blockState,
CommonColors.BLACK
);
*///?} else {
*///?} else if <26.3 {
//? if <26.1 {
((WorldRendererInvoker) context.worldRenderer()).invokeRenderHitOutline(
//? } else
Expand Down Expand Up @@ -193,7 +211,20 @@ public static BlockHitResult findAirPlaceBlockHit(Player playerEntity) {
*///? }
CommonColors.BLACK/*? if >=1.21.11 {*/, client.getWindow().getAppropriateLineWidth()/*?}*/
);
//?}
//?} else {
/*PoseStack matrices = context.poseStack();
matrices.pushPose();
matrices.translate(blockPos.getX() - camPos.x, blockPos.getY() - camPos.y, blockPos.getZ() - camPos.z);
context.submitNodeCollector().submitShapeOutline(
matrices,
blockState.getShape(client.level, blockPos, net.minecraft.world.phys.shapes.CollisionContext.of(camera.entity())),
RenderTypes.lines(),
CommonColors.BLACK,
client.getWindow().getAppropriateLineWidth(),
false
);
matrices.popPose();
*///?}
};

//? if <1.21.10 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.RedStoneWireBlock;
// Mojang mappings renamed RedStoneWireBlock -> RedstoneWireBlock in 26.3 (casing fix only).
//? if >=26.3 {
import net.minecraft.world.level.block.RedstoneWireBlock;
//? } else
//import net.minecraft.world.level.block.RedStoneWireBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
Expand All @@ -15,7 +19,10 @@
import tools.redstone.redstonetools.config.General;
import tools.redstone.redstonetools.features.toggleable.BigDustFeature;

@Mixin(RedStoneWireBlock.class)
//? if >=26.3 {
@Mixin(RedstoneWireBlock.class)
//? } else
//@Mixin(RedStoneWireBlock.class)
public class RedstoneHitboxMixin {
// use array for better performance
@Unique
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;

// LevelRenderer.renderHitOutline was removed in 26.3, replaced by the submit-node pipeline's
// SubmitNodeCollector.submitShapeOutline(...), which is a public API and needs no invoker mixin.
// This interface is intentionally empty on >=26.3; see AirPlaceFeature for the call site.
@Mixin(LevelRenderer.class)
public interface WorldRendererInvoker {
//? if <26.3 {
@Invoker
//? if <=1.21.8 {
/*void invokeRenderHitOutline(PoseStack matrices, VertexConsumer vertexConsumer, Entity entity, double cameraX, double cameraY, double cameraZ, BlockPos pos, BlockState state, int color);
Expand All @@ -23,4 +27,5 @@ public interface WorldRendererInvoker {
*///?} else {
void invokeRenderHitOutline(PoseStack matrices, VertexConsumer vertexConsumer, double x, double y, double z, BlockOutlineRenderState state, int color, float lineWidth);
//?}
}
//? }
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ private static int calculateComparatorOutput(int items, int slots, int item$getM

private static Item getBestItem(int signalStrength, int slots) {
if (signalStrength > 15)
return Items.WHITE_SHULKER_BOX;
// 26.3 consolidated the per-color shulker box items into a single DYED_SHULKER_BOX
// color collection; WHITE_SHULKER_BOX etc. no longer exist as separate items.
//? if >=26.3 {
return Items.DYED_SHULKER_BOX.white();
//? } else
//return Items.WHITE_SHULKER_BOX;
else if (slots >= 15)
return Items.WOODEN_SHOVEL;
else
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"depends": {
"fabricloader": ">=0.18.1",
"fabric-api": "*",
"minecraft": ">=1.21.4 <=26.1.2"
"minecraft": ">=1.21.4 <=26.3"
},
"recommends": {
"worldedit": "*",
Expand Down
7 changes: 7 additions & 0 deletions versions/26.3/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
minecraft_version=26.3
minecraft_version_out=26.3

fabric_version=0.161.0+26.3
malilib_version=26.3:0.30.1
malilib_api_version=0.8.3-26.2
worldedit_version=26.3:7.4.6-SNAPSHOT