Skip to content

Commit

Permalink
change to mojang mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
topi-banana committed Nov 29, 2024
1 parent 7f123af commit ca575da
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 117 deletions.
17 changes: 9 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,15 @@ dependencies {
// loom
if (use_architectury_loom) {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.layered {
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"

// https://github.com/architectury/architectury-loom/issues/214
if (project.platform == 'neoforge' && project.hasProperty('yarn_mappings_patch')) {
it.mappings("dev.architectury:yarn-mappings-patch-neoforge:${project.yarn_mappings_patch}")
}
}
mappings loom.officialMojangMappings()
// mappings loom.layered {
// mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
//
// // https://github.com/architectury/architectury-loom/issues/214
// if (project.platform == 'neoforge' && project.hasProperty('yarn_mappings_patch')) {
// it.mappings("dev.architectury:yarn-mappings-patch-neoforge:${project.yarn_mappings_patch}")
// }
// }
}
if (use_paperweight) {
paperweight.paperDevBundle("${project.minecraft_version}-R0.1-SNAPSHOT")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.vulpeus.kyoyu.placement.KyoyuPlacement;
import fi.dy.masa.malilib.gui.GuiListBase;
import fi.dy.masa.malilib.util.StringUtils;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screens.Screen;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import fi.dy.masa.malilib.render.RenderUtils;

//? if >=1.20 {
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.GuiGraphics;
//?} elif >=1.16 {
/* import net.minecraft.client.util.math.MatrixStack; */
/* import com.mojang.blaze3d.vertex.PoseStack; */
//?}

import java.util.Collection;
Expand Down Expand Up @@ -51,9 +51,9 @@ protected Collection<KyoyuPlacement> getAllEntries() {

@Override
//? if >=1.20 {
public void drawContents(DrawContext drawContext, int mouseX, int mouseY, float partialTicks) {
public void drawContents(GuiGraphics drawContext, int mouseX, int mouseY, float partialTicks) {
//?} elif >=1.16 {
/* public void drawContents(MatrixStack drawContext, int mouseX, int mouseY, float partialTicks) { */
/* public void drawContents(PoseStack drawContext, int mouseX, int mouseY, float partialTicks) { */
//?} else {
/* public void drawContents(int mouseX, int mouseY, float partialTicks) { */
//?}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
import fi.dy.masa.malilib.render.RenderUtils;
import fi.dy.masa.malilib.util.GuiUtils;
import fi.dy.masa.malilib.util.StringUtils;
import net.minecraft.util.BlockMirror;
import net.minecraft.util.BlockRotation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.block.Mirror;
import net.minecraft.world.level.block.Rotation;

//? if >=1.20 {
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.GuiGraphics;
//?} elif >=1.16 {
/* import net.minecraft.client.util.math.MatrixStack; */
/* import com.mojang.blaze3d.vertex.PoseStack; */
//?}

import java.util.Set;
Expand Down Expand Up @@ -93,9 +93,9 @@ public Explorer_WidgetListEntry(int x, int y, int width, int height, KyoyuPlacem

@Override
//? if >=1.20 {
public void render(int mouseX, int mouseY, boolean selected, DrawContext drawContext) {
public void render(int mouseX, int mouseY, boolean selected, GuiGraphics drawContext) {
//?} elif >=1.16 {
/* public void render(int mouseX, int mouseY, boolean selected, MatrixStack drawContext) { */
/* public void render(int mouseX, int mouseY, boolean selected, PoseStack drawContext) { */
//?} else {
/* public void render(int mouseX, int mouseY, boolean selected) { */
//?}
Expand Down Expand Up @@ -164,8 +164,8 @@ void onAction(Explorer_WidgetListEntry entry) {
void onAction(Explorer_WidgetListEntry entry) {
String name = entry.kyoyuPlacement.getName();
BlockPos pos = entry.kyoyuPlacement.getRegion().getPos();
BlockMirror mirror = entry.kyoyuPlacement.getRegion().getMirror().get();
BlockRotation rotation = entry.kyoyuPlacement.getRegion().getRotation().get();
Mirror mirror = entry.kyoyuPlacement.getRegion().getMirror();
Rotation rotation = entry.kyoyuPlacement.getRegion().getRotation();

LitematicaSchematic schematic = SchematicHolder.getInstance().getOrLoad(entry.kyoyuPlacement.getFile());
SchematicPlacement placement = SchematicPlacement.createFor(schematic, pos, name, true, true);
Expand All @@ -180,8 +180,8 @@ void onAction(Explorer_WidgetListEntry entry) {
String subRegionName = subRegion.getName();

placement.moveSubRegionTo(subRegionName, subRegion.getPos(), null);
placement.setSubRegionMirror(subRegionName, subRegion.getMirror().get(), null);
placement.setSubRegionRotation(subRegionName, subRegion.getRotation().get(), null);
placement.setSubRegionMirror(subRegionName, subRegion.getMirror(), null);
placement.setSubRegionRotation(subRegionName, subRegion.getRotation(), null);
}
placement.toggleLocked();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import fi.dy.masa.malilib.gui.GuiBase;
import fi.dy.masa.malilib.gui.button.ButtonBase;
import fi.dy.masa.malilib.gui.button.IButtonActionListener;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screens.Screen;

public class LoadExplorer_ButtonActionListener implements IButtonActionListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import fi.dy.masa.malilib.util.StringUtils;

//? if >=1.20 {
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.GuiGraphics;
//?} elif >=1.16 {
/* import net.minecraft.client.util.math.MatrixStack; */
/* import com.mojang.blaze3d.vertex.PoseStack; */
//?}

public class LoadingExplorer_Gui extends GuiBase {
Expand All @@ -20,9 +20,9 @@ public void init() {

@Override
//? if >=1.20 {
public void drawContents(DrawContext drawContext, int mouseX, int mouseY, float partialTicks) {
public void drawContents(GuiGraphics drawContext, int mouseX, int mouseY, float partialTicks) {
//?} elif >=1.16 {
/* public void drawContents(MatrixStack drawContext, int mouseX, int mouseY, float partialTicks) { */
/* public void drawContents(PoseStack drawContext, int mouseX, int mouseY, float partialTicks) { */
//?} else {
/* public void drawContents(int mouseX, int mouseY, float partialTicks) { */
//?}
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/com/vulpeus/kyoyu/placement/KyoyuRegion.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package com.vulpeus.kyoyu.placement;

import com.vulpeus.kyoyu.utils.compatible.BlockMirror;
import com.vulpeus.kyoyu.utils.compatible.BlockPos;
import com.vulpeus.kyoyu.utils.compatible.BlockRotation;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.block.Mirror;
import net.minecraft.world.level.block.Rotation;

public class KyoyuRegion {

private final BlockPos pos;
private final BlockMirror mirror;
private final BlockRotation rotation;
private final Mirror mirror;
private final Rotation rotation;
private final String name;

public KyoyuRegion(BlockPos pos, BlockMirror mirror, BlockRotation rotation, String name) {
public KyoyuRegion(BlockPos pos, Mirror mirror, Rotation rotation, String name) {
this.pos = pos;
this.mirror = mirror;
this.rotation = rotation;
Expand All @@ -22,11 +22,11 @@ public BlockPos getPos() {
return pos;
}

public BlockMirror getMirror() {
public Mirror getMirror() {
return mirror;
}

public BlockRotation getRotation() {
public Rotation getRotation() {
return rotation;
}

Expand Down
33 changes: 0 additions & 33 deletions src/main/java/com/vulpeus/kyoyu/utils/compatible/BlockMirror.java

This file was deleted.

13 changes: 0 additions & 13 deletions src/main/java/com/vulpeus/kyoyu/utils/compatible/BlockPos.java

This file was deleted.

This file was deleted.

0 comments on commit ca575da

Please sign in to comment.