-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
100 changed files
with
1,552 additions
and
928 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
patches/net/minecraft/client/gui/components/LogoRenderer.java.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- a/net/minecraft/client/gui/components/LogoRenderer.java | ||
+++ b/net/minecraft/client/gui/components/LogoRenderer.java | ||
@@ -15,8 +_,8 @@ | ||
public static final ResourceLocation MINECRAFT_EDITION = ResourceLocation.withDefaultNamespace("textures/gui/title/edition.png"); | ||
public static final int LOGO_WIDTH = 256; | ||
public static final int LOGO_HEIGHT = 44; | ||
- private static final int LOGO_TEXTURE_WIDTH = 256; | ||
- private static final int LOGO_TEXTURE_HEIGHT = 64; | ||
+ public static final int LOGO_TEXTURE_WIDTH = 256; | ||
+ public static final int LOGO_TEXTURE_HEIGHT = 64; | ||
private static final int EDITION_WIDTH = 128; | ||
private static final int EDITION_HEIGHT = 14; | ||
private static final int EDITION_TEXTURE_WIDTH = 128; |
99 changes: 90 additions & 9 deletions
99
patches/net/minecraft/client/gui/screens/worldselection/ExperimentsScreen.java.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,95 @@ | ||
--- a/net/minecraft/client/gui/screens/worldselection/ExperimentsScreen.java | ||
+++ b/net/minecraft/client/gui/screens/worldselection/ExperimentsScreen.java | ||
@@ -62,6 +_,11 @@ | ||
@@ -35,15 +_,15 @@ | ||
|
||
@Override | ||
protected void init() { | ||
+ if (net.minecraft.world.flag.FeatureFlags.REGISTRY.hasAnyModdedFlags()) { | ||
+ this.minecraft.setScreen(new net.neoforged.neoforge.client.gui.ScrollableExperimentsScreen(this.parent, this.packRepository, this.output)); | ||
+ return; | ||
@OnlyIn(Dist.CLIENT) | ||
public class ExperimentsScreen extends Screen { | ||
- protected static final Component TITLE = Component.translatable("selectWorld.experiments"); | ||
- protected static final Component INFO = Component.translatable("selectWorld.experiments.info").withStyle(ChatFormatting.RED); | ||
- protected static final int MAIN_CONTENT_WIDTH = 310; | ||
+ private static final Component TITLE = Component.translatable("selectWorld.experiments"); | ||
+ private static final Component INFO = Component.translatable("selectWorld.experiments.info").withStyle(ChatFormatting.RED); | ||
+ private static final int MAIN_CONTENT_WIDTH = 310; | ||
private static final int SCROLL_AREA_MIN_HEIGHT = 130; | ||
- protected final HeaderAndFooterLayout layout = new HeaderAndFooterLayout(this); | ||
+ private final HeaderAndFooterLayout layout = new HeaderAndFooterLayout(this); | ||
private final Screen parent; | ||
private final PackRepository packRepository; | ||
private final Consumer<PackRepository> output; | ||
- protected final Object2BooleanMap<Pack> packs = new Object2BooleanLinkedOpenHashMap<>(); | ||
+ private final Object2BooleanMap<Pack> packs = new Object2BooleanLinkedOpenHashMap<>(); | ||
@Nullable | ||
private ExperimentsScreen.ScrollArea scrollArea; | ||
|
||
@@ -87,7 +_,7 @@ | ||
this.repositionElements(); | ||
} | ||
|
||
- protected static Component getHumanReadableTitle(Pack p_270861_) { | ||
+ private static Component getHumanReadableTitle(Pack p_270861_) { | ||
String s = "dataPack." + p_270861_.getId() + ".name"; | ||
return (Component)(I18n.exists(s) ? Component.translatable(s) : p_270861_.getTitle()); | ||
} | ||
@@ -111,7 +_,7 @@ | ||
this.minecraft.setScreen(this.parent); | ||
} | ||
|
||
- protected void onDone() { | ||
+ private void onDone() { | ||
List<Pack> list = new ArrayList<>(this.packRepository.getSelectedPacks()); | ||
List<Pack> list1 = new ArrayList<>(); | ||
this.packs.forEach((p_270540_, p_270780_) -> { | ||
@@ -156,6 +_,8 @@ | ||
p_387127_.pose().pushPose(); | ||
p_387127_.pose().translate(0.0, -this.scrollAmount(), 0.0); | ||
|
||
+ // Neo: work around interaction "hitbox" of buttons not moving when scrolling | ||
+ p_386932_ = (int) (p_386932_ + this.scrollAmount()); | ||
for (AbstractWidget abstractwidget : this.children) { | ||
abstractwidget.render(p_387127_, p_388038_, p_386932_, p_388026_); | ||
} | ||
@@ -188,6 +_,44 @@ | ||
this.setScrollAmount(this.scrollAmount() + (double)j + 14.0); | ||
} | ||
} | ||
+ } | ||
+ | ||
+ // Neo: work around interaction "hitbox" of buttons not moving when scrolling | ||
+ @Override | ||
+ public java.util.Optional<GuiEventListener> getChildAt(double p_94730_, double p_94731_) { | ||
+ return super.getChildAt(p_94730_, p_94731_ + this.scrollAmount()); | ||
+ } | ||
+ | ||
this.layout.addTitleHeader(TITLE, this.font); | ||
LinearLayout linearlayout = this.layout.addToContents(LinearLayout.vertical()); | ||
linearlayout.addChild(new MultiLineTextWidget(INFO, this.font).setMaxWidth(310), p_293611_ -> p_293611_.paddingBottom(15)); | ||
+ // Neo: work around interaction "hitbox" of buttons not moving when scrolling | ||
+ @Override | ||
+ public boolean mouseClicked(double p_313764_, double p_313832_, int p_313688_) { | ||
+ java.util.Optional<GuiEventListener> optional = this.getChildAt(p_313764_, p_313832_); | ||
+ if (optional.isEmpty()) { | ||
+ return false; | ||
+ } else { | ||
+ GuiEventListener guieventlistener = optional.get(); | ||
+ if (guieventlistener.mouseClicked(p_313764_, p_313832_ + this.scrollAmount(), p_313688_)) { | ||
+ this.setFocused(guieventlistener); | ||
+ if (p_313688_ == 0) { | ||
+ this.setDragging(true); | ||
+ } | ||
+ } | ||
+ | ||
+ return true; | ||
+ } | ||
+ } | ||
+ | ||
+ // Neo: work around interaction "hitbox" of buttons not moving when scrolling | ||
+ @Override | ||
+ public boolean mouseReleased(double p_313886_, double p_313935_, int p_313751_) { | ||
+ if (p_313751_ == 0 && this.isDragging()) { | ||
+ this.setDragging(false); | ||
+ if (this.getFocused() != null) { | ||
+ return this.getFocused().mouseReleased(p_313886_, p_313935_ + this.scrollAmount(), p_313751_); | ||
+ } | ||
+ } | ||
+ | ||
+ return this.getChildAt(p_313886_, p_313935_).filter(p_94708_ -> p_94708_.mouseReleased(p_313886_, p_313935_ + this.scrollAmount(), p_313751_)).isPresent(); | ||
} | ||
|
||
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
patches/net/minecraft/client/renderer/LevelRenderer.java.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.