Skip to content

Bring texture-based pattern rendering to 1.20 - #555

Merged
object-Object merged 9 commits into
FallingColors:1.20from
Talia-12:1.20.1
Dec 24, 2023
Merged

Bring texture-based pattern rendering to 1.20#555
object-Object merged 9 commits into
FallingColors:1.20from
Talia-12:1.20.1

Conversation

@Talia-12

Copy link
Copy Markdown
Member

Copied the code from Nitero's texture-based pattern rendering pull request into the 1.20 branch and fixed all resulting errors, then matched the colours with the currently-used colours and got the old-style rendering for slates being centered and scaled the same as the new style so that switching back to the old style when they become energised isn't jarring.

…o the 1.20 branch and fixed it up to work in this version (FallingColors@f5a76ed)
…ntical by altering the old renderer to match the new (only bothered for slate since its the only one that will toggle back to the old renderer in normal gameplay, and the scroll renderer is a bit more complicated).
@object-Object object-Object linked an issue Nov 29, 2023 that may be closed by this pull request
@object-Object object-Object added 1.20 needs reviewer We need to assign someone to review this PR and removed needs reviewer We need to assign someone to review this PR labels Nov 29, 2023
@object-Object object-Object self-assigned this Dec 5, 2023
Comment on lines +18 to +38
// cmd.then(Commands.literal("textureSetColor")
// .requires(dp -> dp.hasPermission(Commands.LEVEL_ADMINS))
// .then(Commands.argument("r", IntegerArgumentType.integer())
// .then(Commands.argument("g", IntegerArgumentType.integer())
// .then(Commands.argument("b", IntegerArgumentType.integer()).executes(ctx -> {
// var r = IntegerArgumentType.getInteger(ctx, "r");
// var g = IntegerArgumentType.getInteger(ctx, "g");
// var b = IntegerArgumentType.getInteger(ctx, "b");
// PatternTextureManager.color = new Color(r,g,b,255);
// PatternTextureManager.repaint();
// return 1;
// })))));
//
// cmd.then(Commands.literal("textureSetResolution")
// .requires(dp -> dp.hasPermission(Commands.LEVEL_ADMINS))
// .then(Commands.argument("integer", IntegerArgumentType.integer()).executes(ctx -> {
// var integer = IntegerArgumentType.getInteger(ctx, "integer");
// PatternTextureManager.resolutionByBlockSize = integer;
// PatternTextureManager.repaint();
// return 1;
// })));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// cmd.then(Commands.literal("textureSetColor")
// .requires(dp -> dp.hasPermission(Commands.LEVEL_ADMINS))
// .then(Commands.argument("r", IntegerArgumentType.integer())
// .then(Commands.argument("g", IntegerArgumentType.integer())
// .then(Commands.argument("b", IntegerArgumentType.integer()).executes(ctx -> {
// var r = IntegerArgumentType.getInteger(ctx, "r");
// var g = IntegerArgumentType.getInteger(ctx, "g");
// var b = IntegerArgumentType.getInteger(ctx, "b");
// PatternTextureManager.color = new Color(r,g,b,255);
// PatternTextureManager.repaint();
// return 1;
// })))));
//
// cmd.then(Commands.literal("textureSetResolution")
// .requires(dp -> dp.hasPermission(Commands.LEVEL_ADMINS))
// .then(Commands.argument("integer", IntegerArgumentType.integer()).executes(ctx -> {
// var integer = IntegerArgumentType.getInteger(ctx, "integer");
// PatternTextureManager.resolutionByBlockSize = integer;
// PatternTextureManager.repaint();
// return 1;
// })));

Probably better to just remove this - we can always grab it from commit history if we need it back

object-Object and others added 4 commits December 5, 2023 02:24
Render pattern textures in a background thread
# Conflicts:
#	Common/src/main/java/at/petrak/hexcasting/client/render/PatternTextureManager.java
@object-Object object-Object removed their assignment Dec 5, 2023
… crash when too many patterns added to render queue at once, try and fix flickering issue.
public static ResourceLocation getTexture(List<Vec2> points, String pointsKey, int blockSize, boolean showsStrokeOrder, float lineWidth, boolean useFullSize, Color innerColor, Color outerColor) {
if (patternTexturesToAdd.containsKey(pointsKey))
return patternTexturesToAdd.get(pointsKey);
if (patternTexturesToAdd.containsKey(pointsKey)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, i think i tried to do something like this but i'm bad at java and minecraft so it didn't work

@object-Object
object-Object merged commit 6117323 into FallingColors:1.20 Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

No open projects
Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Merge texture pattern rendering into 1.20

2 participants