Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 1.20.4 #155

Open
wants to merge 3 commits into
base: 1.20.1
Choose a base branch
from
Open
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: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.3-SNAPSHOT" apply false
id "dev.architectury.loom" version "1.5-SNAPSHOT" apply false
}

architectury {
Expand All @@ -19,7 +19,7 @@ subprojects {
// The following line declares the mojmap mappings, you may use other mappings as well
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-1.20.1:2023.09.03@zip")
parchment("org.parchmentmc.data:parchment-1.20.4:2024.02.25@zip")
}
// The following line declares the yarn mappings you may select this one as well.
// mappings "net.fabricmc:yarn:1.20.1+build.10:v2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void registerRecipeTransferHandlers(IRecipeTransferRegistration registrat
public void onRuntimeAvailable(IJeiRuntime jeiRuntime) {
runtime = jeiRuntime;
ModCompat.isJEILoaded = true;
if (Platform.isForge())
if (Platform.isForgeLike())
try {
FORGE_FLUID_INGREDIENT_CLASS = Class.forName("net.minecraftforge.fluids.FluidStack");
} catch (ClassNotFoundException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public String getAmountString(boolean round) {
public static String format(long amount) {
float bucket = FluidStackHooks.bucketAmount();
return amount >= bucket ? Utilities.cutNumber(amount / bucket, 4) + "B"
: amount + (Platform.isForge() ? "mB" : "U");
: amount + (Platform.isForgeLike() ? "mB" : "U");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ public EventResult onTooltip(GuiGraphics guiGraphics, List<? extends ClientToolt
return interruptFalse();
}

public EventResult onMouseScroll(Minecraft client, Screen screen, double mouseX, double mouseY, double amount) {
public EventResult onMouseScroll(Minecraft client, Screen screen, double mouseX, double mouseY, double horizontalAmount, double verticalAmount) {
if (overlayHandler == null || !isScreenValidForOverlay(screen))
return pass();
return amount != 0 && overlayHandler.onMouseScroll(gui, gui.getGlobalMouseX(), gui.getGlobalMouseY(), (int) amount) ? interruptFalse() : pass();
return verticalAmount != 0 && overlayHandler.onMouseScroll(gui, gui.getGlobalMouseX(), gui.getGlobalMouseY(), (int) verticalAmount) ? interruptFalse() : pass();
}

public EventResult onMouseClicked(Minecraft client, Screen screen, double mouseX, double mouseY, int button) {
Expand Down
16 changes: 8 additions & 8 deletions common/src/main/java/me/towdium/jecalculation/gui/JecaGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,13 @@ else if (gui.hand != ILabel.EMPTY) {
}


public static EventResult onMouseScroll(Minecraft client, Screen screen, double mouseX, double mouseY, double amount) {
public static EventResult onMouseScroll(Minecraft client, Screen screen, double mouseX, double mouseY, double horizontalAmount, double verticalAmount) {
if (!(screen instanceof JecaGui)) return pass();
JecaGui gui = getCurrent();
int xMouse = getMouseX();
int yMouse = getMouseY();
if (amount != 0)
gui.root.onMouseScroll(gui, xMouse, yMouse, (int) amount);
if (verticalAmount != 0)
gui.root.onMouseScroll(gui, xMouse, yMouse, (int) verticalAmount);
return pass();
}

Expand All @@ -242,10 +242,10 @@ public static EventResult onMouseDragged(Minecraft client, Screen screen, double
return pass();
}

@Override
public void containerTick() {
root.onTick(this);
}
// @Override
// public void containerTick() {
// root.onTick(this);
// }

@Nullable
public Slot getSlotUnderMouse() {
Expand Down Expand Up @@ -393,7 +393,7 @@ public boolean isPauseScreen() {

@Override
protected void renderBg(GuiGraphics matrixGraphics, float partialTicks, int x, int y) {
renderBackground(matrixGraphics);
// renderBackground(matrixGraphics);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean acceptsLabel() {

public void update(ILabel l) {
raw = l;
setFCap(!Platform.isForge());
setFCap(!Platform.isForgeLike());
setFMeta(false);
setFNbt(false);
boolean b = l == ILabel.EMPTY;
Expand All @@ -65,7 +65,7 @@ private void setFMeta(boolean b) {
}

private void setFCap(boolean b) {
if (Platform.isForge())
if (Platform.isForgeLike())
setF(b, bCapN, bCapF, () -> fCap = b);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ default boolean getLabelUnderMouse(int xMouse, int yMouse, Wrapper<ILabel> label
return false;
}

default void onTick(JecaGui gui) {
}
// default void onTick(JecaGui gui) {
// }

@FunctionalInterface
interface ListenerValue<W extends IWidget, V> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ public boolean getLabelUnderMouse(int xMouse, int yMouse, Wrapper<ILabel> label)
.anyMatch(i -> i.getLabelUnderMouse(xMouse - offsetX, yMouse - offsetY, label));
}

@Override
public void onTick(JecaGui gui) {
widgets.forEach(i -> i.onTick(gui));
}
// @Override
// public void onTick(JecaGui gui) {
// widgets.forEach(i -> i.onTick(gui));
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ public void onMouseFocused(JecaGui gui, int xMouse, int yMouse, int button) {
textField.mouseClicked(xMouse, yMouse, button);
}

@Override
public void onTick(JecaGui gui) {
textField.tick();
}
// @Override
// public void onTick(JecaGui gui) {
// textField.tick();
// }

@Override
public boolean onMouseClicked(JecaGui gui, int xMouse, int yMouse, int button) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,14 @@ public static ItemStack createItemStackWithCap(Item item, int count, CompoundTag
throw new AssertionError();
}

public static TagKey<Item> IRON_INGOTS = tag(Registries.ITEM, Platform.isForge() ? "ingots/iron" : "iron_ingots");
public static TagKey<Item> IRON_INGOTS = tag(Registries.ITEM, Platform.isForgeLike() ? "ingots/iron" : "iron_ingots");

public static <T> TagKey<T> tag(ResourceKey<? extends Registry<T>> key, String tag) {
return TagKey.create(key, new ResourceLocation(getTagNamespace(), tag));
}

public static String getTagNamespace() {
return Platform.isForge() ? "forge" : "c";
return Platform.isForgeLike() ? "forge" : "c";
}

// MOD NAME
Expand Down
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
org.gradle.jvmargs=-Xmx2048M

minecraft_version=1.20.1
minecraft_version=1.20.4
enabled_platforms=quilt,fabric,forge

archives_base_name=jecalculation
mod_version=4.0.4
maven_group=me.towdium.jecalculation

architectury_version=9.1.12
architectury_version=11.1.13

fabric_loader_version=0.14.23
fabric_api_version=0.90.4+1.20.1
fabric_loader_version=0.15.7
fabric_api_version=0.96.4+1.20.4

forge_version=1.20.1-47.2.1
forge_version=1.20.4-49.0.30

quilt_loader_version=0.21.2-beta.2
quilt_loader_version=0.24.0-beta.8
quilt_fabric_api_version=7.4.0+0.90.0-1.20.1

jei_version=15.2.0.27
rei_version=12.0.684
jei_version=17.3.0.49
rei_version=14.0.688