mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 10:27:44 +01:00
MORE MORE MORE
This commit is contained in:
@@ -1,47 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Kerllenevich <me@notom3ga.me>
|
||||
Date: Sun, 13 Dec 2020 20:40:57 -0500
|
||||
Subject: [PATCH] Striders give saddle back
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityStrider.java b/src/main/java/net/minecraft/world/entity/monster/EntityStrider.java
|
||||
index 892aa844a98ae0d192737c6fc6df0a219256a47b..5e4cc99a746d98231bbb71672fbc02431e4fab48 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EntityStrider.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityStrider.java
|
||||
@@ -448,6 +448,18 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab
|
||||
|
||||
if (!flag && this.hasSaddle() && !this.isVehicle() && !entityhuman.eq()) {
|
||||
if (!this.world.isClientSide) {
|
||||
+ // Purpur start
|
||||
+ if (world.purpurConfig.striderGiveSaddleBack && entityhuman.isSneaking()) {
|
||||
+ this.saddleStorage.setSaddle(false);
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ ItemStack saddle = new ItemStack(Items.SADDLE);
|
||||
+ if (!entityhuman.inventory.pickup(saddle)) {
|
||||
+ entityhuman.drop(saddle, false);
|
||||
+ }
|
||||
+ }
|
||||
+ return EnumInteractionResult.SUCCESS;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
entityhuman.startRiding(this);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 3d1cfd550b12c8dd4bd536c518ac169ff6bbfe50..130dc441be74963c272381e992ea39883804f9f7 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -1562,11 +1562,13 @@ public class PurpurWorldConfig {
|
||||
public boolean striderRidable = false;
|
||||
public boolean striderRidableInWater = false;
|
||||
public int striderBreedingTicks = 6000;
|
||||
+ public boolean striderGiveSaddleBack = false;
|
||||
public double striderMaxHealth = 20.0D;
|
||||
private void striderSettings() {
|
||||
striderRidable = getBoolean("mobs.strider.ridable", striderRidable);
|
||||
striderRidableInWater = getBoolean("mobs.strider.ridable-in-water", striderRidableInWater);
|
||||
striderBreedingTicks = getInt("mobs.strider.breeding-delay-ticks", striderBreedingTicks);
|
||||
+ striderGiveSaddleBack = getBoolean("mobs.strider.give-saddle-back", striderGiveSaddleBack);
|
||||
if (PurpurConfig.version < 10) {
|
||||
double oldValue = getDouble("mobs.strider.attributes.max-health", striderMaxHealth);
|
||||
set("mobs.strider.attributes.max-health", null);
|
||||
@@ -1,34 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Wed, 23 Dec 2020 00:43:59 -0600
|
||||
Subject: [PATCH] PlayerBookTooLargeEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
||||
index dc830f1e23b6eb81d47e111e3f4d8d19010b4c9f..797e067a08395af491ffdb64d01eed6535ffd1f7 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
||||
@@ -1092,6 +1092,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
NBTTagList pageList = testStack.getTag().getList("pages", 8);
|
||||
if (pageList.size() > 100) {
|
||||
PlayerConnection.LOGGER.warn(this.player.getName() + " tried to send a book with too many pages");
|
||||
+ net.pl3x.purpur.event.player.PlayerBookTooLargeEvent event = new net.pl3x.purpur.event.player.PlayerBookTooLargeEvent(player.getBukkitEntity(), testStack.asBukkitCopy()); if (event.shouldKickPlayer()) // Purpur
|
||||
minecraftServer.scheduleOnMain(() -> this.disconnect("Book too large!", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION)); // Paper - kick event cause
|
||||
return;
|
||||
}
|
||||
@@ -1104,6 +1105,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
|
||||
if (byteLength > 256 * 4) {
|
||||
PlayerConnection.LOGGER.warn(this.player.getName() + " tried to send a book with with a page too large!");
|
||||
+ net.pl3x.purpur.event.player.PlayerBookTooLargeEvent event = new net.pl3x.purpur.event.player.PlayerBookTooLargeEvent(player.getBukkitEntity(), testStack.asBukkitCopy()); if (event.shouldKickPlayer()) // Purpur
|
||||
minecraftServer.scheduleOnMain(() -> this.disconnect("Book too large!", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION)); // Paper - kick event cause
|
||||
return;
|
||||
}
|
||||
@@ -1127,6 +1129,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
|
||||
if (byteTotal > byteAllowed) {
|
||||
PlayerConnection.LOGGER.warn(this.player.getName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size());
|
||||
+ net.pl3x.purpur.event.player.PlayerBookTooLargeEvent event = new net.pl3x.purpur.event.player.PlayerBookTooLargeEvent(player.getBukkitEntity(), testStack.asBukkitCopy()); if (event.shouldKickPlayer()) // Purpur
|
||||
minecraftServer.scheduleOnMain(() -> this.disconnect("Book too large!", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION)); // Paper - kick event cause
|
||||
return;
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 24 Dec 2020 11:00:15 -0600
|
||||
Subject: [PATCH] Full netherite armor grants fire resistance
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
|
||||
index 4bb40046f1f21bdfeaf10961001e90b1724e00bb..f28553724fa575f62a67f98891b35a896bb4c3b0 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
|
||||
@@ -339,6 +339,16 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
this.addEffect(new MobEffect(MobEffects.WATER_BREATHING, 200, 0, false, false, true), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.TURTLE_HELMET); // CraftBukkit
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ if (this.world.purpurConfig.playerNetheriteFireResistanceDuration > 0 && this.world.getTime() % 20 == 0) {
|
||||
+ if (itemstack.getItem() == Items.NETHERITE_HELMET
|
||||
+ && this.getEquipment(EnumItemSlot.CHEST).getItem() == Items.NETHERITE_CHESTPLATE
|
||||
+ && this.getEquipment(EnumItemSlot.LEGS).getItem() == Items.NETHERITE_LEGGINGS
|
||||
+ && this.getEquipment(EnumItemSlot.FEET).getItem() == Items.NETHERITE_BOOTS) {
|
||||
+ this.addEffect(new MobEffect(MobEffects.FIRE_RESISTANCE, this.world.purpurConfig.playerNetheriteFireResistanceDuration, this.world.purpurConfig.playerNetheriteFireResistanceAmplifier, this.world.purpurConfig.playerNetheriteFireResistanceAmbient, this.world.purpurConfig.playerNetheriteFireResistanceShowParticles, this.world.purpurConfig.playerNetheriteFireResistanceShowIcon), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.NETHERITE_ARMOR);
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
protected ItemCooldown i() {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 130dc441be74963c272381e992ea39883804f9f7..318513f5612a694c2b240840b24a39210457c202 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -356,6 +356,19 @@ public class PurpurWorldConfig {
|
||||
playerDeathExpDropMax = getInt("gameplay-mechanics.player.exp-dropped-on-death.maximum", playerDeathExpDropMax);
|
||||
}
|
||||
|
||||
+ public int playerNetheriteFireResistanceDuration = 0;
|
||||
+ public int playerNetheriteFireResistanceAmplifier = 0;
|
||||
+ public boolean playerNetheriteFireResistanceAmbient = false;
|
||||
+ public boolean playerNetheriteFireResistanceShowParticles = false;
|
||||
+ public boolean playerNetheriteFireResistanceShowIcon = true;
|
||||
+ private void playerNetheriteFireResistance() {
|
||||
+ playerNetheriteFireResistanceDuration = getInt("gameplay-mechanics.player.netherite-fire-resistance.duration", playerNetheriteFireResistanceDuration);
|
||||
+ playerNetheriteFireResistanceAmplifier = getInt("gameplay-mechanics.player.netherite-fire-resistance.amplifier", playerNetheriteFireResistanceAmplifier);
|
||||
+ playerNetheriteFireResistanceAmbient = getBoolean("gameplay-mechanics.player.netherite-fire-resistance.ambient", playerNetheriteFireResistanceAmbient);
|
||||
+ playerNetheriteFireResistanceShowParticles = getBoolean("gameplay-mechanics.player.netherite-fire-resistance.show-particles", playerNetheriteFireResistanceShowParticles);
|
||||
+ playerNetheriteFireResistanceShowIcon = getBoolean("gameplay-mechanics.player.netherite-fire-resistance.show-icon", playerNetheriteFireResistanceShowIcon);
|
||||
+ }
|
||||
+
|
||||
public int playerSpawnInvulnerableTicks = 60;
|
||||
public boolean playerInvulnerableWhileAcceptingResourcePack = false;
|
||||
private void playerInvulnerabilities() {
|
||||
@@ -1,36 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Wed, 6 Jan 2021 02:19:29 -0600
|
||||
Subject: [PATCH] Fix rotating UP/DOWN CW and CCW
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/core/EnumDirection.java b/src/main/java/net/minecraft/core/EnumDirection.java
|
||||
index 1a765ece1ad6d691c509a018469aa9ecf4f2f8f3..7dbd6619d50492ca7df4df5a2ee3d408abb229a4 100644
|
||||
--- a/src/main/java/net/minecraft/core/EnumDirection.java
|
||||
+++ b/src/main/java/net/minecraft/core/EnumDirection.java
|
||||
@@ -127,6 +127,12 @@ public enum EnumDirection implements INamable {
|
||||
return EnumDirection.NORTH;
|
||||
case EAST:
|
||||
return EnumDirection.SOUTH;
|
||||
+ // Purpur start
|
||||
+ case UP:
|
||||
+ return EnumDirection.UP;
|
||||
+ case DOWN:
|
||||
+ return EnumDirection.DOWN;
|
||||
+ // Purpur end
|
||||
default:
|
||||
throw new IllegalStateException("Unable to get Y-rotated facing of " + this);
|
||||
}
|
||||
@@ -143,6 +149,12 @@ public enum EnumDirection implements INamable {
|
||||
return EnumDirection.SOUTH;
|
||||
case EAST:
|
||||
return EnumDirection.NORTH;
|
||||
+ // Purpur start
|
||||
+ case UP:
|
||||
+ return EnumDirection.UP;
|
||||
+ case DOWN:
|
||||
+ return EnumDirection.DOWN;
|
||||
+ // Purpur end
|
||||
default:
|
||||
throw new IllegalStateException("Unable to get CCW facing of " + this);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 7 Jan 2021 07:51:25 -0600
|
||||
Subject: [PATCH] Add MC-4 fix back
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/item/EntityItem.java b/src/main/java/net/minecraft/world/entity/item/EntityItem.java
|
||||
index cd711fa6f4d8e98fbfa9e3956d9fb1d36e6bb2d9..dd4997e7ffac4773e01add88efec7c0dcd7b4df0 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/item/EntityItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/item/EntityItem.java
|
||||
@@ -583,7 +583,7 @@ public class EntityItem extends Entity {
|
||||
|
||||
// Paper start - fix MC-4
|
||||
public void setPositionRaw(double x, double y, double z) {
|
||||
- if (com.destroystokyo.paper.PaperConfig.fixEntityPositionDesync) {
|
||||
+ if (com.destroystokyo.paper.PaperConfig.fixEntityPositionDesync) { // Tuinity - revert // Purpur - no
|
||||
// encode/decode from PacketPlayOutEntity
|
||||
x = MathHelper.floorLong(x * 4096.0D) * (1 / 4096.0D);
|
||||
y = MathHelper.floorLong(y * 4096.0D) * (1 / 4096.0D);
|
||||
Reference in New Issue
Block a user