3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 20:40:08 +01:00

Make the effect filter stricter

Dieser Commit ist enthalten in:
Thinkofdeath 2014-12-27 14:48:38 +00:00
Ursprung c2c8dda565
Commit e1c64bf0eb

Datei anzeigen

@ -1,5 +1,5 @@
--- ../work/decompile-8eb82bde//net/minecraft/server/TileEntityBeacon.java 2014-12-27 14:03:08.349290689 +0000 --- ../work/decompile-8eb82bde//net/minecraft/server/TileEntityBeacon.java 2014-12-27 14:48:34.677261097 +0000
+++ src/main/java/net/minecraft/server/TileEntityBeacon.java 2014-12-27 14:03:08.349290689 +0000 +++ src/main/java/net/minecraft/server/TileEntityBeacon.java 2014-12-27 14:48:34.677261097 +0000
@@ -5,6 +5,11 @@ @@ -5,6 +5,11 @@
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
@ -77,14 +77,28 @@
} }
} }
@@ -307,4 +336,10 @@ @@ -307,4 +336,24 @@
return super.c(i, j); return super.c(i, j);
} }
} }
+ +
+ // CraftBukkit start + // CraftBukkit start
+ public int validateEffect(int i) { + public int validateEffect(int i) {
+ return i < 0 || i >= MobEffectList.byId.length || MobEffectList.byId[i] == null ? 0 : i; + i = i < 0 || i >= MobEffectList.byId.length || MobEffectList.byId[i] == null ? 0 : i;
+ switch (i) {
+ case 1: // MobEffectList.FASTER_MOVEMENT.id
+ case 3: // MobEffectList.FASTER_DIG.id
+ case 11: // MobEffectList.RESISTANCE.id
+ case 8: // MobEffectList.JUMP.id
+ case 5: // MobEffectList.INCREASE_DAMAGE.id
+ case 10: // MobEffectList.REGENERATION.id
+ break;
+ default:
+ System.out.println("Filtered: " + i);
+ i = 0;
+ break;
+ }
+ return i;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
} }