-
-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '1.21.1' into 1211load-gametest-resources-once
- Loading branch information
Showing
68 changed files
with
1,865 additions
and
36 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
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
14 changes: 14 additions & 0 deletions
14
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- a/net/minecraft/client/gui/screens/worldselection/ExperimentsScreen.java | ||
+++ b/net/minecraft/client/gui/screens/worldselection/ExperimentsScreen.java | ||
@@ -50,6 +_,11 @@ | ||
|
||
@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; | ||
+ } | ||
+ | ||
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)); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- a/net/minecraft/world/flag/FeatureFlag.java | ||
+++ b/net/minecraft/world/flag/FeatureFlag.java | ||
@@ -3,9 +_,25 @@ | ||
public class FeatureFlag { | ||
final FeatureFlagUniverse universe; | ||
final long mask; | ||
+ final int extMaskIndex; | ||
+ final boolean modded; | ||
|
||
+ /** | ||
+ * @deprecated Neo: use {@link #FeatureFlag(FeatureFlagUniverse, int, int, boolean)} instead | ||
+ */ | ||
+ @Deprecated | ||
FeatureFlag(FeatureFlagUniverse p_249115_, int p_251067_) { | ||
+ this(p_249115_, p_251067_, 0, false); | ||
+ } | ||
+ | ||
+ FeatureFlag(FeatureFlagUniverse p_249115_, int p_251067_, int offset, boolean modded) { | ||
this.universe = p_249115_; | ||
this.mask = 1L << p_251067_; | ||
+ this.extMaskIndex = offset - 1; | ||
+ this.modded = modded; | ||
+ } | ||
+ | ||
+ public boolean isModded() { | ||
+ return modded; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
patches/net/minecraft/world/flag/FeatureFlagRegistry.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,44 @@ | ||
--- a/net/minecraft/world/flag/FeatureFlagRegistry.java | ||
+++ b/net/minecraft/world/flag/FeatureFlagRegistry.java | ||
@@ -75,6 +_,18 @@ | ||
}, p_249796_ -> List.copyOf(this.toNames(p_249796_))); | ||
} | ||
|
||
+ public FeatureFlag getFlag(ResourceLocation name) { | ||
+ return com.google.common.base.Preconditions.checkNotNull(this.names.get(name), "Flag %s was not registered", name); | ||
+ } | ||
+ | ||
+ public Map<ResourceLocation, FeatureFlag> getAllFlags() { | ||
+ return this.names; | ||
+ } | ||
+ | ||
+ public boolean hasAnyModdedFlags() { | ||
+ return this.names.values().stream().anyMatch(FeatureFlag::isModded); | ||
+ } | ||
+ | ||
public static class Builder { | ||
private final FeatureFlagUniverse universe; | ||
private int id; | ||
@@ -88,11 +_,20 @@ | ||
return this.create(ResourceLocation.withDefaultNamespace(p_251782_)); | ||
} | ||
|
||
+ /** | ||
+ * @deprecated Neo: use {@link #create(ResourceLocation, boolean)} instead | ||
+ */ | ||
+ @Deprecated | ||
public FeatureFlag create(ResourceLocation p_250098_) { | ||
- if (this.id >= 64) { | ||
+ return create(p_250098_, false); | ||
+ } | ||
+ | ||
+ public FeatureFlag create(ResourceLocation p_250098_, boolean modded) { | ||
+ if (this.id >= 64 && false) { | ||
throw new IllegalStateException("Too many feature flags"); | ||
} else { | ||
- FeatureFlag featureflag = new FeatureFlag(this.universe, this.id++); | ||
+ FeatureFlag featureflag = new FeatureFlag(this.universe, this.id % FeatureFlagSet.MAX_CONTAINER_SIZE, this.id / FeatureFlagSet.MAX_CONTAINER_SIZE, modded); | ||
+ this.id++; | ||
FeatureFlag featureflag1 = this.flags.put(p_250098_, featureflag); | ||
if (featureflag1 != null) { | ||
throw new IllegalStateException("Duplicate feature flag " + p_250098_); |
Oops, something went wrong.