mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-27 23:45:44 +00:00
1.20.3 Initial Update
https://forums.minecraftforge.net/topic/139822-forge-490-minecraft-1203/
This commit is contained in:
456 files changed
+2432
-2933
No files matched your search
+2
-2
@@ -1028,7 +1028,7 @@ publishing {
|
||||
}
|
||||
|
||||
// Make sure we run bin compat checking during local testing.
|
||||
if (!System.env.MAVEN_USER || !System.env.MAVEN_PASSWORD)
|
||||
publish.dependsOn(':forge:checkJarCompatibility')
|
||||
//if (!System.env.MAVEN_USER || !System.env.MAVEN_PASSWORD)
|
||||
// publish.dependsOn(':forge:checkJarCompatibility')
|
||||
|
||||
apply from: rootProject.file('build_forge_eclipse.gradle')
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
MinecraftForge
|
||||
=============
|
||||
[][Download]
|
||||
[][Download] [][Discord] [][Patreon]
|
||||
|
||||
Forge is a free, open-source modding API all of your favourite mods use!
|
||||
|
||||
+3
-3
@@ -4,8 +4,8 @@ org.gradle.jvmargs=-Xmx3G
|
||||
org.gradle.daemon=false
|
||||
|
||||
JAVA_VERSION=17
|
||||
MC_VERSION=1.20.2
|
||||
MC_VERSION=1.20.3
|
||||
MC_NEXT_VERSION=1.21
|
||||
MCP_VERSION=20230921.100330
|
||||
MCP_VERSION=20231205.124940
|
||||
MAPPING_CHANNEL=official
|
||||
MAPPING_VERSION=1.20.2
|
||||
MAPPING_VERSION=1.20.3
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/com/mojang/blaze3d/vertex/BufferBuilder.java
|
||||
+++ b/com/mojang/blaze3d/vertex/BufferBuilder.java
|
||||
@@ -459,4 +_,14 @@
|
||||
@@ -477,4 +_,14 @@
|
||||
this.sorting = p_277855_;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/CrashReport.java
|
||||
+++ b/net/minecraft/CrashReport.java
|
||||
@@ -57,14 +_,9 @@
|
||||
@@ -59,14 +_,9 @@
|
||||
if (this.uncategorizedStackTrace != null && this.uncategorizedStackTrace.length > 0) {
|
||||
p_127520_.append("-- Head --\n");
|
||||
p_127520_.append("Thread: ").append(Thread.currentThread().getName()).append("\n");
|
||||
@@ -18,7 +18,7 @@
|
||||
}
|
||||
|
||||
for(CrashReportCategory crashreportcategory : this.details) {
|
||||
@@ -72,6 +_,7 @@
|
||||
@@ -74,6 +_,7 @@
|
||||
p_127520_.append("\n\n");
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
this.systemReport.appendToCrashReportString(p_127520_);
|
||||
}
|
||||
|
||||
@@ -91,18 +_,7 @@
|
||||
@@ -93,18 +_,7 @@
|
||||
throwable.setStackTrace(this.exception.getStackTrace());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/SharedConstants.java
|
||||
+++ b/net/minecraft/SharedConstants.java
|
||||
@@ -212,6 +_,7 @@
|
||||
@@ -215,6 +_,7 @@
|
||||
}
|
||||
|
||||
static {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/Util.java
|
||||
+++ b/net/minecraft/Util.java
|
||||
@@ -172,6 +_,11 @@
|
||||
@@ -180,6 +_,11 @@
|
||||
return 255;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public static ExecutorService backgroundExecutor() {
|
||||
return BACKGROUND_EXECUTOR;
|
||||
}
|
||||
@@ -240,7 +_,7 @@
|
||||
@@ -254,7 +_,7 @@
|
||||
try {
|
||||
type = DataFixers.getDataFixer().getSchema(DataFixUtils.makeKey(SharedConstants.getCurrentVersion().getDataVersion().getVersion())).getChoiceType(p_137552_, p_137553_);
|
||||
} catch (IllegalArgumentException illegalargumentexception) {
|
||||
|
||||
@@ -1,21 +1,6 @@
|
||||
--- a/net/minecraft/advancements/Advancement.java
|
||||
+++ b/net/minecraft/advancements/Advancement.java
|
||||
@@ -62,7 +_,14 @@
|
||||
return jsonobject;
|
||||
}
|
||||
|
||||
+ /** @deprecated Forge: use {@linkplain #fromJson(JsonObject, DeserializationContext, net.minecraftforge.common.crafting.conditions.ICondition.IContext) overload with context}. */
|
||||
+ @Deprecated
|
||||
public static Advancement fromJson(JsonObject p_300691_, DeserializationContext p_300053_) {
|
||||
+ return fromJson(p_300691_, p_300053_, net.minecraftforge.common.crafting.conditions.ICondition.IContext.EMPTY);
|
||||
+ }
|
||||
+
|
||||
+ public static Advancement fromJson(JsonObject p_300691_, DeserializationContext p_300053_, net.minecraftforge.common.crafting.conditions.ICondition.IContext context) {
|
||||
+ if ((p_300691_ = net.minecraftforge.common.ForgeHooks.readConditionalAdvancement(context, p_300691_)) == null) return null;
|
||||
Optional<ResourceLocation> optional = p_300691_.has("parent") ? Optional.of(new ResourceLocation(GsonHelper.getAsString(p_300691_, "parent"))) : Optional.empty();
|
||||
Optional<DisplayInfo> optional1 = p_300691_.has("display") ? Optional.of(DisplayInfo.fromJson(GsonHelper.getAsJsonObject(p_300691_, "display"))) : Optional.empty();
|
||||
AdvancementRewards advancementrewards = p_300691_.has("rewards") ? AdvancementRewards.deserialize(GsonHelper.getAsJsonObject(p_300691_, "rewards")) : AdvancementRewards.EMPTY;
|
||||
@@ -182,7 +_,11 @@
|
||||
@@ -171,7 +_,11 @@
|
||||
}
|
||||
|
||||
public AdvancementHolder save(Consumer<AdvancementHolder> p_138390_, String p_138391_) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/advancements/AdvancementRewards.java
|
||||
+++ b/net/minecraft/advancements/AdvancementRewards.java
|
||||
@@ -43,7 +_,7 @@
|
||||
@@ -27,7 +_,7 @@
|
||||
|
||||
public void grant(ServerPlayer p_9990_) {
|
||||
p_9990_.giveExperiencePoints(this.experience);
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--- a/net/minecraft/advancements/CriteriaTriggers.java
|
||||
+++ b/net/minecraft/advancements/CriteriaTriggers.java
|
||||
@@ -46,7 +_,7 @@
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
public class CriteriaTriggers {
|
||||
- private static final BiMap<ResourceLocation, CriterionTrigger<?>> CRITERIA = HashBiMap.create();
|
||||
+ private static final BiMap<ResourceLocation, CriterionTrigger<?>> CRITERIA = com.google.common.collect.Maps.synchronizedBiMap(HashBiMap.create());
|
||||
public static final ImpossibleTrigger IMPOSSIBLE = register("impossible", new ImpossibleTrigger());
|
||||
public static final KilledTrigger PLAYER_KILLED_ENTITY = register("player_killed_entity", new KilledTrigger());
|
||||
public static final KilledTrigger ENTITY_KILLED_PLAYER = register("entity_killed_player", new KilledTrigger());
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/advancements/critereon/ItemPredicate.java
|
||||
+++ b/net/minecraft/advancements/critereon/ItemPredicate.java
|
||||
@@ -50,7 +_,7 @@
|
||||
@@ -45,7 +_,7 @@
|
||||
return false;
|
||||
} else {
|
||||
if (!this.enchantments.isEmpty()) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- a/net/minecraft/client/Camera.java
|
||||
+++ b/net/minecraft/client/Camera.java
|
||||
@@ -206,6 +_,18 @@
|
||||
this.initialized = false;
|
||||
@@ -212,6 +_,18 @@
|
||||
return this.partialTickTime;
|
||||
}
|
||||
|
||||
+ public void setAnglesInternal(float yaw, float pitch) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/KeyboardHandler.java
|
||||
+++ b/net/minecraft/client/KeyboardHandler.java
|
||||
@@ -380,11 +_,15 @@
|
||||
@@ -397,11 +_,15 @@
|
||||
Screen.wrapScreenError(() -> {
|
||||
if (p_90897_ != 1 && p_90897_ != 2) {
|
||||
if (p_90897_ == 0) {
|
||||
@@ -18,11 +18,10 @@
|
||||
}
|
||||
|
||||
}, "keyPressed event handler", screen.getClass().getCanonicalName());
|
||||
@@ -443,22 +_,26 @@
|
||||
this.minecraft.debugFpsMeterKeyPress(p_90895_ - 48);
|
||||
@@ -478,21 +_,26 @@
|
||||
}
|
||||
|
||||
}
|
||||
-
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onKeyInput(p_90895_, p_90896_, p_90897_, p_90898_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/Minecraft.java
|
||||
+++ b/net/minecraft/client/Minecraft.java
|
||||
@@ -252,7 +_,7 @@
|
||||
@@ -254,7 +_,7 @@
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@@ -9,15 +9,15 @@
|
||||
static Minecraft instance;
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
public static final boolean ON_OSX = Util.getPlatform() == Util.OS.OSX;
|
||||
@@ -422,7 +_,6 @@
|
||||
}, Util.ioPool());
|
||||
this.userApiService = this.createUserApiService(this.authenticationService, p_91084_);
|
||||
@@ -438,7 +_,6 @@
|
||||
}
|
||||
}, Util.nonCriticalIoPool());
|
||||
LOGGER.info("Setting user: {}", (Object)this.user.getName());
|
||||
- LOGGER.debug("(Session ID is {})", (Object)this.user.getSessionId());
|
||||
this.demo = p_91084_.game.demo;
|
||||
this.allowsMultiplayer = !p_91084_.game.disableMultiplayer;
|
||||
this.allowsChat = !p_91084_.game.disableChat;
|
||||
@@ -458,15 +_,15 @@
|
||||
@@ -474,15 +_,15 @@
|
||||
}
|
||||
|
||||
this.window.setFramerateLimit(this.options.framerateLimit().get());
|
||||
@@ -35,7 +35,7 @@
|
||||
this.resourcePackRepository.reload();
|
||||
this.options.loadSelectedResourcePacks(this.resourcePackRepository);
|
||||
this.languageManager = new LanguageManager(this.options.languageCode);
|
||||
@@ -512,10 +_,13 @@
|
||||
@@ -538,10 +_,13 @@
|
||||
this.gameRenderer = new GameRenderer(this, this.entityRenderDispatcher.getItemInHandRenderer(), this.resourceManager, this.renderBuffers);
|
||||
this.resourceManager.registerReloadListener(this.gameRenderer.createReloadListener());
|
||||
this.levelRenderer = new LevelRenderer(this, this.entityRenderDispatcher, this.blockEntityRenderDispatcher, this.renderBuffers);
|
||||
@@ -50,7 +50,7 @@
|
||||
this.resourceManager.registerReloadListener(this.particleEngine);
|
||||
this.paintingTextures = new PaintingTextureManager(this.textureManager);
|
||||
this.resourceManager.registerReloadListener(this.paintingTextures);
|
||||
@@ -526,7 +_,10 @@
|
||||
@@ -552,7 +_,10 @@
|
||||
this.gpuWarnlistManager = new GpuWarnlistManager();
|
||||
this.resourceManager.registerReloadListener(this.gpuWarnlistManager);
|
||||
this.resourceManager.registerReloadListener(this.regionalCompliancies);
|
||||
@@ -62,7 +62,7 @@
|
||||
this.debugRenderer = new DebugRenderer(this);
|
||||
RealmsClient realmsclient = RealmsClient.create(this);
|
||||
this.realmsDataFetcher = new RealmsDataFetcher(realmsclient);
|
||||
@@ -546,6 +_,7 @@
|
||||
@@ -572,6 +_,7 @@
|
||||
TinyFileDialogs.tinyfd_messageBox("Minecraft", stringbuilder.toString(), "ok", "error", false);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
this.window.updateVsync(this.options.enableVsync().get());
|
||||
this.window.updateRawMouseInput(this.options.rawMouseInput().get());
|
||||
this.window.setDefaultErrorCallback();
|
||||
@@ -565,7 +_,7 @@
|
||||
@@ -592,7 +_,7 @@
|
||||
ReloadInstance reloadinstance = this.resourceManager.createReload(Util.backgroundExecutor(), this, RESOURCE_RELOAD_INITIAL_TASK, list);
|
||||
GameLoadTimesEvent.INSTANCE.beginStep(TelemetryProperty.LOAD_TIME_LOADING_OVERLAY_MS);
|
||||
Minecraft.GameLoadCookie minecraft$gameloadcookie = new Minecraft.GameLoadCookie(realmsclient, p_91084_.quickPlay);
|
||||
@@ -79,7 +79,7 @@
|
||||
Util.ifElse(p_296164_, (p_296162_) -> {
|
||||
this.rollbackResourcePacks(p_296162_, minecraft$gameloadcookie);
|
||||
}, () -> {
|
||||
@@ -575,8 +_,10 @@
|
||||
@@ -602,8 +_,10 @@
|
||||
|
||||
this.reloadStateTracker.finishReload();
|
||||
this.onResourceLoadFinished(minecraft$gameloadcookie);
|
||||
@@ -91,7 +91,7 @@
|
||||
this.quickPlayLog = QuickPlayLog.of(p_91084_.quickPlay.path());
|
||||
}
|
||||
|
||||
@@ -674,7 +_,7 @@
|
||||
@@ -701,7 +_,7 @@
|
||||
private String createTitle() {
|
||||
StringBuilder stringbuilder = new StringBuilder("Minecraft");
|
||||
if (checkModStatus().shouldReportAsModified()) {
|
||||
@@ -100,16 +100,16 @@
|
||||
}
|
||||
|
||||
stringbuilder.append(" ");
|
||||
@@ -699,6 +_,8 @@
|
||||
@@ -725,6 +_,8 @@
|
||||
}
|
||||
|
||||
private UserApiService createUserApiService(YggdrasilAuthenticationService p_193586_, GameConfig p_193587_) {
|
||||
try {
|
||||
+ if ("0".equals(p_193587_.user.user.getAccessToken())) // Forge: We use "0" in dev. Short circuit to stop exception spam.
|
||||
+ return UserApiService.OFFLINE;
|
||||
return p_193586_.createUserApiService(p_193587_.user.user.getAccessToken());
|
||||
} catch (AuthenticationException authenticationexception) {
|
||||
LOGGER.error("Failed to verify authentication", (Throwable)authenticationexception);
|
||||
@@ -711,7 +_,7 @@
|
||||
+ if ("0".equals(p_193587_.user.user.getAccessToken())) // Forge: We use "0" in dev. Short circuit to stop exception spam.
|
||||
+ return UserApiService.OFFLINE;
|
||||
return p_193586_.createUserApiService(p_193587_.user.user.getAccessToken());
|
||||
}
|
||||
|
||||
@@ -733,7 +_,7 @@
|
||||
}
|
||||
|
||||
private void rollbackResourcePacks(Throwable p_91240_, @Nullable Minecraft.GameLoadCookie p_299515_) {
|
||||
@@ -118,7 +118,7 @@
|
||||
this.clearResourcePacksOnError(p_91240_, (Component)null, p_299515_);
|
||||
} else {
|
||||
Util.throwAsRuntime(p_91240_);
|
||||
@@ -803,7 +_,10 @@
|
||||
@@ -819,7 +_,10 @@
|
||||
}
|
||||
|
||||
public void createSearchTrees() {
|
||||
@@ -130,7 +130,7 @@
|
||||
return new FullTextSearchTree<>((p_210797_) -> {
|
||||
return p_210797_.getTooltipLines((Player)null, TooltipFlag.Default.NORMAL.asCreative()).stream().map((p_231455_) -> {
|
||||
return ChatFormatting.stripFormatting(p_231455_.getString()).trim();
|
||||
@@ -814,7 +_,8 @@
|
||||
@@ -830,7 +_,8 @@
|
||||
return Stream.of(BuiltInRegistries.ITEM.getKey(p_91317_.getItem()));
|
||||
}, p_231451_);
|
||||
});
|
||||
@@ -140,7 +140,7 @@
|
||||
return new IdSearchTree<>((p_231353_) -> {
|
||||
return p_231353_.getTags().map(TagKey::location);
|
||||
}, p_231430_);
|
||||
@@ -834,9 +_,12 @@
|
||||
@@ -850,9 +_,12 @@
|
||||
});
|
||||
}, p_301514_);
|
||||
});
|
||||
@@ -156,7 +156,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1019,10 +_,6 @@
|
||||
@@ -1054,10 +_,6 @@
|
||||
LOGGER.error("setScreen called from non-game thread");
|
||||
}
|
||||
|
||||
@@ -164,30 +164,30 @@
|
||||
- this.screen.removed();
|
||||
- }
|
||||
-
|
||||
if (p_91153_ == null && this.level == null) {
|
||||
p_91153_ = new TitleScreen();
|
||||
} else if (p_91153_ == null && this.player.isDeadOrDying()) {
|
||||
@@ -1033,6 +_,19 @@
|
||||
if (p_91153_ == null && this.clientLevelTeardownInProgress) {
|
||||
throw new IllegalStateException("Trying to return to in-game GUI during disconnection");
|
||||
} else {
|
||||
@@ -1071,6 +_,19 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+ net.minecraftforge.client.ForgeHooksClient.clearGuiLayers(this);
|
||||
+ Screen old = this.screen;
|
||||
+ if (p_91153_ != null) {
|
||||
+ var event = net.minecraftforge.client.event.ForgeEventFactoryClient.onScreenOpening(old, p_91153_);
|
||||
+ if (event == null) return;
|
||||
+ p_91153_ = event;
|
||||
+ }
|
||||
+ net.minecraftforge.client.ForgeHooksClient.clearGuiLayers(this);
|
||||
+ Screen old = this.screen;
|
||||
+ if (p_91153_ != null) {
|
||||
+ var event = net.minecraftforge.client.event.ForgeEventFactoryClient.onScreenOpening(old, p_91153_);
|
||||
+ if (event == null) return;
|
||||
+ p_91153_ = event;
|
||||
+ }
|
||||
+
|
||||
+ if (old != null && p_91153_ != old) {
|
||||
+ net.minecraftforge.client.event.ForgeEventFactoryClient.onScreenClose(old);
|
||||
+ old.removed();
|
||||
+ }
|
||||
+ if (old != null && p_91153_ != old) {
|
||||
+ net.minecraftforge.client.event.ForgeEventFactoryClient.onScreenClose(old);
|
||||
+ old.removed();
|
||||
+ }
|
||||
+
|
||||
this.screen = p_91153_;
|
||||
if (this.screen != null) {
|
||||
this.screen.added();
|
||||
@@ -1179,9 +_,12 @@
|
||||
this.screen = p_91153_;
|
||||
if (this.screen != null) {
|
||||
this.screen.added();
|
||||
@@ -1218,9 +_,12 @@
|
||||
RenderSystem.enableCull();
|
||||
this.profiler.pop();
|
||||
if (!this.noRender) {
|
||||
@@ -200,7 +200,7 @@
|
||||
}
|
||||
|
||||
if (this.fpsPieResults != null) {
|
||||
@@ -1223,6 +_,7 @@
|
||||
@@ -1262,6 +_,7 @@
|
||||
}
|
||||
|
||||
this.pause = flag1;
|
||||
@@ -208,7 +208,7 @@
|
||||
}
|
||||
|
||||
long l = Util.getNanos();
|
||||
@@ -1302,10 +_,12 @@
|
||||
@@ -1341,10 +_,12 @@
|
||||
this.window.setGuiScale((double)i);
|
||||
if (this.screen != null) {
|
||||
this.screen.resize(this, this.window.getGuiScaledWidth(), this.window.getGuiScaledHeight());
|
||||
@@ -221,7 +221,7 @@
|
||||
this.gameRenderer.resize(this.window.getWidth(), this.window.getHeight());
|
||||
this.mouseHandler.setIgnoreFirstMove();
|
||||
}
|
||||
@@ -1579,6 +_,7 @@
|
||||
@@ -1618,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
@@ -229,7 +229,7 @@
|
||||
this.running = false;
|
||||
}
|
||||
|
||||
@@ -1608,10 +_,18 @@
|
||||
@@ -1647,10 +_,18 @@
|
||||
if (p_91387_ && this.hitResult != null && this.hitResult.getType() == HitResult.Type.BLOCK) {
|
||||
BlockHitResult blockhitresult = (BlockHitResult)this.hitResult;
|
||||
BlockPos blockpos = blockhitresult.getBlockPos();
|
||||
@@ -251,7 +251,7 @@
|
||||
this.player.swing(InteractionHand.MAIN_HAND);
|
||||
}
|
||||
}
|
||||
@@ -1640,6 +_,8 @@
|
||||
@@ -1679,6 +_,8 @@
|
||||
return false;
|
||||
} else {
|
||||
boolean flag = false;
|
||||
@@ -260,7 +260,7 @@
|
||||
switch (this.hitResult.getType()) {
|
||||
case ENTITY:
|
||||
this.gameMode.attack(this.player, ((EntityHitResult)this.hitResult).getEntity());
|
||||
@@ -1647,7 +_,7 @@
|
||||
@@ -1686,7 +_,7 @@
|
||||
case BLOCK:
|
||||
BlockHitResult blockhitresult = (BlockHitResult)this.hitResult;
|
||||
BlockPos blockpos = blockhitresult.getBlockPos();
|
||||
@@ -269,7 +269,7 @@
|
||||
this.gameMode.startDestroyBlock(blockpos, blockhitresult.getDirection());
|
||||
if (this.level.getBlockState(blockpos).isAir()) {
|
||||
flag = true;
|
||||
@@ -1660,8 +_,10 @@
|
||||
@@ -1699,8 +_,10 @@
|
||||
}
|
||||
|
||||
this.player.resetAttackStrengthTicker();
|
||||
@@ -280,7 +280,7 @@
|
||||
this.player.swing(InteractionHand.MAIN_HAND);
|
||||
return flag;
|
||||
}
|
||||
@@ -1677,6 +_,11 @@
|
||||
@@ -1716,6 +_,11 @@
|
||||
}
|
||||
|
||||
for(InteractionHand interactionhand : InteractionHand.values()) {
|
||||
@@ -292,7 +292,7 @@
|
||||
ItemStack itemstack = this.player.getItemInHand(interactionhand);
|
||||
if (!itemstack.isItemEnabled(this.level.enabledFeatures())) {
|
||||
return;
|
||||
@@ -1697,7 +_,7 @@
|
||||
@@ -1736,7 +_,7 @@
|
||||
}
|
||||
|
||||
if (interactionresult.consumesAction()) {
|
||||
@@ -301,7 +301,7 @@
|
||||
this.player.swing(interactionhand);
|
||||
}
|
||||
|
||||
@@ -1709,7 +_,7 @@
|
||||
@@ -1748,7 +_,7 @@
|
||||
int i = itemstack.getCount();
|
||||
InteractionResult interactionresult1 = this.gameMode.useItemOn(this.player, interactionhand, blockhitresult);
|
||||
if (interactionresult1.consumesAction()) {
|
||||
@@ -310,7 +310,7 @@
|
||||
this.player.swing(interactionhand);
|
||||
if (!itemstack.isEmpty() && (itemstack.getCount() != i || this.gameMode.hasInfiniteItems())) {
|
||||
this.gameRenderer.itemInHandRenderer.itemUsed(interactionhand);
|
||||
@@ -1725,6 +_,9 @@
|
||||
@@ -1764,6 +_,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,7 +320,7 @@
|
||||
if (!itemstack.isEmpty()) {
|
||||
InteractionResult interactionresult2 = this.gameMode.useItem(this.player, interactionhand);
|
||||
if (interactionresult2.consumesAction()) {
|
||||
@@ -1751,6 +_,8 @@
|
||||
@@ -1795,6 +_,8 @@
|
||||
--this.rightClickDelay;
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@
|
||||
this.profiler.push("gui");
|
||||
this.chatListener.tick();
|
||||
this.gui.tick(this.pause);
|
||||
@@ -1839,6 +_,7 @@
|
||||
@@ -1887,6 +_,7 @@
|
||||
|
||||
this.tutorial.tick();
|
||||
|
||||
@@ -337,7 +337,7 @@
|
||||
try {
|
||||
this.level.tick(() -> {
|
||||
return true;
|
||||
@@ -1854,6 +_,7 @@
|
||||
@@ -1902,6 +_,7 @@
|
||||
|
||||
throw new ReportedException(crashreport);
|
||||
}
|
||||
@@ -345,7 +345,7 @@
|
||||
}
|
||||
|
||||
this.profiler.popPush("animateTick");
|
||||
@@ -1873,6 +_,8 @@
|
||||
@@ -1921,6 +_,8 @@
|
||||
this.profiler.popPush("keyboard");
|
||||
this.keyboardHandler.tick();
|
||||
this.profiler.pop();
|
||||
@@ -354,36 +354,39 @@
|
||||
}
|
||||
|
||||
private boolean isMultiplayerServer() {
|
||||
@@ -2069,6 +_,7 @@
|
||||
@@ -2112,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void setLevel(ClientLevel p_91157_) {
|
||||
+ if (this.level != null) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.level.LevelEvent.Unload(this.level));
|
||||
+ if (this.level != null) net.minecraftforge.event.ForgeEventFactory.onLevelUnload(this.level);
|
||||
ProgressScreen progressscreen = new ProgressScreen(true);
|
||||
progressscreen.progressStartNoAbort(Component.translatable("connect.joining"));
|
||||
this.updateScreenAndTick(progressscreen);
|
||||
@@ -2102,10 +_,12 @@
|
||||
@@ -2146,6 +_,7 @@
|
||||
IntegratedServer integratedserver = this.singleplayerServer;
|
||||
this.singleplayerServer = null;
|
||||
this.gameRenderer.resetData();
|
||||
+ net.minecraftforge.client.ForgeHooksClient.firePlayerLogout(this.gameMode, this.player);
|
||||
this.gameMode = null;
|
||||
this.narrator.clear();
|
||||
this.updateScreenAndTick(p_91321_);
|
||||
if (this.level != null) {
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.level.LevelEvent.Unload(this.level));
|
||||
if (integratedserver != null) {
|
||||
this.profiler.push("waitForServer");
|
||||
this.clientLevelTeardownInProgress = true;
|
||||
@@ -2153,6 +_,7 @@
|
||||
try {
|
||||
this.updateScreenAndTick(p_91321_);
|
||||
if (this.level != null) {
|
||||
+ net.minecraftforge.event.ForgeEventFactory.onLevelUnload(this.level);
|
||||
if (integratedserver != null) {
|
||||
this.profiler.push("waitForServer");
|
||||
|
||||
@@ -2119,6 +_,7 @@
|
||||
this.downloadedPackSource.clearServerPack();
|
||||
this.gui.onDisconnected();
|
||||
this.isLocalServer = false;
|
||||
+ net.minecraftforge.client.ForgeHooksClient.handleClientLevelClosing(this.level);
|
||||
}
|
||||
@@ -2165,6 +_,7 @@
|
||||
|
||||
this.level = null;
|
||||
@@ -2243,6 +_,7 @@
|
||||
this.gui.onDisconnected();
|
||||
this.isLocalServer = false;
|
||||
+ net.minecraftforge.client.ForgeHooksClient.handleClientLevelClosing(this.level);
|
||||
}
|
||||
|
||||
this.level = null;
|
||||
@@ -2313,6 +_,7 @@
|
||||
|
||||
private void pickBlock() {
|
||||
if (this.hitResult != null && this.hitResult.getType() != HitResult.Type.MISS) {
|
||||
@@ -391,7 +394,7 @@
|
||||
boolean flag = this.player.getAbilities().instabuild;
|
||||
BlockEntity blockentity = null;
|
||||
HitResult.Type hitresult$type = this.hitResult.getType();
|
||||
@@ -2255,10 +_,7 @@
|
||||
@@ -2325,10 +_,7 @@
|
||||
}
|
||||
|
||||
Block block = blockstate.getBlock();
|
||||
@@ -403,7 +406,7 @@
|
||||
|
||||
if (flag && Screen.hasControlDown() && blockstate.hasBlockEntity()) {
|
||||
blockentity = this.level.getBlockEntity(blockpos);
|
||||
@@ -2269,7 +_,7 @@
|
||||
@@ -2339,7 +_,7 @@
|
||||
}
|
||||
|
||||
Entity entity = ((EntityHitResult)this.hitResult).getEntity();
|
||||
@@ -412,7 +415,7 @@
|
||||
if (itemstack == null) {
|
||||
return;
|
||||
}
|
||||
@@ -2808,6 +_,19 @@
|
||||
@@ -2904,6 +_,19 @@
|
||||
|
||||
public void updateMaxMipLevel(int p_91313_) {
|
||||
this.modelManager.updateMaxMipLevel(p_91313_);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/Options.java
|
||||
+++ b/net/minecraft/client/Options.java
|
||||
@@ -507,7 +_,8 @@
|
||||
@@ -509,7 +_,8 @@
|
||||
}, new OptionInstance.LazyEnum<>(() -> {
|
||||
return Stream.concat(Stream.of(""), Minecraft.getInstance().getSoundManager().getAvailableSoundDevices().stream()).toList();
|
||||
}, (p_232011_) -> {
|
||||
@@ -10,7 +10,7 @@
|
||||
}, Codec.STRING), "", (p_299350_) -> {
|
||||
SoundManager soundmanager = Minecraft.getInstance().getSoundManager();
|
||||
soundmanager.reload();
|
||||
@@ -835,6 +_,7 @@
|
||||
@@ -841,6 +_,7 @@
|
||||
}
|
||||
|
||||
public Options(Minecraft p_92138_, File p_92139_) {
|
||||
@@ -18,7 +18,7 @@
|
||||
this.minecraft = p_92138_;
|
||||
this.optionsFile = new File(p_92139_, "options.txt");
|
||||
boolean flag = p_92138_.is64Bit();
|
||||
@@ -957,11 +_,20 @@
|
||||
@@ -964,11 +_,20 @@
|
||||
p_168428_.process("telemetryOptInExtra", this.telemetryOptInExtra);
|
||||
this.onboardAccessibility = p_168428_.process("onboardAccessibility", this.onboardAccessibility);
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -980,6 +_,9 @@
|
||||
@@ -987,6 +_,9 @@
|
||||
}
|
||||
|
||||
public void load() {
|
||||
@@ -51,7 +51,7 @@
|
||||
try {
|
||||
if (!this.optionsFile.exists()) {
|
||||
return;
|
||||
@@ -1008,7 +_,8 @@
|
||||
@@ -1015,7 +_,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
@Nullable
|
||||
private String getValueOrNull(String p_168459_) {
|
||||
return compoundtag1.contains(p_168459_) ? compoundtag1.getString(p_168459_) : null;
|
||||
@@ -1181,6 +_,7 @@
|
||||
@@ -1188,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void broadcastOptions() {
|
||||
@@ -69,7 +69,7 @@
|
||||
if (this.minecraft.player != null) {
|
||||
this.minecraft.player.connection.send(new ServerboundClientInformationPacket(this.buildPlayerInformation()));
|
||||
}
|
||||
@@ -1239,6 +_,23 @@
|
||||
@@ -1246,6 +_,23 @@
|
||||
}
|
||||
|
||||
p_92146_.setSelected(set);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/Gui.java
|
||||
+++ b/net/minecraft/client/gui/Gui.java
|
||||
@@ -130,7 +_,7 @@
|
||||
@@ -131,7 +_,7 @@
|
||||
public float vignetteBrightness = 1.0F;
|
||||
protected int toolHighlightTimer;
|
||||
protected ItemStack lastToolHighlight = ItemStack.EMPTY;
|
||||
@@ -9,7 +9,7 @@
|
||||
protected final SubtitleOverlay subtitleOverlay;
|
||||
protected final SpectatorGui spectatorGui;
|
||||
protected final PlayerTabOverlay tabList;
|
||||
@@ -453,6 +_,8 @@
|
||||
@@ -454,6 +_,8 @@
|
||||
|
||||
for(MobEffectInstance mobeffectinstance : Ordering.natural().reverse().sortedCopy(collection)) {
|
||||
MobEffect mobeffect = mobeffectinstance.getEffect();
|
||||
@@ -18,7 +18,7 @@
|
||||
if (mobeffectinstance.showIcon()) {
|
||||
int i = this.screenWidth;
|
||||
int j = 1;
|
||||
@@ -481,6 +_,7 @@
|
||||
@@ -482,6 +_,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
TextureAtlasSprite textureatlassprite = mobeffecttexturemanager.get(mobeffect);
|
||||
int i1 = j;
|
||||
float f1 = f;
|
||||
@@ -601,16 +_,21 @@
|
||||
@@ -602,16 +_,21 @@
|
||||
}
|
||||
|
||||
public void renderSelectedItemName(GuiGraphics p_283501_) {
|
||||
@@ -51,7 +51,7 @@
|
||||
if (!this.minecraft.gameMode.canHurtPlayer()) {
|
||||
k += 14;
|
||||
}
|
||||
@@ -622,7 +_,13 @@
|
||||
@@ -623,7 +_,13 @@
|
||||
|
||||
if (l > 0) {
|
||||
p_283501_.fill(j - 2, k - 2, j + i + 2, k + 9 + 2, this.minecraft.options.getBackgroundColor(0));
|
||||
@@ -66,7 +66,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1069,7 +_,7 @@
|
||||
@@ -1080,7 +_,7 @@
|
||||
ItemStack itemstack = this.minecraft.player.getInventory().getSelected();
|
||||
if (itemstack.isEmpty()) {
|
||||
this.toolHighlightTimer = 0;
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
int i = p_282636_.drawInBatch(p_281596_, (float)p_281586_, (float)p_282816_, p_281743_, p_282394_, this.pose.last().pose(), this.bufferSource, Font.DisplayMode.NORMAL, 0, 15728880);
|
||||
this.flushIfUnmanaged();
|
||||
return i;
|
||||
@@ -511,6 +_,7 @@
|
||||
@@ -515,6 +_,7 @@
|
||||
crashreportcategory.setDetail("Item Type", () -> {
|
||||
return String.valueOf((Object)p_281675_.getItem());
|
||||
});
|
||||
@@ -41,7 +41,7 @@
|
||||
crashreportcategory.setDetail("Item Damage", () -> {
|
||||
return String.valueOf(p_281675_.getDamageValue());
|
||||
});
|
||||
@@ -558,18 +_,26 @@
|
||||
@@ -562,18 +_,26 @@
|
||||
}
|
||||
|
||||
this.pose.popPose();
|
||||
@@ -72,7 +72,7 @@
|
||||
this.renderTooltipInternal(p_283128_, list, p_283678_, p_281696_, DefaultTooltipPositioner.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -578,7 +_,15 @@
|
||||
@@ -582,7 +_,15 @@
|
||||
}
|
||||
|
||||
public void renderComponentTooltip(Font p_282739_, List<Component> p_281832_, int p_282191_, int p_282446_) {
|
||||
@@ -89,7 +89,7 @@
|
||||
}
|
||||
|
||||
public void renderTooltip(Font p_282192_, List<? extends FormattedCharSequence> p_282297_, int p_281680_, int p_283325_) {
|
||||
@@ -591,11 +_,13 @@
|
||||
@@ -595,11 +_,13 @@
|
||||
|
||||
private void renderTooltipInternal(Font p_282675_, List<ClientTooltipComponent> p_282615_, int p_283230_, int p_283417_, ClientTooltipPositioner p_282442_) {
|
||||
if (!p_282615_.isEmpty()) {
|
||||
@@ -104,7 +104,7 @@
|
||||
if (k > i) {
|
||||
i = k;
|
||||
}
|
||||
@@ -605,20 +_,21 @@
|
||||
@@ -609,20 +_,21 @@
|
||||
|
||||
int i2 = i;
|
||||
int j2 = j;
|
||||
@@ -129,7 +129,7 @@
|
||||
k1 += clienttooltipcomponent1.getHeight() + (l1 == 0 ? 2 : 0);
|
||||
}
|
||||
|
||||
@@ -626,7 +_,7 @@
|
||||
@@ -630,7 +_,7 @@
|
||||
|
||||
for(int k2 = 0; k2 < p_282615_.size(); ++k2) {
|
||||
ClientTooltipComponent clienttooltipcomponent2 = p_282615_.get(k2);
|
||||
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
--- a/net/minecraft/client/gui/components/AbstractSelectionList.java
|
||||
+++ b/net/minecraft/client/gui/components/AbstractSelectionList.java
|
||||
@@ -504,6 +_,13 @@
|
||||
return new ScreenRectangle(this.x0, this.y0, this.x1 - this.x0, this.y1 - this.y0);
|
||||
}
|
||||
|
||||
+ public int getWidth() { return this.width; }
|
||||
+ public int getHeight() { return this.height; }
|
||||
+ public int getTop() { return this.y0; }
|
||||
+ public int getBottom() { return this.y1; }
|
||||
+ public int getLeft() { return this.x0; }
|
||||
+ public int getRight() { return this.x1; }
|
||||
+
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
protected abstract static class Entry<E extends AbstractSelectionList.Entry<E>> implements GuiEventListener {
|
||||
/** @deprecated */
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/components/AbstractWidget.java
|
||||
+++ b/net/minecraft/client/gui/components/AbstractWidget.java
|
||||
@@ -259,6 +_,19 @@
|
||||
@@ -233,6 +_,19 @@
|
||||
this.focused = p_93693_;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/components/Button.java
|
||||
+++ b/net/minecraft/client/gui/components/Button.java
|
||||
@@ -29,6 +_,11 @@
|
||||
@@ -30,6 +_,11 @@
|
||||
this.createNarration = p_259552_;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public void onPress() {
|
||||
this.onPress.onPress(this);
|
||||
}
|
||||
@@ -92,9 +_,11 @@
|
||||
@@ -93,9 +_,11 @@
|
||||
}
|
||||
|
||||
public Button build() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/components/DebugScreenOverlay.java
|
||||
+++ b/net/minecraft/client/gui/components/DebugScreenOverlay.java
|
||||
@@ -93,9 +_,9 @@
|
||||
@@ -95,9 +_,9 @@
|
||||
@Nullable
|
||||
private CompletableFuture<LevelChunk> serverChunk;
|
||||
private boolean renderDebug;
|
||||
@@ -13,7 +13,7 @@
|
||||
private final SampleLogger frameTimeLogger = new SampleLogger();
|
||||
private final SampleLogger tickTimeLogger = new SampleLogger();
|
||||
private final SampleLogger pingLogger = new SampleLogger();
|
||||
@@ -120,14 +_,18 @@
|
||||
@@ -124,14 +_,18 @@
|
||||
this.clientChunk = null;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
if (this.renderFpsCharts) {
|
||||
int i = p_281427_.guiWidth();
|
||||
int j = i / 2;
|
||||
@@ -137,7 +_,9 @@
|
||||
@@ -141,7 +_,9 @@
|
||||
this.tpsChart.drawChart(p_281427_, i - k, k);
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@
|
||||
if (this.renderNetworkCharts) {
|
||||
int l = p_281427_.guiWidth();
|
||||
int i1 = l / 2;
|
||||
@@ -148,17 +_,32 @@
|
||||
@@ -152,17 +_,32 @@
|
||||
int j1 = this.pingChart.getWidth(i1);
|
||||
this.pingChart.drawChart(p_281427_, l - j1, j1);
|
||||
}
|
||||
@@ -82,7 +82,7 @@
|
||||
this.renderLines(p_281525_, list, true);
|
||||
}
|
||||
|
||||
@@ -430,6 +_,7 @@
|
||||
@@ -451,6 +_,7 @@
|
||||
list.add("");
|
||||
list.add(ChatFormatting.UNDERLINE + "Targeted Entity");
|
||||
list.add(String.valueOf((Object)BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType())));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/screens/ConnectScreen.java
|
||||
+++ b/net/minecraft/client/gui/screens/ConnectScreen.java
|
||||
@@ -84,6 +_,8 @@
|
||||
@@ -85,6 +_,8 @@
|
||||
}
|
||||
|
||||
if (optional.isEmpty()) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/screens/MenuScreens.java
|
||||
+++ b/net/minecraft/client/gui/screens/MenuScreens.java
|
||||
@@ -40,6 +_,10 @@
|
||||
@@ -41,6 +_,10 @@
|
||||
private static final Map<MenuType<?>, MenuScreens.ScreenConstructor<?, ?>> SCREENS = Maps.newHashMap();
|
||||
|
||||
public static <T extends AbstractContainerMenu> void create(@Nullable MenuType<T> p_96202_, Minecraft p_96203_, int p_96204_, Component p_96205_) {
|
||||
@@ -11,7 +11,7 @@
|
||||
if (p_96202_ == null) {
|
||||
LOGGER.warn("Trying to open invalid screen with name: {}", (Object)p_96205_.getString());
|
||||
} else {
|
||||
@@ -47,9 +_,10 @@
|
||||
@@ -48,9 +_,10 @@
|
||||
if (screenconstructor == null) {
|
||||
LOGGER.warn("Failed to create screen for menu type: {}", (Object)BuiltInRegistries.MENU.getKey(p_96202_));
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/screens/PauseScreen.java
|
||||
+++ b/net/minecraft/client/gui/screens/PauseScreen.java
|
||||
@@ -88,6 +_,7 @@
|
||||
@@ -87,6 +_,7 @@
|
||||
} else {
|
||||
gridlayout$rowhelper.addChild(this.openScreenButton(PLAYER_REPORTING, SocialInteractionsScreen::new));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/screens/TitleScreen.java
|
||||
+++ b/net/minecraft/client/gui/screens/TitleScreen.java
|
||||
@@ -64,6 +_,7 @@
|
||||
@@ -63,6 +_,7 @@
|
||||
@Nullable
|
||||
private TitleScreen.WarningLabel warningLabel;
|
||||
private final LogoRenderer logoRenderer;
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
public TitleScreen() {
|
||||
this(false);
|
||||
@@ -114,11 +_,15 @@
|
||||
@@ -113,11 +_,15 @@
|
||||
int j = this.width - i - 2;
|
||||
int k = 24;
|
||||
int l = this.height / 4 + 48;
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
SpriteIconButton spriteiconbutton = this.addRenderableWidget(CommonButtons.language(20, (p_280830_) -> {
|
||||
this.minecraft.setScreen(new LanguageSelectScreen(this, this.minecraft.options, this.minecraft.getLanguageManager()));
|
||||
@@ -164,7 +_,7 @@
|
||||
@@ -163,7 +_,7 @@
|
||||
}).bounds(this.width / 2 - 100, p_96764_ + p_96765_ * 1, 200, 20).tooltip(tooltip).build())).active = flag;
|
||||
(this.addRenderableWidget(Button.builder(Component.translatable("menu.online"), (p_210872_) -> {
|
||||
this.realmsButtonClicked();
|
||||
@@ -33,15 +33,15 @@
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -248,6 +_,7 @@
|
||||
@@ -243,6 +_,7 @@
|
||||
this.warningLabel.render(p_282860_, i);
|
||||
}
|
||||
|
||||
+ net.minecraftforge.client.ForgeHooksClient.renderMainMenu(this, p_282860_, this.font, this.width, this.height, i);
|
||||
if (this.splash != null) {
|
||||
if (this.splash != null && !this.minecraft.options.hideSplashTexts().get()) {
|
||||
this.splash.render(p_282860_, this.width, this.font, i);
|
||||
}
|
||||
@@ -263,7 +_,14 @@
|
||||
@@ -258,7 +_,14 @@
|
||||
s = s + I18n.get("menu.modded");
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
for(GuiEventListener guieventlistener : this.children()) {
|
||||
if (guieventlistener instanceof AbstractWidget) {
|
||||
@@ -276,6 +_,7 @@
|
||||
@@ -271,6 +_,7 @@
|
||||
RenderSystem.enableDepthTest();
|
||||
this.realmsNotificationsScreen.render(p_282860_, p_281753_, p_283539_, p_282628_);
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/screens/advancements/AdvancementTab.java
|
||||
+++ b/net/minecraft/client/gui/screens/advancements/AdvancementTab.java
|
||||
@@ -38,6 +_,7 @@
|
||||
@@ -37,6 +_,7 @@
|
||||
private int maxY = Integer.MIN_VALUE;
|
||||
private float fade;
|
||||
private boolean centered;
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
public AdvancementTab(Minecraft p_97145_, AdvancementsScreen p_97146_, AdvancementTabType p_97147_, int p_97148_, AdvancementNode p_297568_, DisplayInfo p_97150_) {
|
||||
this.minecraft = p_97145_;
|
||||
@@ -52,6 +_,15 @@
|
||||
@@ -51,6 +_,15 @@
|
||||
this.addWidget(this.root, p_297568_.holder());
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
public AdvancementTabType getType() {
|
||||
return this.type;
|
||||
}
|
||||
@@ -146,8 +_,8 @@
|
||||
@@ -145,8 +_,8 @@
|
||||
return null;
|
||||
} else {
|
||||
for(AdvancementTabType advancementtabtype : AdvancementTabType.values()) {
|
||||
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
--- a/net/minecraft/client/gui/screens/controls/KeyBindsScreen.java
|
||||
+++ b/net/minecraft/client/gui/screens/controls/KeyBindsScreen.java
|
||||
@@ -31,7 +_,7 @@
|
||||
this.addWidget(this.keyBindsList);
|
||||
@@ -30,7 +_,7 @@
|
||||
this.keyBindsList = this.addRenderableWidget(new KeyBindsList(this, this.minecraft));
|
||||
this.resetButton = this.addRenderableWidget(Button.builder(Component.translatable("controls.resetAll"), (p_269619_) -> {
|
||||
for(KeyMapping keymapping : this.options.keyMappings) {
|
||||
- keymapping.setKey(keymapping.getDefaultKey());
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
this.keyBindsList.resetMappingAndUpdateButtons();
|
||||
@@ -55,11 +_,13 @@
|
||||
@@ -54,11 +_,13 @@
|
||||
public boolean keyPressed(int p_193987_, int p_193988_, int p_193989_) {
|
||||
if (this.selectedKey != null) {
|
||||
if (p_193987_ == 256) {
|
||||
@@ -24,7 +24,7 @@
|
||||
this.selectedKey = null;
|
||||
this.lastKeySelection = Util.getMillis();
|
||||
this.keyBindsList.resetMappingAndUpdateButtons();
|
||||
@@ -67,6 +_,19 @@
|
||||
@@ -66,6 +_,19 @@
|
||||
} else {
|
||||
return super.keyPressed(p_193987_, p_193988_, p_193989_);
|
||||
}
|
||||
|
||||
+9
-9
@@ -52,7 +52,7 @@
|
||||
p_282567_.pose().popPose();
|
||||
}
|
||||
|
||||
@@ -274,7 +_,8 @@
|
||||
@@ -280,7 +_,8 @@
|
||||
if (super.mouseClicked(p_97748_, p_97749_, p_97750_)) {
|
||||
return true;
|
||||
} else {
|
||||
@@ -62,7 +62,7 @@
|
||||
Slot slot = this.findSlot(p_97748_, p_97749_);
|
||||
long i = Util.getMillis();
|
||||
this.doubleclick = this.lastClickSlot == slot && i - this.lastClickTime < 250L && this.lastClickButton == p_97750_;
|
||||
@@ -285,6 +_,7 @@
|
||||
@@ -291,6 +_,7 @@
|
||||
int j = this.leftPos;
|
||||
int k = this.topPos;
|
||||
boolean flag1 = this.hasClickedOutside(p_97748_, p_97749_, j, k, p_97750_);
|
||||
@@ -70,7 +70,7 @@
|
||||
int l = -1;
|
||||
if (slot != null) {
|
||||
l = slot.index;
|
||||
@@ -310,7 +_,7 @@
|
||||
@@ -316,7 +_,7 @@
|
||||
}
|
||||
} else if (!this.isQuickCrafting) {
|
||||
if (this.menu.getCarried().isEmpty()) {
|
||||
@@ -79,7 +79,7 @@
|
||||
this.slotClicked(slot, l, p_97750_, ClickType.CLONE);
|
||||
} else {
|
||||
boolean flag2 = l != -999 && (InputConstants.isKeyDown(Minecraft.getInstance().getWindow().getWindow(), 340) || InputConstants.isKeyDown(Minecraft.getInstance().getWindow().getWindow(), 344));
|
||||
@@ -334,7 +_,7 @@
|
||||
@@ -340,7 +_,7 @@
|
||||
this.quickCraftingType = 0;
|
||||
} else if (p_97750_ == 1) {
|
||||
this.quickCraftingType = 1;
|
||||
@@ -88,7 +88,7 @@
|
||||
this.quickCraftingType = 2;
|
||||
}
|
||||
}
|
||||
@@ -403,10 +_,13 @@
|
||||
@@ -409,10 +_,13 @@
|
||||
}
|
||||
|
||||
public boolean mouseReleased(double p_97812_, double p_97813_, int p_97814_) {
|
||||
@@ -102,7 +102,7 @@
|
||||
int k = -1;
|
||||
if (slot != null) {
|
||||
k = slot.index;
|
||||
@@ -420,7 +_,7 @@
|
||||
@@ -426,7 +_,7 @@
|
||||
if (hasShiftDown()) {
|
||||
if (!this.lastQuickMoved.isEmpty()) {
|
||||
for(Slot slot2 : this.menu.slots) {
|
||||
@@ -111,7 +111,7 @@
|
||||
this.slotClicked(slot2, slot2.index, p_97814_, ClickType.QUICK_MOVE);
|
||||
}
|
||||
}
|
||||
@@ -483,7 +_,7 @@
|
||||
@@ -489,7 +_,7 @@
|
||||
|
||||
this.slotClicked((Slot)null, -999, AbstractContainerMenu.getQuickcraftMask(2, this.quickCraftingType), ClickType.QUICK_CRAFT);
|
||||
} else if (!this.menu.getCarried().isEmpty()) {
|
||||
@@ -120,7 +120,7 @@
|
||||
this.slotClicked(slot, k, p_97814_, ClickType.CLONE);
|
||||
} else {
|
||||
boolean flag1 = k != -999 && (InputConstants.isKeyDown(Minecraft.getInstance().getWindow().getWindow(), 340) || InputConstants.isKeyDown(Minecraft.getInstance().getWindow().getWindow(), 344));
|
||||
@@ -530,34 +_,39 @@
|
||||
@@ -540,34 +_,39 @@
|
||||
}
|
||||
|
||||
public boolean keyPressed(int p_97765_, int p_97766_, int p_97767_) {
|
||||
@@ -167,7 +167,7 @@
|
||||
this.slotClicked(this.hoveredSlot, this.hoveredSlot.index, i, ClickType.SWAP);
|
||||
return true;
|
||||
}
|
||||
@@ -592,6 +_,18 @@
|
||||
@@ -602,6 +_,18 @@
|
||||
|
||||
public T getMenu() {
|
||||
return this.menu;
|
||||
|
||||
+1
-1
@@ -42,4 +42,4 @@
|
||||
+ }
|
||||
Component component = this.getEffectName(mobeffectinstance);
|
||||
p_281462_.drawString(this.font, component, p_283484_ + 10 + 18, i + 6, 16777215);
|
||||
Component component1 = MobEffectUtil.formatDuration(mobeffectinstance, 1.0F);
|
||||
Component component1 = MobEffectUtil.formatDuration(mobeffectinstance, 1.0F, this.minecraft.level.tickRateManager().tickrate());
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java
|
||||
+++ b/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java
|
||||
@@ -346,6 +_,8 @@
|
||||
@@ -342,6 +_,8 @@
|
||||
this.screen.setToolTip(list1);
|
||||
}
|
||||
|
||||
|
||||
+5
-10
@@ -1,16 +1,11 @@
|
||||
--- a/net/minecraft/client/gui/screens/packs/PackSelectionScreen.java
|
||||
+++ b/net/minecraft/client/gui/screens/packs/PackSelectionScreen.java
|
||||
@@ -138,10 +_,10 @@
|
||||
@@ -136,7 +_,7 @@
|
||||
TransferableSelectionList.PackEntry transferableselectionlist$packentry = p_100014_.getSelected();
|
||||
String s = transferableselectionlist$packentry == null ? "" : transferableselectionlist$packentry.getPackId();
|
||||
p_100014_.setSelected((TransferableSelectionList.PackEntry)null);
|
||||
- p_100015_.forEach((p_280875_) -> {
|
||||
- TransferableSelectionList.PackEntry transferableselectionlist$packentry1 = new TransferableSelectionList.PackEntry(this.minecraft, p_100014_, p_280875_);
|
||||
+ p_100015_.filter(PackSelectionModel.Entry::notHidden).forEach((p_264692_) -> {
|
||||
+ TransferableSelectionList.PackEntry transferableselectionlist$packentry1 = new TransferableSelectionList.PackEntry(this.minecraft, p_100014_, p_264692_);
|
||||
- p_100015_.forEach((p_308207_) -> {
|
||||
+ p_100015_.filter(PackSelectionModel.Entry::notHidden).forEach((p_308207_) -> {
|
||||
TransferableSelectionList.PackEntry transferableselectionlist$packentry1 = new TransferableSelectionList.PackEntry(this.minecraft, p_100014_, p_308207_);
|
||||
p_100014_.children().add(transferableselectionlist$packentry1);
|
||||
- if (p_280875_.getId().equals(s)) {
|
||||
+ if (p_264692_.getId().equals(s)) {
|
||||
p_100014_.setSelected(transferableselectionlist$packentry1);
|
||||
}
|
||||
|
||||
if (p_308207_.getId().equals(s)) {
|
||||
+40
-42
@@ -1,49 +1,47 @@
|
||||
--- a/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java
|
||||
+++ b/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java
|
||||
@@ -181,13 +_,23 @@
|
||||
@@ -280,12 +_,19 @@
|
||||
}
|
||||
|
||||
private void doLoadLevel(Screen p_233146_, String p_233147_, boolean p_233148_, boolean p_233149_) {
|
||||
+ // FORGE: Patch in overload to reduce further patching
|
||||
+ this.doLoadLevel(p_233146_, p_233147_, p_233148_, p_233149_, false);
|
||||
private void loadLevel(LevelStorageSource.LevelStorageAccess p_309733_, Dynamic<?> p_312455_, boolean p_310657_, boolean p_309504_, Runnable p_309915_) {
|
||||
+ loadLevel(p_309733_, p_312455_, p_310657_, p_309504_, p_309915_, false);
|
||||
+ }
|
||||
+
|
||||
+ // FORGE: Patch in confirmExperimentalWarning which confirms the experimental warning when true
|
||||
+ private void doLoadLevel(Screen p_233146_, String p_233147_, boolean p_233148_, boolean p_233149_, boolean confirmExperimentalWarning) {
|
||||
LevelStorageSource.LevelStorageAccess levelstoragesource$levelstorageaccess = this.createWorldAccess(p_233147_);
|
||||
if (levelstoragesource$levelstorageaccess != null) {
|
||||
PackRepository packrepository = ServerPacksSource.createPackRepository(levelstoragesource$levelstorageaccess);
|
||||
+ private void loadLevel(LevelStorageSource.LevelStorageAccess p_309733_, Dynamic<?> p_312455_, boolean p_310657_, boolean p_309504_, Runnable p_309915_, boolean confirmExperimentalWarning) {
|
||||
this.minecraft.forceSetScreen(new GenericDirtMessageScreen(Component.translatable("selectWorld.resource_load")));
|
||||
PackRepository packrepository = ServerPacksSource.createPackRepository(p_309733_);
|
||||
|
||||
WorldStem worldstem;
|
||||
try {
|
||||
+ levelstoragesource$levelstorageaccess.readAdditionalLevelSaveData(); // Read extra (e.g. modded) data from the world before creating it
|
||||
worldstem = this.loadWorldStem(levelstoragesource$levelstorageaccess, p_233148_, packrepository);
|
||||
+ if (confirmExperimentalWarning && worldstem.worldData() instanceof PrimaryLevelData pld) {
|
||||
+ pld.withConfirmedWarning(true);
|
||||
+ }
|
||||
} catch (Exception exception) {
|
||||
LOGGER.warn("Failed to load level data or datapacks, can't proceed with server load", (Throwable)exception);
|
||||
if (!p_233148_) {
|
||||
@@ -207,7 +_,9 @@
|
||||
WorldData worlddata = worldstem.worldData();
|
||||
boolean flag = worlddata.worldGenOptions().isOldCustomizedWorld();
|
||||
boolean flag1 = worlddata.worldGenSettingsLifecycle() != Lifecycle.stable();
|
||||
- if (!p_233149_ || !flag && !flag1) {
|
||||
+ // Forge: Skip confirmation if it has been done already for this world
|
||||
+ boolean skipConfirmation = worlddata instanceof PrimaryLevelData pld && pld.hasConfirmedExperimentalWarning();
|
||||
+ if (skipConfirmation || !p_233149_ || !flag && !flag1) {
|
||||
this.minecraft.getDownloadedPackSource().loadBundledResourcePack(levelstoragesource$levelstorageaccess).thenApply((p_233177_) -> {
|
||||
return true;
|
||||
}).exceptionallyComposeAsync((p_233183_) -> {
|
||||
@@ -229,9 +_,11 @@
|
||||
return null;
|
||||
});
|
||||
} else {
|
||||
+ if (flag) // Forge: For legacy world options, let vanilla handle it.
|
||||
this.askForBackup(p_233146_, p_233147_, flag, () -> {
|
||||
this.doLoadLevel(p_233146_, p_233147_, p_233148_, false);
|
||||
});
|
||||
+ else net.minecraftforge.client.ForgeHooksClient.createWorldConfirmationScreen(() -> this.doLoadLevel(p_233146_, p_233147_, p_233148_, false, true));
|
||||
worldstem.close();
|
||||
safeCloseAccess(levelstoragesource$levelstorageaccess, p_233147_);
|
||||
}
|
||||
+ net.minecraftforge.common.ForgeHooks.readAdditionalLevelSaveData(p_312455_, p_309733_.getLevelDirectory());
|
||||
+
|
||||
WorldStem worldstem;
|
||||
try {
|
||||
worldstem = this.loadWorldStem(p_312455_, p_310657_, packrepository);
|
||||
+ if (confirmExperimentalWarning && worldstem.worldData() instanceof PrimaryLevelData pld) pld.withConfirmedWarning(true);
|
||||
} catch (Exception exception) {
|
||||
LOGGER.warn("Failed to load level data or datapacks, can't proceed with server load", (Throwable)exception);
|
||||
if (!p_310657_) {
|
||||
@@ -305,7 +_,8 @@
|
||||
|
||||
WorldData worlddata = worldstem.worldData();
|
||||
boolean flag = worlddata.worldGenOptions().isOldCustomizedWorld();
|
||||
- boolean flag1 = worlddata.worldGenSettingsLifecycle() != Lifecycle.stable();
|
||||
+ boolean skipConfirmation = worlddata instanceof PrimaryLevelData pld && pld.hasConfirmedExperimentalWarning();
|
||||
+ boolean flag1 = worlddata.worldGenSettingsLifecycle() != Lifecycle.stable() && !skipConfirmation;
|
||||
if (!p_309504_ || !flag && !flag1) {
|
||||
DownloadedPackSource downloadedpacksource = this.minecraft.getDownloadedPackSource();
|
||||
this.loadBundledResourcePack(downloadedpacksource, p_309733_).thenApply((p_233177_) -> {
|
||||
@@ -328,12 +_,14 @@
|
||||
return null;
|
||||
});
|
||||
} else {
|
||||
+ if (flag) // Forge: For legacy world options, let vanilla handle it.
|
||||
this.askForBackup(p_309733_, flag, () -> {
|
||||
this.loadLevel(p_309733_, p_312455_, p_310657_, false, p_309915_);
|
||||
}, () -> {
|
||||
p_309733_.safeClose();
|
||||
p_309915_.run();
|
||||
});
|
||||
+ else net.minecraftforge.client.ForgeHooksClient.createWorldConfirmationScreen(() -> this.loadLevel(p_309733_, p_312455_, p_310657_, false, p_309915_, true));
|
||||
worldstem.close();
|
||||
}
|
||||
}
|
||||
+6
-6
@@ -1,14 +1,14 @@
|
||||
--- a/net/minecraft/client/gui/screens/worldselection/WorldSelectionList.java
|
||||
+++ b/net/minecraft/client/gui/screens/worldselection/WorldSelectionList.java
|
||||
@@ -74,6 +_,7 @@
|
||||
@@ -76,6 +_,7 @@
|
||||
static final ResourceLocation JOIN_SPRITE = new ResourceLocation("world_list/join");
|
||||
static final Logger LOGGER = LogUtils.getLogger();
|
||||
static final DateFormat DATE_FORMAT = new SimpleDateFormat();
|
||||
private static final ResourceLocation ICON_MISSING = new ResourceLocation("textures/misc/unknown_server.png");
|
||||
+ private static final ResourceLocation FORGE_EXPERIMENTAL_WARNING_ICON = new ResourceLocation("forge","textures/gui/experimental_warning.png");
|
||||
static final Component FROM_NEWER_TOOLTIP_1 = Component.translatable("selectWorld.tooltip.fromNewerVersion1").withStyle(ChatFormatting.RED);
|
||||
static final Component FROM_NEWER_TOOLTIP_2 = Component.translatable("selectWorld.tooltip.fromNewerVersion2").withStyle(ChatFormatting.RED);
|
||||
static final Component SNAPSHOT_TOOLTIP_1 = Component.translatable("selectWorld.tooltip.snapshot1").withStyle(ChatFormatting.GOLD);
|
||||
@@ -362,6 +_,7 @@
|
||||
@@ -372,6 +_,7 @@
|
||||
RenderSystem.enableBlend();
|
||||
p_281612_.blit(this.icon.textureLocation(), p_282820_, p_283181_, 0.0F, 0.0F, 32, 32, 32, 32);
|
||||
RenderSystem.disableBlend();
|
||||
@@ -16,10 +16,10 @@
|
||||
if (this.minecraft.options.touchscreen().get() || p_283396_) {
|
||||
p_281612_.fill(p_282820_, p_283181_, p_282820_ + 32, p_283181_ + 32, -1601138544);
|
||||
int j = p_283204_ - p_282820_;
|
||||
@@ -608,6 +_,19 @@
|
||||
@@ -579,6 +_,19 @@
|
||||
|
||||
public boolean isSelectable() {
|
||||
return !this.summary.isDisabled();
|
||||
public String getLevelName() {
|
||||
return this.summary.getLevelName();
|
||||
+ }
|
||||
+
|
||||
+ // FORGE: Patch in experimental warning icon for worlds in the world selection screen
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
--- a/net/minecraft/client/main/Main.java
|
||||
+++ b/net/minecraft/client/main/Main.java
|
||||
@@ -150,8 +_,8 @@
|
||||
}
|
||||
|
||||
@@ -152,8 +_,8 @@
|
||||
CrashReport.preload();
|
||||
- Bootstrap.bootStrap();
|
||||
GameLoadTimesEvent.INSTANCE.setBootstrapTime(Bootstrap.bootstrapDuration.get());
|
||||
+ net.minecraftforge.fml.loading.BackgroundWaiter.runAndTick(()->Bootstrap.bootStrap(), net.minecraftforge.fml.loading.FMLLoader.progressWindowTick);
|
||||
Bootstrap.validate();
|
||||
Util.startTimerHackThread();
|
||||
String s12 = optionspec25.value(optionset);
|
||||
|
||||
try {
|
||||
- Bootstrap.bootStrap();
|
||||
GameLoadTimesEvent.INSTANCE.setBootstrapTime(Bootstrap.bootstrapDuration.get());
|
||||
+ net.minecraftforge.fml.loading.BackgroundWaiter.runAndTick(()->Bootstrap.bootStrap(), net.minecraftforge.fml.loading.FMLLoader.progressWindowTick);
|
||||
Bootstrap.validate();
|
||||
} catch (Throwable throwable2) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable2, "Bootstrap");
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/model/HumanoidModel.java
|
||||
+++ b/net/minecraft/client/model/HumanoidModel.java
|
||||
@@ -270,6 +_,8 @@
|
||||
@@ -272,6 +_,8 @@
|
||||
case TOOT_HORN:
|
||||
this.rightArm.xRot = Mth.clamp(this.head.xRot, -1.2F, 1.2F) - 1.4835298F;
|
||||
this.rightArm.yRot = this.head.yRot - ((float)Math.PI / 6F);
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -314,6 +_,8 @@
|
||||
@@ -315,6 +_,8 @@
|
||||
case TOOT_HORN:
|
||||
this.leftArm.xRot = Mth.clamp(this.head.xRot, -1.2F, 1.2F) - 1.4835298F;
|
||||
this.leftArm.yRot = this.head.yRot + ((float)Math.PI / 6F);
|
||||
@@ -18,7 +18,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -406,7 +_,7 @@
|
||||
@@ -412,7 +_,7 @@
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@@ -27,7 +27,7 @@
|
||||
EMPTY(false),
|
||||
ITEM(false),
|
||||
BLOCK(false),
|
||||
@@ -422,10 +_,29 @@
|
||||
@@ -428,10 +_,29 @@
|
||||
|
||||
private ArmPose(boolean p_102896_) {
|
||||
this.twoHanded = p_102896_;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/model/geom/LayerDefinitions.java
|
||||
+++ b/net/minecraft/client/model/geom/LayerDefinitions.java
|
||||
@@ -319,6 +_,7 @@
|
||||
@@ -325,6 +_,7 @@
|
||||
WoodType.values().forEach((p_247864_) -> {
|
||||
builder.put(ModelLayers.createHangingSignModelName(p_247864_), layerdefinition24);
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/model/geom/ModelLayers.java
|
||||
+++ b/net/minecraft/client/model/geom/ModelLayers.java
|
||||
@@ -220,11 +_,13 @@
|
||||
@@ -224,11 +_,13 @@
|
||||
}
|
||||
|
||||
public static ModelLayerLocation createSignModelName(WoodType p_171292_) {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/multiplayer/ClientCommonPacketListenerImpl.java
|
||||
+++ b/net/minecraft/client/multiplayer/ClientCommonPacketListenerImpl.java
|
||||
@@ -89,6 +_,7 @@
|
||||
@@ -93,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void handleCustomPayload(ClientboundCustomPayloadPacket p_298103_) {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/multiplayer/ClientConfigurationPacketListenerImpl.java
|
||||
+++ b/net/minecraft/client/multiplayer/ClientConfigurationPacketListenerImpl.java
|
||||
@@ -71,6 +_,7 @@
|
||||
@@ -72,6 +_,7 @@
|
||||
this.connection.setListener(new ClientPacketListener(this.minecraft, this.connection, new CommonListenerCookie(this.localGameProfile, this.telemetryManager, this.receivedRegistries, this.enabledFeatures, this.serverBrand, this.serverData, this.postDisconnectScreen)));
|
||||
this.connection.resumeInboundAfterProtocolChange();
|
||||
this.connection.send(new ServerboundFinishConfigurationPacket());
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/multiplayer/ClientHandshakePacketListenerImpl.java
|
||||
+++ b/net/minecraft/client/multiplayer/ClientHandshakePacketListenerImpl.java
|
||||
@@ -156,6 +_,7 @@
|
||||
@@ -157,6 +_,7 @@
|
||||
public void onDisconnect(Component p_104543_) {
|
||||
if (this.serverData != null && this.serverData.isRealm()) {
|
||||
this.minecraft.setScreen(new DisconnectedRealmsScreen(this.parent, CommonComponents.CONNECT_FAILED, p_104543_));
|
||||
@@ -8,7 +8,7 @@
|
||||
} else {
|
||||
this.minecraft.setScreen(new DisconnectedScreen(this.parent, CommonComponents.CONNECT_FAILED, p_104543_));
|
||||
}
|
||||
@@ -178,6 +_,7 @@
|
||||
@@ -179,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void handleCustomQuery(ClientboundCustomQueryPacket p_104545_) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/multiplayer/ClientLevel.java
|
||||
+++ b/net/minecraft/client/multiplayer/ClientLevel.java
|
||||
@@ -116,12 +_,15 @@
|
||||
@@ -118,12 +_,15 @@
|
||||
p_194170_.put(BiomeColors.WATER_COLOR_RESOLVER, new BlockTintCache((p_194168_) -> {
|
||||
return this.calculateBlockTint(p_194168_, BiomeColors.WATER_COLOR_RESOLVER);
|
||||
}));
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
public void handleBlockChangedAck(int p_233652_) {
|
||||
this.blockStatePredictionHandler.endPredictionsUpTo(p_233652_, this);
|
||||
@@ -175,6 +_,8 @@
|
||||
@@ -178,6 +_,8 @@
|
||||
this.serverSimulationDistance = p_205510_;
|
||||
this.updateSkyBrightness();
|
||||
this.prepareWeather();
|
||||
@@ -25,7 +25,7 @@
|
||||
}
|
||||
|
||||
public void queueLightUpdate(Runnable p_194172_) {
|
||||
@@ -265,6 +_,7 @@
|
||||
@@ -271,6 +_,7 @@
|
||||
this.getProfiler().push(() -> {
|
||||
return BuiltInRegistries.ENTITY_TYPE.getKey(p_104640_.getType()).toString();
|
||||
});
|
||||
@@ -33,7 +33,7 @@
|
||||
p_104640_.tick();
|
||||
this.getProfiler().pop();
|
||||
|
||||
@@ -320,8 +_,10 @@
|
||||
@@ -326,8 +_,10 @@
|
||||
}
|
||||
|
||||
public void addEntity(Entity p_104741_) {
|
||||
@@ -44,7 +44,7 @@
|
||||
}
|
||||
|
||||
public void removeEntity(int p_171643_, Entity.RemovalReason p_171644_) {
|
||||
@@ -448,6 +_,12 @@
|
||||
@@ -457,6 +_,12 @@
|
||||
}
|
||||
|
||||
public void playSeededSound(@Nullable Player p_263381_, double p_263372_, double p_263404_, double p_263365_, Holder<SoundEvent> p_263335_, SoundSource p_263417_, float p_263416_, float p_263349_, long p_263408_) {
|
||||
@@ -57,7 +57,7 @@
|
||||
if (p_263381_ == this.minecraft.player) {
|
||||
this.playSound(p_263372_, p_263404_, p_263365_, p_263335_.value(), p_263417_, p_263416_, p_263349_, false, p_263408_);
|
||||
}
|
||||
@@ -455,6 +_,12 @@
|
||||
@@ -464,6 +_,12 @@
|
||||
}
|
||||
|
||||
public void playSeededSound(@Nullable Player p_263514_, Entity p_263536_, Holder<SoundEvent> p_263518_, SoundSource p_263487_, float p_263538_, float p_263524_, long p_263509_) {
|
||||
@@ -70,7 +70,7 @@
|
||||
if (p_263514_ == this.minecraft.player) {
|
||||
this.minecraft.getSoundManager().play(new EntityBoundSoundInstance(p_263518_.value(), p_263487_, p_263538_, p_263524_, p_263536_, p_263509_));
|
||||
}
|
||||
@@ -892,6 +_,7 @@
|
||||
@@ -909,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void setDifficulty(Difficulty p_104852_) {
|
||||
@@ -78,7 +78,7 @@
|
||||
this.difficulty = p_104852_;
|
||||
}
|
||||
|
||||
@@ -929,14 +_,46 @@
|
||||
@@ -946,14 +_,46 @@
|
||||
ClientLevel.this.players.add((AbstractClientPlayer)p_171712_);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/multiplayer/ClientPacketListener.java
|
||||
+++ b/net/minecraft/client/multiplayer/ClientPacketListener.java
|
||||
@@ -385,6 +_,7 @@
|
||||
@@ -398,6 +_,7 @@
|
||||
|
||||
this.minecraft.debugRenderer.clear();
|
||||
this.minecraft.player.resetPos();
|
||||
@@ -8,7 +8,7 @@
|
||||
this.minecraft.player.setId(p_105030_.playerId());
|
||||
this.level.addEntity(this.minecraft.player);
|
||||
this.minecraft.player.input = new KeyboardInput(this.minecraft.options);
|
||||
@@ -1016,7 +_,9 @@
|
||||
@@ -1043,7 +_,9 @@
|
||||
localplayer1.getAttributes().assignValues(localplayer.getAttributes());
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
this.level.addEntity(localplayer1);
|
||||
localplayer1.setYRot(-180.0F);
|
||||
localplayer1.input = new KeyboardInput(this.minecraft.options);
|
||||
@@ -1125,10 +_,7 @@
|
||||
@@ -1152,10 +_,7 @@
|
||||
PacketUtils.ensureRunningOnSameThread(p_104976_, this, this.minecraft);
|
||||
BlockPos blockpos = p_104976_.getPos();
|
||||
this.minecraft.level.getBlockEntity(blockpos, p_104976_.getType()).ifPresent((p_205557_) -> {
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
if (p_205557_ instanceof CommandBlockEntity && this.minecraft.screen instanceof CommandBlockEditScreen) {
|
||||
((CommandBlockEditScreen)this.minecraft.screen).updateGui();
|
||||
@@ -1276,7 +_,9 @@
|
||||
@@ -1312,7 +_,9 @@
|
||||
|
||||
public void handleCommands(ClientboundCommandsPacket p_104990_) {
|
||||
PacketUtils.ensureRunningOnSameThread(p_104990_, this, this.minecraft);
|
||||
@@ -41,7 +41,7 @@
|
||||
}
|
||||
|
||||
public void handleStopSoundEvent(ClientboundStopSoundPacket p_105116_) {
|
||||
@@ -1295,6 +_,7 @@
|
||||
@@ -1331,6 +_,7 @@
|
||||
ClientRecipeBook clientrecipebook = this.minecraft.player.getRecipeBook();
|
||||
clientrecipebook.setupCollections(this.recipeManager.getRecipes(), this.minecraft.level.registryAccess());
|
||||
this.minecraft.populateSearchTree(SearchRegistry.RECIPE_COLLECTIONS, clientrecipebook.getCollections());
|
||||
@@ -49,7 +49,7 @@
|
||||
}
|
||||
|
||||
public void handleLookAt(ClientboundPlayerLookAtPacket p_105054_) {
|
||||
@@ -1393,7 +_,8 @@
|
||||
@@ -1429,7 +_,8 @@
|
||||
Blocks.rebuildCache();
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
}
|
||||
|
||||
public void handlePlayerCombatEnd(ClientboundPlayerCombatEndPacket p_171771_) {
|
||||
@@ -2086,6 +_,8 @@
|
||||
@@ -2145,6 +_,8 @@
|
||||
}
|
||||
|
||||
public void sendChat(String p_249888_) {
|
||||
@@ -68,7 +68,7 @@
|
||||
Instant instant = Instant.now();
|
||||
long i = Crypt.SaltSupplier.getLong();
|
||||
LastSeenMessagesTracker.Update lastseenmessagestracker$update = this.lastSeenMessages.generateAndApplyUpdate();
|
||||
@@ -2094,6 +_,7 @@
|
||||
@@ -2153,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void sendCommand(String p_250092_) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/multiplayer/MultiPlayerGameMode.java
|
||||
+++ b/net/minecraft/client/multiplayer/MultiPlayerGameMode.java
|
||||
@@ -104,6 +_,7 @@
|
||||
@@ -105,6 +_,7 @@
|
||||
}
|
||||
|
||||
public boolean destroyBlock(BlockPos p_105268_) {
|
||||
@@ -8,7 +8,7 @@
|
||||
if (this.minecraft.player.blockActionRestricted(this.minecraft.level, p_105268_, this.localPlayerMode)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -118,9 +_,8 @@
|
||||
@@ -119,9 +_,8 @@
|
||||
} else if (blockstate.isAir()) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -19,7 +19,7 @@
|
||||
if (flag) {
|
||||
block.destroy(level, p_105268_, blockstate);
|
||||
}
|
||||
@@ -141,6 +_,7 @@
|
||||
@@ -142,6 +_,7 @@
|
||||
BlockState blockstate = this.minecraft.level.getBlockState(p_105270_);
|
||||
this.minecraft.getTutorial().onDestroyBlock(this.minecraft.level, p_105270_, blockstate, 1.0F);
|
||||
this.startPrediction(this.minecraft.level, (p_233757_) -> {
|
||||
@@ -27,7 +27,7 @@
|
||||
this.destroyBlock(p_105270_);
|
||||
return new ServerboundPlayerActionPacket(ServerboundPlayerActionPacket.Action.START_DESTROY_BLOCK, p_105270_, p_105271_, p_233757_);
|
||||
});
|
||||
@@ -149,15 +_,19 @@
|
||||
@@ -150,15 +_,19 @@
|
||||
if (this.isDestroying) {
|
||||
this.connection.send(new ServerboundPlayerActionPacket(ServerboundPlayerActionPacket.Action.ABORT_DESTROY_BLOCK, this.destroyBlockPos, p_105271_));
|
||||
}
|
||||
@@ -47,7 +47,7 @@
|
||||
if (flag && blockstate1.getDestroyProgress(this.minecraft.player, this.minecraft.player.level(), p_105270_) >= 1.0F) {
|
||||
this.destroyBlock(p_105270_);
|
||||
} else {
|
||||
@@ -169,7 +_,7 @@
|
||||
@@ -170,7 +_,7 @@
|
||||
this.minecraft.level.destroyBlockProgress(this.minecraft.player.getId(), this.destroyBlockPos, this.getDestroyStage());
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
@@ -200,6 +_,7 @@
|
||||
@@ -201,6 +_,7 @@
|
||||
BlockState blockstate1 = this.minecraft.level.getBlockState(p_105284_);
|
||||
this.minecraft.getTutorial().onDestroyBlock(this.minecraft.level, p_105284_, blockstate1, 1.0F);
|
||||
this.startPrediction(this.minecraft.level, (p_233753_) -> {
|
||||
@@ -64,7 +64,7 @@
|
||||
this.destroyBlock(p_105284_);
|
||||
return new ServerboundPlayerActionPacket(ServerboundPlayerActionPacket.Action.START_DESTROY_BLOCK, p_105284_, p_105285_, p_233753_);
|
||||
});
|
||||
@@ -212,12 +_,13 @@
|
||||
@@ -213,12 +_,13 @@
|
||||
} else {
|
||||
this.destroyProgress += blockstate.getDestroyProgress(this.minecraft.player, this.minecraft.player.level(), p_105284_);
|
||||
if (this.destroyTicks % 4.0F == 0.0F) {
|
||||
@@ -79,16 +79,16 @@
|
||||
if (this.destroyProgress >= 1.0F) {
|
||||
this.isDestroying = false;
|
||||
this.startPrediction(this.minecraft.level, (p_233739_) -> {
|
||||
@@ -247,7 +_,7 @@
|
||||
@@ -248,7 +_,7 @@
|
||||
}
|
||||
|
||||
public float getPickRange() {
|
||||
- return this.localPlayerMode.isCreative() ? 5.0F : 4.5F;
|
||||
- return Player.getPickRange(this.localPlayerMode.isCreative());
|
||||
+ return (float) this.minecraft.player.getBlockReach();
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
@@ -262,7 +_,7 @@
|
||||
@@ -263,7 +_,7 @@
|
||||
|
||||
private boolean sameDestroyTarget(BlockPos p_105282_) {
|
||||
ItemStack itemstack = this.minecraft.player.getMainHandItem();
|
||||
@@ -97,7 +97,7 @@
|
||||
}
|
||||
|
||||
private void ensureHasSentCarriedItem() {
|
||||
@@ -291,25 +_,38 @@
|
||||
@@ -292,25 +_,38 @@
|
||||
private InteractionResult performUseItemOn(LocalPlayer p_233747_, InteractionHand p_233748_, BlockHitResult p_233749_) {
|
||||
BlockPos blockpos = p_233749_.getBlockPos();
|
||||
ItemStack itemstack = p_233747_.getItemInHand(p_233748_);
|
||||
@@ -140,7 +140,7 @@
|
||||
InteractionResult interactionresult1;
|
||||
if (this.localPlayerMode.isCreative()) {
|
||||
int i = itemstack.getCount();
|
||||
@@ -340,10 +_,17 @@
|
||||
@@ -341,10 +_,17 @@
|
||||
mutableobject.setValue(InteractionResult.PASS);
|
||||
return serverbounduseitempacket;
|
||||
} else {
|
||||
@@ -158,7 +158,7 @@
|
||||
}
|
||||
|
||||
mutableobject.setValue(interactionresultholder.getResult());
|
||||
@@ -382,6 +_,9 @@
|
||||
@@ -383,6 +_,9 @@
|
||||
this.ensureHasSentCarriedItem();
|
||||
Vec3 vec3 = p_105233_.getLocation().subtract(p_105232_.getX(), p_105232_.getY(), p_105232_.getZ());
|
||||
this.connection.send(ServerboundInteractPacket.createInteractionPacket(p_105232_, p_105231_.isShiftKeyDown(), p_105234_, vec3));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/multiplayer/ServerStatusPinger.java
|
||||
+++ b/net/minecraft/client/multiplayer/ServerStatusPinger.java
|
||||
@@ -105,6 +_,7 @@
|
||||
@@ -103,6 +_,7 @@
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
private final Queue<Particle> particlesToAdd = Queues.newArrayDeque();
|
||||
private final Map<ResourceLocation, ParticleEngine.MutableSpriteSet> spriteSets = Maps.newHashMap();
|
||||
private final TextureAtlas textureAtlas;
|
||||
@@ -194,10 +_,14 @@
|
||||
this.register(ParticleTypes.EGG_CRACK, SuspendedTownParticle.EggCrackProvider::new);
|
||||
@@ -200,10 +_,14 @@
|
||||
this.register(ParticleTypes.TRIAL_SPAWNER_DETECTION, TrialSpawnerDetectionParticle.Provider::new);
|
||||
}
|
||||
|
||||
+ /** @deprecated Register via {@link net.minecraftforge.client.event.RegisterParticleProvidersEvent} */
|
||||
@@ -30,7 +30,7 @@
|
||||
public <T extends ParticleOptions> void register(ParticleType<T> p_273423_, ParticleProvider.Sprite<T> p_273134_) {
|
||||
this.register(p_273423_, (p_272320_) -> {
|
||||
return (p_272323_, p_272324_, p_272325_, p_272326_, p_272327_, p_272328_, p_272329_, p_272330_) -> {
|
||||
@@ -211,10 +_,12 @@
|
||||
@@ -217,10 +_,12 @@
|
||||
});
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
}
|
||||
|
||||
public CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier p_107305_, ResourceManager p_107306_, ProfilerFiller p_107307_, ProfilerFiller p_107308_, Executor p_107309_, Executor p_107310_) {
|
||||
@@ -313,7 +_,7 @@
|
||||
@@ -319,7 +_,7 @@
|
||||
|
||||
@Nullable
|
||||
private <T extends ParticleOptions> Particle makeParticle(T p_107396_, double p_107397_, double p_107398_, double p_107399_, double p_107400_, double p_107401_, double p_107402_) {
|
||||
@@ -53,7 +53,7 @@
|
||||
return particleprovider == null ? null : particleprovider.createParticle(p_107396_, this.level, p_107397_, p_107398_, p_107399_, p_107400_, p_107401_, p_107402_);
|
||||
}
|
||||
|
||||
@@ -394,15 +_,24 @@
|
||||
@@ -400,15 +_,24 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
Iterable<Particle> iterable = this.particles.get(particlerendertype);
|
||||
if (iterable != null) {
|
||||
RenderSystem.setShader(GameRenderer::getParticleShader);
|
||||
@@ -411,6 +_,7 @@
|
||||
@@ -417,6 +_,7 @@
|
||||
particlerendertype.begin(bufferbuilder, this.textureManager);
|
||||
|
||||
for(Particle particle : iterable) {
|
||||
@@ -87,7 +87,7 @@
|
||||
try {
|
||||
particle.render(bufferbuilder, p_107340_, p_107341_);
|
||||
} catch (Throwable throwable) {
|
||||
@@ -440,7 +_,7 @@
|
||||
@@ -446,7 +_,7 @@
|
||||
}
|
||||
|
||||
public void destroy(BlockPos p_107356_, BlockState p_107357_) {
|
||||
@@ -96,7 +96,7 @@
|
||||
VoxelShape voxelshape = p_107357_.getShape(this.level, p_107356_);
|
||||
double d0 = 0.25D;
|
||||
voxelshape.forAllBoxes((p_172273_, p_172274_, p_172275_, p_172276_, p_172277_, p_172278_) -> {
|
||||
@@ -460,7 +_,7 @@
|
||||
@@ -466,7 +_,7 @@
|
||||
double d7 = d4 * d1 + p_172273_;
|
||||
double d8 = d5 * d2 + p_172274_;
|
||||
double d9 = d6 * d3 + p_172275_;
|
||||
@@ -105,7 +105,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -504,12 +_,18 @@
|
||||
@@ -510,12 +_,18 @@
|
||||
d0 = (double)i + aabb.maxX + (double)0.1F;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,60 +13,14 @@
|
||||
|
||||
}
|
||||
@@ -610,6 +_,7 @@
|
||||
list1.add(Pair.of(new ShaderInstance(p_250719_, "rendertype_gui_ghost_recipe_overlay", DefaultVertexFormat.POSITION_COLOR), (p_286147_) -> {
|
||||
rendertypeGuiGhostRecipeOverlayShader = p_286147_;
|
||||
list1.add(Pair.of(new ShaderInstance(p_250719_, "rendertype_breeze_wind", DefaultVertexFormat.NEW_ENTITY), (p_308287_) -> {
|
||||
rendertypeBreezeWindShader = p_308287_;
|
||||
}));
|
||||
+ net.minecraftforge.fml.ModLoader.get().postEvent(new net.minecraftforge.client.event.RegisterShadersEvent(p_250719_, list1));
|
||||
} catch (IOException ioexception) {
|
||||
list1.forEach((p_172729_) -> {
|
||||
p_172729_.getFirst().close();
|
||||
@@ -686,12 +_,13 @@
|
||||
this.minecraft.getProfiler().push("pick");
|
||||
this.minecraft.crosshairPickEntity = null;
|
||||
double d0 = (double)this.minecraft.gameMode.getPickRange();
|
||||
- this.minecraft.hitResult = entity.pick(d0, p_109088_, false);
|
||||
+ double entityReach = this.minecraft.player.getEntityReach(); // Note - MC-76493 - We must validate players cannot click-through objects.
|
||||
+ this.minecraft.hitResult = entity.pick(Math.max(d0, entityReach), p_109088_, false); // Run pick() with the max of the two, so we can prevent click-through.
|
||||
Vec3 vec3 = entity.getEyePosition(p_109088_);
|
||||
boolean flag = false;
|
||||
int i = 3;
|
||||
double d1 = d0;
|
||||
- if (this.minecraft.gameMode.hasFarPickRange()) {
|
||||
+ if (false && this.minecraft.gameMode.hasFarPickRange()) {
|
||||
d1 = 6.0D;
|
||||
d0 = d1;
|
||||
} else {
|
||||
@@ -701,10 +_,19 @@
|
||||
|
||||
d0 = d0;
|
||||
}
|
||||
+ d0 = d1 = Math.max(d0, entityReach); // Pick entities with the max of both for the same reason.
|
||||
|
||||
d1 *= d1;
|
||||
- if (this.minecraft.hitResult != null) {
|
||||
+ // If we picked a block, we need to ignore entities past that block. Added != MISS check to not truncate on failed picks.
|
||||
+ // Also fixes MC-250858
|
||||
+ if (this.minecraft.hitResult != null && this.minecraft.hitResult.getType() != HitResult.Type.MISS) {
|
||||
d1 = this.minecraft.hitResult.getLocation().distanceToSqr(vec3);
|
||||
+ double blockReach = this.minecraft.player.getBlockReach();
|
||||
+ // Discard the result as a miss if it is outside the block reach.
|
||||
+ if (d1 > blockReach * blockReach) {
|
||||
+ Vec3 pos = this.minecraft.hitResult.getLocation();
|
||||
+ this.minecraft.hitResult = BlockHitResult.miss(pos, Direction.getNearest(vec3.x, vec3.y, vec3.z), BlockPos.containing(pos));
|
||||
+ }
|
||||
}
|
||||
|
||||
Vec3 vec31 = entity.getViewVector(1.0F);
|
||||
@@ -718,7 +_,7 @@
|
||||
Entity entity1 = entityhitresult.getEntity();
|
||||
Vec3 vec33 = entityhitresult.getLocation();
|
||||
double d2 = vec3.distanceToSqr(vec33);
|
||||
- if (flag && d2 > 9.0D) {
|
||||
+ if (d2 > d1 || d2 > entityReach * entityReach) { // Discard if the result is behind a block, or past the entity reach max. The var "flag" no longer has a use.
|
||||
this.minecraft.hitResult = BlockHitResult.miss(vec33, Direction.getNearest(vec31.x, vec31.y, vec31.z), BlockPos.containing(vec33));
|
||||
} else if (d2 < d1 || this.minecraft.hitResult == null) {
|
||||
this.minecraft.hitResult = entityhitresult;
|
||||
@@ -772,7 +_,7 @@
|
||||
@@ -757,7 +_,7 @@
|
||||
d0 *= Mth.lerp(this.minecraft.options.fovEffectScale().get(), 1.0D, (double)0.85714287F);
|
||||
}
|
||||
|
||||
@@ -75,7 +29,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -908,12 +_,12 @@
|
||||
@@ -894,12 +_,12 @@
|
||||
|
||||
Window window = this.minecraft.getWindow();
|
||||
RenderSystem.clear(256, Minecraft.ON_OSX);
|
||||
@@ -90,7 +44,7 @@
|
||||
RenderSystem.applyModelViewMatrix();
|
||||
Lighting.setupFor3DItems();
|
||||
GuiGraphics guigraphics = new GuiGraphics(this.minecraft, this.renderBuffers.bufferSource());
|
||||
@@ -949,7 +_,7 @@
|
||||
@@ -935,7 +_,7 @@
|
||||
}
|
||||
} else if (flag && this.minecraft.screen != null) {
|
||||
try {
|
||||
@@ -99,10 +53,10 @@
|
||||
} catch (Throwable throwable1) {
|
||||
CrashReport crashreport1 = CrashReport.forThrowable(throwable1, "Rendering screen");
|
||||
CrashReportCategory crashreportcategory1 = crashreport1.addCategory("Screen render details");
|
||||
@@ -1103,12 +_,19 @@
|
||||
@@ -1090,12 +_,19 @@
|
||||
|
||||
Matrix4f matrix4f = posestack.last().pose();
|
||||
this.resetProjectionMatrix(matrix4f);
|
||||
camera.setup(this.minecraft.level, (Entity)(this.minecraft.getCameraEntity() == null ? this.minecraft.player : this.minecraft.getCameraEntity()), !this.minecraft.options.getCameraType().isFirstPerson(), this.minecraft.options.getCameraType().isMirrored(), p_109090_);
|
||||
+
|
||||
+ net.minecraftforge.client.event.ViewportEvent.ComputeCameraAngles cameraSetup = net.minecraftforge.client.ForgeHooksClient.onCameraSetup(this, camera, p_109090_);
|
||||
+ camera.setAnglesInternal(cameraSetup.getYaw(), cameraSetup.getPitch());
|
||||
|
||||
@@ -5,18 +5,18 @@
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class ItemBlockRenderTypes {
|
||||
+ @Deprecated
|
||||
private static final Map<Block, RenderType> TYPE_BY_BLOCK = Util.make(Maps.newHashMap(), (p_296246_) -> {
|
||||
private static final Map<Block, RenderType> TYPE_BY_BLOCK = Util.make(Maps.newHashMap(), (p_308288_) -> {
|
||||
RenderType rendertype = RenderType.tripwire();
|
||||
p_296246_.put(Blocks.TRIPWIRE, rendertype);
|
||||
@@ -309,6 +_,7 @@
|
||||
p_296246_.put(Blocks.BUBBLE_COLUMN, rendertype3);
|
||||
p_296246_.put(Blocks.TINTED_GLASS, rendertype3);
|
||||
p_308288_.put(Blocks.TRIPWIRE, rendertype);
|
||||
@@ -334,6 +_,7 @@
|
||||
p_308288_.put(Blocks.BUBBLE_COLUMN, rendertype3);
|
||||
p_308288_.put(Blocks.TINTED_GLASS, rendertype3);
|
||||
});
|
||||
+ @Deprecated
|
||||
private static final Map<Fluid, RenderType> TYPE_BY_FLUID = Util.make(Maps.newHashMap(), (p_109290_) -> {
|
||||
RenderType rendertype = RenderType.translucent();
|
||||
p_109290_.put(Fluids.FLOWING_WATER, rendertype);
|
||||
@@ -316,6 +_,8 @@
|
||||
@@ -341,6 +_,8 @@
|
||||
});
|
||||
private static boolean renderCutout;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
public static RenderType getChunkRenderType(BlockState p_109283_) {
|
||||
Block block = p_109283_.getBlock();
|
||||
if (block instanceof LeavesBlock) {
|
||||
@@ -326,6 +_,8 @@
|
||||
@@ -351,6 +_,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
public static RenderType getMovingBlockRenderType(BlockState p_109294_) {
|
||||
Block block = p_109294_.getBlock();
|
||||
if (block instanceof LeavesBlock) {
|
||||
@@ -340,6 +_,8 @@
|
||||
@@ -365,6 +_,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
public static RenderType getRenderType(BlockState p_109285_, boolean p_109286_) {
|
||||
RenderType rendertype = getChunkRenderType(p_109285_);
|
||||
if (rendertype == RenderType.translucent()) {
|
||||
@@ -353,6 +_,8 @@
|
||||
@@ -378,6 +_,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
public static RenderType getRenderType(ItemStack p_109280_, boolean p_109281_) {
|
||||
Item item = p_109280_.getItem();
|
||||
if (item instanceof BlockItem) {
|
||||
@@ -364,8 +_,73 @@
|
||||
@@ -389,8 +_,73 @@
|
||||
}
|
||||
|
||||
public static RenderType getRenderLayer(FluidState p_109288_) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/renderer/LevelRenderer.java
|
||||
+++ b/net/minecraft/client/renderer/LevelRenderer.java
|
||||
@@ -245,6 +_,8 @@
|
||||
@@ -248,6 +_,8 @@
|
||||
}
|
||||
|
||||
private void renderSnowAndRain(LightTexture p_109704_, float p_109705_, double p_109706_, double p_109707_, double p_109708_) {
|
||||
@@ -9,7 +9,7 @@
|
||||
float f = this.minecraft.level.getRainLevel(p_109705_);
|
||||
if (!(f <= 0.0F)) {
|
||||
p_109704_.turnOnLightLayer();
|
||||
@@ -364,6 +_,8 @@
|
||||
@@ -370,6 +_,8 @@
|
||||
}
|
||||
|
||||
public void tickRain(Camera p_109694_) {
|
||||
@@ -18,21 +18,21 @@
|
||||
float f = this.minecraft.level.getRainLevel(1.0F) / (Minecraft.useFancyGraphics() ? 1.0F : 2.0F);
|
||||
if (!(f <= 0.0F)) {
|
||||
RandomSource randomsource = RandomSource.create((long)this.ticks * 312987231L);
|
||||
@@ -888,11 +_,13 @@
|
||||
@@ -894,11 +_,13 @@
|
||||
RenderSystem.clear(16640, Minecraft.ON_OSX);
|
||||
float f = p_109605_.getRenderDistance();
|
||||
float f1 = p_109605_.getRenderDistance();
|
||||
boolean flag1 = this.minecraft.level.effects().isFoggyAt(Mth.floor(d0), Mth.floor(d1)) || this.minecraft.gui.getBossOverlay().shouldCreateWorldFog();
|
||||
+ FogRenderer.setupFog(p_109604_, FogRenderer.FogMode.FOG_SKY, f, flag1, p_109601_);
|
||||
profilerfiller.popPush("sky");
|
||||
RenderSystem.setShader(GameRenderer::getPositionShader);
|
||||
this.renderSky(p_109600_, p_254120_, p_109601_, p_109604_, flag1, () -> {
|
||||
FogRenderer.setupFog(p_109604_, FogRenderer.FogMode.FOG_SKY, f, flag1, p_109601_);
|
||||
this.renderSky(p_109600_, p_254120_, f, p_109604_, flag1, () -> {
|
||||
FogRenderer.setupFog(p_109604_, FogRenderer.FogMode.FOG_SKY, f1, flag1, f);
|
||||
});
|
||||
+ net.minecraftforge.client.event.RenderLevelStageEvent.Stage.AFTER_SKY.dispatch(this, p_109600_, p_254120_, this.ticks, p_109604_, frustum);
|
||||
profilerfiller.popPush("fog");
|
||||
FogRenderer.setupFog(p_109604_, FogRenderer.FogMode.FOG_TERRAIN, Math.max(f, 32.0F), flag1, p_109601_);
|
||||
FogRenderer.setupFog(p_109604_, FogRenderer.FogMode.FOG_TERRAIN, Math.max(f1, 32.0F), flag1, f);
|
||||
profilerfiller.popPush("terrain_setup");
|
||||
@@ -901,7 +_,9 @@
|
||||
@@ -907,7 +_,9 @@
|
||||
this.compileSections(p_109604_);
|
||||
profilerfiller.popPush("terrain");
|
||||
this.renderSectionLayer(RenderType.solid(), p_109600_, d0, d1, d2, p_254120_);
|
||||
@@ -42,7 +42,7 @@
|
||||
this.renderSectionLayer(RenderType.cutout(), p_109600_, d0, d1, d2, p_254120_);
|
||||
if (this.level.effects().constantAmbientLight()) {
|
||||
Lighting.setupNetherLevel(p_109600_.last().pose());
|
||||
@@ -933,7 +_,7 @@
|
||||
@@ -939,7 +_,7 @@
|
||||
for(Entity entity : this.level.entitiesForRendering()) {
|
||||
if (this.entityRenderDispatcher.shouldRender(entity, frustum, d0, d1, d2) || entity.hasIndirectPassenger(this.minecraft.player)) {
|
||||
BlockPos blockpos = entity.blockPosition();
|
||||
@@ -51,7 +51,7 @@
|
||||
++this.renderedEntities;
|
||||
if (entity.tickCount == 0) {
|
||||
entity.xOld = entity.getX();
|
||||
@@ -949,6 +_,9 @@
|
||||
@@ -955,6 +_,9 @@
|
||||
int i = entity.getTeamColor();
|
||||
outlinebuffersource.setColor(FastColor.ARGB32.red(i), FastColor.ARGB32.green(i), FastColor.ARGB32.blue(i), 255);
|
||||
} else {
|
||||
@@ -61,7 +61,7 @@
|
||||
multibuffersource = multibuffersource$buffersource;
|
||||
}
|
||||
|
||||
@@ -963,12 +_,14 @@
|
||||
@@ -970,12 +_,14 @@
|
||||
multibuffersource$buffersource.endBatch(RenderType.entityCutout(TextureAtlas.LOCATION_BLOCKS));
|
||||
multibuffersource$buffersource.endBatch(RenderType.entityCutoutNoCull(TextureAtlas.LOCATION_BLOCKS));
|
||||
multibuffersource$buffersource.endBatch(RenderType.entitySmoothCutout(TextureAtlas.LOCATION_BLOCKS));
|
||||
@@ -76,7 +76,7 @@
|
||||
BlockPos blockpos4 = blockentity1.getBlockPos();
|
||||
MultiBufferSource multibuffersource1 = multibuffersource$buffersource;
|
||||
p_109600_.pushPose();
|
||||
@@ -985,6 +_,9 @@
|
||||
@@ -992,6 +_,9 @@
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -84,9 +84,9 @@
|
||||
+ flag2 = true;
|
||||
+ }
|
||||
|
||||
this.blockEntityRenderDispatcher.render(blockentity1, p_109601_, p_109600_, multibuffersource1);
|
||||
this.blockEntityRenderDispatcher.render(blockentity1, f, p_109600_, multibuffersource1);
|
||||
p_109600_.popPose();
|
||||
@@ -994,9 +_,13 @@
|
||||
@@ -1001,9 +_,13 @@
|
||||
|
||||
synchronized(this.globalBlockEntities) {
|
||||
for(BlockEntity blockentity : this.globalBlockEntities) {
|
||||
@@ -97,10 +97,10 @@
|
||||
+ if (this.shouldShowEntityOutlines() && blockentity.hasCustomOutlineRendering(this.minecraft.player)) { // FORGE: allow custom outline rendering
|
||||
+ flag2 = true;
|
||||
+ }
|
||||
this.blockEntityRenderDispatcher.render(blockentity, p_109601_, p_109600_, multibuffersource$buffersource);
|
||||
this.blockEntityRenderDispatcher.render(blockentity, f, p_109600_, multibuffersource$buffersource);
|
||||
p_109600_.popPose();
|
||||
}
|
||||
@@ -1019,6 +_,7 @@
|
||||
@@ -1026,6 +_,7 @@
|
||||
this.minecraft.getMainRenderTarget().bindWrite(false);
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
profilerfiller.popPush("destroyProgress");
|
||||
|
||||
for(Long2ObjectMap.Entry<SortedSet<BlockDestructionProgress>> entry : this.destructionProgress.long2ObjectEntrySet()) {
|
||||
@@ -1034,7 +_,8 @@
|
||||
@@ -1041,7 +_,8 @@
|
||||
p_109600_.translate((double)blockpos2.getX() - d0, (double)blockpos2.getY() - d1, (double)blockpos2.getZ() - d2);
|
||||
PoseStack.Pose posestack$pose1 = p_109600_.last();
|
||||
VertexConsumer vertexconsumer1 = new SheetedDecalTextureGenerator(this.renderBuffers.crumblingBufferSource().getBuffer(ModelBakery.DESTROY_TYPES.get(k)), posestack$pose1.pose(), posestack$pose1.normal(), 1.0F);
|
||||
@@ -118,7 +118,7 @@
|
||||
p_109600_.popPose();
|
||||
}
|
||||
}
|
||||
@@ -1046,10 +_,13 @@
|
||||
@@ -1053,10 +_,13 @@
|
||||
profilerfiller.popPush("outline");
|
||||
BlockPos blockpos1 = ((BlockHitResult)hitresult).getBlockPos();
|
||||
BlockState blockstate = this.level.getBlockState(blockpos1);
|
||||
@@ -132,43 +132,43 @@
|
||||
}
|
||||
|
||||
this.minecraft.debugRenderer.render(p_109600_, multibuffersource$buffersource, d0, d1, d2);
|
||||
@@ -1081,7 +_,8 @@
|
||||
@@ -1088,7 +_,8 @@
|
||||
this.particlesTarget.copyDepthFrom(this.minecraft.getMainRenderTarget());
|
||||
RenderStateShard.PARTICLES_TARGET.setupRenderState();
|
||||
profilerfiller.popPush("particles");
|
||||
- this.minecraft.particleEngine.render(p_109600_, multibuffersource$buffersource, p_109606_, p_109604_, p_109601_);
|
||||
- this.minecraft.particleEngine.render(p_109600_, multibuffersource$buffersource, p_109606_, p_109604_, f);
|
||||
+ this.minecraft.particleEngine.render(p_109600_, multibuffersource$buffersource, p_109606_, p_109604_, p_109601_, frustum);
|
||||
+ net.minecraftforge.client.event.RenderLevelStageEvent.Stage.AFTER_PARTICLES.dispatch(this, p_109600_, p_254120_, this.ticks, p_109604_, frustum);
|
||||
RenderStateShard.PARTICLES_TARGET.clearRenderState();
|
||||
} else {
|
||||
profilerfiller.popPush("translucent");
|
||||
@@ -1095,7 +_,8 @@
|
||||
@@ -1102,7 +_,8 @@
|
||||
profilerfiller.popPush("string");
|
||||
this.renderSectionLayer(RenderType.tripwire(), p_109600_, d0, d1, d2, p_254120_);
|
||||
profilerfiller.popPush("particles");
|
||||
- this.minecraft.particleEngine.render(p_109600_, multibuffersource$buffersource, p_109606_, p_109604_, p_109601_);
|
||||
- this.minecraft.particleEngine.render(p_109600_, multibuffersource$buffersource, p_109606_, p_109604_, f);
|
||||
+ this.minecraft.particleEngine.render(p_109600_, multibuffersource$buffersource, p_109606_, p_109604_, p_109601_, frustum);
|
||||
+ net.minecraftforge.client.event.RenderLevelStageEvent.Stage.AFTER_PARTICLES.dispatch(this, p_109600_, p_254120_, this.ticks, p_109604_, frustum);
|
||||
}
|
||||
|
||||
posestack.pushPose();
|
||||
@@ -1119,6 +_,7 @@
|
||||
@@ -1126,6 +_,7 @@
|
||||
RenderStateShard.WEATHER_TARGET.setupRenderState();
|
||||
profilerfiller.popPush("weather");
|
||||
this.renderSnowAndRain(p_109606_, p_109601_, d0, d1, d2);
|
||||
this.renderSnowAndRain(p_109606_, f, d0, d1, d2);
|
||||
+ net.minecraftforge.client.event.RenderLevelStageEvent.Stage.AFTER_WEATHER.dispatch(this, p_109600_, p_254120_, this.ticks, p_109604_, frustum);
|
||||
this.renderWorldBorder(p_109604_);
|
||||
RenderStateShard.WEATHER_TARGET.clearRenderState();
|
||||
this.transparencyChain.process(p_109601_);
|
||||
@@ -1127,6 +_,7 @@
|
||||
this.transparencyChain.process(f);
|
||||
@@ -1134,6 +_,7 @@
|
||||
RenderSystem.depthMask(false);
|
||||
profilerfiller.popPush("weather");
|
||||
this.renderSnowAndRain(p_109606_, p_109601_, d0, d1, d2);
|
||||
this.renderSnowAndRain(p_109606_, f, d0, d1, d2);
|
||||
+ net.minecraftforge.client.event.RenderLevelStageEvent.Stage.AFTER_WEATHER.dispatch(this, p_109600_, p_254120_, this.ticks, p_109604_, frustum);
|
||||
this.renderWorldBorder(p_109604_);
|
||||
RenderSystem.depthMask(true);
|
||||
}
|
||||
@@ -1269,6 +_,7 @@
|
||||
@@ -1276,6 +_,7 @@
|
||||
shaderinstance.clear();
|
||||
VertexBuffer.unbind();
|
||||
this.minecraft.getProfiler().pop();
|
||||
@@ -176,7 +176,7 @@
|
||||
p_298012_.clearRenderState();
|
||||
}
|
||||
|
||||
@@ -1485,6 +_,8 @@
|
||||
@@ -1495,6 +_,8 @@
|
||||
}
|
||||
|
||||
public void renderSky(PoseStack p_202424_, Matrix4f p_254034_, float p_202426_, Camera p_202427_, boolean p_202428_, Runnable p_202429_) {
|
||||
@@ -185,7 +185,7 @@
|
||||
p_202429_.run();
|
||||
if (!p_202428_) {
|
||||
FogType fogtype = p_202427_.getFluidInCamera();
|
||||
@@ -1606,6 +_,8 @@
|
||||
@@ -1616,6 +_,8 @@
|
||||
}
|
||||
|
||||
public void renderClouds(PoseStack p_254145_, Matrix4f p_254537_, float p_254364_, double p_253843_, double p_253663_, double p_253795_) {
|
||||
@@ -194,7 +194,7 @@
|
||||
float f = this.level.effects().getCloudHeight();
|
||||
if (!Float.isNaN(f)) {
|
||||
RenderSystem.disableCull();
|
||||
@@ -1792,7 +_,7 @@
|
||||
@@ -1802,7 +_,7 @@
|
||||
boolean flag = false;
|
||||
if (this.minecraft.options.prioritizeChunkUpdates().get() == PrioritizeChunkUpdates.NEARBY) {
|
||||
BlockPos blockpos1 = sectionrenderdispatcher$rendersection.getOrigin().offset(8, 8, 8);
|
||||
@@ -203,7 +203,7 @@
|
||||
} else if (this.minecraft.options.prioritizeChunkUpdates().get() == PrioritizeChunkUpdates.PLAYER_AFFECTED) {
|
||||
flag = sectionrenderdispatcher$rendersection.isDirtyFromPlayer();
|
||||
}
|
||||
@@ -2139,7 +_,23 @@
|
||||
@@ -2149,7 +_,23 @@
|
||||
this.viewArea.setDirty(p_109502_, p_109503_, p_109504_, p_109505_);
|
||||
}
|
||||
|
||||
@@ -227,7 +227,7 @@
|
||||
SoundInstance soundinstance = this.playingRecords.get(p_109516_);
|
||||
if (soundinstance != null) {
|
||||
this.minecraft.getSoundManager().stop(soundinstance);
|
||||
@@ -2147,7 +_,7 @@
|
||||
@@ -2157,7 +_,7 @@
|
||||
}
|
||||
|
||||
if (p_109515_ != null) {
|
||||
@@ -236,7 +236,7 @@
|
||||
if (recorditem != null) {
|
||||
this.minecraft.gui.setNowPlaying(recorditem.getDisplayName());
|
||||
}
|
||||
@@ -2284,7 +_,7 @@
|
||||
@@ -2294,7 +_,7 @@
|
||||
case 1010:
|
||||
Item item = Item.byId(p_234307_);
|
||||
if (item instanceof RecordItem recorditem) {
|
||||
@@ -245,7 +245,7 @@
|
||||
}
|
||||
break;
|
||||
case 1011:
|
||||
@@ -2437,7 +_,7 @@
|
||||
@@ -2436,7 +_,7 @@
|
||||
case 2001:
|
||||
BlockState blockstate1 = Block.stateById(p_234307_);
|
||||
if (!blockstate1.isAir()) {
|
||||
@@ -254,7 +254,7 @@
|
||||
this.level.playLocalSound(p_234306_, soundtype.getBreakSound(), SoundSource.BLOCKS, (soundtype.getVolume() + 1.0F) / 2.0F, soundtype.getPitch() * 0.8F, false);
|
||||
}
|
||||
|
||||
@@ -2672,7 +_,7 @@
|
||||
@@ -2692,7 +_,7 @@
|
||||
} else {
|
||||
int i = p_109538_.getBrightness(LightLayer.SKY, p_109540_);
|
||||
int j = p_109538_.getBrightness(LightLayer.BLOCK, p_109540_);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/renderer/RenderType.java
|
||||
+++ b/net/minecraft/client/renderer/RenderType.java
|
||||
@@ -322,7 +_,7 @@
|
||||
@@ -323,7 +_,7 @@
|
||||
}
|
||||
|
||||
public static RenderType text(ResourceLocation p_110498_) {
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
public static RenderType textBackground() {
|
||||
@@ -330,19 +_,19 @@
|
||||
@@ -331,19 +_,19 @@
|
||||
}
|
||||
|
||||
public static RenderType textIntensity(ResourceLocation p_173238_) {
|
||||
@@ -33,7 +33,7 @@
|
||||
}
|
||||
|
||||
public static RenderType textBackgroundSeeThrough() {
|
||||
@@ -350,7 +_,7 @@
|
||||
@@ -351,7 +_,7 @@
|
||||
}
|
||||
|
||||
public static RenderType textIntensitySeeThrough(ResourceLocation p_173241_) {
|
||||
@@ -42,7 +42,7 @@
|
||||
}
|
||||
|
||||
public static RenderType lightning() {
|
||||
@@ -677,4 +_,17 @@
|
||||
@@ -678,4 +_,17 @@
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
||||
+9
-27
@@ -1,24 +1,6 @@
|
||||
--- a/net/minecraft/client/renderer/chunk/SectionRenderDispatcher.java
|
||||
+++ b/net/minecraft/client/renderer/chunk/SectionRenderDispatcher.java
|
||||
@@ -78,12 +_,16 @@
|
||||
private Vec3 camera = Vec3.ZERO;
|
||||
|
||||
public SectionRenderDispatcher(ClientLevel p_299878_, LevelRenderer p_299032_, Executor p_298480_, boolean p_298587_, SectionBufferBuilderPack p_299187_) {
|
||||
+ this(p_299878_, p_299032_, p_298480_, p_298587_, p_299187_, -1);
|
||||
+ }
|
||||
+
|
||||
+ public SectionRenderDispatcher(ClientLevel p_299878_, LevelRenderer p_299032_, Executor p_298480_, boolean p_298587_, SectionBufferBuilderPack p_299187_, int countRenderBuilders) {
|
||||
this.level = p_299878_;
|
||||
this.renderer = p_299032_;
|
||||
int i = Math.max(1, (int)((double)Runtime.getRuntime().maxMemory() * 0.3D) / (RenderType.chunkBufferLayers().stream().mapToInt(RenderType::bufferSize).sum() * 4) - 1);
|
||||
int j = Runtime.getRuntime().availableProcessors();
|
||||
int k = p_298587_ ? j : Math.min(j, 4);
|
||||
- int l = Math.max(1, Math.min(k, i));
|
||||
+ int l = countRenderBuilders < 0 ? Math.max(1, Math.min(k, i)) : countRenderBuilders;
|
||||
this.fixedBuffers = p_299187_;
|
||||
List<SectionBufferBuilderPack> list = Lists.newArrayListWithExpectedSize(l);
|
||||
|
||||
@@ -413,7 +_,7 @@
|
||||
@@ -394,7 +_,7 @@
|
||||
if (!sectionrenderdispatcher$compiledsection.hasBlocks.contains(p_301074_)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -27,7 +9,7 @@
|
||||
p_298196_.schedule(this.lastResortTransparencyTask);
|
||||
return true;
|
||||
}
|
||||
@@ -445,7 +_,7 @@
|
||||
@@ -426,7 +_,7 @@
|
||||
this.initialCompilationCancelCount.incrementAndGet();
|
||||
}
|
||||
|
||||
@@ -36,7 +18,7 @@
|
||||
return this.lastRebuildTask;
|
||||
}
|
||||
|
||||
@@ -483,10 +_,20 @@
|
||||
@@ -464,10 +_,20 @@
|
||||
protected final double distAtCreation;
|
||||
protected final AtomicBoolean isCancelled = new AtomicBoolean(false);
|
||||
protected final boolean isHighPriority;
|
||||
@@ -57,7 +39,7 @@
|
||||
}
|
||||
|
||||
public abstract CompletableFuture<SectionRenderDispatcher.SectionTaskResult> doTask(SectionBufferBuilderPack p_300298_);
|
||||
@@ -498,6 +_,10 @@
|
||||
@@ -479,6 +_,10 @@
|
||||
public int compareTo(SectionRenderDispatcher.RenderSection.CompileTask p_298947_) {
|
||||
return Doubles.compare(this.distAtCreation, p_298947_.distAtCreation);
|
||||
}
|
||||
@@ -68,7 +50,7 @@
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@@ -505,8 +_,13 @@
|
||||
@@ -486,8 +_,13 @@
|
||||
@Nullable
|
||||
protected RenderChunkRegion region;
|
||||
|
||||
@@ -83,7 +65,7 @@
|
||||
this.region = p_300496_;
|
||||
}
|
||||
|
||||
@@ -602,7 +_,10 @@
|
||||
@@ -583,7 +_,10 @@
|
||||
}
|
||||
|
||||
if (blockstate.getRenderShape() != RenderShape.INVISIBLE) {
|
||||
@@ -95,7 +77,7 @@
|
||||
BufferBuilder bufferbuilder2 = p_300020_.builder(rendertype2);
|
||||
if (set.add(rendertype2)) {
|
||||
RenderSection.this.beginLayer(bufferbuilder2);
|
||||
@@ -610,8 +_,9 @@
|
||||
@@ -591,8 +_,9 @@
|
||||
|
||||
posestack.pushPose();
|
||||
posestack.translate((float)(blockpos2.getX() & 15), (float)(blockpos2.getY() & 15), (float)(blockpos2.getZ() & 15));
|
||||
@@ -106,7 +88,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -640,10 +_,10 @@
|
||||
@@ -621,10 +_,10 @@
|
||||
private <E extends BlockEntity> void handleBlockEntity(SectionRenderDispatcher.RenderSection.RebuildTask.CompileResults p_297364_, E p_299361_) {
|
||||
BlockEntityRenderer<E> blockentityrenderer = Minecraft.getInstance().getBlockEntityRenderDispatcher().getRenderer(p_299361_);
|
||||
if (blockentityrenderer != null) {
|
||||
@@ -118,7 +100,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -671,8 +_,13 @@
|
||||
@@ -652,8 +_,13 @@
|
||||
class ResortTransparencyTask extends SectionRenderDispatcher.RenderSection.CompileTask {
|
||||
private final SectionRenderDispatcher.CompiledSection compiledSection;
|
||||
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/renderer/entity/EntityRenderDispatcher.java
|
||||
+++ b/net/minecraft/client/renderer/entity/EntityRenderDispatcher.java
|
||||
@@ -173,12 +_,12 @@
|
||||
@@ -172,12 +_,12 @@
|
||||
private static void renderHitbox(PoseStack p_114442_, VertexConsumer p_114443_, Entity p_114444_, float p_114445_) {
|
||||
AABB aabb = p_114444_.getBoundingBox().move(-p_114444_.getX(), -p_114444_.getY(), -p_114444_.getZ());
|
||||
LevelRenderer.renderLineBox(p_114442_, p_114443_, aabb, 1.0F, 1.0F, 1.0F, 1.0F);
|
||||
@@ -15,7 +15,7 @@
|
||||
p_114442_.pushPose();
|
||||
double d3 = d0 + Mth.lerp((double)p_114445_, enderdragonpart.xOld, enderdragonpart.getX());
|
||||
double d4 = d1 + Mth.lerp((double)p_114445_, enderdragonpart.yOld, enderdragonpart.getY());
|
||||
@@ -360,9 +_,14 @@
|
||||
@@ -359,9 +_,14 @@
|
||||
return this.itemInHandRenderer;
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/renderer/entity/player/PlayerRenderer.java
|
||||
+++ b/net/minecraft/client/renderer/entity/player/PlayerRenderer.java
|
||||
@@ -60,7 +_,9 @@
|
||||
@@ -61,7 +_,9 @@
|
||||
|
||||
public void render(AbstractClientPlayer p_117788_, float p_117789_, float p_117790_, PoseStack p_117791_, MultiBufferSource p_117792_, int p_117793_) {
|
||||
this.setModelProperties(p_117788_);
|
||||
@@ -10,7 +10,7 @@
|
||||
}
|
||||
|
||||
public Vec3 getRenderOffset(AbstractClientPlayer p_117785_, float p_117786_) {
|
||||
@@ -133,10 +_,13 @@
|
||||
@@ -134,10 +_,13 @@
|
||||
if (useanim == UseAnim.BRUSH) {
|
||||
return HumanoidModel.ArmPose.BRUSH;
|
||||
}
|
||||
@@ -25,7 +25,7 @@
|
||||
return HumanoidModel.ArmPose.ITEM;
|
||||
}
|
||||
}
|
||||
@@ -168,10 +_,12 @@
|
||||
@@ -170,10 +_,12 @@
|
||||
}
|
||||
|
||||
public void renderRightHand(PoseStack p_117771_, MultiBufferSource p_117772_, int p_117773_, AbstractClientPlayer p_117774_) {
|
||||
@@ -38,7 +38,7 @@
|
||||
this.renderHand(p_117814_, p_117815_, p_117816_, p_117817_, (this.model).leftArm, (this.model).leftSleeve);
|
||||
}
|
||||
|
||||
@@ -211,7 +_,7 @@
|
||||
@@ -213,7 +_,7 @@
|
||||
}
|
||||
} else if (f > 0.0F) {
|
||||
super.setupRotations(p_117802_, p_117803_, p_117804_, p_117805_, p_117806_);
|
||||
|
||||
+7
-7
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/resources/model/MultiPartBakedModel.java
|
||||
+++ b/net/minecraft/client/resources/model/MultiPartBakedModel.java
|
||||
@@ -21,7 +_,7 @@
|
||||
@@ -20,7 +_,7 @@
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@@ -9,10 +9,10 @@
|
||||
private final List<Pair<Predicate<BlockState>, BakedModel>> selectors;
|
||||
protected final boolean hasAmbientOcclusion;
|
||||
protected final boolean isGui3d;
|
||||
@@ -30,10 +_,12 @@
|
||||
@@ -29,10 +_,12 @@
|
||||
protected final ItemTransforms transforms;
|
||||
protected final ItemOverrides overrides;
|
||||
private final Map<BlockState, BitSet> selectorCache = new Object2ObjectOpenCustomHashMap<>(Util.identityStrategy());
|
||||
private final Map<BlockState, BitSet> selectorCache = new Reference2ObjectOpenHashMap<>();
|
||||
+ private final BakedModel defaultModel;
|
||||
|
||||
public MultiPartBakedModel(List<Pair<Predicate<BlockState>, BakedModel>> p_119462_) {
|
||||
@@ -22,7 +22,7 @@
|
||||
this.hasAmbientOcclusion = bakedmodel.useAmbientOcclusion();
|
||||
this.isGui3d = bakedmodel.isGui3d();
|
||||
this.usesBlockLight = bakedmodel.usesBlockLight();
|
||||
@@ -42,10 +_,7 @@
|
||||
@@ -41,10 +_,7 @@
|
||||
this.overrides = bakedmodel.getOverrides();
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
BitSet bitset = this.selectorCache.get(p_235050_);
|
||||
if (bitset == null) {
|
||||
bitset = new BitSet();
|
||||
@@ -59,17 +_,27 @@
|
||||
@@ -58,17 +_,27 @@
|
||||
|
||||
this.selectorCache.put(p_235050_, bitset);
|
||||
}
|
||||
@@ -65,7 +65,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,6 +_,14 @@
|
||||
@@ -76,6 +_,14 @@
|
||||
return this.hasAmbientOcclusion;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
public boolean isGui3d() {
|
||||
return this.isGui3d;
|
||||
}
|
||||
@@ -89,12 +_,32 @@
|
||||
@@ -88,12 +_,32 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
+ return net.minecraftforge.server.ServerLifecycleHooks.handleServerStarting(this);
|
||||
}
|
||||
|
||||
public void tickServer(BooleanSupplier p_120049_) {
|
||||
@@ -196,6 +_,7 @@
|
||||
public boolean isPaused() {
|
||||
@@ -200,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void halt(boolean p_120053_) {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
}
|
||||
|
||||
private synchronized void loadLibrary() {
|
||||
@@ -324,7 +_,8 @@
|
||||
@@ -331,7 +_,8 @@
|
||||
|
||||
public void play(SoundInstance p_120313_) {
|
||||
if (this.loaded) {
|
||||
@@ -26,12 +26,12 @@
|
||||
WeighedSoundEvents weighedsoundevents = p_120313_.resolve(this.soundManager);
|
||||
ResourceLocation resourcelocation = p_120313_.getLocation();
|
||||
if (weighedsoundevents == null) {
|
||||
@@ -393,18 +_,21 @@
|
||||
@@ -397,18 +_,21 @@
|
||||
p_194488_.setSelfPosition(vec3);
|
||||
p_194488_.setRelative(flag);
|
||||
});
|
||||
+ final SoundInstance soundinstance = p_120313_;
|
||||
if (!flag3) {
|
||||
if (!flag2) {
|
||||
this.soundBuffers.getCompleteBuffer(sound.getPath()).thenAccept((p_194501_) -> {
|
||||
channelaccess$channelhandle.execute((p_194495_) -> {
|
||||
p_194495_.attachStaticBuffer(p_194501_);
|
||||
@@ -40,7 +40,7 @@
|
||||
});
|
||||
});
|
||||
} else {
|
||||
- this.soundBuffers.getStream(sound.getPath(), flag2).thenAccept((p_194504_) -> {
|
||||
- this.soundBuffers.getStream(sound.getPath(), flag1).thenAccept((p_194504_) -> {
|
||||
+ soundinstance.getStream(this.soundBuffers, sound, flag2).thenAccept((p_194504_) -> {
|
||||
channelaccess$channelhandle.execute((p_194498_) -> {
|
||||
p_194498_.attachBufferStream(p_194504_);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
--- a/net/minecraft/commands/CommandSourceStack.java
|
||||
+++ b/net/minecraft/commands/CommandSourceStack.java
|
||||
@@ -40,7 +_,7 @@
|
||||
@@ -43,7 +_,7 @@
|
||||
import net.minecraft.world.phys.Vec2;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
-public class CommandSourceStack implements SharedSuggestionProvider {
|
||||
+public class CommandSourceStack implements SharedSuggestionProvider, net.minecraftforge.common.extensions.IForgeCommandSourceStack {
|
||||
-public class CommandSourceStack implements ExecutionCommandSource<CommandSourceStack>, SharedSuggestionProvider {
|
||||
+public class CommandSourceStack implements ExecutionCommandSource<CommandSourceStack>, SharedSuggestionProvider, net.minecraftforge.common.extensions.IForgeCommandSourceStack {
|
||||
public static final SimpleCommandExceptionType ERROR_NOT_PLAYER = new SimpleCommandExceptionType(Component.translatable("permissions.requires.player"));
|
||||
public static final SimpleCommandExceptionType ERROR_NOT_ENTITY = new SimpleCommandExceptionType(Component.translatable("permissions.requires.entity"));
|
||||
public final CommandSource source;
|
||||
@@ -1,45 +1,42 @@
|
||||
--- a/net/minecraft/commands/Commands.java
|
||||
+++ b/net/minecraft/commands/Commands.java
|
||||
@@ -196,7 +_,7 @@
|
||||
@@ -210,7 +_,7 @@
|
||||
JfrCommand.register(this.dispatcher);
|
||||
}
|
||||
|
||||
- if (SharedConstants.IS_RUNNING_IN_IDE) {
|
||||
+ if (net.minecraftforge.gametest.ForgeGameTestHooks.isGametestEnabled()) {
|
||||
TestCommand.register(this.dispatcher);
|
||||
SpawnArmorTrimsCommand.register(this.dispatcher);
|
||||
if (p_230943_.includeDedicated) {
|
||||
@@ -224,9 +_,11 @@
|
||||
ResetChunksCommand.register(this.dispatcher);
|
||||
RaidCommand.register(this.dispatcher);
|
||||
@@ -244,6 +_,7 @@
|
||||
if (p_230943_.includeIntegrated) {
|
||||
PublishCommand.register(this.dispatcher);
|
||||
}
|
||||
+ net.minecraftforge.event.ForgeEventFactory.onCommandRegister(this.dispatcher, p_230943_, p_230944_);
|
||||
|
||||
this.dispatcher.setConsumer((p_230954_, p_230955_, p_230956_) -> {
|
||||
p_230954_.getSource().onCommandComplete(p_230954_, p_230955_, p_230956_);
|
||||
+ p_230954_.getSource().onCommandComplete(p_230954_, p_230955_, p_230956_);
|
||||
});
|
||||
this.dispatcher.setConsumer(ExecutionCommandSource.resultConsumer());
|
||||
}
|
||||
|
||||
@@ -249,7 +_,16 @@
|
||||
@@ -264,9 +_,17 @@
|
||||
commandsourcestack.getServer().getProfiler().push(() -> {
|
||||
return "/" + p_242841_;
|
||||
});
|
||||
- ContextChain<CommandSourceStack> contextchain = finishParsing(p_242844_, p_242841_, commandsourcestack);
|
||||
|
||||
try {
|
||||
try {
|
||||
- return this.dispatcher.execute(p_242844_);
|
||||
+ net.minecraftforge.event.CommandEvent event = new net.minecraftforge.event.CommandEvent(p_242844_);
|
||||
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) {
|
||||
+ if (event.getException() instanceof Exception exception) {
|
||||
+ throw exception;
|
||||
+ } else if (event.getException() != null) {
|
||||
+ com.google.common.base.Throwables.throwIfUnchecked(event.getException());
|
||||
+ }
|
||||
+ return 1;
|
||||
+ }
|
||||
+ return this.dispatcher.execute(event.getParseResults());
|
||||
} catch (CommandRuntimeException commandruntimeexception) {
|
||||
commandsourcestack.sendFailure(commandruntimeexception.getComponent());
|
||||
return 0;
|
||||
@@ -305,7 +_,8 @@
|
||||
+ var event = new net.minecraftforge.event.CommandEvent(p_242844_);
|
||||
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) {
|
||||
+ if (event.getException() instanceof Exception exception)
|
||||
+ throw exception;
|
||||
+ else if (event.getException() != null)
|
||||
+ com.google.common.base.Throwables.throwIfUnchecked(event.getException());
|
||||
+ return;
|
||||
+ }
|
||||
+ ContextChain<CommandSourceStack> contextchain = finishParsing(event.getParseResults(), p_242841_, commandsourcestack);
|
||||
if (contextchain != null) {
|
||||
executeCommandInContext(commandsourcestack, (p_308343_) -> {
|
||||
ExecutionContext.queueInitialCommandExecution(p_308343_, p_242841_, contextchain, commandsourcestack, CommandResultCallback.EMPTY);
|
||||
@@ -353,7 +_,8 @@
|
||||
Map<CommandNode<CommandSourceStack>, CommandNode<SharedSuggestionProvider>> map = Maps.newHashMap();
|
||||
RootCommandNode<SharedSuggestionProvider> rootcommandnode = new RootCommandNode<>();
|
||||
map.put(this.dispatcher.getRoot(), rootcommandnode);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/commands/arguments/MessageArgument.java
|
||||
+++ b/net/minecraft/commands/arguments/MessageArgument.java
|
||||
@@ -97,7 +_,7 @@
|
||||
@@ -95,7 +_,7 @@
|
||||
}
|
||||
|
||||
Component resolveComponent(CommandSourceStack p_232197_) throws CommandSyntaxException {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/commands/synchronization/ArgumentTypeInfos.java
|
||||
+++ b/net/minecraft/commands/synchronization/ArgumentTypeInfos.java
|
||||
@@ -65,6 +_,20 @@
|
||||
@@ -66,6 +_,20 @@
|
||||
public class ArgumentTypeInfos {
|
||||
private static final Map<Class<?>, ArgumentTypeInfo<?, ?>> BY_CLASS = Maps.newHashMap();
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
private static <A extends ArgumentType<?>, T extends ArgumentTypeInfo.Template<A>> ArgumentTypeInfo<A, T> register(Registry<ArgumentTypeInfo<?, ?>> p_235387_, String p_235388_, Class<? extends A> p_235389_, ArgumentTypeInfo<A, T> p_235390_) {
|
||||
BY_CLASS.put(p_235389_, p_235390_);
|
||||
return Registry.register(p_235387_, p_235388_, p_235390_);
|
||||
@@ -119,12 +_,14 @@
|
||||
@@ -121,12 +_,14 @@
|
||||
register(p_235385_, "template_mirror", TemplateMirrorArgument.class, SingletonArgumentInfo.contextFree(TemplateMirrorArgument::templateMirror));
|
||||
register(p_235385_, "template_rotation", TemplateRotationArgument.class, SingletonArgumentInfo.contextFree(TemplateRotationArgument::templateRotation));
|
||||
register(p_235385_, "heightmap", HeightmapTypeArgument.class, SingletonArgumentInfo.contextFree(HeightmapTypeArgument::heightmap));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/core/MappedRegistry.java
|
||||
+++ b/net/minecraft/core/MappedRegistry.java
|
||||
@@ -121,7 +_,16 @@
|
||||
@@ -117,7 +_,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
this.validateWrite(p_256594_);
|
||||
Validate.notNull(p_256594_);
|
||||
Validate.notNull(p_256374_);
|
||||
@@ -145,6 +_,8 @@
|
||||
@@ -141,6 +_,8 @@
|
||||
reference = this.byKey.computeIfAbsent(p_256594_, (p_258168_) -> {
|
||||
return Holder.Reference.createStandAlone(this.holderOwner(), p_258168_);
|
||||
});
|
||||
@@ -26,7 +26,7 @@
|
||||
}
|
||||
|
||||
this.byKey.put(p_256594_, reference);
|
||||
@@ -300,14 +_,17 @@
|
||||
@@ -296,14 +_,17 @@
|
||||
return this.byKey.containsKey(p_175392_);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
List<ResourceLocation> list = this.byKey.entrySet().stream().filter((p_211055_) -> {
|
||||
return !p_211055_.getValue().isBound();
|
||||
}).map((p_211794_) -> {
|
||||
@@ -321,7 +_,8 @@
|
||||
@@ -317,7 +_,8 @@
|
||||
throw new IllegalStateException("Some intrusive holders were not registered: " + this.unregisteredIntrusiveHolders.values());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/core/RegistrySetBuilder.java
|
||||
+++ b/net/minecraft/core/RegistrySetBuilder.java
|
||||
@@ -37,6 +_,10 @@
|
||||
@@ -68,6 +_,10 @@
|
||||
return this.add(p_256261_, Lifecycle.stable(), p_256010_);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
private RegistrySetBuilder.BuildState createState(RegistryAccess p_256400_) {
|
||||
RegistrySetBuilder.BuildState registrysetbuilder$buildstate = RegistrySetBuilder.BuildState.create(p_256400_, this.entries.stream().map(RegistrySetBuilder.RegistryStub::key));
|
||||
this.entries.forEach((p_255629_) -> {
|
||||
@@ -87,7 +_,7 @@
|
||||
@@ -168,7 +_,7 @@
|
||||
RegistrySetBuilder.UniversalLookup registrysetbuilder$universallookup = new RegistrySetBuilder.UniversalLookup(registrysetbuilder$compositeowner);
|
||||
ImmutableMap.Builder<ResourceLocation, HolderGetter<?>> builder = ImmutableMap.builder();
|
||||
p_255995_.registries().forEach((p_258197_) -> {
|
||||
@@ -20,7 +20,7 @@
|
||||
});
|
||||
p_256495_.forEach((p_256603_) -> {
|
||||
builder.put(p_256603_.location(), registrysetbuilder$universallookup);
|
||||
@@ -108,6 +_,11 @@
|
||||
@@ -189,6 +_,11 @@
|
||||
|
||||
public <S> HolderGetter<S> lookup(ResourceKey<? extends Registry<? extends S>> p_255961_) {
|
||||
return (HolderGetter<S>) BuildState.this.registries.getOrDefault(p_255961_.location(), BuildState.this.lookup);
|
||||
|
||||
@@ -1,29 +1,30 @@
|
||||
--- a/net/minecraft/core/dispenser/BoatDispenseItemBehavior.java
|
||||
+++ b/net/minecraft/core/dispenser/BoatDispenseItemBehavior.java
|
||||
@@ -34,20 +_,21 @@
|
||||
@@ -35,21 +_,22 @@
|
||||
double d2 = vec3.y() + (double)((float)direction.getStepY() * 1.125F);
|
||||
double d3 = vec3.z() + (double)direction.getStepZ() * d0;
|
||||
BlockPos blockpos = p_123375_.pos().relative(direction);
|
||||
+ Boat boat = (Boat)(this.isChestBoat ? new ChestBoat(level, d0, d1, d2) : new Boat(level, d0, d1, d2));
|
||||
+ Boat boat = (Boat)(this.isChestBoat ? new ChestBoat(serverlevel, d0, d1, d2) : new Boat(serverlevel, d0, d1, d2));
|
||||
+ boat.setVariant(this.type);
|
||||
+ boat.setYRot(direction.toYRot());
|
||||
double d4;
|
||||
- if (level.getFluidState(blockpos).is(FluidTags.WATER)) {
|
||||
+ if (boat.canBoatInFluid(level.getFluidState(blockpos))) {
|
||||
- if (serverlevel.getFluidState(blockpos).is(FluidTags.WATER)) {
|
||||
+ if (boat.canBoatInFluid(serverlevel.getFluidState(blockpos))) {
|
||||
d4 = 1.0D;
|
||||
} else {
|
||||
- if (!level.getBlockState(blockpos).isAir() || !level.getFluidState(blockpos.below()).is(FluidTags.WATER)) {
|
||||
+ if (!level.getBlockState(blockpos).isAir() || !boat.canBoatInFluid(level.getFluidState(blockpos.below()))) {
|
||||
- if (!serverlevel.getBlockState(blockpos).isAir() || !serverlevel.getFluidState(blockpos.below()).is(FluidTags.WATER)) {
|
||||
+ if (!serverlevel.getBlockState(blockpos).isAir() || !boat.canBoatInFluid(serverlevel.getFluidState(blockpos.below()))) {
|
||||
return this.defaultDispenseItemBehavior.dispense(p_123375_, p_123376_);
|
||||
}
|
||||
|
||||
d4 = 0.0D;
|
||||
}
|
||||
|
||||
- Boat boat = (Boat)(this.isChestBoat ? new ChestBoat(level, d1, d2 + d4, d3) : new Boat(level, d1, d2 + d4, d3));
|
||||
- Boat boat = (Boat)(this.isChestBoat ? new ChestBoat(serverlevel, d1, d2 + d4, d3) : new Boat(serverlevel, d1, d2 + d4, d3));
|
||||
EntityType.<Boat>createDefaultStackConfig(serverlevel, p_123376_, (Player)null).accept(boat);
|
||||
- boat.setVariant(this.type);
|
||||
- boat.setYRot(direction.toYRot());
|
||||
+ boat.setPos(d1, d2 + d4, d3);
|
||||
level.addFreshEntity(boat);
|
||||
serverlevel.addFreshEntity(boat);
|
||||
p_123376_.shrink(1);
|
||||
return p_123376_;
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/core/registries/BuiltInRegistries.java
|
||||
+++ b/net/minecraft/core/registries/BuiltInRegistries.java
|
||||
@@ -114,41 +_,89 @@
|
||||
@@ -122,41 +_,89 @@
|
||||
public static final DefaultedRegistry<GameEvent> GAME_EVENT = registerDefaultedWithIntrusiveHolders(Registries.GAME_EVENT, "step", (p_260052_) -> {
|
||||
return GameEvent.STEP;
|
||||
});
|
||||
@@ -102,7 +102,7 @@
|
||||
return ChunkStatus.EMPTY;
|
||||
});
|
||||
public static final Registry<RuleTestType<?>> RULE_TEST = registerSimple(Registries.RULE_TEST, (p_259641_) -> {
|
||||
@@ -160,42 +_,90 @@
|
||||
@@ -168,42 +_,90 @@
|
||||
public static final Registry<PosRuleTestType<?>> POS_RULE_TEST = registerSimple(Registries.POS_RULE_TEST, (p_259262_) -> {
|
||||
return PosRuleTestType.ALWAYS_TRUE_TEST;
|
||||
});
|
||||
@@ -205,7 +205,7 @@
|
||||
return Activity.IDLE;
|
||||
});
|
||||
public static final Registry<LootPoolEntryType> LOOT_POOL_ENTRY_TYPE = registerSimple(Registries.LOOT_POOL_ENTRY_TYPE, (p_260042_) -> {
|
||||
@@ -228,10 +_,18 @@
|
||||
@@ -236,10 +_,18 @@
|
||||
public static final Registry<BlockPredicateType<?>> BLOCK_PREDICATE_TYPE = registerSimple(Registries.BLOCK_PREDICATE_TYPE, (p_260006_) -> {
|
||||
return BlockPredicateType.NOT;
|
||||
});
|
||||
@@ -226,7 +226,7 @@
|
||||
return Feature.ORE;
|
||||
});
|
||||
public static final Registry<StructurePlacementType<?>> STRUCTURE_PLACEMENT = registerSimple(Registries.STRUCTURE_PLACEMENT, (p_259179_) -> {
|
||||
@@ -246,10 +_,18 @@
|
||||
@@ -254,10 +_,18 @@
|
||||
public static final Registry<PlacementModifierType<?>> PLACEMENT_MODIFIER_TYPE = registerSimple(Registries.PLACEMENT_MODIFIER_TYPE, (p_260335_) -> {
|
||||
return PlacementModifierType.COUNT;
|
||||
});
|
||||
@@ -247,7 +247,7 @@
|
||||
return FoliagePlacerType.BLOB_FOLIAGE_PLACER;
|
||||
});
|
||||
public static final Registry<TrunkPlacerType<?>> TRUNK_PLACER_TYPE = registerSimple(Registries.TRUNK_PLACER_TYPE, (p_259690_) -> {
|
||||
@@ -258,7 +_,11 @@
|
||||
@@ -266,7 +_,11 @@
|
||||
public static final Registry<RootPlacerType<?>> ROOT_PLACER_TYPE = registerSimple(Registries.ROOT_PLACER_TYPE, (p_259493_) -> {
|
||||
return RootPlacerType.MANGROVE_ROOT_PLACER;
|
||||
});
|
||||
@@ -260,7 +260,7 @@
|
||||
return TreeDecoratorType.LEAVE_VINE;
|
||||
});
|
||||
public static final Registry<FeatureSizeType<?>> FEATURE_SIZE_TYPE = registerSimple(Registries.FEATURE_SIZE_TYPE, (p_259370_) -> {
|
||||
@@ -293,10 +_,18 @@
|
||||
@@ -305,10 +_,18 @@
|
||||
return internalRegister(p_297531_, new MappedRegistry<>(p_297531_, Lifecycle.stable(), true), p_298446_, Lifecycle.stable());
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@
|
||||
private static <T> DefaultedRegistry<T> registerDefaultedWithIntrusiveHolders(ResourceKey<? extends Registry<T>> p_259296_, String p_259101_, BuiltInRegistries.RegistryBootstrap<T> p_259485_) {
|
||||
return registerDefaultedWithIntrusiveHolders(p_259296_, p_259101_, Lifecycle.stable(), p_259485_);
|
||||
}
|
||||
@@ -305,10 +_,19 @@
|
||||
@@ -317,10 +_,19 @@
|
||||
return internalRegister(p_259121_, new MappedRegistry<>(p_259121_, p_259977_, false), p_259874_, p_259977_);
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@
|
||||
private static <T> DefaultedRegistry<T> registerDefaultedWithIntrusiveHolders(ResourceKey<? extends Registry<T>> p_260010_, String p_260220_, Lifecycle p_260139_, BuiltInRegistries.RegistryBootstrap<T> p_260185_) {
|
||||
return internalRegister(p_260010_, new DefaultedMappedRegistry<>(p_260220_, p_260010_, p_260139_, true), p_260185_, p_260139_);
|
||||
}
|
||||
@@ -354,7 +_,7 @@
|
||||
@@ -369,7 +_,7 @@
|
||||
|
||||
if (p_259410_ instanceof DefaultedRegistry) {
|
||||
ResourceLocation resourcelocation = ((DefaultedRegistry)p_259410_).getDefaultKey();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/data/Main.java
|
||||
+++ b/net/minecraft/data/Main.java
|
||||
@@ -68,8 +_,15 @@
|
||||
@@ -79,8 +_,15 @@
|
||||
OptionSpec<Void> optionspec6 = optionparser.accepts("all", "Include all generators");
|
||||
OptionSpec<String> optionspec7 = optionparser.accepts("output", "Output folder").withRequiredArg().defaultsTo("generated");
|
||||
OptionSpec<String> optionspec8 = optionparser.accepts("input", "Input folder").withRequiredArg();
|
||||
@@ -17,7 +17,7 @@
|
||||
Path path = Paths.get(optionspec7.value(optionset));
|
||||
boolean flag = optionset.has(optionspec6);
|
||||
boolean flag1 = flag || optionset.has(optionspec2);
|
||||
@@ -77,10 +_,14 @@
|
||||
@@ -88,10 +_,14 @@
|
||||
boolean flag3 = flag || optionset.has(optionspec3);
|
||||
boolean flag4 = flag || optionset.has(optionspec4);
|
||||
boolean flag5 = flag || optionset.has(optionspec5);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/data/advancements/AdvancementProvider.java
|
||||
+++ b/net/minecraft/data/advancements/AdvancementProvider.java
|
||||
@@ -14,6 +_,11 @@
|
||||
@@ -15,6 +_,11 @@
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/data/loot/LootTableProvider.java
|
||||
+++ b/net/minecraft/data/loot/LootTableProvider.java
|
||||
@@ -43,7 +_,7 @@
|
||||
@@ -44,7 +_,7 @@
|
||||
public CompletableFuture<?> run(CachedOutput p_254060_) {
|
||||
final Map<ResourceLocation, LootTable> map = Maps.newHashMap();
|
||||
Map<RandomSupport.Seed128bit, ResourceLocation> map1 = new Object2ObjectOpenHashMap<>();
|
||||
@@ -9,22 +9,22 @@
|
||||
p_288263_.provider().get().generate((p_288259_, p_288260_) -> {
|
||||
ResourceLocation resourcelocation1 = map1.put(RandomSequence.seedForKey(p_288259_), p_288259_);
|
||||
if (resourcelocation1 != null) {
|
||||
@@ -63,13 +_,8 @@
|
||||
@@ -65,13 +_,8 @@
|
||||
}
|
||||
});
|
||||
|
||||
- for(ResourceLocation resourcelocation : Sets.difference(this.requiredTables, map.keySet())) {
|
||||
- validationcontext.reportProblem("Missing built-in table: " + resourcelocation);
|
||||
- problemreporter$collector.report("Missing built-in table: " + resourcelocation);
|
||||
- }
|
||||
+ validate(map, validationcontext);
|
||||
|
||||
- map.forEach((p_278897_, p_278898_) -> {
|
||||
- p_278898_.validate(validationcontext.setParams(p_278898_.getParamSet()).enterElement("{" + p_278897_ + "}", new LootDataId<>(LootDataType.TABLE, p_278897_)));
|
||||
- });
|
||||
Multimap<String, String> multimap = validationcontext.getProblems();
|
||||
Multimap<String, String> multimap = problemreporter$collector.get();
|
||||
if (!multimap.isEmpty()) {
|
||||
multimap.forEach((p_124446_, p_124447_) -> {
|
||||
@@ -86,6 +_,20 @@
|
||||
@@ -88,6 +_,20 @@
|
||||
return new CompletableFuture[p_253403_];
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
--- a/net/minecraft/data/recipes/CraftingRecipeBuilder.java
|
||||
+++ b/net/minecraft/data/recipes/CraftingRecipeBuilder.java
|
||||
@@ -31,8 +_,15 @@
|
||||
this.category = p_250313_;
|
||||
}
|
||||
|
||||
+ private net.minecraftforge.common.crafting.conditions.ICondition condition;
|
||||
+ public <R extends CraftingResult> R withCondition(net.minecraftforge.common.crafting.conditions.ICondition condition) {
|
||||
+ this.condition = condition;
|
||||
+ return (R)this;
|
||||
+ }
|
||||
+
|
||||
public void serializeRecipeData(JsonObject p_250456_) {
|
||||
p_250456_.addProperty("category", this.category.getSerializedName());
|
||||
+ net.minecraftforge.common.ForgeHooks.writeCondition(this.condition, p_250456_);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
--- a/net/minecraft/data/recipes/FinishedRecipe.java
|
||||
+++ b/net/minecraft/data/recipes/FinishedRecipe.java
|
||||
@@ -23,4 +_,12 @@
|
||||
|
||||
@Nullable
|
||||
AdvancementHolder advancement();
|
||||
+
|
||||
+ @Nullable
|
||||
+ default AdvancementData advancementData() {
|
||||
+ var adv = this.advancement();
|
||||
+ return adv == null ? null : new AdvancementData(adv.id(), adv.value().serializeToJson());
|
||||
+ }
|
||||
+
|
||||
+ record AdvancementData(ResourceLocation id, JsonObject data) {}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
--- a/net/minecraft/data/recipes/RecipeOutput.java
|
||||
+++ b/net/minecraft/data/recipes/RecipeOutput.java
|
||||
@@ -7,7 +_,16 @@
|
||||
import net.minecraft.world.item.crafting.Recipe;
|
||||
|
||||
public interface RecipeOutput {
|
||||
- void accept(ResourceLocation p_310578_, Recipe<?> p_312265_, @Nullable AdvancementHolder p_310407_);
|
||||
+ default void accept(ResourceLocation id, Recipe<?> recipe, @Nullable AdvancementHolder advancement) {
|
||||
+ if (advancement == null)
|
||||
+ accept(id, recipe, null, null);
|
||||
+ else {
|
||||
+ var json = net.minecraft.Util.getOrThrow(Advancement.CODEC.encodeStart(com.mojang.serialization.JsonOps.INSTANCE, advancement.value()), IllegalStateException::new);
|
||||
+ accept(id, recipe, advancement.id(), json);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ void accept(ResourceLocation id, Recipe<?> recipe, @Nullable ResourceLocation advancementId, @Nullable com.google.gson.JsonElement advancement);
|
||||
|
||||
Advancement.Builder advancement();
|
||||
}
|
||||
@@ -1,16 +1,19 @@
|
||||
--- a/net/minecraft/data/recipes/RecipeProvider.java
|
||||
+++ b/net/minecraft/data/recipes/RecipeProvider.java
|
||||
@@ -90,10 +_,11 @@
|
||||
throw new IllegalStateException("Duplicate recipe " + p_300066_.id());
|
||||
@@ -87,13 +_,15 @@
|
||||
final Set<ResourceLocation> set = Sets.newHashSet();
|
||||
final List<CompletableFuture<?>> list = new ArrayList<>();
|
||||
this.buildRecipes(new RecipeOutput() {
|
||||
- public void accept(ResourceLocation p_312383_, Recipe<?> p_312007_, @Nullable AdvancementHolder p_311384_) {
|
||||
+ public void accept(ResourceLocation p_312383_, Recipe<?> p_312007_, @Nullable ResourceLocation advancementId, @Nullable com.google.gson.JsonElement advancement) {
|
||||
if (!set.add(p_312383_)) {
|
||||
throw new IllegalStateException("Duplicate recipe " + p_312383_);
|
||||
} else {
|
||||
list.add(DataProvider.saveStable(p_254020_, p_300066_.serializeRecipe(), RecipeProvider.this.recipePathProvider.json(p_300066_.id())));
|
||||
- AdvancementHolder advancementholder = p_300066_.advancement();
|
||||
- if (advancementholder != null) {
|
||||
- JsonObject jsonobject = advancementholder.value().serializeToJson();
|
||||
- list.add(DataProvider.saveStable(p_254020_, jsonobject, RecipeProvider.this.advancementPathProvider.json(advancementholder.id())));
|
||||
+ var advancementdata = p_300066_.advancementData();
|
||||
+ if (advancementdata != null) {
|
||||
+ var saveAdvancementFuture = saveAdvancement(p_254020_, advancementdata.id(), advancementdata.data(), p_300066_);
|
||||
list.add(DataProvider.saveStable(p_254020_, Recipe.CODEC, p_312007_, RecipeProvider.this.recipePathProvider.json(p_312383_)));
|
||||
- if (p_311384_ != null) {
|
||||
- list.add(DataProvider.saveStable(p_254020_, Advancement.CODEC, p_311384_.value(), RecipeProvider.this.advancementPathProvider.json(p_311384_.id())));
|
||||
+ if (advancement != null) {
|
||||
+ var saveAdvancementFuture = saveAdvancement(p_254020_, advancementId, advancement);
|
||||
+ if (saveAdvancementFuture != null)
|
||||
+ list.add(saveAdvancementFuture);
|
||||
}
|
||||
@@ -28,8 +31,8 @@
|
||||
+ * @return A completable future that saves the advancement to disk, or null to cancel saving the advancement.
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ protected CompletableFuture<?> saveAdvancement(CachedOutput output, ResourceLocation advancementId, JsonObject advancementJson, FinishedRecipe finishedRecipe) {
|
||||
+ return DataProvider.saveStable(output, advancementJson, this.advancementPathProvider.json(advancementId));
|
||||
+ protected CompletableFuture<?> saveAdvancement(CachedOutput output, ResourceLocation advancementId, com.google.gson.JsonElement advancement) {
|
||||
+ return DataProvider.saveStable(output, advancement, this.advancementPathProvider.json(advancementId));
|
||||
}
|
||||
|
||||
protected CompletableFuture<?> buildAdvancement(CachedOutput p_253674_, AdvancementHolder p_297687_) {
|
||||
@@ -1,18 +0,0 @@
|
||||
--- a/net/minecraft/data/recipes/ShapedRecipeBuilder.java
|
||||
+++ b/net/minecraft/data/recipes/ShapedRecipeBuilder.java
|
||||
@@ -101,7 +_,14 @@
|
||||
this.ensureValid(p_126142_);
|
||||
Advancement.Builder advancement$builder = p_298334_.advancement().addCriterion("has_the_recipe", RecipeUnlockedTrigger.unlocked(p_126142_)).rewards(AdvancementRewards.Builder.recipe(p_126142_)).requirements(AdvancementRequirements.Strategy.OR);
|
||||
this.criteria.forEach(advancement$builder::addCriterion);
|
||||
- p_298334_.accept(new ShapedRecipeBuilder.Result(p_126142_, this.result, this.count, this.group == null ? "" : this.group, determineBookCategory(this.category), this.rows, this.key, advancement$builder.build(p_126142_.withPrefix("recipes/" + this.category.getFolderName() + "/")), this.showNotification));
|
||||
+ p_298334_.accept(new ShapedRecipeBuilder.Result(p_126142_, this.result, this.count, this.group == null ? "" : this.group, determineBookCategory(this.category), this.rows, this.key, advancement$builder.build(p_126142_.withPrefix("recipes/" + this.category.getFolderName() + "/")), this.showNotification).withCondition(this.condition));
|
||||
+ }
|
||||
+
|
||||
+ @Nullable
|
||||
+ private net.minecraftforge.common.crafting.conditions.ICondition condition;
|
||||
+ public ShapedRecipeBuilder condition(net.minecraftforge.common.crafting.conditions.ICondition condition) {
|
||||
+ this.condition = condition;
|
||||
+ return this;
|
||||
}
|
||||
|
||||
private void ensureValid(ResourceLocation p_126144_) {
|
||||
@@ -1,18 +0,0 @@
|
||||
--- a/net/minecraft/data/recipes/ShapelessRecipeBuilder.java
|
||||
+++ b/net/minecraft/data/recipes/ShapelessRecipeBuilder.java
|
||||
@@ -91,7 +_,14 @@
|
||||
this.ensureValid(p_126206_);
|
||||
Advancement.Builder advancement$builder = p_300117_.advancement().addCriterion("has_the_recipe", RecipeUnlockedTrigger.unlocked(p_126206_)).rewards(AdvancementRewards.Builder.recipe(p_126206_)).requirements(AdvancementRequirements.Strategy.OR);
|
||||
this.criteria.forEach(advancement$builder::addCriterion);
|
||||
- p_300117_.accept(new ShapelessRecipeBuilder.Result(p_126206_, this.result, this.count, this.group == null ? "" : this.group, determineBookCategory(this.category), this.ingredients, advancement$builder.build(p_126206_.withPrefix("recipes/" + this.category.getFolderName() + "/"))));
|
||||
+ p_300117_.accept(new ShapelessRecipeBuilder.Result(p_126206_, this.result, this.count, this.group == null ? "" : this.group, determineBookCategory(this.category), this.ingredients, advancement$builder.build(p_126206_.withPrefix("recipes/" + this.category.getFolderName() + "/"))).withCondition(this.condition));
|
||||
+ }
|
||||
+
|
||||
+ @Nullable
|
||||
+ private net.minecraftforge.common.crafting.conditions.ICondition condition;
|
||||
+ public ShapelessRecipeBuilder condition(net.minecraftforge.common.crafting.conditions.ICondition condition) {
|
||||
+ this.condition = condition;
|
||||
+ return this;
|
||||
}
|
||||
|
||||
private void ensureValid(ResourceLocation p_126208_) {
|
||||
@@ -1,33 +0,0 @@
|
||||
--- a/net/minecraft/data/recipes/SimpleCookingRecipeBuilder.java
|
||||
+++ b/net/minecraft/data/recipes/SimpleCookingRecipeBuilder.java
|
||||
@@ -80,7 +_,14 @@
|
||||
this.ensureValid(p_126264_);
|
||||
Advancement.Builder advancement$builder = p_299448_.advancement().addCriterion("has_the_recipe", RecipeUnlockedTrigger.unlocked(p_126264_)).rewards(AdvancementRewards.Builder.recipe(p_126264_)).requirements(AdvancementRequirements.Strategy.OR);
|
||||
this.criteria.forEach(advancement$builder::addCriterion);
|
||||
- p_299448_.accept(new SimpleCookingRecipeBuilder.Result(p_126264_, this.group == null ? "" : this.group, this.bookCategory, this.ingredient, this.result, this.experience, this.cookingTime, advancement$builder.build(p_126264_.withPrefix("recipes/" + this.category.getFolderName() + "/")), this.serializer));
|
||||
+ p_299448_.accept(new SimpleCookingRecipeBuilder.Result(p_126264_, this.group == null ? "" : this.group, this.bookCategory, this.ingredient, this.result, this.experience, this.cookingTime, advancement$builder.build(p_126264_.withPrefix("recipes/" + this.category.getFolderName() + "/")), this.serializer, this.condition));
|
||||
+ }
|
||||
+
|
||||
+ @Nullable
|
||||
+ private net.minecraftforge.common.crafting.conditions.ICondition condition;
|
||||
+ public SimpleCookingRecipeBuilder condition(net.minecraftforge.common.crafting.conditions.ICondition condition) {
|
||||
+ this.condition = condition;
|
||||
+ return this;
|
||||
}
|
||||
|
||||
private static CookingBookCategory determineSmeltingRecipeCategory(ItemLike p_251938_) {
|
||||
@@ -113,8 +_,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
- static record Result(ResourceLocation id, String group, CookingBookCategory category, Ingredient ingredient, Item result, float experience, int cookingTime, AdvancementHolder advancement, RecipeSerializer<? extends AbstractCookingRecipe> type) implements FinishedRecipe {
|
||||
+ static record Result(ResourceLocation id, String group, CookingBookCategory category, Ingredient ingredient, Item result, float experience, int cookingTime, AdvancementHolder advancement, RecipeSerializer<? extends AbstractCookingRecipe> type, net.minecraftforge.common.crafting.conditions.ICondition condition) implements FinishedRecipe {
|
||||
+ public Result(ResourceLocation id, String group, CookingBookCategory category, Ingredient ingredient, Item result, float experience, int cookingTime, AdvancementHolder advancement, RecipeSerializer<? extends AbstractCookingRecipe> type) {
|
||||
+ this(id, group, category, ingredient, result, experience, cookingTime, advancement, type, null);
|
||||
+ }
|
||||
+
|
||||
public void serializeRecipeData(JsonObject p_126297_) {
|
||||
+ net.minecraftforge.common.ForgeHooks.writeCondition(this.condition, p_126297_);
|
||||
if (!this.group.isEmpty()) {
|
||||
p_126297_.addProperty("group", this.group);
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
--- a/net/minecraft/data/recipes/SingleItemRecipeBuilder.java
|
||||
+++ b/net/minecraft/data/recipes/SingleItemRecipeBuilder.java
|
||||
@@ -61,7 +_,14 @@
|
||||
this.ensureValid(p_126328_);
|
||||
Advancement.Builder advancement$builder = p_298439_.advancement().addCriterion("has_the_recipe", RecipeUnlockedTrigger.unlocked(p_126328_)).rewards(AdvancementRewards.Builder.recipe(p_126328_)).requirements(AdvancementRequirements.Strategy.OR);
|
||||
this.criteria.forEach(advancement$builder::addCriterion);
|
||||
- p_298439_.accept(new SingleItemRecipeBuilder.Result(p_126328_, this.type, this.group == null ? "" : this.group, this.ingredient, this.result, this.count, advancement$builder.build(p_126328_.withPrefix("recipes/" + this.category.getFolderName() + "/"))));
|
||||
+ p_298439_.accept(new SingleItemRecipeBuilder.Result(p_126328_, this.type, this.group == null ? "" : this.group, this.ingredient, this.result, this.count, advancement$builder.build(p_126328_.withPrefix("recipes/" + this.category.getFolderName() + "/")), condition));
|
||||
+ }
|
||||
+
|
||||
+ @Nullable
|
||||
+ private net.minecraftforge.common.crafting.conditions.ICondition condition;
|
||||
+ public SingleItemRecipeBuilder condition(net.minecraftforge.common.crafting.conditions.ICondition condition) {
|
||||
+ this.condition = condition;
|
||||
+ return this;
|
||||
}
|
||||
|
||||
private void ensureValid(ResourceLocation p_126330_) {
|
||||
@@ -70,8 +_,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
- public static record Result(ResourceLocation id, RecipeSerializer<?> type, String group, Ingredient ingredient, Item result, int count, AdvancementHolder advancement) implements FinishedRecipe {
|
||||
+ public static record Result(ResourceLocation id, RecipeSerializer<?> type, String group, Ingredient ingredient, Item result, int count, AdvancementHolder advancement, net.minecraftforge.common.crafting.conditions.ICondition condition) implements FinishedRecipe {
|
||||
+ Result(ResourceLocation id, RecipeSerializer<?> type, String group, Ingredient ingredient, Item result, int count, AdvancementHolder advancement) {
|
||||
+ this(id, type, group, ingredient, result, count, advancement, null);
|
||||
+ }
|
||||
+
|
||||
public void serializeRecipeData(JsonObject p_126349_) {
|
||||
+ net.minecraftforge.common.ForgeHooks.writeCondition(this.condition, p_126349_);
|
||||
if (!this.group.isEmpty()) {
|
||||
p_126349_.addProperty("group", this.group);
|
||||
}
|
||||
+1
-10
@@ -1,20 +1,11 @@
|
||||
--- a/net/minecraft/data/registries/RegistriesDatapackGenerator.java
|
||||
+++ b/net/minecraft/data/registries/RegistriesDatapackGenerator.java
|
||||
@@ -18,20 +_,36 @@
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
+/**
|
||||
+ * @deprecated Forge: Use {@link net.minecraftforge.common.data.DatapackBuiltinEntriesProvider} instead
|
||||
+ */
|
||||
+@Deprecated
|
||||
public class RegistriesDatapackGenerator implements DataProvider {
|
||||
@@ -22,16 +_,27 @@
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
private final PackOutput output;
|
||||
private final CompletableFuture<HolderLookup.Provider> registries;
|
||||
+ private final java.util.function.Predicate<String> namespacePredicate;
|
||||
|
||||
+ @Deprecated
|
||||
public RegistriesDatapackGenerator(PackOutput p_256643_, CompletableFuture<HolderLookup.Provider> p_255780_) {
|
||||
+ this(p_256643_, p_255780_, null);
|
||||
+ }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/gametest/framework/GameTestHelper.java
|
||||
+++ b/net/minecraft/gametest/framework/GameTestHelper.java
|
||||
@@ -54,7 +_,7 @@
|
||||
@@ -60,7 +_,7 @@
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
--- a/net/minecraft/gametest/framework/GameTestRegistry.java
|
||||
+++ b/net/minecraft/gametest/framework/GameTestRegistry.java
|
||||
@@ -25,22 +_,31 @@
|
||||
@@ -26,22 +_,31 @@
|
||||
private static final Map<String, Consumer<ServerLevel>> AFTER_BATCH_FUNCTIONS = Maps.newHashMap();
|
||||
private static final Collection<TestFunction> LAST_FAILED_TESTS = Sets.newHashSet();
|
||||
|
||||
+ /** @deprecated Forge: Use {@link net.minecraftforge.event.RegisterGameTestsEvent RegisterGameTestsEvent} to register game tests */
|
||||
+ @Deprecated
|
||||
public static void register(Class<?> p_177502_) {
|
||||
Arrays.stream(p_177502_.getDeclaredMethods()).forEach(GameTestRegistry::register);
|
||||
Arrays.stream(p_177502_.getDeclaredMethods()).sorted(Comparator.comparing(Method::getName)).forEach(GameTestRegistry::register);
|
||||
}
|
||||
|
||||
+ /** @deprecated Forge: Use {@link net.minecraftforge.event.RegisterGameTestsEvent RegisterGameTestsEvent} to register game tests */
|
||||
@@ -36,7 +36,7 @@
|
||||
}
|
||||
|
||||
registerBatchFunction(p_177504_, BeforeBatch.class, BeforeBatch::batch, BEFORE_BATCH_FUNCTIONS);
|
||||
@@ -104,7 +_,9 @@
|
||||
@@ -105,7 +_,9 @@
|
||||
|
||||
private static Collection<TestFunction> useTestGeneratorMethod(Method p_177514_) {
|
||||
try {
|
||||
@@ -47,7 +47,7 @@
|
||||
return (Collection)p_177514_.invoke(object);
|
||||
} catch (ReflectiveOperationException reflectiveoperationexception) {
|
||||
throw new RuntimeException(reflectiveoperationexception);
|
||||
@@ -115,9 +_,9 @@
|
||||
@@ -116,9 +_,9 @@
|
||||
GameTest gametest = p_177516_.getAnnotation(GameTest.class);
|
||||
String s = p_177516_.getDeclaringClass().getSimpleName();
|
||||
String s1 = s.toLowerCase();
|
||||
@@ -60,7 +60,7 @@
|
||||
Rotation rotation = StructureUtils.getRotationForRotationSteps(gametest.rotationSteps());
|
||||
return new TestFunction(s4, s2, s3, rotation, gametest.timeoutTicks(), gametest.setupTicks(), gametest.required(), gametest.requiredSuccesses(), gametest.attempts(), (Consumer<net.minecraft.gametest.framework.GameTestHelper>)turnMethodIntoConsumer(p_177516_));
|
||||
}
|
||||
@@ -125,7 +_,9 @@
|
||||
@@ -126,7 +_,9 @@
|
||||
private static Consumer<?> turnMethodIntoConsumer(Method p_177520_) {
|
||||
return (p_177512_) -> {
|
||||
try {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/gametest/framework/GameTestServer.java
|
||||
+++ b/net/minecraft/gametest/framework/GameTestServer.java
|
||||
@@ -105,13 +_,14 @@
|
||||
@@ -106,13 +_,14 @@
|
||||
public boolean initServer() {
|
||||
this.setPlayerList(new PlayerList(this, this.registries(), this.playerDataStorage, 1) {
|
||||
});
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--- a/net/minecraft/gametest/framework/StructureUtils.java
|
||||
+++ b/net/minecraft/gametest/framework/StructureUtils.java
|
||||
@@ -218,7 +_,7 @@
|
||||
if (optional.isPresent()) {
|
||||
return optional.get();
|
||||
} else {
|
||||
- String s = p_127881_ + ".snbt";
|
||||
+ String s = new ResourceLocation(p_127881_).getPath() + ".snbt";
|
||||
Path path = Paths.get(testStructuresDir, s);
|
||||
CompoundTag compoundtag = tryLoadStructure(path);
|
||||
if (compoundtag == null) {
|
||||
@@ -8,10 +8,10 @@
|
||||
+ return (new net.minecraftforge.common.util.INBTBuilder(){}).nbt();
|
||||
+ }
|
||||
+
|
||||
public static final Codec<CompoundTag> CODEC = Codec.PASSTHROUGH.comapFlatMap((p_274781_) -> {
|
||||
Tag tag = p_274781_.convert(NbtOps.INSTANCE).getValue();
|
||||
return tag instanceof CompoundTag ? DataResult.success((CompoundTag)tag) : DataResult.error(() -> {
|
||||
@@ -204,6 +_,7 @@
|
||||
public static final Codec<CompoundTag> CODEC = Codec.PASSTHROUGH.comapFlatMap((p_308555_) -> {
|
||||
Tag tag = p_308555_.convert(NbtOps.INSTANCE).getValue();
|
||||
if (tag instanceof CompoundTag compoundtag) {
|
||||
@@ -208,6 +_,7 @@
|
||||
|
||||
@Nullable
|
||||
public Tag put(String p_128366_, Tag p_128367_) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/nbt/NbtIo.java
|
||||
+++ b/net/minecraft/nbt/NbtIo.java
|
||||
@@ -154,10 +_,12 @@
|
||||
@@ -168,10 +_,12 @@
|
||||
|
||||
private static Tag readUnnamedTag(DataInput p_128931_, NbtAccounter p_128933_) throws IOException {
|
||||
byte b0 = p_128931_.readByte();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/nbt/StringTag.java
|
||||
+++ b/net/minecraft/nbt/StringTag.java
|
||||
@@ -21,7 +_,7 @@
|
||||
@@ -19,7 +_,7 @@
|
||||
private static String readAccounted(DataInput p_301750_, NbtAccounter p_301732_) throws IOException {
|
||||
p_301732_.accountBytes(36L);
|
||||
String s = p_301750_.readUTF();
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
--- a/net/minecraft/network/ConnectionProtocol.java
|
||||
+++ b/net/minecraft/network/ConnectionProtocol.java
|
||||
@@ -211,11 +_,231 @@
|
||||
@@ -216,11 +_,237 @@
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public enum ConnectionProtocol {
|
||||
- HANDSHAKING("handshake", protocol().addFlow(PacketFlow.CLIENTBOUND, new ConnectionProtocol.PacketSet()).addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet<ServerHandshakePacketListener>()).addPacket(ClientIntentionPacket.class, ClientIntentionPacket::new))),
|
||||
- PLAY("play", protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet<ClientGamePacketListener>()).withBundlePacket(ClientboundBundlePacket.class, ClientboundBundlePacket::new).addPacket(ClientboundAddEntityPacket.class, ClientboundAddEntityPacket::new).addPacket(ClientboundAddExperienceOrbPacket.class, ClientboundAddExperienceOrbPacket::new).addPacket(ClientboundAnimatePacket.class, ClientboundAnimatePacket::new).addPacket(ClientboundAwardStatsPacket.class, ClientboundAwardStatsPacket::new).addPacket(ClientboundBlockChangedAckPacket.class, ClientboundBlockChangedAckPacket::new).addPacket(ClientboundBlockDestructionPacket.class, ClientboundBlockDestructionPacket::new).addPacket(ClientboundBlockEntityDataPacket.class, ClientboundBlockEntityDataPacket::new).addPacket(ClientboundBlockEventPacket.class, ClientboundBlockEventPacket::new).addPacket(ClientboundBlockUpdatePacket.class, ClientboundBlockUpdatePacket::new).addPacket(ClientboundBossEventPacket.class, ClientboundBossEventPacket::new).addPacket(ClientboundChangeDifficultyPacket.class, ClientboundChangeDifficultyPacket::new).addPacket(ClientboundChunkBatchFinishedPacket.class, ClientboundChunkBatchFinishedPacket::new).addPacket(ClientboundChunkBatchStartPacket.class, ClientboundChunkBatchStartPacket::new).addPacket(ClientboundChunksBiomesPacket.class, ClientboundChunksBiomesPacket::new).addPacket(ClientboundClearTitlesPacket.class, ClientboundClearTitlesPacket::new).addPacket(ClientboundCommandSuggestionsPacket.class, ClientboundCommandSuggestionsPacket::new).addPacket(ClientboundCommandsPacket.class, ClientboundCommandsPacket::new).addPacket(ClientboundContainerClosePacket.class, ClientboundContainerClosePacket::new).addPacket(ClientboundContainerSetContentPacket.class, ClientboundContainerSetContentPacket::new).addPacket(ClientboundContainerSetDataPacket.class, ClientboundContainerSetDataPacket::new).addPacket(ClientboundContainerSetSlotPacket.class, ClientboundContainerSetSlotPacket::new).addPacket(ClientboundCooldownPacket.class, ClientboundCooldownPacket::new).addPacket(ClientboundCustomChatCompletionsPacket.class, ClientboundCustomChatCompletionsPacket::new).addPacket(ClientboundCustomPayloadPacket.class, ClientboundCustomPayloadPacket::new).addPacket(ClientboundDamageEventPacket.class, ClientboundDamageEventPacket::new).addPacket(ClientboundDeleteChatPacket.class, ClientboundDeleteChatPacket::new).addPacket(ClientboundDisconnectPacket.class, ClientboundDisconnectPacket::new).addPacket(ClientboundDisguisedChatPacket.class, ClientboundDisguisedChatPacket::new).addPacket(ClientboundEntityEventPacket.class, ClientboundEntityEventPacket::new).addPacket(ClientboundExplodePacket.class, ClientboundExplodePacket::new).addPacket(ClientboundForgetLevelChunkPacket.class, ClientboundForgetLevelChunkPacket::new).addPacket(ClientboundGameEventPacket.class, ClientboundGameEventPacket::new).addPacket(ClientboundHorseScreenOpenPacket.class, ClientboundHorseScreenOpenPacket::new).addPacket(ClientboundHurtAnimationPacket.class, ClientboundHurtAnimationPacket::new).addPacket(ClientboundInitializeBorderPacket.class, ClientboundInitializeBorderPacket::new).addPacket(ClientboundKeepAlivePacket.class, ClientboundKeepAlivePacket::new).addPacket(ClientboundLevelChunkWithLightPacket.class, ClientboundLevelChunkWithLightPacket::new).addPacket(ClientboundLevelEventPacket.class, ClientboundLevelEventPacket::new).addPacket(ClientboundLevelParticlesPacket.class, ClientboundLevelParticlesPacket::new).addPacket(ClientboundLightUpdatePacket.class, ClientboundLightUpdatePacket::new).addPacket(ClientboundLoginPacket.class, ClientboundLoginPacket::new).addPacket(ClientboundMapItemDataPacket.class, ClientboundMapItemDataPacket::new).addPacket(ClientboundMerchantOffersPacket.class, ClientboundMerchantOffersPacket::new).addPacket(ClientboundMoveEntityPacket.Pos.class, ClientboundMoveEntityPacket.Pos::read).addPacket(ClientboundMoveEntityPacket.PosRot.class, ClientboundMoveEntityPacket.PosRot::read).addPacket(ClientboundMoveEntityPacket.Rot.class, ClientboundMoveEntityPacket.Rot::read).addPacket(ClientboundMoveVehiclePacket.class, ClientboundMoveVehiclePacket::new).addPacket(ClientboundOpenBookPacket.class, ClientboundOpenBookPacket::new).addPacket(ClientboundOpenScreenPacket.class, ClientboundOpenScreenPacket::new).addPacket(ClientboundOpenSignEditorPacket.class, ClientboundOpenSignEditorPacket::new).addPacket(ClientboundPingPacket.class, ClientboundPingPacket::new).addPacket(ClientboundPongResponsePacket.class, ClientboundPongResponsePacket::new).addPacket(ClientboundPlaceGhostRecipePacket.class, ClientboundPlaceGhostRecipePacket::new).addPacket(ClientboundPlayerAbilitiesPacket.class, ClientboundPlayerAbilitiesPacket::new).addPacket(ClientboundPlayerChatPacket.class, ClientboundPlayerChatPacket::new).addPacket(ClientboundPlayerCombatEndPacket.class, ClientboundPlayerCombatEndPacket::new).addPacket(ClientboundPlayerCombatEnterPacket.class, ClientboundPlayerCombatEn
Line truncated
|
||||
- PLAY("play", protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet<ClientGamePacketListener>()).withBundlePacket(ClientboundBundlePacket.class, ClientboundBundlePacket::new).addPacket(ClientboundAddEntityPacket.class, ClientboundAddEntityPacket::new).addPacket(ClientboundAddExperienceOrbPacket.class, ClientboundAddExperienceOrbPacket::new).addPacket(ClientboundAnimatePacket.class, ClientboundAnimatePacket::new).addPacket(ClientboundAwardStatsPacket.class, ClientboundAwardStatsPacket::new).addPacket(ClientboundBlockChangedAckPacket.class, ClientboundBlockChangedAckPacket::new).addPacket(ClientboundBlockDestructionPacket.class, ClientboundBlockDestructionPacket::new).addPacket(ClientboundBlockEntityDataPacket.class, ClientboundBlockEntityDataPacket::new).addPacket(ClientboundBlockEventPacket.class, ClientboundBlockEventPacket::new).addPacket(ClientboundBlockUpdatePacket.class, ClientboundBlockUpdatePacket::new).addPacket(ClientboundBossEventPacket.class, ClientboundBossEventPacket::new).addPacket(ClientboundChangeDifficultyPacket.class, ClientboundChangeDifficultyPacket::new).addPacket(ClientboundChunkBatchFinishedPacket.class, ClientboundChunkBatchFinishedPacket::new).addPacket(ClientboundChunkBatchStartPacket.class, ClientboundChunkBatchStartPacket::new).addPacket(ClientboundChunksBiomesPacket.class, ClientboundChunksBiomesPacket::new).addPacket(ClientboundClearTitlesPacket.class, ClientboundClearTitlesPacket::new).addPacket(ClientboundCommandSuggestionsPacket.class, ClientboundCommandSuggestionsPacket::new).addPacket(ClientboundCommandsPacket.class, ClientboundCommandsPacket::new).addPacket(ClientboundContainerClosePacket.class, ClientboundContainerClosePacket::new).addPacket(ClientboundContainerSetContentPacket.class, ClientboundContainerSetContentPacket::new).addPacket(ClientboundContainerSetDataPacket.class, ClientboundContainerSetDataPacket::new).addPacket(ClientboundContainerSetSlotPacket.class, ClientboundContainerSetSlotPacket::new).addPacket(ClientboundCooldownPacket.class, ClientboundCooldownPacket::new).addPacket(ClientboundCustomChatCompletionsPacket.class, ClientboundCustomChatCompletionsPacket::new).addPacket(ClientboundCustomPayloadPacket.class, ClientboundCustomPayloadPacket::new).addPacket(ClientboundDamageEventPacket.class, ClientboundDamageEventPacket::new).addPacket(ClientboundDeleteChatPacket.class, ClientboundDeleteChatPacket::new).addPacket(ClientboundDisconnectPacket.class, ClientboundDisconnectPacket::new).addPacket(ClientboundDisguisedChatPacket.class, ClientboundDisguisedChatPacket::new).addPacket(ClientboundEntityEventPacket.class, ClientboundEntityEventPacket::new).addPacket(ClientboundExplodePacket.class, ClientboundExplodePacket::new).addPacket(ClientboundForgetLevelChunkPacket.class, ClientboundForgetLevelChunkPacket::new).addPacket(ClientboundGameEventPacket.class, ClientboundGameEventPacket::new).addPacket(ClientboundHorseScreenOpenPacket.class, ClientboundHorseScreenOpenPacket::new).addPacket(ClientboundHurtAnimationPacket.class, ClientboundHurtAnimationPacket::new).addPacket(ClientboundInitializeBorderPacket.class, ClientboundInitializeBorderPacket::new).addPacket(ClientboundKeepAlivePacket.class, ClientboundKeepAlivePacket::new).addPacket(ClientboundLevelChunkWithLightPacket.class, ClientboundLevelChunkWithLightPacket::new).addPacket(ClientboundLevelEventPacket.class, ClientboundLevelEventPacket::new).addPacket(ClientboundLevelParticlesPacket.class, ClientboundLevelParticlesPacket::new).addPacket(ClientboundLightUpdatePacket.class, ClientboundLightUpdatePacket::new).addPacket(ClientboundLoginPacket.class, ClientboundLoginPacket::new).addPacket(ClientboundMapItemDataPacket.class, ClientboundMapItemDataPacket::new).addPacket(ClientboundMerchantOffersPacket.class, ClientboundMerchantOffersPacket::new).addPacket(ClientboundMoveEntityPacket.Pos.class, ClientboundMoveEntityPacket.Pos::read).addPacket(ClientboundMoveEntityPacket.PosRot.class, ClientboundMoveEntityPacket.PosRot::read).addPacket(ClientboundMoveEntityPacket.Rot.class, ClientboundMoveEntityPacket.Rot::read).addPacket(ClientboundMoveVehiclePacket.class, ClientboundMoveVehiclePacket::new).addPacket(ClientboundOpenBookPacket.class, ClientboundOpenBookPacket::new).addPacket(ClientboundOpenScreenPacket.class, ClientboundOpenScreenPacket::new).addPacket(ClientboundOpenSignEditorPacket.class, ClientboundOpenSignEditorPacket::new).addPacket(ClientboundPingPacket.class, ClientboundPingPacket::new).addPacket(ClientboundPongResponsePacket.class, ClientboundPongResponsePacket::new).addPacket(ClientboundPlaceGhostRecipePacket.class, ClientboundPlaceGhostRecipePacket::new).addPacket(ClientboundPlayerAbilitiesPacket.class, ClientboundPlayerAbilitiesPacket::new).addPacket(ClientboundPlayerChatPacket.class, ClientboundPlayerChatPacket::new).addPacket(ClientboundPlayerCombatEndPacket.class, ClientboundPlayerCombatEndPacket::new).addPacket(ClientboundPlayerCombatEnterPacket.class, ClientboundPlayerCombatEn
Line truncated
|
||||
- STATUS("status", protocol().addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet<ServerStatusPacketListener>()).addPacket(ServerboundStatusRequestPacket.class, ServerboundStatusRequestPacket::new).addPacket(ServerboundPingRequestPacket.class, ServerboundPingRequestPacket::new)).addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet<ClientStatusPacketListener>()).addPacket(ClientboundStatusResponsePacket.class, ClientboundStatusResponsePacket::new).addPacket(ClientboundPongResponsePacket.class, ClientboundPongResponsePacket::new))),
|
||||
- LOGIN("login", protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet<ClientLoginPacketListener>()).addPacket(ClientboundLoginDisconnectPacket.class, ClientboundLoginDisconnectPacket::new).addPacket(ClientboundHelloPacket.class, ClientboundHelloPacket::new).addPacket(ClientboundGameProfilePacket.class, ClientboundGameProfilePacket::new).addPacket(ClientboundLoginCompressionPacket.class, ClientboundLoginCompressionPacket::new).addPacket(ClientboundCustomQueryPacket.class, ClientboundCustomQueryPacket::new)).addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet<ServerLoginPacketListener>()).addPacket(ServerboundHelloPacket.class, ServerboundHelloPacket::new).addPacket(ServerboundKeyPacket.class, ServerboundKeyPacket::new).addPacket(ServerboundCustomQueryAnswerPacket.class, ServerboundCustomQueryAnswerPacket::read).addPacket(ServerboundLoginAcknowledgedPacket.class, ServerboundLoginAcknowledgedPacket::new))),
|
||||
- CONFIGURATION("configuration", protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet<net.minecraft.network.protocol.configuration.ClientConfigurationPacketListener>()).addPacket(ClientboundCustomPayloadPacket.class, ClientboundCustomPayloadPacket::new).addPacket(ClientboundDisconnectPacket.class, ClientboundDisconnectPacket::new).addPacket(ClientboundFinishConfigurationPacket.class, ClientboundFinishConfigurationPacket::new).addPacket(ClientboundKeepAlivePacket.class, ClientboundKeepAlivePacket::new).addPacket(ClientboundPingPacket.class, ClientboundPingPacket::new).addPacket(ClientboundRegistryDataPacket.class, ClientboundRegistryDataPacket::new).addPacket(ClientboundResourcePackPacket.class, ClientboundResourcePackPacket::new).addPacket(ClientboundUpdateEnabledFeaturesPacket.class, ClientboundUpdateEnabledFeaturesPacket::new).addPacket(ClientboundUpdateTagsPacket.class, ClientboundUpdateTagsPacket::new)).addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet<net.minecraft.network.protocol.configuration.ServerConfigurationPacketListener>()).addPacket(ServerboundClientInformationPacket.class, ServerboundClientInformationPacket::new).addPacket(ServerboundCustomPayloadPacket.class, ServerboundCustomPayloadPacket::new).addPacket(ServerboundFinishConfigurationPacket.class, ServerboundFinishConfigurationPacket::new).addPacket(ServerboundKeepAlivePacket.class, ServerboundKeepAlivePacket::new).addPacket(ServerboundPongPacket.class, ServerboundPongPacket::new).addPacket(ServerboundResourcePackPacket.class, ServerboundResourcePackPacket::new)));
|
||||
- CONFIGURATION("configuration", protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet<net.minecraft.network.protocol.configuration.ClientConfigurationPacketListener>()).addPacket(ClientboundCustomPayloadPacket.class, ClientboundCustomPayloadPacket::new).addPacket(ClientboundDisconnectPacket.class, ClientboundDisconnectPacket::new).addPacket(ClientboundFinishConfigurationPacket.class, ClientboundFinishConfigurationPacket::new).addPacket(ClientboundKeepAlivePacket.class, ClientboundKeepAlivePacket::new).addPacket(ClientboundPingPacket.class, ClientboundPingPacket::new).addPacket(ClientboundRegistryDataPacket.class, ClientboundRegistryDataPacket::new).addPacket(ClientboundResourcePackPopPacket.class, ClientboundResourcePackPopPacket::new).addPacket(ClientboundResourcePackPushPacket.class, ClientboundResourcePackPushPacket::new).addPacket(ClientboundUpdateEnabledFeaturesPacket.class, ClientboundUpdateEnabledFeaturesPacket::new).addPacket(ClientboundUpdateTagsPacket.class, ClientboundUpdateTagsPacket::new)).addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet<net.minecraft.network.protocol.configuration.ServerConfigurationPacketListener>()).addPacket(ServerboundClientInformationPacket.class, ServerboundClientInformationPacket::new).addPacket(ServerboundCustomPayloadPacket.class, ServerboundCustomPayloadPacket::new).addPacket(ServerboundFinishConfigurationPacket.class, ServerboundFinishConfigurationPacket::new).addPacket(ServerboundKeepAlivePacket.class, ServerboundKeepAlivePacket::new).addPacket(ServerboundPongPacket.class, ServerboundPongPacket::new).addPacket(ServerboundResourcePackPacket.class, ServerboundResourcePackPacket::new)));
|
||||
+ HANDSHAKING("handshake", protocol()
|
||||
+ .addFlow(PacketFlow.CLIENTBOUND, new ConnectionProtocol.PacketSet<>())
|
||||
+ .addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet<ServerHandshakePacketListener>())
|
||||
@@ -83,7 +83,9 @@
|
||||
+ .addPacket(ClientboundRecipePacket.class, ClientboundRecipePacket::new)
|
||||
+ .addPacket(ClientboundRemoveEntitiesPacket.class, ClientboundRemoveEntitiesPacket::new)
|
||||
+ .addPacket(ClientboundRemoveMobEffectPacket.class, ClientboundRemoveMobEffectPacket::new)
|
||||
+ .addPacket(ClientboundResourcePackPacket.class, ClientboundResourcePackPacket::new)
|
||||
+ .addPacket(ClientboundResetScorePacket.class, ClientboundResetScorePacket::new)
|
||||
+ .addPacket(ClientboundResourcePackPopPacket.class, ClientboundResourcePackPopPacket::new)
|
||||
+ .addPacket(ClientboundResourcePackPushPacket.class, ClientboundResourcePackPushPacket::new)
|
||||
+ .addPacket(ClientboundRespawnPacket.class, ClientboundRespawnPacket::new)
|
||||
+ .addPacket(ClientboundRotateHeadPacket.class, ClientboundRotateHeadPacket::new)
|
||||
+ .addPacket(ClientboundSectionBlocksUpdatePacket.class, ClientboundSectionBlocksUpdatePacket::new)
|
||||
@@ -125,6 +127,8 @@
|
||||
+ .addPacket(ClientboundTagQueryPacket.class, ClientboundTagQueryPacket::new)
|
||||
+ .addPacket(ClientboundTakeItemEntityPacket.class, ClientboundTakeItemEntityPacket::new)
|
||||
+ .addPacket(ClientboundTeleportEntityPacket.class, ClientboundTeleportEntityPacket::new)
|
||||
+ .addPacket(ClientboundTickingStatePacket.class, ClientboundTickingStatePacket::new)
|
||||
+ .addPacket(ClientboundTickingStepPacket.class, ClientboundTickingStepPacket::new)
|
||||
+ .addPacket(ClientboundUpdateAdvancementsPacket.class, ClientboundUpdateAdvancementsPacket::new)
|
||||
+ .addPacket(ClientboundUpdateAttributesPacket.class, ClientboundUpdateAttributesPacket::new)
|
||||
+ .addPacket(ClientboundUpdateMobEffectPacket.class, ClientboundUpdateMobEffectPacket::new)
|
||||
@@ -147,6 +151,7 @@
|
||||
+ .addPacket(ServerboundContainerButtonClickPacket.class, ServerboundContainerButtonClickPacket::new)
|
||||
+ .addPacket(ServerboundContainerClickPacket.class, ServerboundContainerClickPacket::new)
|
||||
+ .addPacket(ServerboundContainerClosePacket.class, ServerboundContainerClosePacket::new)
|
||||
+ .addPacket(ServerboundContainerSlotStateChangedPacket.class, ServerboundContainerSlotStateChangedPacket::new)
|
||||
+ .addPacket(ServerboundCustomPayloadPacket.class, ServerboundCustomPayloadPacket::new)
|
||||
+ .addPacket(ServerboundEditBookPacket.class, ServerboundEditBookPacket::new)
|
||||
+ .addPacket(ServerboundEntityTagQuery.class, ServerboundEntityTagQuery::new)
|
||||
@@ -221,7 +226,8 @@
|
||||
+ .addPacket(ClientboundKeepAlivePacket.class, ClientboundKeepAlivePacket::new)
|
||||
+ .addPacket(ClientboundPingPacket.class, ClientboundPingPacket::new)
|
||||
+ .addPacket(ClientboundRegistryDataPacket.class, ClientboundRegistryDataPacket::new)
|
||||
+ .addPacket(ClientboundResourcePackPacket.class, ClientboundResourcePackPacket::new)
|
||||
+ .addPacket(ClientboundResourcePackPopPacket.class, ClientboundResourcePackPopPacket::new)
|
||||
+ .addPacket(ClientboundResourcePackPushPacket.class, ClientboundResourcePackPushPacket::new)
|
||||
+ .addPacket(ClientboundUpdateEnabledFeaturesPacket.class, ClientboundUpdateEnabledFeaturesPacket::new)
|
||||
+ .addPacket(ClientboundUpdateTagsPacket.class, ClientboundUpdateTagsPacket::new)
|
||||
+ )
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/network/FriendlyByteBuf.java
|
||||
+++ b/net/minecraft/network/FriendlyByteBuf.java
|
||||
@@ -78,7 +_,7 @@
|
||||
@@ -80,7 +_,7 @@
|
||||
import org.joml.Quaternionf;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public static final int DEFAULT_NBT_QUOTA = 2097152;
|
||||
private final ByteBuf source;
|
||||
public static final short MAX_STRING_LENGTH = Short.MAX_VALUE;
|
||||
@@ -577,6 +_,15 @@
|
||||
@@ -578,6 +_,15 @@
|
||||
}
|
||||
|
||||
public FriendlyByteBuf writeItem(ItemStack p_130056_) {
|
||||
@@ -25,7 +25,7 @@
|
||||
if (p_130056_.isEmpty()) {
|
||||
this.writeBoolean(false);
|
||||
} else {
|
||||
@@ -585,8 +_,8 @@
|
||||
@@ -586,8 +_,8 @@
|
||||
this.writeId(BuiltInRegistries.ITEM, item);
|
||||
this.writeByte(p_130056_.getCount());
|
||||
CompoundTag compoundtag = null;
|
||||
@@ -36,7 +36,7 @@
|
||||
}
|
||||
|
||||
this.writeNbt(compoundtag);
|
||||
@@ -602,7 +_,7 @@
|
||||
@@ -603,7 +_,7 @@
|
||||
Item item = this.readById(BuiltInRegistries.ITEM);
|
||||
int i = this.readByte();
|
||||
ItemStack itemstack = new ItemStack(item, i);
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/network/chat/contents/TranslatableContents.java
|
||||
+++ b/net/minecraft/network/chat/contents/TranslatableContents.java
|
||||
@@ -91,6 +_,11 @@
|
||||
@@ -153,6 +_,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -1,15 +1,15 @@
|
||||
--- a/net/minecraft/network/protocol/common/ClientboundCustomPayloadPacket.java
|
||||
+++ b/net/minecraft/network/protocol/common/ClientboundCustomPayloadPacket.java
|
||||
@@ -26,7 +_,7 @@
|
||||
@@ -27,7 +_,7 @@
|
||||
import net.minecraft.network.protocol.common.custom.WorldGenAttemptDebugPayload;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
-public record ClientboundCustomPayloadPacket(CustomPacketPayload payload) implements Packet<ClientCommonPacketListener> {
|
||||
+public record ClientboundCustomPayloadPacket(CustomPacketPayload payload) implements Packet<ClientCommonPacketListener>, net.minecraftforge.network.ICustomPacket<ClientboundCustomPayloadPacket> {
|
||||
private static final int MAX_PAYLOAD_SIZE = 1048576;
|
||||
private static final Map<ResourceLocation, FriendlyByteBuf.Reader<? extends CustomPacketPayload>> KNOWN_TYPES = ImmutableMap.<ResourceLocation, FriendlyByteBuf.Reader<? extends CustomPacketPayload>>builder().put(BrandPayload.ID, BrandPayload::new).put(BeeDebugPayload.ID, BeeDebugPayload::new).put(BrainDebugPayload.ID, BrainDebugPayload::new).put(GameEventDebugPayload.ID, GameEventDebugPayload::new).put(GameEventListenerDebugPayload.ID, GameEventListenerDebugPayload::new).put(GameTestAddMarkerDebugPayload.ID, GameTestAddMarkerDebugPayload::new).put(GameTestClearMarkersDebugPayload.ID, GameTestClearMarkersDebugPayload::new).put(GoalDebugPayload.ID, GoalDebugPayload::new).put(HiveDebugPayload.ID, HiveDebugPayload::new).put(NeighborUpdatesDebugPayload.ID, NeighborUpdatesDebugPayload::new).put(PathfindingDebugPayload.ID, PathfindingDebugPayload::new).put(PoiAddedDebugPayload.ID, PoiAddedDebugPayload::new).put(PoiRemovedDebugPayload.ID, PoiRemovedDebugPayload::new).put(PoiTicketCountDebugPayload.ID, PoiTicketCountDebugPayload::new).put(RaidsDebugPayload.ID, RaidsDebugPayload::new).put(StructuresDebugPayload.ID, StructuresDebugPayload::new).put(VillageSectionsDebugPayload.ID, VillageSectionsDebugPayload::new).put(WorldGenAttemptDebugPayload.ID, WorldGenAttemptDebugPayload::new).build();
|
||||
private static final Map<ResourceLocation, FriendlyByteBuf.Reader<? extends CustomPacketPayload>> KNOWN_TYPES = ImmutableMap.<ResourceLocation, FriendlyByteBuf.Reader<? extends CustomPacketPayload>>builder().put(BrandPayload.ID, BrandPayload::new).put(BeeDebugPayload.ID, BeeDebugPayload::new).put(BrainDebugPayload.ID, BrainDebugPayload::new).put(BreezeDebugPayload.ID, BreezeDebugPayload::new).put(GameEventDebugPayload.ID, GameEventDebugPayload::new).put(GameEventListenerDebugPayload.ID, GameEventListenerDebugPayload::new).put(GameTestAddMarkerDebugPayload.ID, GameTestAddMarkerDebugPayload::new).put(GameTestClearMarkersDebugPayload.ID, GameTestClearMarkersDebugPayload::new).put(GoalDebugPayload.ID, GoalDebugPayload::new).put(HiveDebugPayload.ID, HiveDebugPayload::new).put(NeighborUpdatesDebugPayload.ID, NeighborUpdatesDebugPayload::new).put(PathfindingDebugPayload.ID, PathfindingDebugPayload::new).put(PoiAddedDebugPayload.ID, PoiAddedDebugPayload::new).put(PoiRemovedDebugPayload.ID, PoiRemovedDebugPayload::new).put(PoiTicketCountDebugPayload.ID, PoiTicketCountDebugPayload::new).put(RaidsDebugPayload.ID, RaidsDebugPayload::new).put(StructuresDebugPayload.ID, StructuresDebugPayload::new).put(VillageSectionsDebugPayload.ID, VillageSectionsDebugPayload::new).put(WorldGenAttemptDebugPayload.ID, WorldGenAttemptDebugPayload::new).build();
|
||||
|
||||
@@ -42,8 +_,7 @@
|
||||
@@ -43,8 +_,7 @@
|
||||
private static DiscardedPayload readUnknownPayload(ResourceLocation p_299265_, FriendlyByteBuf p_297545_) {
|
||||
int i = p_297545_.readableBytes();
|
||||
if (i >= 0 && i <= 1048576) {
|
||||
@@ -19,7 +19,7 @@
|
||||
} else {
|
||||
throw new IllegalArgumentException("Payload may not be larger than 1048576 bytes");
|
||||
}
|
||||
@@ -57,4 +_,8 @@
|
||||
@@ -58,4 +_,8 @@
|
||||
public void handle(ClientCommonPacketListener p_299773_) {
|
||||
p_299773_.handleCustomPayload(this);
|
||||
}
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
+++ b/net/minecraft/network/protocol/status/ServerStatus.java
|
||||
@@ -15,9 +_,9 @@
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.util.ExtraCodecs;
|
||||
import net.minecraft.network.chat.ComponentSerialization;
|
||||
|
||||
-public record ServerStatus(Component description, Optional<ServerStatus.Players> players, Optional<ServerStatus.Version> version, Optional<ServerStatus.Favicon> favicon, boolean enforcesSecureChat) {
|
||||
+public record ServerStatus(Component description, Optional<ServerStatus.Players> players, Optional<ServerStatus.Version> version, Optional<ServerStatus.Favicon> favicon, boolean enforcesSecureChat, Optional<net.minecraftforge.network.ServerStatusPing> forgeData) {
|
||||
public static final Codec<ServerStatus> CODEC = RecordCodecBuilder.create((p_273270_) -> {
|
||||
- return p_273270_.group(ExtraCodecs.COMPONENT.optionalFieldOf("description", CommonComponents.EMPTY).forGetter(ServerStatus::description), ServerStatus.Players.CODEC.optionalFieldOf("players").forGetter(ServerStatus::players), ServerStatus.Version.CODEC.optionalFieldOf("version").forGetter(ServerStatus::version), ServerStatus.Favicon.CODEC.optionalFieldOf("favicon").forGetter(ServerStatus::favicon), Codec.BOOL.optionalFieldOf("enforcesSecureChat", Boolean.valueOf(false)).forGetter(ServerStatus::enforcesSecureChat)).apply(p_273270_, ServerStatus::new);
|
||||
+ return p_273270_.group(ExtraCodecs.COMPONENT.optionalFieldOf("description", CommonComponents.EMPTY).forGetter(ServerStatus::description), ServerStatus.Players.CODEC.optionalFieldOf("players").forGetter(ServerStatus::players), ServerStatus.Version.CODEC.optionalFieldOf("version").forGetter(ServerStatus::version), ServerStatus.Favicon.CODEC.optionalFieldOf("favicon").forGetter(ServerStatus::favicon), Codec.BOOL.optionalFieldOf("enforcesSecureChat", Boolean.valueOf(false)).forGetter(ServerStatus::enforcesSecureChat), net.minecraftforge.network.ServerStatusPing.CODEC.optionalFieldOf("forgeData").forGetter(ServerStatus::forgeData)).apply(p_273270_, ServerStatus::new);
|
||||
public static final Codec<ServerStatus> CODEC = RecordCodecBuilder.create((p_308583_) -> {
|
||||
- return p_308583_.group(ComponentSerialization.CODEC.optionalFieldOf("description", CommonComponents.EMPTY).forGetter(ServerStatus::description), ServerStatus.Players.CODEC.optionalFieldOf("players").forGetter(ServerStatus::players), ServerStatus.Version.CODEC.optionalFieldOf("version").forGetter(ServerStatus::version), ServerStatus.Favicon.CODEC.optionalFieldOf("favicon").forGetter(ServerStatus::favicon), Codec.BOOL.optionalFieldOf("enforcesSecureChat", Boolean.valueOf(false)).forGetter(ServerStatus::enforcesSecureChat)).apply(p_308583_, ServerStatus::new);
|
||||
+ return p_308583_.group(ComponentSerialization.CODEC.optionalFieldOf("description", CommonComponents.EMPTY).forGetter(ServerStatus::description), ServerStatus.Players.CODEC.optionalFieldOf("players").forGetter(ServerStatus::players), ServerStatus.Version.CODEC.optionalFieldOf("version").forGetter(ServerStatus::version), ServerStatus.Favicon.CODEC.optionalFieldOf("favicon").forGetter(ServerStatus::favicon), Codec.BOOL.optionalFieldOf("enforcesSecureChat", Boolean.valueOf(false)).forGetter(ServerStatus::enforcesSecureChat), net.minecraftforge.network.ServerStatusPing.CODEC.optionalFieldOf("forgeData").forGetter(ServerStatus::forgeData)).apply(p_308583_, ServerStatus::new);
|
||||
});
|
||||
|
||||
public static record Favicon(byte[] iconBytes) {
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/resources/DelegatingOps.java
|
||||
+++ b/net/minecraft/resources/DelegatingOps.java
|
||||
@@ -160,4 +_,33 @@
|
||||
@@ -160,4 +_,37 @@
|
||||
public RecordBuilder<T> mapBuilder() {
|
||||
return new RecordBuilder.MapBuilder<>(this);
|
||||
}
|
||||
@@ -14,6 +14,10 @@
|
||||
+ return new Builder(root);
|
||||
+ }
|
||||
+
|
||||
+ public static <T> Builder<DelegatingOps<T>> builder(DynamicOps<T> ops) {
|
||||
+ return builder(() -> new DelegatingOps<>(ops) {});
|
||||
+ }
|
||||
+
|
||||
+ public static class Builder<R extends DelegatingOps<?>> {
|
||||
+ private final java.util.function.Supplier<R> func;
|
||||
+ private final java.util.Map<ResourceLocation, Object> ctx = new java.util.HashMap<>();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/resources/RegistryDataLoader.java
|
||||
+++ b/net/minecraft/resources/RegistryDataLoader.java
|
||||
@@ -123,13 +_,16 @@
|
||||
@@ -124,13 +_,16 @@
|
||||
}
|
||||
|
||||
private static String registryDirPath(ResourceLocation p_252033_) {
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
for(Map.Entry<ResourceLocation, Resource> entry : filetoidconverter.listMatchingResources(p_256349_).entrySet()) {
|
||||
ResourceLocation resourcelocation = entry.getKey();
|
||||
@@ -138,7 +_,12 @@
|
||||
@@ -139,7 +_,12 @@
|
||||
|
||||
try (Reader reader = resource.openAsReader()) {
|
||||
JsonElement jsonelement = JsonParser.parseReader(reader);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+++ b/net/minecraft/resources/ResourceKey.java
|
||||
@@ -7,7 +_,7 @@
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
|
||||
-public class ResourceKey<T> {
|
||||
+public class ResourceKey<T> implements Comparable<ResourceKey<?>> {
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
Path path = optionset.valueOf(optionspec13);
|
||||
if (path != null) {
|
||||
@@ -102,25 +_,24 @@
|
||||
@@ -102,23 +_,21 @@
|
||||
Bootstrap.validate();
|
||||
Util.startTimerHackThread();
|
||||
Path path1 = Paths.get("server.properties");
|
||||
@@ -58,20 +58,27 @@
|
||||
+ }
|
||||
LevelStorageSource levelstoragesource = LevelStorageSource.createDefault(file1.toPath());
|
||||
LevelStorageSource.LevelStorageAccess levelstoragesource$levelstorageaccess = levelstoragesource.validateAndCreateAccess(s);
|
||||
+ levelstoragesource$levelstorageaccess.readAdditionalLevelSaveData();
|
||||
LevelSummary levelsummary = levelstoragesource$levelstorageaccess.getSummary();
|
||||
if (levelsummary != null) {
|
||||
if (levelsummary.requiresManualConversion()) {
|
||||
@@ -166,6 +_,8 @@
|
||||
worlddimensions = dedicatedserverproperties.createDimensions(p_248079_.datapackWorldgen());
|
||||
Dynamic<?> dynamic;
|
||||
@@ -165,6 +_,8 @@
|
||||
|
||||
PackRepository packrepository = ServerPacksSource.createPackRepository(levelstoragesource$levelstorageaccess);
|
||||
|
||||
+ if (dynamic != null)
|
||||
+ net.minecraftforge.common.ForgeHooks.readAdditionalLevelSaveData(dynamic, levelstoragesource$levelstorageaccess.getLevelDirectory());
|
||||
WorldStem worldstem;
|
||||
try {
|
||||
WorldLoader.InitConfig worldloader$initconfig = loadOrCreateConfig(dedicatedserversettings.getProperties(), dynamic1, flag, packrepository);
|
||||
@@ -190,6 +_,9 @@
|
||||
worlddimensions = dedicatedserverproperties.createDimensions(p_308589_.datapackWorldgen());
|
||||
}
|
||||
|
||||
+ //Forge: Do a write-read-cycle to inject modded dimensions on first start of a dedicated server into its generated world dimensions list.
|
||||
+ net.minecraft.resources.RegistryOps<net.minecraft.nbt.Tag> dynamicops = net.minecraft.resources.RegistryOps.create(net.minecraft.nbt.NbtOps.INSTANCE, p_308589_.datapackWorldgen());
|
||||
+ worlddimensions = WorldDimensions.CODEC.encoder().encodeStart(dynamicops, worlddimensions).flatMap((writtenPayloadWithModdedDimensions) -> WorldDimensions.CODEC.decoder().parse(dynamicops, writtenPayloadWithModdedDimensions)).resultOrPartial(LOGGER::error).orElse(worlddimensions);
|
||||
WorldDimensions.Complete worlddimensions$complete = worlddimensions.bake(registry);
|
||||
Lifecycle lifecycle = worlddimensions$complete.lifecycle().add(p_248079_.datapackWorldgen().allRegistriesLifecycle());
|
||||
Lifecycle lifecycle = worlddimensions$complete.lifecycle().add(p_308589_.datapackWorldgen().allRegistriesLifecycle());
|
||||
return new WorldLoader.DataLoadOutput<>(new PrimaryLevelData(levelsettings, worldoptions, worlddimensions$complete.specialWorldProperty(), lifecycle), worlddimensions$complete.dimensionsRegistryAccess());
|
||||
@@ -186,21 +_,32 @@
|
||||
@@ -210,21 +_,32 @@
|
||||
|
||||
WorldData worlddata = worldstem.worldData();
|
||||
levelstoragesource$levelstorageaccess.saveDataTag(registryaccess$frozen, worlddata);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -245,7 +_,7 @@
|
||||
@@ -252,7 +_,7 @@
|
||||
|
||||
public static <S extends MinecraftServer> S spin(Function<Thread, S> p_129873_) {
|
||||
AtomicReference<S> atomicreference = new AtomicReference<>();
|
||||
@@ -9,7 +9,7 @@
|
||||
atomicreference.get().runServer();
|
||||
}, "Server thread");
|
||||
thread.setUncaughtExceptionHandler((p_177909_, p_177910_) -> {
|
||||
@@ -338,6 +_,7 @@
|
||||
@@ -346,6 +_,7 @@
|
||||
this.readScoreboard(dimensiondatastorage);
|
||||
this.commandStorage = new CommandStorage(dimensiondatastorage);
|
||||
WorldBorder worldborder = serverlevel.getWorldBorder();
|
||||
@@ -17,7 +17,7 @@
|
||||
if (!serverleveldata.isInitialized()) {
|
||||
try {
|
||||
setInitialSpawn(serverlevel, serverleveldata, worldoptions.generateBonusChest(), flag);
|
||||
@@ -374,6 +_,7 @@
|
||||
@@ -382,6 +_,7 @@
|
||||
ServerLevel serverlevel1 = new ServerLevel(this, this.executor, this.storageSource, derivedleveldata, resourcekey1, entry.getValue(), p_129816_, flag, j, ImmutableList.of(), false, randomsequences);
|
||||
worldborder.addListener(new BorderChangeListener.DelegateBorderChangeListener(serverlevel1.getWorldBorder()));
|
||||
this.levels.put(resourcekey1, serverlevel1);
|
||||
@@ -25,7 +25,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,6 +_,7 @@
|
||||
@@ -393,6 +_,7 @@
|
||||
p_177898_.setSpawn(BlockPos.ZERO.above(80), 0.0F);
|
||||
} else {
|
||||
ServerChunkCache serverchunkcache = p_177897_.getChunkSource();
|
||||
@@ -33,7 +33,7 @@
|
||||
ChunkPos chunkpos = new ChunkPos(serverchunkcache.randomState().sampler().findSpawnPosition());
|
||||
int i = serverchunkcache.getGenerator().getSpawnHeight(p_177897_);
|
||||
if (i < p_177897_.getMinBuildHeight()) {
|
||||
@@ -467,6 +_,7 @@
|
||||
@@ -475,6 +_,7 @@
|
||||
ChunkPos chunkpos = new ChunkPos(i);
|
||||
serverlevel1.getChunkSource().updateChunkForced(chunkpos, true);
|
||||
}
|
||||
@@ -41,7 +41,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -577,6 +_,7 @@
|
||||
@@ -585,6 +_,7 @@
|
||||
for(ServerLevel serverlevel2 : this.getAllLevels()) {
|
||||
if (serverlevel2 != null) {
|
||||
try {
|
||||
@@ -49,28 +49,28 @@
|
||||
serverlevel2.close();
|
||||
} catch (IOException ioexception1) {
|
||||
LOGGER.error("Exception closing the level", (Throwable)ioexception1);
|
||||
@@ -625,9 +_,11 @@
|
||||
@@ -633,9 +_,11 @@
|
||||
throw new IllegalStateException("Failed to initialize server");
|
||||
}
|
||||
|
||||
+ net.minecraftforge.server.ServerLifecycleHooks.handleServerStarted(this);
|
||||
this.nextTickTime = Util.getMillis();
|
||||
this.nextTickTimeNanos = Util.getNanos();
|
||||
this.statusIcon = this.loadStatusIcon().orElse((ServerStatus.Favicon)null);
|
||||
this.status = this.buildServerStatus();
|
||||
+ resetStatusCache(status);
|
||||
|
||||
while(this.running) {
|
||||
long i = Util.getMillis() - this.nextTickTime;
|
||||
@@ -656,6 +_,8 @@
|
||||
long i;
|
||||
@@ -679,6 +_,8 @@
|
||||
this.isReady = true;
|
||||
JvmProfiler.INSTANCE.onServerTick(this.averageTickTime);
|
||||
JvmProfiler.INSTANCE.onServerTick(this.smoothedTickTimeMillis);
|
||||
}
|
||||
+ net.minecraftforge.server.ServerLifecycleHooks.handleServerStopping(this);
|
||||
+ net.minecraftforge.server.ServerLifecycleHooks.expectServerStopped(); // Forge: Has to come before MinecraftServer#onServerCrash to avoid race conditions
|
||||
} catch (Throwable throwable1) {
|
||||
LOGGER.error("Encountered an unexpected exception", throwable1);
|
||||
CrashReport crashreport = constructOrExtractCrashReport(throwable1);
|
||||
@@ -667,6 +_,7 @@
|
||||
@@ -690,6 +_,7 @@
|
||||
LOGGER.error("We were unable to save this crash report to disk.");
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
this.onServerCrash(crashreport);
|
||||
} finally {
|
||||
try {
|
||||
@@ -679,6 +_,7 @@
|
||||
@@ -702,6 +_,7 @@
|
||||
this.services.profileCache().clearExecutor();
|
||||
}
|
||||
|
||||
@@ -86,23 +86,24 @@
|
||||
this.onServerExit();
|
||||
}
|
||||
|
||||
@@ -793,11 +_,13 @@
|
||||
@@ -820,12 +_,14 @@
|
||||
|
||||
public void tickServer(BooleanSupplier p_129871_) {
|
||||
long i = Util.getNanos();
|
||||
+ net.minecraftforge.event.ForgeEventFactory.onPreServerTick(p_129871_, this);
|
||||
++this.tickCount;
|
||||
this.tickRateManager.tick();
|
||||
this.tickChildren(p_129871_);
|
||||
if (i - this.lastServerStatus >= 5000000000L) {
|
||||
if (i - this.lastServerStatus >= STATUS_EXPIRE_TIME_NANOS) {
|
||||
this.lastServerStatus = i;
|
||||
this.status = this.buildServerStatus();
|
||||
+ resetStatusCache(status);
|
||||
}
|
||||
|
||||
if (this.tickCount % 6000 == 0) {
|
||||
@@ -814,6 +_,17 @@
|
||||
long k = Util.getNanos();
|
||||
this.logTickTime(k - i);
|
||||
--this.ticksUntilAutosave;
|
||||
@@ -848,6 +_,17 @@
|
||||
long l = Util.getNanos();
|
||||
this.logTickTime(l - i);
|
||||
this.profiler.pop();
|
||||
+ net.minecraftforge.event.ForgeEventFactory.onPostServerTick(p_129871_, this);
|
||||
+ }
|
||||
@@ -117,8 +118,8 @@
|
||||
+ return cachedServerStatus;
|
||||
}
|
||||
|
||||
protected void logTickTime(long p_298126_) {
|
||||
@@ -821,7 +_,7 @@
|
||||
private int computeNextAutosaveInterval() {
|
||||
@@ -876,7 +_,7 @@
|
||||
|
||||
private ServerStatus buildServerStatus() {
|
||||
ServerStatus.Players serverstatus$players = this.buildPlayerStatus();
|
||||
@@ -127,7 +128,7 @@
|
||||
}
|
||||
|
||||
private ServerStatus.Players buildPlayerStatus() {
|
||||
@@ -852,7 +_,8 @@
|
||||
@@ -907,7 +_,8 @@
|
||||
this.getFunctions().tick();
|
||||
this.profiler.popPush("levels");
|
||||
|
||||
@@ -137,7 +138,7 @@
|
||||
this.profiler.push(() -> {
|
||||
return serverlevel + " " + serverlevel.dimension().location();
|
||||
});
|
||||
@@ -863,6 +_,7 @@
|
||||
@@ -918,6 +_,7 @@
|
||||
}
|
||||
|
||||
this.profiler.push("tick");
|
||||
@@ -145,7 +146,7 @@
|
||||
|
||||
try {
|
||||
serverlevel.tick(p_129954_);
|
||||
@@ -871,16 +_,18 @@
|
||||
@@ -926,16 +_,18 @@
|
||||
serverlevel.fillReportDetails(crashreport);
|
||||
throw new ReportedException(crashreport);
|
||||
}
|
||||
@@ -160,12 +161,12 @@
|
||||
this.getConnection().tick();
|
||||
this.profiler.popPush("players");
|
||||
this.playerList.tick();
|
||||
- if (SharedConstants.IS_RUNNING_IN_IDE) {
|
||||
- if (SharedConstants.IS_RUNNING_IN_IDE && this.tickRateManager.runsNormally()) {
|
||||
+ if (net.minecraftforge.gametest.ForgeGameTestHooks.isGametestEnabled()) {
|
||||
GameTestTicker.SINGLETON.tick();
|
||||
}
|
||||
|
||||
@@ -969,7 +_,7 @@
|
||||
@@ -1024,7 +_,7 @@
|
||||
|
||||
@DontObfuscate
|
||||
public String getServerModName() {
|
||||
@@ -174,7 +175,7 @@
|
||||
}
|
||||
|
||||
public SystemReport fillSystemReport(SystemReport p_177936_) {
|
||||
@@ -1318,6 +_,7 @@
|
||||
@@ -1373,6 +_,7 @@
|
||||
this.getPlayerList().reloadResources();
|
||||
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
|
||||
this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager);
|
||||
@@ -182,7 +183,7 @@
|
||||
}, this);
|
||||
if (this.isSameThread()) {
|
||||
this.managedBlock(completablefuture::isDone);
|
||||
@@ -1327,10 +_,13 @@
|
||||
@@ -1382,10 +_,13 @@
|
||||
}
|
||||
|
||||
public static WorldDataConfiguration configurePackRepository(PackRepository p_248681_, DataPackConfig p_248920_, boolean p_249869_, FeatureFlagSet p_251243_) {
|
||||
@@ -198,7 +199,7 @@
|
||||
} else {
|
||||
Set<String> set = Sets.newLinkedHashSet();
|
||||
|
||||
@@ -1484,6 +_,31 @@
|
||||
@@ -1551,6 +_,31 @@
|
||||
|
||||
public abstract boolean isSingleplayerOwner(GameProfile p_129840_);
|
||||
|
||||
@@ -230,7 +231,7 @@
|
||||
public void dumpServerProperties(Path p_177911_) throws IOException {
|
||||
}
|
||||
|
||||
@@ -1647,6 +_,10 @@
|
||||
@@ -1714,6 +_,10 @@
|
||||
|
||||
public WorldData getWorldData() {
|
||||
return this.worldData;
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
--- a/net/minecraft/server/PlayerAdvancements.java
|
||||
+++ b/net/minecraft/server/PlayerAdvancements.java
|
||||
@@ -178,6 +_,7 @@
|
||||
@@ -177,6 +_,7 @@
|
||||
this.unregisterListeners(p_298135_);
|
||||
this.progressChanged.add(p_298135_);
|
||||
flag = true;
|
||||
+ net.minecraftforge.event.ForgeEventFactory.onAdvancementGrant(this.player, p_298135_, advancementprogress, p_135990_);
|
||||
if (!flag1 && advancementprogress.isDone()) {
|
||||
p_298135_.value().rewards().grant(this.player);
|
||||
p_298135_.value().display().ifPresent((p_296444_) -> {
|
||||
@@ -186,6 +_,7 @@
|
||||
p_298135_.value().display().ifPresent((p_308592_) -> {
|
||||
@@ -185,6 +_,7 @@
|
||||
}
|
||||
|
||||
});
|
||||
@@ -16,7 +16,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,6 +_,7 @@
|
||||
@@ -203,6 +_,7 @@
|
||||
this.registerListeners(p_297905_);
|
||||
this.progressChanged.add(p_297905_);
|
||||
flag = true;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/ServerAdvancementManager.java
|
||||
+++ b/net/minecraft/server/ServerAdvancementManager.java
|
||||
@@ -29,10 +_,18 @@
|
||||
@@ -32,17 +_,30 @@
|
||||
private Map<ResourceLocation, AdvancementHolder> advancements = Map.of();
|
||||
private AdvancementTree tree = new AdvancementTree();
|
||||
private final LootDataManager lootData;
|
||||
@@ -19,16 +19,16 @@
|
||||
}
|
||||
|
||||
protected void apply(Map<ResourceLocation, JsonElement> p_136034_, ResourceManager p_136035_, ProfilerFiller p_136036_) {
|
||||
@@ -40,7 +_,11 @@
|
||||
p_136034_.forEach((p_296449_, p_296450_) -> {
|
||||
ImmutableMap.Builder<ResourceLocation, AdvancementHolder> builder = ImmutableMap.builder();
|
||||
p_136034_.forEach((p_308595_, p_308596_) -> {
|
||||
try {
|
||||
JsonObject jsonobject = GsonHelper.convertToJsonObject(p_296450_, "advancement");
|
||||
- Advancement advancement = Advancement.fromJson(jsonobject, new DeserializationContext(p_296449_, this.lootData));
|
||||
+ Advancement advancement = Advancement.fromJson(jsonobject, new DeserializationContext(p_296449_, this.lootData), this.context);
|
||||
+ if (advancement == null) {
|
||||
+ LOGGER.debug("Skipping loading advancement {} as its conditions were not met", p_296449_);
|
||||
- Advancement advancement = Util.getOrThrow(Advancement.CODEC.parse(JsonOps.INSTANCE, p_308596_), JsonParseException::new);
|
||||
+ var json = net.minecraftforge.common.ForgeHooks.readConditionalAdvancement(null, (com.google.gson.JsonObject)p_308596_);
|
||||
+ if (json == null) {
|
||||
+ LOGGER.debug("Skipping loading advancement {} as its conditions were not met", p_308595_);
|
||||
+ return;
|
||||
+ }
|
||||
builder.put(p_296449_, new AdvancementHolder(p_296449_, advancement));
|
||||
+ Advancement advancement = Util.getOrThrow(Advancement.CODEC.parse(JsonOps.INSTANCE, json), JsonParseException::new);
|
||||
this.validate(p_308595_, advancement);
|
||||
builder.put(p_308595_, new AdvancementHolder(p_308595_, advancement));
|
||||
} catch (Exception exception) {
|
||||
LOGGER.error("Parsing error loading custom advancement {}: {}", p_296449_, exception.getMessage());
|
||||
@@ -27,7 +27,7 @@
|
||||
long j = Util.getNanos() - i;
|
||||
String s = String.format(Locale.ROOT, "%.3fs", (double)j / 1.0E9D);
|
||||
LOGGER.info("Done ({})! For help, type \"help\"", (Object)s);
|
||||
+ this.nextTickTime = Util.getMillis(); //Forge: Update server time to prevent watchdog/spaming during long load.
|
||||
+ this.nextTickTimeNanos = Util.getNanos(); //Forge: Update server time to prevent watchdog/spaming during long load.
|
||||
if (dedicatedserverproperties.announcePlayerAchievements != null) {
|
||||
this.getGameRules().getRule(GameRules.RULE_ANNOUNCE_ADVANCEMENTS).set(dedicatedserverproperties.announcePlayerAchievements, this);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/dedicated/ServerWatchdog.java
|
||||
+++ b/net/minecraft/server/dedicated/ServerWatchdog.java
|
||||
@@ -40,7 +_,7 @@
|
||||
@@ -41,7 +_,7 @@
|
||||
ThreadMXBean threadmxbean = ManagementFactory.getThreadMXBean();
|
||||
ThreadInfo[] athreadinfo = threadmxbean.dumpAllThreads(true, true);
|
||||
StringBuilder stringbuilder = new StringBuilder();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -162,6 +_,7 @@
|
||||
@@ -160,6 +_,7 @@
|
||||
if (chunkholder == null) {
|
||||
return null;
|
||||
} else {
|
||||
@@ -8,16 +8,16 @@
|
||||
Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure> either = chunkholder.getFutureIfPresent(ChunkStatus.FULL).getNow((Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>)null);
|
||||
if (either == null) {
|
||||
return null;
|
||||
@@ -351,7 +_,7 @@
|
||||
for(ServerChunkCache.ChunkAndHolder serverchunkcache$chunkandholder : list) {
|
||||
LevelChunk levelchunk1 = serverchunkcache$chunkandholder.chunk;
|
||||
ChunkPos chunkpos = levelchunk1.getPos();
|
||||
- if (this.level.isNaturalSpawningAllowed(chunkpos) && this.chunkMap.anyPlayerCloseEnoughForSpawning(chunkpos)) {
|
||||
+ if ((this.level.isNaturalSpawningAllowed(chunkpos) && this.chunkMap.anyPlayerCloseEnoughForSpawning(chunkpos)) || this.distanceManager.shouldForceTicks(chunkpos.toLong())) {
|
||||
levelchunk1.incrementInhabitedTime(j);
|
||||
if (flag2 && (this.spawnEnemies || this.spawnFriendlies) && this.level.getWorldBorder().isWithinBounds(chunkpos)) {
|
||||
NaturalSpawner.spawnForChunk(this.level, levelchunk1, naturalspawner$spawnstate, this.spawnFriendlies, this.spawnEnemies, flag1);
|
||||
@@ -432,11 +_,17 @@
|
||||
@@ -347,7 +_,7 @@
|
||||
for(ServerChunkCache.ChunkAndHolder serverchunkcache$chunkandholder : list) {
|
||||
LevelChunk levelchunk1 = serverchunkcache$chunkandholder.chunk;
|
||||
ChunkPos chunkpos = levelchunk1.getPos();
|
||||
- if (this.level.isNaturalSpawningAllowed(chunkpos) && this.chunkMap.anyPlayerCloseEnoughForSpawning(chunkpos)) {
|
||||
+ if ((this.level.isNaturalSpawningAllowed(chunkpos) && this.chunkMap.anyPlayerCloseEnoughForSpawning(chunkpos)) || this.distanceManager.shouldForceTicks(chunkpos.toLong())) {
|
||||
levelchunk1.incrementInhabitedTime(j);
|
||||
if (flag1 && (this.spawnEnemies || this.spawnFriendlies) && this.level.getWorldBorder().isWithinBounds(chunkpos)) {
|
||||
NaturalSpawner.spawnForChunk(this.level, levelchunk1, naturalspawner$spawnstate, this.spawnFriendlies, this.spawnEnemies, flag);
|
||||
@@ -428,11 +_,17 @@
|
||||
}
|
||||
|
||||
public <T> void addRegionTicket(TicketType<T> p_8388_, ChunkPos p_8389_, int p_8390_, T p_8391_) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -188,11 +_,12 @@
|
||||
@@ -190,11 +_,12 @@
|
||||
private final List<CustomSpawner> customSpawners;
|
||||
@Nullable
|
||||
private EndDragonFight dragonFight;
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
public ServerLevel(MinecraftServer p_214999_, Executor p_215000_, LevelStorageSource.LevelStorageAccess p_215001_, ServerLevelData p_215002_, ResourceKey<Level> p_215003_, LevelStem p_215004_, ChunkProgressListener p_215005_, boolean p_215006_, long p_215007_, List<CustomSpawner> p_215008_, boolean p_215009_, @Nullable RandomSequences p_288977_) {
|
||||
super(p_215002_, p_215003_, p_214999_.registryAccess(), p_215004_.type(), p_214999_::getProfiler, false, p_215006_, p_215007_, p_214999_.getMaxChainedNeighborUpdates());
|
||||
@@ -232,6 +_,7 @@
|
||||
@@ -234,6 +_,7 @@
|
||||
this.randomSequences = Objects.requireNonNullElseGet(p_288977_, () -> {
|
||||
return this.getDataStorage().computeIfAbsent(RandomSequences.factory(i), "random_sequences");
|
||||
});
|
||||
@@ -22,7 +22,7 @@
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
@@ -267,8 +_,8 @@
|
||||
@@ -274,8 +_,8 @@
|
||||
int i = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
|
||||
if (this.sleepStatus.areEnoughSleeping(i) && this.sleepStatus.areEnoughDeepSleeping(i, this.players)) {
|
||||
if (this.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) {
|
||||
@@ -33,27 +33,24 @@
|
||||
}
|
||||
|
||||
this.wakeUpAllPlayers();
|
||||
@@ -297,7 +_,7 @@
|
||||
this.runBlockEvents();
|
||||
@@ -313,7 +_,7 @@
|
||||
|
||||
this.handlingTick = false;
|
||||
profilerfiller.pop();
|
||||
- boolean flag = !this.players.isEmpty() || !this.getForcedChunks().isEmpty();
|
||||
+ boolean flag = !this.players.isEmpty() || net.minecraftforge.common.world.ForgeChunkManager.hasForcedChunks(this); //Forge: Replace vanilla's has forced chunk check with forge's that checks both the vanilla and forge added ones
|
||||
if (flag) {
|
||||
- boolean flag1 = !this.players.isEmpty() || !this.getForcedChunks().isEmpty();
|
||||
+ boolean flag1 = !this.players.isEmpty() || net.minecraftforge.common.world.ForgeChunkManager.hasForcedChunks(this); //Forge: Replace vanilla's has forced chunk check with forge's that checks both the vanilla and forge added ones
|
||||
if (flag1) {
|
||||
this.resetEmptyTime();
|
||||
}
|
||||
@@ -329,7 +_,9 @@
|
||||
@@ -344,6 +_,7 @@
|
||||
p_308944_.stopRiding();
|
||||
}
|
||||
|
||||
+ if (p_308944_.isRemoved() || p_308944_ instanceof net.minecraftforge.entity.PartEntity) return;
|
||||
profilerfiller.push("tick");
|
||||
- this.guardEntityTick(this::tickNonPassenger, p_184065_);
|
||||
+ if (!p_184065_.isRemoved() && !(p_184065_ instanceof net.minecraftforge.entity.PartEntity)) {
|
||||
+ this.guardEntityTick(this::tickNonPassenger, p_184065_);
|
||||
+ }
|
||||
this.guardEntityTick(this::tickNonPassenger, p_308944_);
|
||||
profilerfiller.pop();
|
||||
}
|
||||
}
|
||||
@@ -461,6 +_,7 @@
|
||||
@@ -478,6 +_,7 @@
|
||||
BlockPos blockpos = this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, p_300602_);
|
||||
BlockPos blockpos1 = blockpos.below();
|
||||
Biome biome = this.getBiome(blockpos).value();
|
||||
@@ -61,7 +58,7 @@
|
||||
if (biome.shouldFreeze(this, blockpos1)) {
|
||||
this.setBlockAndUpdate(blockpos1, Blocks.ICE.defaultBlockState());
|
||||
}
|
||||
@@ -633,15 +_,19 @@
|
||||
@@ -650,15 +_,19 @@
|
||||
this.server.getPlayerList().broadcastAll(new ClientboundGameEventPacket(ClientboundGameEventPacket.THUNDER_LEVEL_CHANGE, this.thunderLevel), this.dimension());
|
||||
}
|
||||
|
||||
@@ -85,7 +82,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -700,6 +_,7 @@
|
||||
@@ -718,6 +_,7 @@
|
||||
return BuiltInRegistries.ENTITY_TYPE.getKey(p_8664_.getType()).toString();
|
||||
});
|
||||
profilerfiller.incrementCounter("tickPassenger");
|
||||
@@ -93,7 +90,7 @@
|
||||
p_8664_.rideTick();
|
||||
profilerfiller.pop();
|
||||
|
||||
@@ -736,6 +_,7 @@
|
||||
@@ -754,6 +_,7 @@
|
||||
this.entityManager.autoSave();
|
||||
}
|
||||
|
||||
@@ -101,7 +98,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -828,6 +_,7 @@
|
||||
@@ -846,6 +_,7 @@
|
||||
}
|
||||
|
||||
private void addPlayer(ServerPlayer p_8854_) {
|
||||
@@ -109,7 +106,7 @@
|
||||
Entity entity = this.getEntities().get(p_8854_.getUUID());
|
||||
if (entity != null) {
|
||||
LOGGER.warn("Force-added player with duplicate UUID {}", (Object)p_8854_.getUUID());
|
||||
@@ -835,7 +_,8 @@
|
||||
@@ -853,7 +_,8 @@
|
||||
this.removePlayerImmediately((ServerPlayer)entity, Entity.RemovalReason.DISCARDED);
|
||||
}
|
||||
|
||||
@@ -119,7 +116,7 @@
|
||||
}
|
||||
|
||||
private boolean addEntity(Entity p_8873_) {
|
||||
@@ -843,7 +_,12 @@
|
||||
@@ -861,7 +_,12 @@
|
||||
LOGGER.warn("Tried to add entity {} but it was marked as removed already", (Object)EntityType.getKey(p_8873_.getType()));
|
||||
return false;
|
||||
} else {
|
||||
@@ -133,7 +130,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -880,10 +_,22 @@
|
||||
@@ -898,10 +_,22 @@
|
||||
}
|
||||
|
||||
public void playSeededSound(@Nullable Player p_263330_, double p_263393_, double p_263369_, double p_263354_, Holder<SoundEvent> p_263412_, SoundSource p_263338_, float p_263352_, float p_263390_, long p_263403_) {
|
||||
@@ -156,7 +153,7 @@
|
||||
this.server.getPlayerList().broadcast(p_263545_, p_263544_.getX(), p_263544_.getY(), p_263544_.getZ(), (double)p_263491_.value().getRange(p_263530_), this.dimension(), new ClientboundSoundEntityPacket(p_263491_, p_263542_, p_263544_, p_263530_, p_263520_, p_263490_));
|
||||
}
|
||||
|
||||
@@ -905,6 +_,7 @@
|
||||
@@ -923,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void gameEvent(GameEvent p_215041_, Vec3 p_215042_, GameEvent.Context p_215043_) {
|
||||
@@ -164,7 +161,7 @@
|
||||
this.gameEventDispatcher.post(p_215041_, p_215042_, p_215043_);
|
||||
}
|
||||
|
||||
@@ -941,10 +_,15 @@
|
||||
@@ -959,10 +_,15 @@
|
||||
}
|
||||
|
||||
public void updateNeighborsAt(BlockPos p_215045_, Block p_215046_) {
|
||||
@@ -180,7 +177,7 @@
|
||||
this.neighborUpdater.updateNeighborsAtExceptFromFacing(p_215052_, p_215053_, p_215054_);
|
||||
}
|
||||
|
||||
@@ -1380,6 +_,11 @@
|
||||
@@ -1402,6 +_,11 @@
|
||||
});
|
||||
}
|
||||
|
||||
@@ -192,7 +189,7 @@
|
||||
public LevelEntityGetter<Entity> getEntities() {
|
||||
return this.entityManager.getEntityGetter();
|
||||
}
|
||||
@@ -1475,8 +_,8 @@
|
||||
@@ -1505,8 +_,8 @@
|
||||
ServerLevel.this.navigatingMobs.add(mob);
|
||||
}
|
||||
|
||||
@@ -203,7 +200,7 @@
|
||||
ServerLevel.this.dragonParts.put(enderdragonpart.getId(), enderdragonpart);
|
||||
}
|
||||
}
|
||||
@@ -1500,17 +_,25 @@
|
||||
@@ -1530,17 +_,25 @@
|
||||
ServerLevel.this.navigatingMobs.remove(mob);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -147,7 +_,7 @@
|
||||
@@ -153,7 +_,7 @@
|
||||
import net.minecraft.world.scores.criteria.ObjectiveCriteria;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_XZ = 32;
|
||||
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10;
|
||||
@@ -569,6 +_,7 @@
|
||||
@@ -576,6 +_,7 @@
|
||||
|
||||
public void die(DamageSource p_9035_) {
|
||||
this.gameEvent(GameEvent.ENTITY_DIE);
|
||||
@@ -17,7 +17,7 @@
|
||||
boolean flag = this.level().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES);
|
||||
if (flag) {
|
||||
Component component = this.getCombatTracker().getDeathMessage();
|
||||
@@ -715,11 +_,12 @@
|
||||
@@ -720,11 +_,12 @@
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -32,7 +32,7 @@
|
||||
this.unRide();
|
||||
this.serverLevel().removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION);
|
||||
if (!this.wonGame) {
|
||||
@@ -736,13 +_,14 @@
|
||||
@@ -741,13 +_,14 @@
|
||||
PlayerList playerlist = this.server.getPlayerList();
|
||||
playerlist.sendPlayerPermissionLevel(this);
|
||||
serverlevel.removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION);
|
||||
@@ -50,7 +50,7 @@
|
||||
this.createEndPlatform(p_9180_, BlockPos.containing(portalinfo.pos));
|
||||
}
|
||||
|
||||
@@ -754,6 +_,9 @@
|
||||
@@ -759,6 +_,9 @@
|
||||
p_9180_.addDuringPortalTeleport(this);
|
||||
serverlevel.getProfiler().pop();
|
||||
this.triggerDimensionChangeTriggers(serverlevel);
|
||||
@@ -60,7 +60,7 @@
|
||||
this.connection.send(new ClientboundPlayerAbilitiesPacket(this.getAbilities()));
|
||||
playerlist.sendLevelInfo(this, p_9180_);
|
||||
playerlist.sendAllPlayerInfo(this);
|
||||
@@ -762,10 +_,12 @@
|
||||
@@ -767,10 +_,12 @@
|
||||
this.connection.send(new ClientboundUpdateMobEffectPacket(this.getId(), mobeffectinstance));
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
}
|
||||
|
||||
return this;
|
||||
@@ -829,6 +_,9 @@
|
||||
@@ -834,6 +_,9 @@
|
||||
}
|
||||
|
||||
public Either<Player.BedSleepingProblem, Unit> startSleepInBed(BlockPos p_9115_) {
|
||||
@@ -83,7 +83,7 @@
|
||||
Direction direction = this.level().getBlockState(p_9115_).getValue(HorizontalDirectionalBlock.FACING);
|
||||
if (!this.isSleeping() && this.isAlive()) {
|
||||
if (!this.level().dimensionType().natural()) {
|
||||
@@ -839,7 +_,7 @@
|
||||
@@ -844,7 +_,7 @@
|
||||
return Either.left(Player.BedSleepingProblem.OBSTRUCTED);
|
||||
} else {
|
||||
this.setRespawnPosition(this.level().dimension(), p_9115_, this.getYRot(), false, true);
|
||||
@@ -92,7 +92,7 @@
|
||||
return Either.left(Player.BedSleepingProblem.NOT_POSSIBLE_NOW);
|
||||
} else {
|
||||
if (!this.isCreative()) {
|
||||
@@ -877,6 +_,7 @@
|
||||
@@ -882,6 +_,7 @@
|
||||
}
|
||||
|
||||
private boolean bedInRange(BlockPos p_9117_, Direction p_9118_) {
|
||||
@@ -100,7 +100,7 @@
|
||||
return this.isReachableBedBlock(p_9117_) || this.isReachableBedBlock(p_9117_.relative(p_9118_.getOpposite()));
|
||||
}
|
||||
|
||||
@@ -958,6 +_,7 @@
|
||||
@@ -970,6 +_,7 @@
|
||||
this.connection.send(new ClientboundOpenScreenPacket(abstractcontainermenu.containerId, abstractcontainermenu.getType(), p_9033_.getDisplayName()));
|
||||
this.initMenu(abstractcontainermenu);
|
||||
this.containerMenu = abstractcontainermenu;
|
||||
@@ -108,7 +108,7 @@
|
||||
return OptionalInt.of(this.containerCounter);
|
||||
}
|
||||
}
|
||||
@@ -976,6 +_,7 @@
|
||||
@@ -988,6 +_,7 @@
|
||||
this.connection.send(new ClientboundHorseScreenOpenPacket(this.containerCounter, p_9060_.getContainerSize(), p_9059_.getId()));
|
||||
this.containerMenu = new HorseInventoryMenu(this.containerCounter, this.getInventory(), p_9060_, p_9059_);
|
||||
this.initMenu(this.containerMenu);
|
||||
@@ -116,7 +116,7 @@
|
||||
}
|
||||
|
||||
public void openItemGui(ItemStack p_9082_, InteractionHand p_9083_) {
|
||||
@@ -1001,6 +_,7 @@
|
||||
@@ -1013,6 +_,7 @@
|
||||
public void doCloseContainer() {
|
||||
this.containerMenu.removed(this);
|
||||
this.inventoryMenu.transferState(this.containerMenu);
|
||||
@@ -124,7 +124,7 @@
|
||||
this.containerMenu = this.inventoryMenu;
|
||||
}
|
||||
|
||||
@@ -1134,6 +_,15 @@
|
||||
@@ -1233,6 +_,15 @@
|
||||
this.setShoulderEntityLeft(p_9016_.getShoulderEntityLeft());
|
||||
this.setShoulderEntityRight(p_9016_.getShoulderEntityRight());
|
||||
this.setLastDeathLocation(p_9016_.getLastDeathLocation());
|
||||
@@ -140,7 +140,7 @@
|
||||
}
|
||||
|
||||
protected void onEffectAdded(MobEffectInstance p_143393_, @Nullable Entity p_143394_) {
|
||||
@@ -1214,6 +_,7 @@
|
||||
@@ -1313,6 +_,7 @@
|
||||
}
|
||||
|
||||
public boolean setGameMode(GameType p_143404_) {
|
||||
@@ -148,7 +148,7 @@
|
||||
if (!this.gameMode.changeGameModeForPlayer(p_143404_)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -1348,6 +_,8 @@
|
||||
@@ -1447,6 +_,8 @@
|
||||
public void setCamera(@Nullable Entity p_9214_) {
|
||||
Entity entity = this.getCamera();
|
||||
this.camera = (Entity)(p_9214_ == null ? this : p_9214_);
|
||||
@@ -157,7 +157,7 @@
|
||||
if (entity != this.camera) {
|
||||
Level level = this.camera.level();
|
||||
if (level instanceof ServerLevel) {
|
||||
@@ -1387,7 +_,11 @@
|
||||
@@ -1486,7 +_,11 @@
|
||||
|
||||
@Nullable
|
||||
public Component getTabListDisplayName() {
|
||||
@@ -170,7 +170,7 @@
|
||||
}
|
||||
|
||||
public void swing(InteractionHand p_9031_) {
|
||||
@@ -1413,20 +_,23 @@
|
||||
@@ -1512,20 +_,23 @@
|
||||
if (p_9000_ == this.level()) {
|
||||
this.connection.teleport(p_9001_, p_9002_, p_9003_, p_9004_, p_9005_);
|
||||
} else {
|
||||
@@ -195,7 +195,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1449,6 +_,8 @@
|
||||
@@ -1548,6 +_,8 @@
|
||||
}
|
||||
|
||||
public void setRespawnPosition(ResourceKey<Level> p_9159_, @Nullable BlockPos p_9160_, float p_9161_, boolean p_9162_, boolean p_9163_) {
|
||||
@@ -204,7 +204,7 @@
|
||||
if (p_9160_ != null) {
|
||||
boolean flag = p_9160_.equals(this.respawnPosition) && p_9159_.equals(this.respawnDimension);
|
||||
if (p_9163_ && !flag) {
|
||||
@@ -1493,6 +_,9 @@
|
||||
@@ -1592,6 +_,9 @@
|
||||
if (itementity == null) {
|
||||
return null;
|
||||
} else {
|
||||
@@ -214,7 +214,7 @@
|
||||
this.level().addFreshEntity(itementity);
|
||||
ItemStack itemstack = itementity.getItem();
|
||||
if (p_9087_) {
|
||||
@@ -1507,6 +_,75 @@
|
||||
@@ -1606,6 +_,75 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,7 +290,7 @@
|
||||
public TextFilter getTextFilter() {
|
||||
return this.textFilter;
|
||||
}
|
||||
@@ -1566,11 +_,14 @@
|
||||
@@ -1665,11 +_,14 @@
|
||||
|
||||
public boolean drop(boolean p_182295_) {
|
||||
Inventory inventory = this.getInventory();
|
||||
|
||||
@@ -24,47 +24,48 @@
|
||||
@@ -221,7 +_,8 @@
|
||||
|
||||
public boolean destroyBlock(BlockPos p_9281_) {
|
||||
BlockState blockstate = this.level.getBlockState(p_9281_);
|
||||
- if (!this.player.getMainHandItem().getItem().canAttackBlock(blockstate, this.level, p_9281_, this.player)) {
|
||||
BlockState blockstate1 = this.level.getBlockState(p_9281_);
|
||||
- if (!this.player.getMainHandItem().getItem().canAttackBlock(blockstate1, this.level, p_9281_, this.player)) {
|
||||
+ int exp = net.minecraftforge.common.ForgeHooks.onBlockBreakEvent(level, gameModeForPlayer, player, p_9281_);
|
||||
+ if (exp == -1) {
|
||||
return false;
|
||||
} else {
|
||||
BlockEntity blockentity = this.level.getBlockEntity(p_9281_);
|
||||
@@ -229,30 +_,42 @@
|
||||
@@ -229,30 +_,43 @@
|
||||
if (block instanceof GameMasterBlock && !this.player.canUseGameMasterBlocks()) {
|
||||
this.level.sendBlockUpdated(p_9281_, blockstate, blockstate, 3);
|
||||
this.level.sendBlockUpdated(p_9281_, blockstate1, blockstate1, 3);
|
||||
return false;
|
||||
+ } else if (player.getMainHandItem().onBlockStartBreak(p_9281_, player)) {
|
||||
+ return false;
|
||||
} else if (this.player.blockActionRestricted(this.level, p_9281_, this.gameModeForPlayer)) {
|
||||
return false;
|
||||
} else {
|
||||
- block.playerWillDestroy(this.level, p_9281_, blockstate, this.player);
|
||||
- boolean flag = this.level.removeBlock(p_9281_, false);
|
||||
- if (flag) {
|
||||
- BlockState blockstate = block.playerWillDestroy(this.level, p_9281_, blockstate1, this.player);
|
||||
- boolean flag1 = this.level.removeBlock(p_9281_, false);
|
||||
- if (flag1) {
|
||||
- block.destroy(this.level, p_9281_, blockstate);
|
||||
- }
|
||||
-
|
||||
+ BlockState blockstate = blockstate1;
|
||||
if (this.isCreative()) {
|
||||
+ removeBlock(p_9281_, false);
|
||||
return true;
|
||||
} else {
|
||||
ItemStack itemstack = this.player.getMainHandItem();
|
||||
ItemStack itemstack1 = itemstack.copy();
|
||||
- boolean flag1 = this.player.hasCorrectToolForDrops(blockstate);
|
||||
+ boolean flag1 = blockstate.canHarvestBlock(this.level, p_9281_, this.player); // previously player.hasCorrectToolForDrops(blockstate)
|
||||
- boolean flag = this.player.hasCorrectToolForDrops(blockstate);
|
||||
+ boolean flag = blockstate.canHarvestBlock(this.level, p_9281_, this.player); // previously player.hasCorrectToolForDrops(blockstate)
|
||||
itemstack.mineBlock(this.level, blockstate, p_9281_, this.player);
|
||||
+ if (itemstack.isEmpty() && !itemstack1.isEmpty())
|
||||
+ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this.player, itemstack1, InteractionHand.MAIN_HAND);
|
||||
+ boolean flag = removeBlock(p_9281_, flag1);
|
||||
+ boolean flag1 = removeBlock(p_9281_, flag);
|
||||
+
|
||||
if (flag && flag1) {
|
||||
if (flag1 && flag) {
|
||||
block.playerDestroy(this.level, this.player, p_9281_, blockstate, blockentity, itemstack1);
|
||||
}
|
||||
|
||||
+ if (flag && exp > 0)
|
||||
+ blockstate.getBlock().popExperience(level, p_9281_, exp);
|
||||
+ blockstate1.getBlock().popExperience(level, p_9281_, exp);
|
||||
+
|
||||
return true;
|
||||
}
|
||||
|
||||
Loaded 100 of 456 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user