9
0
mirror of https://github.com/Dreeam-qwq/Gale.git synced 2025-12-29 11:39:10 +00:00
Files
Gale/patches/server/0073-Fix-MC-123848.patch
2023-03-22 16:49:11 +01:00

76 lines
3.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Tue, 29 Nov 2022 16:25:51 +0100
Subject: [PATCH] Fix MC-123848
License: MIT (https://opensource.org/licenses/MIT)
Gale - https://galemc.org
This patch is based on the following patch:
"Fix MC-123848"
By: BillyGalbreath <blake.galbreath@gmail.com>
As part of: Purpur (https://github.com/PurpurMC/Purpur)
Licensed under: MIT (https://opensource.org/licenses/MIT)
* Purpur copyright *
MIT License
Copyright (c) 2019-2022 PurpurMC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
index 30aec9dff249ae629b22318e52902361a9fa4099..c58fab79c9425a56cd9ffdfa81e4ea97d5dff941 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
@@ -287,6 +287,16 @@ public class ItemFrame extends HangingEntity {
}
}
+ // Gale start - Purpur - fix MC-123848
+ @Override
+ public @Nullable net.minecraft.world.entity.item.ItemEntity spawnAtLocation(ItemStack stack) {
+ if (!this.level.galeConfig().gameplayMechanics.fixes.mc123848) {
+ return super.spawnAtLocation(stack);
+ }
+ return this.spawnAtLocation(stack, getDirection().equals(Direction.DOWN) ? -0.6F : 0.0F);
+ }
+ // Gale end - Purpur - fix MC-123848
+
private void removeFramedMap(ItemStack itemstack) {
// Paper start - fix MC-252817 (green map markers do not disappear)
this.getFramedMapIdFromItem(itemstack).ifPresent((i) -> {
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
index 78e9ea40795ad55b948d6ecc6747e4eb5834eba4..aa544ed67ed9db995556d8771417decb5a4d0e82 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
@@ -285,6 +285,11 @@ public class GaleWorldConfiguration extends ConfigurationPart {
public boolean mc238526 = false;
// Gale end - Purpur - fix MC-238526
+ // Gale start - Purpur - fix MC-123848
+ @Setting("mc-123848")
+ public boolean mc123848 = false;
+ // Gale end - Purpur - fix MC-123848
+
}
}