mirror of
https://github.com/Dreeam-qwq/Gale.git
synced 2025-12-27 10:39:12 +00:00
79 lines
4.2 KiB
Diff
79 lines
4.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
|
Date: Tue, 29 Nov 2022 15:55:05 +0100
|
|
Subject: [PATCH] Fix cow rotation when shearing mooshroom
|
|
|
|
License: MIT (https://opensource.org/licenses/MIT)
|
|
Gale - https://galemc.org
|
|
|
|
This patch is based on the following patch:
|
|
"Fix cow rotation when shearing mooshroom"
|
|
By: William Blake Galbreath <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/animal/MushroomCow.java b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java
|
|
index 0c21959f57ae88fcd0a4d6dc911c1ce347c96528..5707c6287a691030841fa973e8f7f34a816103e4 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java
|
|
@@ -196,12 +196,21 @@ public class MushroomCow extends Cow implements Shearable, VariantHolder<Mushroo
|
|
// this.discard(); // CraftBukkit - moved down
|
|
entitycow.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot());
|
|
entitycow.setHealth(this.getHealth());
|
|
+ // Gale start - Purpur - fix cow rotation when shearing mooshroom
|
|
+ if (this.level().galeConfig().gameplayMechanics.fixes.keepMooshroomRotationAfterShearing) {
|
|
+ entitycow.copyPosition(this);
|
|
+ entitycow.yBodyRot = this.yBodyRot;
|
|
+ entitycow.setYHeadRot(this.getYHeadRot());
|
|
+ entitycow.yRotO = this.yRotO;
|
|
+ entitycow.xRotO = this.xRotO;
|
|
+ } else {
|
|
+ // Gale end - Purpur - fix cow rotation when shearing mooshroom
|
|
entitycow.yBodyRot = this.yBodyRot;
|
|
+ } // Gale - Purpur - fix cow rotation when shearing mooshroom
|
|
if (this.hasCustomName()) {
|
|
entitycow.setCustomName(this.getCustomName());
|
|
entitycow.setCustomNameVisible(this.isCustomNameVisible());
|
|
}
|
|
-
|
|
if (this.isPersistenceRequired()) {
|
|
entitycow.setPersistenceRequired();
|
|
}
|
|
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
index fff9f552a9b3cc4913837077857c78826bf1bdb0..3fa354ceef3ec5ab9bca3f13f23aca586dfe09c4 100644
|
|
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
+++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
@@ -99,6 +99,8 @@ public class GaleWorldConfiguration extends ConfigurationPart {
|
|
public Fixes fixes;
|
|
public class Fixes extends ConfigurationPart {
|
|
|
|
+ public boolean keepMooshroomRotationAfterShearing = true; // Gale - Purpur - fix cow rotation when shearing mooshroom
|
|
+
|
|
// Gale start - Purpur - fix MC-238526
|
|
@Setting("mc-238526")
|
|
public boolean mc238526 = false;
|