|
@@ -15,6 +15,7 @@ import me.km.utils.*;
|
|
import net.minecraft.block.*;
|
|
import net.minecraft.block.*;
|
|
import net.minecraft.command.ICommandSource;
|
|
import net.minecraft.command.ICommandSource;
|
|
import net.minecraft.entity.*;
|
|
import net.minecraft.entity.*;
|
|
|
|
+import net.minecraft.entity.item.FallingBlockEntity;
|
|
import net.minecraft.entity.player.*;
|
|
import net.minecraft.entity.player.*;
|
|
import net.minecraft.inventory.*;
|
|
import net.minecraft.inventory.*;
|
|
import net.minecraft.inventory.container.ClickType;
|
|
import net.minecraft.inventory.container.ClickType;
|
|
@@ -683,6 +684,14 @@ public class ScriptEvents implements BlockHarvest, Craft {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @SubscribeEvent(receiveCanceled = true)
|
|
|
|
+ public void onEntityLeaveWorld(EntityLeaveWorldEvent e) {
|
|
|
|
+ Entity ent = e.getEntity();
|
|
|
|
+ handleEvent(e, "entity_leave", (sc) -> {
|
|
|
|
+ setEntity(sc, ent);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
public void onServerTick(TickEvent.ServerTickEvent e) {
|
|
public void onServerTick(TickEvent.ServerTickEvent e) {
|
|
if(e.phase == TickEvent.Phase.END) {
|
|
if(e.phase == TickEvent.Phase.END) {
|
|
@@ -724,11 +733,7 @@ public class ScriptEvents implements BlockHarvest, Craft {
|
|
GameRules rules = w.getGameRules();
|
|
GameRules rules = w.getGameRules();
|
|
if(rules != null) {
|
|
if(rules != null) {
|
|
try {
|
|
try {
|
|
- Boolean br = rules.getBoolean(GameRules.MOB_GRIEFING);
|
|
+ b = !rules.getBoolean(GameRules.MOB_GRIEFING);
|
|
- if(br == null) {
|
|
|
|
- System.out.println("Boolean is null");
|
|
|
|
- }
|
|
|
|
- b = !br;
|
|
|
|
} catch(Exception ex) {
|
|
} catch(Exception ex) {
|
|
System.out.println("onMobGriefing Exception");
|
|
System.out.println("onMobGriefing Exception");
|
|
ex.printStackTrace();
|
|
ex.printStackTrace();
|