Goddamn debug messages.
This commit is contained in:
parent
a872fe6de9
commit
1a019e4e84
@ -4,7 +4,6 @@ import java.lang.reflect.Field;
|
|||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.event.Event;
|
import org.bukkit.event.Event;
|
||||||
|
|
||||||
@ -20,8 +19,6 @@ public class ExprFireProof extends SimpleExpression<Boolean> {
|
|||||||
private Expression<Entity> entity;
|
private Expression<Entity> entity;
|
||||||
|
|
||||||
private Class<?> craftEntClass = ReflectionUtils.getOBCClass("entity.CraftEntity");
|
private Class<?> craftEntClass = ReflectionUtils.getOBCClass("entity.CraftEntity");
|
||||||
private Class<?> entityClass = ReflectionUtils.getNMSClass("Entity");
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<? extends Boolean> getReturnType() {
|
public Class<? extends Boolean> getReturnType() {
|
||||||
return Boolean.class;
|
return Boolean.class;
|
||||||
@ -75,21 +72,7 @@ public class ExprFireProof extends SimpleExpression<Boolean> {
|
|||||||
if (mode == ChangeMode.SET) {
|
if (mode == ChangeMode.SET) {
|
||||||
Boolean newValue = (Boolean) delta[0];
|
Boolean newValue = (Boolean) delta[0];
|
||||||
try {
|
try {
|
||||||
//Field field = nmsEnt.getClass().getDeclaredField("fireProof");
|
Field field = nmsEnt.getClass().getDeclaredField("fireProof");
|
||||||
Bukkit.broadcastMessage("Looping all declared fields...");
|
|
||||||
Field field = null;
|
|
||||||
int i = 1;
|
|
||||||
for (Field f : entityClass.getDeclaredFields()) {
|
|
||||||
Bukkit.broadcastMessage("Field #" + i + " = \u00A7b" + f.getName());
|
|
||||||
if (f.getName().toLowerCase().contains("fire")) {
|
|
||||||
field = f;
|
|
||||||
}
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
if (field == null) {
|
|
||||||
Bukkit.broadcastMessage("No field containing \"fire\" was found...");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
field.setAccessible(true);
|
field.setAccessible(true);
|
||||||
field.setBoolean(nmsEnt, newValue);
|
field.setBoolean(nmsEnt, newValue);
|
||||||
field.setAccessible(false);
|
field.setAccessible(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user