mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-29 03:31:27 +01:00
Updated Upstream (Bukkit/CraftBukkit/Spigot)
This commit is contained in:
parent
a657f18f1f
commit
a36a4e2018
@ -54,9 +54,6 @@ public net.minecraft.world.entity.player.Player removeEntitiesOnShoulder()V
|
|||||||
# LivingEntity setkiller
|
# LivingEntity setkiller
|
||||||
public net.minecraft.world.entity.LivingEntity lastHurtByPlayerTime
|
public net.minecraft.world.entity.LivingEntity lastHurtByPlayerTime
|
||||||
|
|
||||||
# SkeletonHorse Additions
|
|
||||||
public net.minecraft.world.entity.animal.horse.SkeletonHorse trapTime
|
|
||||||
|
|
||||||
# Fix client rendering skulls
|
# Fix client rendering skulls
|
||||||
public net.minecraft.world.item.ItemStack tag
|
public net.minecraft.world.item.ItemStack tag
|
||||||
|
|
||||||
@ -189,8 +186,6 @@ public net.minecraft.server.level.ServerLevel players
|
|||||||
# Chunk priority urgency system
|
# Chunk priority urgency system
|
||||||
public net.minecraft.server.level.ChunkMap$ChunkDistanceManager
|
public net.minecraft.server.level.ChunkMap$ChunkDistanceManager
|
||||||
|
|
||||||
# Here's Johnny
|
|
||||||
public net.minecraft.world.entity.monster.Vindicator isJohnny
|
|
||||||
|
|
||||||
# Chunk debug command
|
# Chunk debug command
|
||||||
public net.minecraft.server.level.Ticket createdTick
|
public net.minecraft.server.level.Ticket createdTick
|
||||||
|
@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/src/main/java/org/bukkit/Material.java
|
--- a/src/main/java/org/bukkit/Material.java
|
||||||
+++ b/src/main/java/org/bukkit/Material.java
|
+++ b/src/main/java/org/bukkit/Material.java
|
||||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||||
public com.google.common.collect.Multimap<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> getItemAttributes(@NotNull EquipmentSlot equipmentSlot) {
|
public Multimap<Attribute, AttributeModifier> getItemAttributes(@NotNull EquipmentSlot equipmentSlot) {
|
||||||
return Bukkit.getUnsafe().getItemAttributes(this, equipmentSlot);
|
return Bukkit.getUnsafe().getItemAttributes(this, equipmentSlot);
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
|
@ -20,9 +20,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ * @param equipmentSlot the slot to get the attributes for
|
+ * @param equipmentSlot the slot to get the attributes for
|
||||||
+ * @throws IllegalArgumentException if {@link #isItem()} is false
|
+ * @throws IllegalArgumentException if {@link #isItem()} is false
|
||||||
+ * @return an immutable multimap of attributes
|
+ * @return an immutable multimap of attributes
|
||||||
|
+ * @deprecated use {@link #getDefaultAttributeModifiers(EquipmentSlot)}
|
||||||
+ */
|
+ */
|
||||||
+ @NotNull
|
+ @NotNull
|
||||||
+ public com.google.common.collect.Multimap<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> getItemAttributes(@NotNull EquipmentSlot equipmentSlot) {
|
+ @Deprecated
|
||||||
|
+ public Multimap<Attribute, AttributeModifier> getItemAttributes(@NotNull EquipmentSlot equipmentSlot) {
|
||||||
+ return Bukkit.getUnsafe().getItemAttributes(this, equipmentSlot);
|
+ return Bukkit.getUnsafe().getItemAttributes(this, equipmentSlot);
|
||||||
+ }
|
+ }
|
||||||
// Paper end
|
// Paper end
|
||||||
@ -46,7 +48,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ * @return an immutable multimap of attributes
|
+ * @return an immutable multimap of attributes
|
||||||
+ */
|
+ */
|
||||||
+ @org.jetbrains.annotations.NotNull
|
+ @org.jetbrains.annotations.NotNull
|
||||||
+ public com.google.common.collect.Multimap<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> getItemAttributes(@org.jetbrains.annotations.NotNull Material material, @org.jetbrains.annotations.NotNull org.bukkit.inventory.EquipmentSlot equipmentSlot);
|
+ public Multimap<Attribute, AttributeModifier> getItemAttributes(@org.jetbrains.annotations.NotNull Material material, @org.jetbrains.annotations.NotNull EquipmentSlot equipmentSlot);
|
||||||
+
|
+
|
||||||
/**
|
/**
|
||||||
* Returns the server's protocol version.
|
* Returns the server's protocol version.
|
||||||
|
@ -1,42 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
|
||||||
Date: Fri, 12 Oct 2018 01:37:16 -0500
|
|
||||||
Subject: [PATCH] Here's Johnny!
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/entity/Vindicator.java b/src/main/java/org/bukkit/entity/Vindicator.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/org/bukkit/entity/Vindicator.java
|
|
||||||
+++ b/src/main/java/org/bukkit/entity/Vindicator.java
|
|
||||||
@@ -0,0 +0,0 @@ package org.bukkit.entity;
|
|
||||||
/**
|
|
||||||
* Represents a Vindicator.
|
|
||||||
*/
|
|
||||||
-public interface Vindicator extends Illager { }
|
|
||||||
+public interface Vindicator extends Illager {
|
|
||||||
+ // Paper start
|
|
||||||
+ /**
|
|
||||||
+ * Check if this Vindicator is set to Johnny mode.
|
|
||||||
+ * <p>
|
|
||||||
+ * When in Johnny mode the Vindicator will be hostile to any kind of mob, except
|
|
||||||
+ * for evokers, ghasts, illusioners and other vindicators. It will even be hostile
|
|
||||||
+ * to vexes. All mobs, except for endermites, phantoms, guardians, slimes and
|
|
||||||
+ * magma cubes, will try to attack the vindicator in return.
|
|
||||||
+ *
|
|
||||||
+ * @return True if in Johnny mode
|
|
||||||
+ */
|
|
||||||
+ boolean isJohnny();
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Set this Vindicator's Johnny mode.
|
|
||||||
+ * <p>
|
|
||||||
+ * When in Johnny mode the Vindicator will be hostile to any kind of mob, except
|
|
||||||
+ * for evokers, ghasts, illusioners and other vindicators. It will even be hostile
|
|
||||||
+ * to vexes. All mobs, except for endermites, phantoms, guardians, slimes and
|
|
||||||
+ * magma cubes, will try to attack the vindicator in return.
|
|
||||||
+ *
|
|
||||||
+ * @param johnny True to enable Johnny mode
|
|
||||||
+ */
|
|
||||||
+ void setJohnny(boolean johnny);
|
|
||||||
+ // Paper end
|
|
||||||
+}
|
|
@ -1,19 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Aikar <aikar@aikar.co>
|
|
||||||
Date: Fri, 10 Aug 2018 22:08:34 -0400
|
|
||||||
Subject: [PATCH] Make EnderDragon extend Mob
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/entity/EnderDragon.java b/src/main/java/org/bukkit/entity/EnderDragon.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/org/bukkit/entity/EnderDragon.java
|
|
||||||
+++ b/src/main/java/org/bukkit/entity/EnderDragon.java
|
|
||||||
@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable;
|
|
||||||
/**
|
|
||||||
* Represents an Ender Dragon
|
|
||||||
*/
|
|
||||||
-public interface EnderDragon extends ComplexLivingEntity, Boss {
|
|
||||||
+public interface EnderDragon extends ComplexLivingEntity, Boss, org.bukkit.entity.Mob { // Paper - add Mob
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents a phase or action that an Ender Dragon can perform.
|
|
@ -18,7 +18,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ * Gets if a horse is in their eating grass animation.
|
+ * Gets if a horse is in their eating grass animation.
|
||||||
+ *
|
+ *
|
||||||
+ * @return eating grass animation is active
|
+ * @return eating grass animation is active
|
||||||
|
+ * @deprecated use {@link #isEatingHaystack()}
|
||||||
+ */
|
+ */
|
||||||
|
+ @Deprecated
|
||||||
+ public boolean isEatingGrass();
|
+ public boolean isEatingGrass();
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
@ -27,7 +29,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ * <p>When true, the horse will lower its neck.</p>
|
+ * <p>When true, the horse will lower its neck.</p>
|
||||||
+ *
|
+ *
|
||||||
+ * @param eating eating grass animation is active
|
+ * @param eating eating grass animation is active
|
||||||
|
+ * @deprecated use {@link #setEatingHaystack(boolean)}
|
||||||
+ */
|
+ */
|
||||||
|
+ @Deprecated
|
||||||
+ public void setEatingGrass(boolean eating);
|
+ public void setEatingGrass(boolean eating);
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
|
@ -76,17 +76,22 @@ diff --git a/src/main/java/org/bukkit/entity/SkeletonHorse.java b/src/main/java/
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/bukkit/entity/SkeletonHorse.java
|
--- a/src/main/java/org/bukkit/entity/SkeletonHorse.java
|
||||||
+++ b/src/main/java/org/bukkit/entity/SkeletonHorse.java
|
+++ b/src/main/java/org/bukkit/entity/SkeletonHorse.java
|
||||||
@@ -0,0 +0,0 @@ package org.bukkit.entity;
|
@@ -0,0 +0,0 @@ public interface SkeletonHorse extends AbstractHorse {
|
||||||
/**
|
* @param trapTime new trap time
|
||||||
* Represents a SkeletonHorse - variant of {@link AbstractHorse}.
|
*/
|
||||||
*/
|
void setTrapTime(int trapTime);
|
||||||
-public interface SkeletonHorse extends AbstractHorse { }
|
|
||||||
+public interface SkeletonHorse extends AbstractHorse {
|
|
||||||
+ // Paper start
|
|
||||||
+ int getTrapTime();
|
|
||||||
+
|
+
|
||||||
|
+ // Paper start
|
||||||
|
+ /**
|
||||||
|
+ * @deprecated use {@link #isTrapped()}
|
||||||
|
+ */
|
||||||
|
+ @Deprecated
|
||||||
+ boolean isTrap();
|
+ boolean isTrap();
|
||||||
+
|
+
|
||||||
|
+ /**
|
||||||
|
+ * @deprecated use {@link #setTrapped(boolean)}
|
||||||
|
+ */
|
||||||
|
+ @Deprecated
|
||||||
+ void setTrap(boolean trap);
|
+ void setTrap(boolean trap);
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
+}
|
}
|
||||||
|
@ -0,0 +1,51 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||||
|
Date: Thu, 30 Dec 2021 16:35:56 -0800
|
||||||
|
Subject: [PATCH] System prop for default config comment parsing
|
||||||
|
|
||||||
|
Allows for certain legacy plugins to continue to work without changing
|
||||||
|
by setting `Paper.parseYamlCommentsByDefault` to false
|
||||||
|
|
||||||
|
diff --git a/src/main/java/org/bukkit/configuration/file/FileConfigurationOptions.java b/src/main/java/org/bukkit/configuration/file/FileConfigurationOptions.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/org/bukkit/configuration/file/FileConfigurationOptions.java
|
||||||
|
+++ b/src/main/java/org/bukkit/configuration/file/FileConfigurationOptions.java
|
||||||
|
@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable;
|
||||||
|
public class FileConfigurationOptions extends MemoryConfigurationOptions {
|
||||||
|
private List<String> header = Collections.emptyList();
|
||||||
|
private List<String> footer = Collections.emptyList();
|
||||||
|
- private boolean parseComments = true;
|
||||||
|
+ // Paper start - add system prop for comment parsing
|
||||||
|
+ private static final boolean PAPER_PARSE_COMMENTS_BY_DEFAULT = Boolean.parseBoolean(System.getProperty("Paper.parseYamlCommentsByDefault", "true"));
|
||||||
|
+ private boolean parseComments = PAPER_PARSE_COMMENTS_BY_DEFAULT;
|
||||||
|
+ // Paper end
|
||||||
|
|
||||||
|
protected FileConfigurationOptions(@NotNull MemoryConfiguration configuration) {
|
||||||
|
super(configuration);
|
||||||
|
diff --git a/src/main/java/org/bukkit/configuration/file/YamlRepresenter.java b/src/main/java/org/bukkit/configuration/file/YamlRepresenter.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/org/bukkit/configuration/file/YamlRepresenter.java
|
||||||
|
+++ b/src/main/java/org/bukkit/configuration/file/YamlRepresenter.java
|
||||||
|
@@ -0,0 +0,0 @@ import org.yaml.snakeyaml.representer.Representer;
|
||||||
|
public class YamlRepresenter extends Representer {
|
||||||
|
|
||||||
|
public YamlRepresenter() {
|
||||||
|
+ this.multiRepresenters.put(org.bukkit.configuration.ConfigurationSection.class, new RepresentConfigurationSection()); // Paper - restore old yaml config section representer
|
||||||
|
this.multiRepresenters.put(ConfigurationSerializable.class, new RepresentConfigurationSerializable());
|
||||||
|
// SPIGOT-6234: We could just switch YamlConstructor to extend Constructor rather than SafeConstructor, however there is a very small risk of issues with plugins treating config as untrusted input
|
||||||
|
// So instead we will just allow future plugins to have their enums extend ConfigurationSerializable
|
||||||
|
this.multiRepresenters.remove(Enum.class);
|
||||||
|
}
|
||||||
|
+ // Paper start - restore old yaml config section representer
|
||||||
|
+ private class RepresentConfigurationSection extends RepresentMap {
|
||||||
|
+
|
||||||
|
+ @NotNull
|
||||||
|
+ @Override
|
||||||
|
+ public Node representData(@NotNull Object data) {
|
||||||
|
+ return super.representData(((org.bukkit.configuration.ConfigurationSection) data).getValues(false));
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ // Paper end
|
||||||
|
|
||||||
|
private class RepresentConfigurationSerializable extends RepresentMap {
|
||||||
|
|
@ -2837,9 +2837,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
|
|
||||||
Material fromLegacy(Material material);
|
Material fromLegacy(Material material);
|
||||||
@@ -0,0 +0,0 @@ public interface UnsafeValues {
|
@@ -0,0 +0,0 @@ public interface UnsafeValues {
|
||||||
* @return true if a file matching this key was found and deleted
|
|
||||||
*/
|
|
||||||
boolean removeAdvancement(NamespacedKey key);
|
boolean removeAdvancement(NamespacedKey key);
|
||||||
|
|
||||||
|
Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(Material material, EquipmentSlot slot);
|
||||||
+
|
+
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ /**
|
+ /**
|
||||||
|
@ -4,20 +4,6 @@ Date: Tue, 20 Jul 2021 21:25:35 -0700
|
|||||||
Subject: [PATCH] Add a bunch of missing forceDrop toggles
|
Subject: [PATCH] Add a bunch of missing forceDrop toggles
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
|
||||||
@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity {
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.tickCount > 100) {
|
|
||||||
+ this.forceDrops = true; // Paper
|
|
||||||
this.spawnAtLocation((ItemLike) Items.LEAD);
|
|
||||||
+ this.forceDrops = false; // Paper
|
|
||||||
this.leashInfoTag = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java b/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java b/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java
|
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java
|
||||||
|
@ -14,8 +14,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
MerchantOffer merchantrecipe = (MerchantOffer) iterator.next();
|
MerchantOffer merchantrecipe = (MerchantOffer) iterator.next();
|
||||||
+ if (merchantrecipe.ignoreDiscounts) continue; // Paper
|
+ if (merchantrecipe.ignoreDiscounts) continue; // Paper
|
||||||
|
|
||||||
// CraftBukkit start
|
merchantrecipe.addToSpecialPriceDiff(-Mth.floor((float) i * merchantrecipe.getPriceMultiplier()));
|
||||||
int bonus = -Mth.floor((float) i * merchantrecipe.getPriceMultiplier());
|
}
|
||||||
@@ -0,0 +0,0 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
@@ -0,0 +0,0 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||||
|
|
||||||
while (iterator1.hasNext()) {
|
while (iterator1.hasNext()) {
|
||||||
|
@ -1303,7 +1303,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+import io.papermc.paper.adventure.PaperAdventure; // Paper
|
+import io.papermc.paper.adventure.PaperAdventure; // Paper
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import net.minecraft.world.inventory.AbstractContainerMenu;
|
import net.minecraft.world.entity.animal.Bucketable;
|
||||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||||
return this.server.isSingleplayerOwner(this.player.getGameProfile());
|
return this.server.isSingleplayerOwner(this.player.getGameProfile());
|
||||||
}
|
}
|
||||||
|
@ -4,21 +4,6 @@ Date: Sat, 8 May 2021 15:01:54 -0700
|
|||||||
Subject: [PATCH] Attributes API for item defaults
|
Subject: [PATCH] Attributes API for item defaults
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java
|
|
||||||
@@ -0,0 +0,0 @@ public class CraftAttributeInstance implements AttributeInstance {
|
|
||||||
public static AttributeModifier convert(net.minecraft.world.entity.ai.attributes.AttributeModifier nms) {
|
|
||||||
return new AttributeModifier(nms.getId(), nms.getName(), nms.getAmount(), AttributeModifier.Operation.values()[nms.getOperation().ordinal()]);
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ // Paper start - construct using slot
|
|
||||||
+ public static AttributeModifier convert(net.minecraft.world.entity.ai.attributes.AttributeModifier nms, org.bukkit.inventory.EquipmentSlot slot) {
|
|
||||||
+ return new AttributeModifier(nms.getId(), nms.getName(), nms.getAmount(), AttributeModifier.Operation.values()[nms.getOperation().ordinal()], slot);
|
|
||||||
+ }
|
|
||||||
+ // Paper end
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||||
@ -28,14 +13,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
}
|
}
|
||||||
|
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public com.google.common.collect.Multimap<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> getItemAttributes(org.bukkit.Material material, org.bukkit.inventory.EquipmentSlot equipmentSlot) {
|
+ public Multimap<Attribute, AttributeModifier> getItemAttributes(Material material, EquipmentSlot equipmentSlot) {
|
||||||
+ Item item = CraftMagicNumbers.getItem(material);
|
+ Item item = CraftMagicNumbers.getItem(material);
|
||||||
+ if (item == null) {
|
+ if (item == null) {
|
||||||
+ throw new IllegalArgumentException(material + " is not an item and therefore does not have attributes");
|
+ throw new IllegalArgumentException(material + " is not an item and therefore does not have attributes");
|
||||||
+ }
|
+ }
|
||||||
+ com.google.common.collect.ImmutableMultimap.Builder<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> attributeMapBuilder = com.google.common.collect.ImmutableMultimap.builder();
|
+ ImmutableMultimap.Builder<Attribute, AttributeModifier> attributeMapBuilder = ImmutableMultimap.builder();
|
||||||
+ item.getDefaultAttributeModifiers(org.bukkit.craftbukkit.CraftEquipmentSlot.getNMS(equipmentSlot)).forEach((attributeBase, attributeModifier) -> {
|
+ item.getDefaultAttributeModifiers(CraftEquipmentSlot.getNMS(equipmentSlot)).forEach((attributeBase, attributeModifier) -> {
|
||||||
+ attributeMapBuilder.put(org.bukkit.Registry.ATTRIBUTE.get(CraftNamespacedKey.fromMinecraft(net.minecraft.core.Registry.ATTRIBUTE.getKey(attributeBase))), org.bukkit.craftbukkit.attribute.CraftAttributeInstance.convert(attributeModifier, equipmentSlot));
|
+ attributeMapBuilder.put(CraftAttributeMap.fromMinecraft(net.minecraft.core.Registry.ATTRIBUTE.getKey(attributeBase).toString()), CraftAttributeInstance.convert(attributeModifier, equipmentSlot));
|
||||||
+ });
|
+ });
|
||||||
+ return attributeMapBuilder.build();
|
+ return attributeMapBuilder.build();
|
||||||
+ }
|
+ }
|
||||||
|
@ -39,8 +39,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java
|
--- a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java
|
||||||
@@ -0,0 +0,0 @@ public class Vindicator extends AbstractIllager {
|
@@ -0,0 +0,0 @@ public class Vindicator extends AbstractIllager {
|
||||||
|
private static class VindicatorBreakDoorGoal extends BreakDoorGoal {
|
||||||
|
|
||||||
static class VindicatorBreakDoorGoal extends BreakDoorGoal {
|
|
||||||
public VindicatorBreakDoorGoal(Mob mob) {
|
public VindicatorBreakDoorGoal(Mob mob) {
|
||||||
- super(mob, 6, Vindicator.DOOR_BREAKING_PREDICATE);
|
- super(mob, 6, Vindicator.DOOR_BREAKING_PREDICATE);
|
||||||
+ super(mob, 6, com.google.common.base.Predicates.in(mob.level.paperConfig.vindicatorBreakDoors)); // Paper
|
+ super(mob, 6, com.google.common.base.Predicates.in(mob.level.paperConfig.vindicatorBreakDoors)); // Paper
|
||||||
|
@ -346,6 +346,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
+import net.minecraft.server.level.ServerChunkCache;
|
+import net.minecraft.server.level.ServerChunkCache;
|
||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
|
import net.minecraft.world.entity.ExperienceOrb;
|
||||||
+import net.minecraft.world.entity.FlyingMob;
|
+import net.minecraft.world.entity.FlyingMob;
|
||||||
import net.minecraft.world.entity.LightningBolt;
|
import net.minecraft.world.entity.LightningBolt;
|
||||||
import net.minecraft.world.entity.LivingEntity;
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
@ -566,8 +567,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
{
|
{
|
||||||
- return true;
|
- return true;
|
||||||
+ return 20; // Paper
|
+ return 20; // Paper
|
||||||
}
|
+ }
|
||||||
- if ( entity instanceof Villager && ( (Villager) entity ).canBreed() )
|
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ if (entity instanceof Bee) {
|
+ if (entity instanceof Bee) {
|
||||||
+ Bee bee = (Bee)entity;
|
+ Bee bee = (Bee)entity;
|
||||||
@ -595,7 +595,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ return config.villagersWorkImmunityFor;
|
+ return config.villagersWorkImmunityFor;
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ }
|
}
|
||||||
|
- if ( entity instanceof Villager && ( (Villager) entity ).canBreed() )
|
||||||
+ if ( entity instanceof Llama && ( (Llama) entity ).inCaravan() )
|
+ if ( entity instanceof Llama && ( (Llama) entity ).inCaravan() )
|
||||||
{
|
{
|
||||||
- return true;
|
- return true;
|
||||||
@ -630,6 +631,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
}
|
}
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
}
|
}
|
||||||
|
// SPIGOT-6644: Otherwise the target refresh tick will be missed
|
||||||
|
if (entity instanceof ExperienceOrb) {
|
||||||
|
- return true;
|
||||||
|
+ return 20; // Paper
|
||||||
|
}
|
||||||
- return false;
|
- return false;
|
||||||
+ return -1; // Paper
|
+ return -1; // Paper
|
||||||
}
|
}
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
|
||||||
Date: Fri, 12 Oct 2018 01:37:22 -0500
|
|
||||||
Subject: [PATCH] Here's Johnny!
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java
|
|
||||||
@@ -0,0 +0,0 @@ public class CraftVindicator extends CraftIllager implements Vindicator {
|
|
||||||
public EntityType getType() {
|
|
||||||
return EntityType.VINDICATOR;
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ // Paper start
|
|
||||||
+ public boolean isJohnny() {
|
|
||||||
+ return getHandle().isJohnny;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setJohnny(boolean johnny) {
|
|
||||||
+ getHandle().isJohnny = johnny;
|
|
||||||
+ }
|
|
||||||
+ // Paper end
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Aikar <aikar@aikar.co>
|
|
||||||
Date: Fri, 10 Aug 2018 22:11:49 -0400
|
|
||||||
Subject: [PATCH] Make EnderDragon implement Mob
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java
|
|
||||||
@@ -0,0 +0,0 @@
|
|
||||||
package org.bukkit.craftbukkit.entity;
|
|
||||||
|
|
||||||
-import net.minecraft.world.entity.LivingEntity;
|
|
||||||
+import net.minecraft.world.entity.Mob;
|
|
||||||
import org.bukkit.craftbukkit.CraftServer;
|
|
||||||
import org.bukkit.entity.ComplexLivingEntity;
|
|
||||||
|
|
||||||
-public abstract class CraftComplexLivingEntity extends CraftLivingEntity implements ComplexLivingEntity {
|
|
||||||
- public CraftComplexLivingEntity(CraftServer server, LivingEntity entity) {
|
|
||||||
+public abstract class CraftComplexLivingEntity extends CraftMob implements ComplexLivingEntity { // Paper
|
|
||||||
+ public CraftComplexLivingEntity(CraftServer server, Mob entity) { // Paper
|
|
||||||
super(server, entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
- public LivingEntity getHandle() {
|
|
||||||
- return (LivingEntity) entity;
|
|
||||||
+ public Mob getHandle() { // Paper
|
|
||||||
+ return (Mob) entity; // Paper
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
@ -69,21 +69,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java
|
||||||
@@ -0,0 +0,0 @@ public class CraftSkeletonHorse extends CraftAbstractHorse implements SkeletonHo
|
@@ -0,0 +0,0 @@ public class CraftSkeletonHorse extends CraftAbstractHorse implements SkeletonHo
|
||||||
public Variant getVariant() {
|
public void setTrapTime(int trapTime) {
|
||||||
return Variant.SKELETON_HORSE;
|
this.getHandle().trapTime = trapTime;
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ // Paper start
|
+ // Paper start - replaced by above methods
|
||||||
+ @Override
|
|
||||||
+ public net.minecraft.world.entity.animal.horse.SkeletonHorse getHandle() {
|
|
||||||
+ return (net.minecraft.world.entity.animal.horse.SkeletonHorse) super.getHandle();
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public int getTrapTime() {
|
|
||||||
+ return getHandle().trapTime;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public boolean isTrap() {
|
+ public boolean isTrap() {
|
||||||
+ return getHandle().isTrap();
|
+ return getHandle().isTrap();
|
||||||
|
@ -2131,7 +2131,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
public static byte toLegacyData(BlockState data) {
|
public static byte toLegacyData(BlockState data) {
|
||||||
return CraftLegacy.toLegacyData(data);
|
return CraftLegacy.toLegacyData(data);
|
||||||
@@ -0,0 +0,0 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
@@ -0,0 +0,0 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||||
return clazz;
|
return defaultAttributes.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 031731e60ece4b3fe0468a0df94b89d339b4169d
|
Subproject commit 7b1856bfe9bbf0ae0e1e9fee6759bd956f958e22
|
@ -1 +1 @@
|
|||||||
Subproject commit 2a2caa7e25cfcf66c368b0098f320ac93d416d6a
|
Subproject commit c93fcba47ab0e9c319a5c06e83e3f4b675fbe17c
|
@ -1 +1 @@
|
|||||||
Subproject commit 8965a5024427f83a4e82ce3e3d4773fd78d22d76
|
Subproject commit 78a14d9d9cc79fd5692226f74cad274c5052f4cd
|
Loading…
Reference in New Issue
Block a user