Handle error properly

This commit is contained in:
Flowsqy 2021-12-30 12:30:54 +01:00
parent 59152bbf30
commit c58f39c8b2
3 changed files with 12 additions and 8 deletions

View File

@ -25,8 +25,9 @@ public class FakeArmorStandImpl extends FakeEntityImpl implements FakeArmorStand
.newInstance(entityId, dataWatcher, true), receiver);
}
} catch (ReflectiveOperationException e) {
// TODO Handle this properly
throw new RuntimeException(e);
debug.getLogger().severe("Could not set hologram data");
debug.debug("Could not set armor stand data");
debug.debug(e);
}
}

View File

@ -31,8 +31,9 @@ public abstract class FakeEntityImpl implements FakeEntity {
ReflectionUtils.sendPacket(debug, packetPlayOutEntityDestroyClass.getConstructor(int[].class).newInstance((Object) new int[]{entityId}), receiver);
}
} catch (ReflectiveOperationException e){
// TODO Handle this properly
throw new RuntimeException(e);
debug.getLogger().severe("Could not remove hologram");
debug.debug("Could not remove hologram");
debug.debug(e);
}
}
}

View File

@ -43,8 +43,9 @@ public class FakeItemImpl extends FakeEntityImpl implements FakeItem {
ReflectionUtils.sendPacket(debug, packetPlayOutEntityMetadataClass.getConstructor(int.class, dataWatcherClass, boolean.class).newInstance(entityId, dataWatcher, true), receiver);
}
}catch (ReflectiveOperationException e){
// TODO Handle this properly
throw new RuntimeException(e);
debug.getLogger().severe("Failed to send item's data!");
debug.debug("Failed to send item's data!");
debug.debug(e);
}
}
@ -62,8 +63,9 @@ public class FakeItemImpl extends FakeEntityImpl implements FakeItem {
ReflectionUtils.sendPacket(debug, velocityPacket, receiver);
}
}catch (ReflectiveOperationException e){
// TODO Handle this properly
throw new RuntimeException(e);
debug.getLogger().severe("Failed to reset item's velocity!");
debug.debug("Failed to reset item's velocity!");
debug.debug(e);
}
}