Archiviert
13
0

Silence BeaconEffectEvent, swallow exception in version checking

Dieser Commit ist enthalten in:
Zach Brown 2016-03-03 04:48:46 -06:00
Ursprung 6287e97b6b
Commit a54fb8d270
2 geänderte Dateien mit 62 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -1,11 +1,11 @@
From 7d9c89c650173fed78c662109eea960d61b6e678 Mon Sep 17 00:00:00 2001
From 8944bee4927eb1d51651160612345a139ef645ca Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Mon, 29 Feb 2016 17:58:01 -0600
Subject: [PATCH] Check Paper versions
diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
index b55abdb..e1bea95 100644
index b55abdb..ad3a9e5 100644
--- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
@@ -185,30 +185,17 @@ public class VersionCommand extends BukkitCommand {
@ -62,12 +62,13 @@ index b55abdb..e1bea95 100644
- JSONObject obj = (JSONObject) new JSONParser().parse(reader);
- return ((Number) obj.get("totalCount")).intValue();
- } catch (ParseException ex) {
- ex.printStackTrace();
+ // Paper start
+ int newVer = Integer.decode(reader.readLine());
+ int currentVer = Integer.decode(currentVerInt);
+ return newVer - currentVer;
+ } catch (NumberFormatException ex) {
ex.printStackTrace();
+ //ex.printStackTrace();
+ // Paper end
return -1;
} finally {

Datei anzeigen

@ -0,0 +1,58 @@
From 1d5a9281412eb02af76aaa116280e5e02c987d6d Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Thu, 3 Mar 2016 04:45:26 -0600
Subject: [PATCH] Temp patch to nuke BeaconEffectEvent until we get some sleep
diff --git a/src/main/java/net/minecraft/server/TileEntityBeacon.java b/src/main/java/net/minecraft/server/TileEntityBeacon.java
index 6615890..92b1211 100644
--- a/src/main/java/net/minecraft/server/TileEntityBeacon.java
+++ b/src/main/java/net/minecraft/server/TileEntityBeacon.java
@@ -95,30 +95,34 @@ public class TileEntityBeacon extends TileEntityContainer implements ITickable,
// Paper start
org.bukkit.block.Block block = world.getWorld().getBlockAt(position.getX(), position.getY(), position.getZ());
- PotionEffect primaryEffect = new PotionEffect(PotionEffectType.getByName(this.l.e), 180, b0, true, true);
+ // TODO: anytime other than 5 am
+ //PotionEffect primaryEffect = new PotionEffect(PotionEffectType.getById(MobEffectList.getId(this.l)), 180, b0, true, true);
// Paper end
while (iterator.hasNext()) {
entityhuman = (EntityHuman) iterator.next();
// Paper start - BeaconEffectEvent
- BeaconEffectEvent event = new BeaconEffectEvent(block, primaryEffect, (Player) entityhuman.getBukkitEntity(), true);
- if (CraftEventFactory.callEvent(event).isCancelled()) continue;
- PotionEffect effect = event.getEffect();
- entityhuman.addEffect(new MobEffect(MobEffectList.fromId(effect.getType().getId()), effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles()));
+ //BeaconEffectEvent event = new BeaconEffectEvent(block, primaryEffect, (Player) entityhuman.getBukkitEntity(), true);
+ //if (CraftEventFactory.callEvent(event).isCancelled()) continue;
+ //PotionEffect effect = event.getEffect();
+ //entityhuman.addEffect(new MobEffect(MobEffectList.fromId(effect.getType().getId()), effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles()));
+ entityhuman.addEffect(new MobEffect(this.l, i, b0, true, true));
// Paper end
}
if (this.k >= 4 && this.l != this.m && this.m != null) {
iterator = list.iterator();
- PotionEffect secondaryEffect = new PotionEffect(PotionEffectType.getByName(this.m.e), 180, 0, true, true); // Paper
+ // TODO: anytime other than 5 am
+ //PotionEffect primaryEffect = new PotionEffect(PotionEffectType.getById(MobEffectList.getId(this.m)), 180, b0, true, true);
while (iterator.hasNext()) {
entityhuman = (EntityHuman) iterator.next();
// Paper start - BeaconEffectEvent
- BeaconEffectEvent event = new BeaconEffectEvent(block, secondaryEffect, (Player) entityhuman.getBukkitEntity(), false);
- if (CraftEventFactory.callEvent(event).isCancelled()) continue;
- PotionEffect effect = event.getEffect();
- entityhuman.addEffect(new MobEffect(MobEffectList.fromId(effect.getType().getId()), effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles()));
+ //BeaconEffectEvent event = new BeaconEffectEvent(block, secondaryEffect, (Player) entityhuman.getBukkitEntity(), false);
+ //if (CraftEventFactory.callEvent(event).isCancelled()) continue;
+ //PotionEffect effect = event.getEffect();
+ //entityhuman.addEffect(new MobEffect(MobEffectList.fromId(effect.getType().getId()), effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles()));
+ entityhuman.addEffect(new MobEffect(this.m, i, 0, true, true));
// Paper end
}
}
--
2.7.2