Update upstream B/CB

This commit is contained in:
Zach Brown 2016-07-26 19:30:03 -05:00
parent 56d669ca52
commit e30fab8ee6
No known key found for this signature in database
GPG Key ID: CC9DA35FC5450B76
6 changed files with 46 additions and 38 deletions

View File

@ -1,20 +1,19 @@
From ec66ca6a5947ee2ead5f18eb00767ef7f8ae0b7f Mon Sep 17 00:00:00 2001
From a73b6bfd3a69352a8bf17b618de3549a8a32dbc4 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Wed, 2 Mar 2016 23:30:53 -0600
Subject: [PATCH] Add BeaconEffectEvent
diff --git a/src/main/java/net/minecraft/server/TileEntityBeacon.java b/src/main/java/net/minecraft/server/TileEntityBeacon.java
index 660e2e5..220eb82 100644
index 48f8793..9b0a1c4 100644
--- a/src/main/java/net/minecraft/server/TileEntityBeacon.java
+++ b/src/main/java/net/minecraft/server/TileEntityBeacon.java
@@ -14,6 +14,15 @@ import org.bukkit.craftbukkit.entity.CraftHumanEntity;
import org.bukkit.entity.HumanEntity;
@@ -16,6 +16,14 @@ import org.bukkit.entity.HumanEntity;
import org.bukkit.potion.PotionEffect;
// CraftBukkit end
+// Paper start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.craftbukkit.potion.CraftPotionUtil;
+import org.bukkit.entity.Player;
+import org.bukkit.potion.PotionData;
+import org.bukkit.potion.PotionEffect;
@ -24,42 +23,51 @@ index 660e2e5..220eb82 100644
public class TileEntityBeacon extends TileEntityContainer implements ITickable, IWorldInventory {
public static final MobEffectList[][] a = new MobEffectList[][] { { MobEffects.FASTER_MOVEMENT, MobEffects.FASTER_DIG}, { MobEffects.RESISTANCE, MobEffects.JUMP}, { MobEffects.INCREASE_DAMAGE}, { MobEffects.REGENERATION}};
@@ -88,17 +97,33 @@ public class TileEntityBeacon extends TileEntityContainer implements ITickable,
@@ -114,14 +122,30 @@ public class TileEntityBeacon extends TileEntityContainer implements ITickable,
}
private void applyEffect(List list, MobEffectList effects, int i, int b0) {
+ // Paper - BeaconEffectEvent
+ applyEffect(list, effects, i, b0, true);
+ }
+
+ private void applyEffect(List list, MobEffectList effects, int i, int b0, boolean isPrimary) {
+ // Paper - BeaconEffectEvent
{
Iterator iterator = list.iterator();
EntityHuman entityhuman;
+ // Paper start
+ // Paper start - BeaconEffectEvent
+ org.bukkit.block.Block block = world.getWorld().getBlockAt(position.getX(), position.getY(), position.getZ());
+ PotionEffect primaryEffect = CraftPotionUtil.toBukkit(new MobEffect(this.l, i, b0, true, true));
+ PotionEffect effect = CraftPotionUtil.toBukkit(new MobEffect(effects, i, b0, true, true));
+ // Paper end
+
while (iterator.hasNext()) {
entityhuman = (EntityHuman) iterator.next();
- entityhuman.addEffect(new MobEffect(this.l, i, b0, true, true));
- entityhuman.addEffect(new MobEffect(effects, i, b0, true, true));
+ // Paper start - BeaconEffectEvent
+ BeaconEffectEvent event = new BeaconEffectEvent(block, primaryEffect, (Player) entityhuman.getBukkitEntity(), true);
+ BeaconEffectEvent event = new BeaconEffectEvent(block, effect, (Player) entityhuman.getBukkitEntity(), isPrimary);
+ if (CraftEventFactory.callEvent(event).isCancelled()) continue;
+ PotionEffect effect = event.getEffect();
+ entityhuman.getBukkitEntity().addPotionEffect(effect, true);
+ PotionEffect eventEffect = event.getEffect();
+ entityhuman.getBukkitEntity().addPotionEffect(eventEffect, true);
+ // Paper end
}
}
}
@@ -143,10 +167,10 @@ public class TileEntityBeacon extends TileEntityContainer implements ITickable,
int i = getLevel();
List list = getHumansInRange();
if (this.k >= 4 && this.l != this.m && this.m != null) {
iterator = list.iterator();
+ PotionEffect secondaryEffect = org.bukkit.craftbukkit.potion.CraftPotionUtil.toBukkit(new MobEffect(this.m, i, 0, true, true)); // Paper
- applyEffect(list, this.l, i, b0);
+ applyEffect(list, this.l, i, b0, true); // Paper - BeaconEffectEvent
while (iterator.hasNext()) {
entityhuman = (EntityHuman) iterator.next();
- entityhuman.addEffect(new MobEffect(this.m, i, 0, true, true));
+ // Paper start - BeaconEffectEvent
+ BeaconEffectEvent event = new BeaconEffectEvent(block, secondaryEffect, (Player) entityhuman.getBukkitEntity(), false);
+ if (CraftEventFactory.callEvent(event).isCancelled()) continue;
+ PotionEffect effect = event.getEffect();
+ entityhuman.getBukkitEntity().addPotionEffect(effect, true);
+ // Paper end
}
if (hasSecondaryEffect()) {
- applyEffect(list, this.m, i, 0);
+ applyEffect(list, this.m, i, 0, false); // Paper - BeaconEffectEvent
}
}
--
2.8.3
--
2.9.0

View File

@ -1,4 +1,4 @@
From 4f6415f24bde429a493de4e36f769b615d2cf0ed Mon Sep 17 00:00:00 2001
From a9a860d7ba36c3c64e242508ba5d5b2179a3aa66 Mon Sep 17 00:00:00 2001
From: DemonWav <demonwav@gmail.com>
Date: Thu, 3 Mar 2016 01:44:39 -0600
Subject: [PATCH] Add Location support to tab completers (vanilla feature
@ -119,7 +119,7 @@ index e83a422..eb1dc5a 100644
player.sendMessage(ChatColor.RED + "An internal error occurred while attempting to tab-complete this command");
getLogger().log(Level.SEVERE, "Exception when " + player.getName() + " attempted to tab complete " + message, ex);
diff --git a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java
index 100d84a..a40218c 100644
index 0930d30..7461d04 100644
--- a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java
+++ b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java
@@ -7,6 +7,7 @@ import net.minecraft.server.*;
@ -130,7 +130,7 @@ index 100d84a..a40218c 100644
import org.bukkit.command.BlockCommandSender;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
@@ -46,10 +47,23 @@ public final class VanillaCommandWrapper extends VanillaCommand {
@@ -39,10 +40,23 @@ public final class VanillaCommandWrapper extends VanillaCommand {
@Override
public List<String> tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException {
@ -156,5 +156,5 @@ index 100d84a..a40218c 100644
public static CommandSender lastSender = null; // Nasty :(
--
2.9.0.windows.1
2.9.0

View File

@ -1,4 +1,4 @@
From 12cc663c719ad4ee7818a5ecee48c84e4d67af62 Mon Sep 17 00:00:00 2001
From 138388e6bcda40de657f7031e90f74979868bbd6 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 13 Sep 2014 23:14:43 -0400
Subject: [PATCH] Configurable Keep Spawn Loaded range per world
@ -65,10 +65,10 @@ index 91d00dc..7f1caa8 100644
for (int j = -short1; j <= short1; j += 16) {
for (int k = -short1; k <= short1; k += 16) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 2606890..1994401 100644
index 0c54005..cf76fd3 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1207,8 +1207,9 @@ public class CraftWorld implements World {
@@ -1196,8 +1196,9 @@ public class CraftWorld implements World {
int chunkCoordX = chunkcoordinates.getX() >> 4;
int chunkCoordZ = chunkcoordinates.getZ() >> 4;
// Cycle through the 25x25 Chunks around it to load/unload the chunks.

View File

@ -1,4 +1,4 @@
From 8c5533d2f02936af9b92553c6dae717de161f10a Mon Sep 17 00:00:00 2001
From dfc2ef2e5fbd2e862167bcfe062a7f92d591ec3b Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 18 Jun 2016 23:22:12 -0400
Subject: [PATCH] Delay Chunk Unloads based on Player Movement
@ -129,10 +129,10 @@ index 6320247..9fed846 100644
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 1994401..f62878d 100644
index cf76fd3..af2f24a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1491,7 +1491,7 @@ public class CraftWorld implements World {
@@ -1480,7 +1480,7 @@ public class CraftWorld implements World {
ChunkProviderServer cps = world.getChunkProviderServer();
for (net.minecraft.server.Chunk chunk : cps.chunks.values()) {
// If in use, skip it

@ -1 +1 @@
Subproject commit e73ec6b833d245ce3c984d6da1cccb22fbe9f3e5
Subproject commit c5354dfc2689616b92a74feea44b7fa5ce3238ee

@ -1 +1 @@
Subproject commit f5d891f609a5b93afbc778aadcd107363477d791
Subproject commit 21e3b055225dade6100342632f059509ca638c2a