Folia/patches/server/0006-Make-CraftEntity-getHandle-and-overrides-perform-thr.patch
2024-08-24 13:13:45 -07:00

3289 lines
165 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Sun, 19 Mar 2023 14:35:46 -0700
Subject: [PATCH] Make CraftEntity#getHandle and overrides perform thread
checks
While these checks are painful, it should assist in debugging
threading issues for plugins.
diff --git a/src/main/java/io/papermc/paper/entity/PaperSchoolableFish.java b/src/main/java/io/papermc/paper/entity/PaperSchoolableFish.java
index 41bf71d116ffc5431586ce54abba7f8def6c1dcf..1cf9a7677449ab8f03fb23d835e3fadce61542db 100644
--- a/src/main/java/io/papermc/paper/entity/PaperSchoolableFish.java
+++ b/src/main/java/io/papermc/paper/entity/PaperSchoolableFish.java
@@ -11,8 +11,16 @@ public class PaperSchoolableFish extends CraftFish implements SchoolableFish {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public AbstractSchoolingFish getHandleRaw() {
+ return (AbstractSchoolingFish)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public AbstractSchoolingFish getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (AbstractSchoolingFish) super.getHandle();
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index f736ad7e211c89e4c7edc689b089b1b3b486fbab..7a102b4e90fbc09b8653e5b566299efe24a04cf6 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3044,6 +3044,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
if (!force && (!this.canRide(entity) || !entity.canAddPassenger(this))) {
return false;
} else {
+ if (this.valid) { // Folia - region threading - suppress entire event logic during worldgen
// CraftBukkit start
if (entity.getBukkitEntity() instanceof Vehicle && this.getBukkitEntity() instanceof LivingEntity) {
VehicleEnterEvent event = new VehicleEnterEvent((Vehicle) entity.getBukkitEntity(), this.getBukkitEntity());
@@ -3065,6 +3066,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return false;
}
// CraftBukkit end
+ } // Folia - region threading - suppress entire event logic during worldgen
if (this.isPassenger()) {
this.stopRiding();
}
@@ -3148,6 +3150,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
} else {
// CraftBukkit start
+ if (this.valid) { // Folia - region threading - suppress entire event logic during worldgen
CraftEntity craft = (CraftEntity) entity.getBukkitEntity().getVehicle();
Entity orig = craft == null ? null : craft.getHandle();
if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) {
@@ -3175,6 +3178,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return false;
}
// CraftBukkit end
+ } // Folia - region threading - suppress entire event logic during worldgen
if (this.passengers.size() == 1 && this.passengers.get(0) == entity) {
this.passengers = ImmutableList.of();
} else {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java b/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java
index 591af9d0d2fdc9953415979fc97a4a00afd85885..4a0fd1e3203342b7a5ffde579947057fe84a0d80 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java
@@ -1,5 +1,6 @@
package org.bukkit.craftbukkit.entity;
+import net.minecraft.world.entity.Entity;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.Projectile;
@@ -38,6 +39,13 @@ public abstract class AbstractProjectile extends CraftEntity implements Projecti
this.getHandle().hasBeenShot = beenShot;
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.projectile.Projectile getHandleRaw() {
+ return (net.minecraft.world.entity.projectile.Projectile)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public boolean canHitEntity(org.bukkit.entity.Entity entity) {
return this.getHandle().canHitEntity(((CraftEntity) entity).getHandle());
@@ -55,6 +63,7 @@ public abstract class AbstractProjectile extends CraftEntity implements Projecti
@Override
public net.minecraft.world.entity.projectile.Projectile getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.projectile.Projectile) entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractArrow.java
index 501e2aa3a10dae94c4a8d9dfcdc902e434fcca62..865419a80712e111aeb1e436ff9c27fa4b6f37fb 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractArrow.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractArrow.java
@@ -130,6 +130,7 @@ public class CraftAbstractArrow extends AbstractProjectile implements AbstractAr
@Override
public net.minecraft.world.entity.projectile.AbstractArrow getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.projectile.AbstractArrow) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
index 467693a60786688b753cebac3b0a88898e332eee..5c6bd9186e47d1414c5e7bd4fa46a8e305390908 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
@@ -17,8 +17,16 @@ public abstract class CraftAbstractHorse extends CraftAnimals implements Abstrac
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.horse.AbstractHorse getHandleRaw() {
+ return (net.minecraft.world.entity.animal.horse.AbstractHorse)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.horse.AbstractHorse getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.horse.AbstractHorse) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractSkeleton.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractSkeleton.java
index 5beaa2bb0d58fe477ce8d2de8b77600d3b416d8c..c8406f2d83f4c8b60efec0de546f45760c759a2a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractSkeleton.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractSkeleton.java
@@ -15,8 +15,17 @@ public abstract class CraftAbstractSkeleton extends CraftMonster implements Abst
throw new UnsupportedOperationException("Not supported.");
}
// Paper start
+
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.AbstractSkeleton getHandleRaw() {
+ return (net.minecraft.world.entity.monster.AbstractSkeleton)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.AbstractSkeleton getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.AbstractSkeleton) super.getHandle();
}
// Paper end
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java
index 34e4c763c7ec971885147ab2509281fad56e1ca6..7fb2e28c12dba743d8c2fb0a8a4e2f3e76d151f6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java
@@ -17,8 +17,16 @@ public class CraftAbstractVillager extends CraftAgeable implements AbstractVilla
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.npc.AbstractVillager getHandleRaw() {
+ return (net.minecraft.world.entity.npc.AbstractVillager)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.npc.AbstractVillager getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (Villager) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractWindCharge.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractWindCharge.java
index 59df9031e8b4466c8687671d745318e7ee83d271..b91b11c2e1ed5df27e6ff99eb5cc25b931e0b79d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractWindCharge.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractWindCharge.java
@@ -17,6 +17,7 @@ public abstract class CraftAbstractWindCharge extends CraftFireball implements A
@Override
public net.minecraft.world.entity.projectile.windcharge.AbstractWindCharge getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.projectile.windcharge.AbstractWindCharge) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAgeable.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAgeable.java
index ae16e8d1bfe8e9315391510eddb367a3fbdc9e03..2b165c209f65de06f55ed51817e33b92463a2987 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAgeable.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAgeable.java
@@ -63,8 +63,16 @@ public class CraftAgeable extends CraftCreature implements Ageable {
}
}
+ // Folia start - region threading
+ @Override
+ public AgeableMob getHandleRaw() {
+ return (AgeableMob)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public AgeableMob getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (AgeableMob) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAllay.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAllay.java
index c64918175ec08d20cde2bda9e0cac8b474385fe0..0df0824d56d62f7b82fcca8f0b9a6175f012e8d3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAllay.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAllay.java
@@ -16,8 +16,16 @@ public class CraftAllay extends CraftCreature implements org.bukkit.entity.Allay
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public Allay getHandleRaw() {
+ return (Allay)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public Allay getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (Allay) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAmbient.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAmbient.java
index 2a2f9f0907eafcabef26a41d20f64a0aa953d181..9d56293083aac5c14e8333366fd4cf6148486585 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAmbient.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAmbient.java
@@ -9,8 +9,16 @@ public class CraftAmbient extends CraftMob implements Ambient {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public AmbientCreature getHandleRaw() {
+ return (AmbientCreature)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public AmbientCreature getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (AmbientCreature) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAnimals.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAnimals.java
index ab42bc721d5b6c17c2ca6c7153b757571aea05e8..e48528689d49c01aa2b0c1599c66f3c1e94c9cd6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAnimals.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAnimals.java
@@ -15,8 +15,16 @@ public class CraftAnimals extends CraftAgeable implements Animals {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public Animal getHandleRaw() {
+ return (Animal)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public Animal getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (Animal) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java
index 88f2a9f310f30a08893f3fa68af13a54cf72fa7f..b0cf5c7ee2542985ea704da26d36b272271ad096 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java
@@ -28,8 +28,16 @@ public class CraftAreaEffectCloud extends CraftEntity implements AreaEffectCloud
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.AreaEffectCloud getHandleRaw() {
+ return (net.minecraft.world.entity.AreaEffectCloud)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.AreaEffectCloud getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.AreaEffectCloud) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmadillo.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmadillo.java
index e7f2d8de25a489d7f52c78c750e6f7f9b8fee177..75191dd32bba12b5742702a2af151b1079a6b48f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmadillo.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmadillo.java
@@ -11,6 +11,7 @@ public class CraftArmadillo extends CraftAnimals implements Armadillo {
@Override
public net.minecraft.world.entity.animal.armadillo.Armadillo getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.armadillo.Armadillo) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
index 9fe85d6f807e64cf02d8e1921672e3196f6d606f..8a95bc7b1250d47f518a62e625e78a7910ead7ff 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
@@ -20,8 +20,16 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand {
return "CraftArmorStand";
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.decoration.ArmorStand getHandleRaw() {
+ return (net.minecraft.world.entity.decoration.ArmorStand)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.decoration.ArmorStand getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.decoration.ArmorStand) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
index 071be344c3265a0cd52b31ffbb02ff7a70bdf231..0152b1ba40f505bfb5ba941f6d6d0a22d825519a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
@@ -26,6 +26,7 @@ public class CraftArrow extends CraftAbstractArrow implements Arrow {
@Override
public net.minecraft.world.entity.projectile.Arrow getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.projectile.Arrow) this.entity;
}
@@ -90,6 +91,13 @@ public class CraftArrow extends CraftAbstractArrow implements Arrow {
return true;
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.projectile.AbstractArrow getHandleRaw() {
+ return (net.minecraft.world.entity.projectile.AbstractArrow)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public void setBasePotionData(PotionData data) {
this.setBasePotionType(CraftPotionUtil.fromBukkit(data));
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAxolotl.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAxolotl.java
index cbfca242f820d238b112f8ce64e9de8398c48a1c..efbfc8480bddf901fe0acebc06408ee625b57418 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAxolotl.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAxolotl.java
@@ -10,8 +10,16 @@ public class CraftAxolotl extends CraftAnimals implements Axolotl, io.papermc.pa
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.axolotl.Axolotl getHandleRaw() {
+ return (net.minecraft.world.entity.animal.axolotl.Axolotl)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.axolotl.Axolotl getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.axolotl.Axolotl) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBat.java
index 1bb72f28085f3885bec068b586ec222111044884..cb56b6690a385e76197cfc0667ebdec72f0cd096 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBat.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBat.java
@@ -8,8 +8,16 @@ public class CraftBat extends CraftAmbient implements Bat {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.ambient.Bat getHandleRaw() {
+ return (net.minecraft.world.entity.ambient.Bat)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.ambient.Bat getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.ambient.Bat) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBee.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBee.java
index 3dac93b0ab5d5acf5b33dc4b0efed60319eb657b..6ade6ca1a32f824271b7deeabc4dd154ae5a67b6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBee.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBee.java
@@ -13,8 +13,16 @@ public class CraftBee extends CraftAnimals implements Bee {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.Bee getHandleRaw() {
+ return (net.minecraft.world.entity.animal.Bee)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.Bee getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.Bee) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBlaze.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBlaze.java
index a4c9c73691300880777483b0beb17e1bd6779d06..05951297aaed63c22f038703ad6fb68dfcec5227 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBlaze.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBlaze.java
@@ -8,8 +8,16 @@ public class CraftBlaze extends CraftMonster implements Blaze {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Blaze getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Blaze)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.Blaze getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Blaze) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBlockDisplay.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBlockDisplay.java
index dd91de8f24c27b9318c2a898a49991d74c100bff..b951571eda47da97ee73ba7d9b71b4f6cf0373d6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBlockDisplay.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBlockDisplay.java
@@ -12,8 +12,16 @@ public class CraftBlockDisplay extends CraftDisplay implements BlockDisplay {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.Display.BlockDisplay getHandleRaw() {
+ return (net.minecraft.world.entity.Display.BlockDisplay)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.Display.BlockDisplay getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.Display.BlockDisplay) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java
index 01a9660de65688b7c1a4f9dafcb650774ce1853b..869524adfe5cb14b3cbd71a76f340bc9343b9e24 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java
@@ -102,8 +102,16 @@ public class CraftBoat extends CraftVehicle implements Boat, io.papermc.paper.en
return CraftBoat.boatStatusFromNms(this.getHandle().status);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.vehicle.Boat getHandleRaw() {
+ return (net.minecraft.world.entity.vehicle.Boat)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.vehicle.Boat getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.vehicle.Boat) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBogged.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBogged.java
index e8e4704304504e69c7964dcd4df8ce5db9e92bf6..20630858d00fa23e911ec38788df971a12f98c6a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBogged.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBogged.java
@@ -12,6 +12,7 @@ public class CraftBogged extends CraftAbstractSkeleton implements Bogged, io.pap
@Override
public net.minecraft.world.entity.monster.Bogged getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Bogged) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBreeze.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBreeze.java
index 3f3d087387d3169f352d7377c0e5a24668c3d17e..fd22213bc7a8461f5e698792c426384683fb3b7b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBreeze.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBreeze.java
@@ -11,6 +11,7 @@ public class CraftBreeze extends CraftMonster implements Breeze {
@Override
public net.minecraft.world.entity.monster.breeze.Breeze getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.breeze.Breeze) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBreezeWindCharge.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBreezeWindCharge.java
index e88e52a9b8a4d2d750101b0529cbe2a9976e91dd..0eadb421cc505c4639f68c932d284e8ef56f7f57 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBreezeWindCharge.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBreezeWindCharge.java
@@ -10,6 +10,7 @@ public class CraftBreezeWindCharge extends CraftAbstractWindCharge implements Br
@Override
public net.minecraft.world.entity.projectile.windcharge.BreezeWindCharge getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.projectile.windcharge.BreezeWindCharge) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCamel.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCamel.java
index 80e571c977db5cdf43bfbfce035f37a3fa325c95..562ac40645f98452d0d923146d4e95c59b029f5b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCamel.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCamel.java
@@ -11,8 +11,16 @@ public class CraftCamel extends CraftAbstractHorse implements Camel {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.camel.Camel getHandleRaw() {
+ return (net.minecraft.world.entity.animal.camel.Camel)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.camel.Camel getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.camel.Camel) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java
index 88e876da7df64b68a5b71fd1deab75b59c5a64e3..3319f46e2c464c553425e33ac31f1d5190c2d1b5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java
@@ -19,8 +19,16 @@ public class CraftCat extends CraftTameableAnimal implements Cat {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.Cat getHandleRaw() {
+ return (net.minecraft.world.entity.animal.Cat)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.Cat getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.Cat) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCaveSpider.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCaveSpider.java
index 4f661fbdb860cf550da0d952b775fe6f990b43b3..2dfbfbbe98815a303516d88e6ea96b9fba9b7f39 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCaveSpider.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCaveSpider.java
@@ -8,8 +8,16 @@ public class CraftCaveSpider extends CraftSpider implements CaveSpider {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.CaveSpider getHandleRaw() {
+ return (net.minecraft.world.entity.monster.CaveSpider)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.CaveSpider getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.CaveSpider) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftChestBoat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftChestBoat.java
index e4f899a6a1d055b3ea17d1114ed0228fbba53352..4d9bb569b6a957c4ebd06f93d36a0f351961fd23 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftChestBoat.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftChestBoat.java
@@ -15,8 +15,16 @@ public class CraftChestBoat extends CraftBoat implements org.bukkit.entity.Chest
this.inventory = new CraftInventory(entity);
}
+ // Folia start - region threading
+ @Override
+ public ChestBoat getHandleRaw() {
+ return (ChestBoat)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public ChestBoat getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (ChestBoat) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftChestedHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftChestedHorse.java
index 40ee96e31dea64ab3a77553dbb6daad001736f2e..9cdb7e5ce6883709b709e88037e70a1953d755a0 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftChestedHorse.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftChestedHorse.java
@@ -10,8 +10,16 @@ public abstract class CraftChestedHorse extends CraftAbstractHorse implements Ch
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public AbstractChestedHorse getHandleRaw() {
+ return (AbstractChestedHorse)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public AbstractChestedHorse getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (AbstractChestedHorse) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftChicken.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftChicken.java
index 96f6e2fd9c6b20d34122abfe5c7fba732502d5a0..2546ce4d7a25bfe6be1533bfbc770726815e8148 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftChicken.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftChicken.java
@@ -9,8 +9,16 @@ public class CraftChicken extends CraftAnimals implements Chicken {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.Chicken getHandleRaw() {
+ return (net.minecraft.world.entity.animal.Chicken)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.Chicken getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.Chicken) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCod.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCod.java
index 63e6b07e3b159c74d9ef17be20b5ab43d07f0f5f..44fa01798eed8368fa0187cecb88de830d7d2e16 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCod.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCod.java
@@ -9,8 +9,16 @@ public class CraftCod extends io.papermc.paper.entity.PaperSchoolableFish implem
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.Cod getHandleRaw() {
+ return (net.minecraft.world.entity.animal.Cod)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.Cod getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.Cod) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexPart.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexPart.java
index c2583982d84c736639eec511daba594d7806a628..d31bba789c51bc344d21a357f54dd8ef55b88873 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexPart.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexPart.java
@@ -32,8 +32,16 @@ public class CraftComplexPart extends CraftEntity implements ComplexEntityPart {
return this.getParent().isValid();
}
+ // Folia start - region threading
+ @Override
+ public EnderDragonPart getHandleRaw() {
+ return (EnderDragonPart)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public EnderDragonPart getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (EnderDragonPart) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCow.java
index 7babc404e4920cd264206d4e83b1be6f841cdb8c..7a5312ab0fe3a21907a1d6b82fab9b4dce15c44e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCow.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCow.java
@@ -9,8 +9,16 @@ public class CraftCow extends CraftAnimals implements Cow {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.Cow getHandleRaw() {
+ return (net.minecraft.world.entity.animal.Cow)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.Cow getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.Cow) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreature.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreature.java
index 664d9c1793b823ed03f198a936f2ebd9b7695898..6cbe6b6438296b6137ceea01b21ab6a69da2cc9c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreature.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreature.java
@@ -9,8 +9,16 @@ public class CraftCreature extends CraftMob implements Creature {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public PathfinderMob getHandleRaw() {
+ return (PathfinderMob)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public PathfinderMob getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (PathfinderMob) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java
index 42dd26b9170f7d217d73f725a6b8440b45ac2190..e59a29ee70e8b1f525c370bb711fa77a5732c500 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java
@@ -87,6 +87,13 @@ public class CraftCreeper extends CraftMonster implements Creeper {
this.getHandle().ignite();
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Creeper getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Creeper)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public Entity getIgniter() {
return (this.getHandle().entityIgniter != null) ? this.getHandle().entityIgniter.getBukkitEntity() : null;
@@ -94,6 +101,7 @@ public class CraftCreeper extends CraftMonster implements Creeper {
@Override
public net.minecraft.world.entity.monster.Creeper getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Creeper) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftDisplay.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftDisplay.java
index 48eeb1d9ba0ad6f895bfe507a6fbe4b9c9530e47..65301b94dc8d813c487deff24cd04b379e666e98 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftDisplay.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftDisplay.java
@@ -12,8 +12,16 @@ public class CraftDisplay extends CraftEntity implements Display {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.Display getHandleRaw() {
+ return (net.minecraft.world.entity.Display)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.Display getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.Display) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftDolphin.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftDolphin.java
index f93f8f6509b12eb9b1e07c829278bb0822dd7988..2c3c2d7f51c60a5ece610edd0bb00cba3b9d5981 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftDolphin.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftDolphin.java
@@ -9,8 +9,16 @@ public class CraftDolphin extends CraftWaterMob implements Dolphin {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.Dolphin getHandleRaw() {
+ return (net.minecraft.world.entity.animal.Dolphin)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.Dolphin getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.Dolphin) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftDrowned.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftDrowned.java
index 51fc4acae9f20e8891069704e4a27f212b870766..2b27d3e685ee1882dc6ecc1ceaee2fb52f1b548f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftDrowned.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftDrowned.java
@@ -9,8 +9,16 @@ public class CraftDrowned extends CraftZombie implements Drowned, com.destroysto
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Drowned getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Drowned)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.Drowned getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Drowned) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEgg.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEgg.java
index 010e9e922a6e30df4e40da151cfd398d1062633e..8f36a715a5fdf1595cdfdad3d9971cca39279777 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEgg.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEgg.java
@@ -9,8 +9,16 @@ public class CraftEgg extends CraftThrowableProjectile implements Egg {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public ThrownEgg getHandleRaw() {
+ return (ThrownEgg)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public ThrownEgg getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (ThrownEgg) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderCrystal.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderCrystal.java
index 676dd5331bec75407a74aea2a89e78ab72d69724..4f876511b116dd6e7704f1f047af6fab2c3a3e47 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderCrystal.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderCrystal.java
@@ -39,8 +39,16 @@ public class CraftEnderCrystal extends CraftEntity implements EnderCrystal {
}
}
+ // Folia start - region threading
+ @Override
+ public EndCrystal getHandleRaw() {
+ return (EndCrystal)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public EndCrystal getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (EndCrystal) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java
index 7b7b89e67d53ed70efae714192c5fa32977f3d9c..747907123b9a9b2b7cae4a20f77455ea48bc04e9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java
@@ -30,8 +30,16 @@ public class CraftEnderDragon extends CraftMob implements EnderDragon, CraftEnem
return builder.build();
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.boss.enderdragon.EnderDragon getHandleRaw() {
+ return (net.minecraft.world.entity.boss.enderdragon.EnderDragon)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.boss.enderdragon.EnderDragon getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.boss.enderdragon.EnderDragon) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragonPart.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragonPart.java
index 33ae03b78b01c005a291a343b42507fb539e81a6..36aec95539044edd429c17833338638262b9db00 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragonPart.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragonPart.java
@@ -16,8 +16,16 @@ public class CraftEnderDragonPart extends CraftComplexPart implements EnderDrago
return (EnderDragon) super.getParent();
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.boss.EnderDragonPart getHandleRaw() {
+ return (net.minecraft.world.entity.boss.EnderDragonPart)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.boss.EnderDragonPart getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.boss.EnderDragonPart) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderPearl.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderPearl.java
index 3bb8d74f2b59c7f0c7c1cbde47a570d628ceceb2..25d7577d17d52dc00a355a684f1493efb2e88584 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderPearl.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderPearl.java
@@ -9,8 +9,16 @@ public class CraftEnderPearl extends CraftThrowableProjectile implements EnderPe
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public ThrownEnderpearl getHandleRaw() {
+ return (ThrownEnderpearl)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public ThrownEnderpearl getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (ThrownEnderpearl) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java
index 27f56fa4b7ef92a9a4dfa6b782350424b88210f2..e76390fe22e2e846313c9a5b2c7f5492f798ca3e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java
@@ -15,8 +15,16 @@ public class CraftEnderSignal extends CraftEntity implements EnderSignal {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public EyeOfEnder getHandleRaw() {
+ return (EyeOfEnder)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public EyeOfEnder getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (EyeOfEnder) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java
index 983b9d6ddb58eff297e96e5c8b28ec427efa267d..16e33e302f8a60f1f9ff67929dc7c63cd5192a37 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java
@@ -62,8 +62,16 @@ public class CraftEnderman extends CraftMonster implements Enderman {
}
// Paper end
+ // Folia start - region threading
+ @Override
+ public EnderMan getHandleRaw() {
+ return (EnderMan)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public EnderMan getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (EnderMan) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEndermite.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEndermite.java
index d657fd2c507a5b215aeab0a5f3e9c2ee892a27c8..399ef60ab5f1bf02b638c8c46a72d297932f6b38 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEndermite.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEndermite.java
@@ -9,8 +9,16 @@ public class CraftEndermite extends CraftMonster implements Endermite {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Endermite getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Endermite)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.Endermite getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Endermite) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index fe6f31d7db873de64c0cfc5c8248d3e5e96f1500..e30bf9b2cb51e1639b414afa8fbe84a9e69b6d63 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -493,7 +493,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@Override
public UUID getUniqueId() {
- return this.getHandle().getUUID();
+ return this.getHandleRaw().getUUID(); // Folia - region threading
}
@Override
@@ -508,6 +508,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
}
public Entity getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java
index 3a890cccf1766758794f3a3b5d31428f42590049..8c148db1b84c65b89fb2779e5b96a71ea4900083 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java
@@ -11,8 +11,16 @@ public class CraftEvoker extends CraftSpellcaster implements Evoker {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Evoker getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Evoker)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.Evoker getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Evoker) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvokerFangs.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEvokerFangs.java
index 19b368cc862cd7e3e1f0e89401a7d099e3eaefa3..4a1c1af06719ff75f6ec2ac27198858b549b0302 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvokerFangs.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEvokerFangs.java
@@ -11,8 +11,16 @@ public class CraftEvokerFangs extends CraftEntity implements EvokerFangs {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.projectile.EvokerFangs getHandleRaw() {
+ return (net.minecraft.world.entity.projectile.EvokerFangs)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.projectile.EvokerFangs getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.projectile.EvokerFangs) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java
index 650e4a01cecc4cc08e7ff9ebcc4c367084351f21..81b2b850dd7d08f2fae7baf56733d753b68d294c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java
@@ -42,8 +42,16 @@ public class CraftExperienceOrb extends CraftEntity implements ExperienceOrb {
}
// Paper end
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.ExperienceOrb getHandleRaw() {
+ return (net.minecraft.world.entity.ExperienceOrb)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.ExperienceOrb getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.ExperienceOrb) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java
index 1359d25a32b4a5d5e8e68ce737bd19f7b5afaf69..4c6ac7f2531311d24081b397c60b2f8b183fad34 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java
@@ -14,8 +14,16 @@ public class CraftFallingBlock extends CraftEntity implements FallingBlock {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public FallingBlockEntity getHandleRaw() {
+ return (FallingBlockEntity)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public FallingBlockEntity getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (FallingBlockEntity) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java
index 43d7bea201a52cfeacf60c75caa28dfd2c4ff164..ac7237e8c28377d5f9abf38b628215ac865c9709 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java
@@ -83,8 +83,16 @@ public class CraftFireball extends AbstractProjectile implements Fireball {
}
// Paper end - Expose power on fireball projectiles
+ // Folia start - region threading
+ @Override
+ public AbstractHurtingProjectile getHandleRaw() {
+ return (AbstractHurtingProjectile)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public AbstractHurtingProjectile getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (AbstractHurtingProjectile) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
index 759b6e54db93792c9862b1f1625118ac6fa49d7a..6fdd39c78a2f7c1c53d5de16e09e0f271c42039e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
@@ -37,8 +37,16 @@ public class CraftFirework extends CraftProjectile implements Firework {
// Paper end - Expose firework item directly
}
+ // Folia start - region threading
+ @Override
+ public FireworkRocketEntity getHandleRaw() {
+ return (FireworkRocketEntity)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public FireworkRocketEntity getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (FireworkRocketEntity) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFish.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFish.java
index eb10f94d5ed8ca89d3786138647dd43357609a6c..f4d92fb44fd7cee7debe3e283e8b672021e3e23f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFish.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFish.java
@@ -10,8 +10,16 @@ public class CraftFish extends CraftWaterMob implements Fish, io.papermc.paper.e
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public AbstractFish getHandleRaw() {
+ return (AbstractFish)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public AbstractFish getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (AbstractFish) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java
index e0d65df2e5b4c14abeb89a5f72cc2d9fa034dcf5..bd8f1925cb3eee30a5b5ea83225b6d94c80bc69a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java
@@ -14,8 +14,16 @@ public class CraftFishHook extends CraftProjectile implements FishHook {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public FishingHook getHandleRaw() {
+ return (FishingHook)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public FishingHook getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (FishingHook) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFlying.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFlying.java
index 8117faa0c89a966d057f4bf251c03a09d1e8797e..7c3827e6ef608ff15be9bced4788b09f1572aecb 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFlying.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFlying.java
@@ -10,8 +10,16 @@ public class CraftFlying extends CraftMob implements Flying {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public FlyingMob getHandleRaw() {
+ return (FlyingMob)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public FlyingMob getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (FlyingMob) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java
index c455deb4fd2a7684bcc01a8212c362a2375c190b..5f0ddb932df148859dc6a699082934cac8d48fcf 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java
@@ -14,8 +14,16 @@ public class CraftFox extends CraftAnimals implements Fox {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.Fox getHandleRaw() {
+ return (net.minecraft.world.entity.animal.Fox)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.Fox getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.Fox) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFrog.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFrog.java
index ebf09c27e02a19d31c777b70a38376e4d01e5ee7..0eb55d6e7541acbc6727a108fdeed1711a17f3cd 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFrog.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFrog.java
@@ -19,8 +19,16 @@ public class CraftFrog extends CraftAnimals implements org.bukkit.entity.Frog {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public Frog getHandleRaw() {
+ return (Frog)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public Frog getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (Frog) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftGhast.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftGhast.java
index 97fa4e1e70203194bd939618b2fad92665af6d59..27b309c9ce10798e3c3a7a9d39b8c300e471e177 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftGhast.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftGhast.java
@@ -9,8 +9,16 @@ public class CraftGhast extends CraftFlying implements Ghast, CraftEnemy {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Ghast getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Ghast)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.Ghast getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Ghast) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftGiant.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftGiant.java
index 5826205339e99e2536b93c8589d95917749f8417..9bb22fc146012310bca849fccb0a1e7e987875e9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftGiant.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftGiant.java
@@ -9,8 +9,16 @@ public class CraftGiant extends CraftMonster implements Giant {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Giant getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Giant)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.Giant getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Giant) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftGlowItemFrame.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftGlowItemFrame.java
index b9a7576d2481b64b7e5b46d66c1f55d1dc28c540..00c95313a233a032518e2435922d4044a9d67aee 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftGlowItemFrame.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftGlowItemFrame.java
@@ -9,8 +9,16 @@ public class CraftGlowItemFrame extends CraftItemFrame implements GlowItemFrame
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.decoration.GlowItemFrame getHandleRaw() {
+ return (net.minecraft.world.entity.decoration.GlowItemFrame)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.decoration.GlowItemFrame getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.decoration.GlowItemFrame) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftGlowSquid.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftGlowSquid.java
index 253a0d2f987163cbbb28d261674b47137cbbcbe2..1ed09d2aa4077165e9f88dd9db34f4083a2953c2 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftGlowSquid.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftGlowSquid.java
@@ -10,8 +10,16 @@ public class CraftGlowSquid extends CraftSquid implements GlowSquid {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.GlowSquid getHandleRaw() {
+ return (net.minecraft.world.entity.GlowSquid)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.GlowSquid getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.GlowSquid) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftGoat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftGoat.java
index 2c21de478bff9cdf13ba46cd041831d54c11e924..e64d7c4cfe65d34bdab13496741645f808f43dc6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftGoat.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftGoat.java
@@ -9,8 +9,16 @@ public class CraftGoat extends CraftAnimals implements Goat {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.goat.Goat getHandleRaw() {
+ return (net.minecraft.world.entity.animal.goat.Goat)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.goat.Goat getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.goat.Goat) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftGolem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftGolem.java
index e27e469894bdd17cf7a004a85fdf0eaa746111a6..bbb8ff66580e62b5fb66aac22de72b9b9eafd3ef 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftGolem.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftGolem.java
@@ -9,8 +9,16 @@ public class CraftGolem extends CraftCreature implements Golem {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public AbstractGolem getHandleRaw() {
+ return (AbstractGolem)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public AbstractGolem getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (AbstractGolem) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftGuardian.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftGuardian.java
index e232350f2c6ef1900b05fda4d3f94099057d10e5..2c411b569cc4b222ed3cdfb95237c86cd6a0fabb 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftGuardian.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftGuardian.java
@@ -13,8 +13,16 @@ public class CraftGuardian extends CraftMonster implements Guardian {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Guardian getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Guardian)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.Guardian getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Guardian) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHanging.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHanging.java
index f1e3f2b89bcd969f3c80548e165881a9b290eb53..2e4b86b44ace5eecefc9ab09c6e1f0a31247ad2f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHanging.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHanging.java
@@ -57,8 +57,16 @@ public class CraftHanging extends CraftBlockAttachedEntity implements Hanging {
return CraftBlock.notchToBlockFace(direction);
}
+ // Folia start - region threading
+ @Override
+ public HangingEntity getHandleRaw() {
+ return (HangingEntity)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public HangingEntity getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (HangingEntity) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHoglin.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHoglin.java
index 37007775d27598e319c0c78929c6a808b697724a..b9819fc2c2ffc1a21a6e0973bb0d3595ee9c565d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHoglin.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHoglin.java
@@ -51,8 +51,16 @@ public class CraftHoglin extends CraftAnimals implements Hoglin, CraftEnemy {
return this.getHandle().isConverting();
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.hoglin.Hoglin getHandleRaw() {
+ return (net.minecraft.world.entity.monster.hoglin.Hoglin)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.hoglin.Hoglin getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.hoglin.Hoglin) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHorse.java
index 9b6ff0f64966c78a3233860bb0840182b52f01bc..fb34651a9e4ed0cb05721d15524a26f89333d5e7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHorse.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHorse.java
@@ -13,8 +13,16 @@ public class CraftHorse extends CraftAbstractHorse implements Horse {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.horse.Horse getHandleRaw() {
+ return (net.minecraft.world.entity.animal.horse.Horse)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.horse.Horse getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.horse.Horse) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index c1bad887d1340ebc7c63fda3dceff929e4a44517..37c8bd3dc3e539ca92216ae5c2896b037d9af21e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -290,8 +290,16 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
this.mode = mode;
}
+ // Folia start - region threading
+ @Override
+ public Player getHandleRaw() {
+ return (Player)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public Player getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (Player) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftIllager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftIllager.java
index fb3c518f02cb4c428f022523d2f838625841332b..846a429493236f5002f0fae85c6cd7d20169dbe0 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftIllager.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftIllager.java
@@ -10,8 +10,16 @@ public class CraftIllager extends CraftRaider implements Illager {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public AbstractIllager getHandleRaw() {
+ return (AbstractIllager)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public AbstractIllager getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (AbstractIllager) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftIllusioner.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftIllusioner.java
index 5b2af80e584977683cd39e6f440e65a76e929be9..789191168f74b3272e8da2131e0311853033c938 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftIllusioner.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftIllusioner.java
@@ -9,8 +9,16 @@ public class CraftIllusioner extends CraftSpellcaster implements Illusioner, com
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Illusioner getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Illusioner)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.Illusioner getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Illusioner) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftInteraction.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftInteraction.java
index caa3016bf9742222205e3ea9a327fad3c4f912bb..2e00c7fe8dadd4c57c83a51cdfce165b6bfd6807 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftInteraction.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftInteraction.java
@@ -12,8 +12,16 @@ public class CraftInteraction extends CraftEntity implements Interaction {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.Interaction getHandleRaw() {
+ return (net.minecraft.world.entity.Interaction)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.Interaction getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.Interaction) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftIronGolem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftIronGolem.java
index 63cae1a2e95d8da17c45c4404a8dd0ca6a413c39..e417ff87b047dcffa6121835af6f4e713526e16b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftIronGolem.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftIronGolem.java
@@ -8,8 +8,16 @@ public class CraftIronGolem extends CraftGolem implements IronGolem {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.IronGolem getHandleRaw() {
+ return (net.minecraft.world.entity.animal.IronGolem)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.IronGolem getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.IronGolem) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
index 30d62ee4d5cd2ddacb8783b5bbbf475d592b3e02..3985b6bea750341f5336babb237aab8874a4cbd9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
@@ -18,8 +18,16 @@ public class CraftItem extends CraftEntity implements Item {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public ItemEntity getHandleRaw() {
+ return (ItemEntity)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public ItemEntity getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (ItemEntity) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItemDisplay.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItemDisplay.java
index 787f91566fc53c2b4aeba1ec10d8f46ccf15cbe6..04a73a31ba09557e901ff1985dc5d5e53f18d99a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItemDisplay.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItemDisplay.java
@@ -13,8 +13,16 @@ public class CraftItemDisplay extends CraftDisplay implements ItemDisplay {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.Display.ItemDisplay getHandleRaw() {
+ return (net.minecraft.world.entity.Display.ItemDisplay)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.Display.ItemDisplay getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.Display.ItemDisplay) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java
index 350ad61ab3fe66abd528e353b431a4a6dac17506..332f209980d3e645ad469fcebb93cc09253ebc20 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java
@@ -157,8 +157,16 @@ public class CraftItemFrame extends CraftHanging implements ItemFrame {
this.getHandle().fixed = fixed;
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.decoration.ItemFrame getHandleRaw() {
+ return (net.minecraft.world.entity.decoration.ItemFrame)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.decoration.ItemFrame getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.decoration.ItemFrame) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLargeFireball.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLargeFireball.java
index 0848963e61e03aa2a1740208ee372fd9edb7fc11..de2236f0106330ebe9d76bd308f9eee8751db826 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLargeFireball.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLargeFireball.java
@@ -14,8 +14,16 @@ public class CraftLargeFireball extends CraftSizedFireball implements LargeFireb
this.getHandle().explosionPower = (int) yield;
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.projectile.LargeFireball getHandleRaw() {
+ return (net.minecraft.world.entity.projectile.LargeFireball)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.projectile.LargeFireball getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.projectile.LargeFireball) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLeash.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLeash.java
index 76a7fc3d6c561d12bde17b9f93cae03a6cbb84b3..cd1ba99a75da644d06c4eb2f2c1ff91bfa5afa01 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLeash.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLeash.java
@@ -24,6 +24,13 @@ public class CraftLeash extends CraftBlockAttachedEntity implements LeashHitch {
return BlockFace.SELF;
}
+ // Folia start - region threading
+ @Override
+ public LeashFenceKnotEntity getHandleRaw() {
+ return (LeashFenceKnotEntity)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public BlockFace getAttachedFace() {
// Leash hitch has no facing direction, so we return self
@@ -37,6 +44,7 @@ public class CraftLeash extends CraftBlockAttachedEntity implements LeashHitch {
@Override
public LeashFenceKnotEntity getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (LeashFenceKnotEntity) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java
index e9f471e60af0725ec34e2985d63ae9ea9f88590a..cd824fc65ac2b1fe55710da4700f7c31f820f205 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java
@@ -41,8 +41,16 @@ public class CraftLightningStrike extends CraftEntity implements LightningStrike
this.getHandle().setCause((player != null) ? ((CraftPlayer) player).getHandle() : null);
}
+ // Folia start - region threading
+ @Override
+ public LightningBolt getHandleRaw() {
+ return (LightningBolt)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public LightningBolt getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (LightningBolt) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index beb6ad312028adb14053e3f019a4fcf6c9149373..90939123cd749321d3846f0970aa75417c1a0f52 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -477,6 +477,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
this.getHandle().invulnerableTime = ticks;
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.LivingEntity getHandleRaw() {
+ return (net.minecraft.world.entity.LivingEntity)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public int getNoActionTicks() {
return this.getHandle().getNoActionTime();
@@ -490,6 +497,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@Override
public net.minecraft.world.entity.LivingEntity getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.LivingEntity) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java
index 351f42842b780d053cd2e5bad9ae299449141b10..63513eff9b849f240b16ea28060b78c774e23934 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java
@@ -14,8 +14,16 @@ public class CraftLlama extends CraftChestedHorse implements Llama, com.destroys
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.horse.Llama getHandleRaw() {
+ return (net.minecraft.world.entity.animal.horse.Llama)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.horse.Llama getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.horse.Llama) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlamaSpit.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlamaSpit.java
index 47633f05b4fab1dcabc2117e7645fe6d6949622a..5e51d6eeda2abdc5df9c9a280a191ca1cbf615b9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlamaSpit.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlamaSpit.java
@@ -10,8 +10,16 @@ public class CraftLlamaSpit extends AbstractProjectile implements LlamaSpit {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.projectile.LlamaSpit getHandleRaw() {
+ return (net.minecraft.world.entity.projectile.LlamaSpit)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.projectile.LlamaSpit getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.projectile.LlamaSpit) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMagmaCube.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMagmaCube.java
index 58b638ffd338e1b0f4962490c665c1eebcf33dcc..9f1b4d0561c10fbbfe0daec3d9dabfdaca9cf70b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMagmaCube.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMagmaCube.java
@@ -9,8 +9,16 @@ public class CraftMagmaCube extends CraftSlime implements MagmaCube {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.MagmaCube getHandleRaw() {
+ return (net.minecraft.world.entity.monster.MagmaCube)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.MagmaCube getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.MagmaCube) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMarker.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMarker.java
index e6782a48d22ba1e683e3fe463e970e8a5ed60fbd..afaa4570c1991cd4260ffcdba823ba2452ad156a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMarker.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMarker.java
@@ -9,8 +9,16 @@ public class CraftMarker extends CraftEntity implements Marker {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.Marker getHandleRaw() {
+ return (net.minecraft.world.entity.Marker)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.Marker getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.Marker) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java
index 8920af5a0dfe737c1f38d906b53e6a278456d2aa..5652ec4aea839fae3f8ea31d7cd5c80ecf129fb5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java
@@ -86,8 +86,16 @@ public abstract class CraftMinecart extends CraftVehicle implements Minecart {
}
// Paper end
+ // Folia start - region threading
+ @Override
+ public AbstractMinecart getHandleRaw() {
+ return (AbstractMinecart)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public AbstractMinecart getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (AbstractMinecart) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java
index f34fa6715e477936097367a7aefd1a2bf87d3d90..e5310b138b13d54448072c15f6768acc1c33a45c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java
@@ -20,8 +20,16 @@ public class CraftMinecartCommand extends CraftMinecart implements CommandMineca
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public MinecartCommandBlock getHandleRaw() {
+ return (MinecartCommandBlock)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public MinecartCommandBlock getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (MinecartCommandBlock) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
index 451f3a6f0b47493da3af3f5d6baced6a8c97f350..d4f98fe5eb5e463679ebc5b82b077c98e4448203 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
@@ -13,8 +13,16 @@ public abstract class CraftMinecartContainer extends CraftMinecart implements co
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public AbstractMinecartContainer getHandleRaw() {
+ return (AbstractMinecartContainer)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public AbstractMinecartContainer getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (AbstractMinecartContainer) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartFurnace.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartFurnace.java
index 1b41026ab638bb2764b19429706eb0aded5aad12..4d242bed3bd40c9749236e138f81d5e8583f7dc3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartFurnace.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartFurnace.java
@@ -11,8 +11,16 @@ public class CraftMinecartFurnace extends CraftMinecart implements PoweredMineca
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public MinecartFurnace getHandleRaw() {
+ return (MinecartFurnace)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public MinecartFurnace getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (MinecartFurnace) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java
index 3a3563a1bdbc0d84d973b3a04b50b78b4bc3d379..1e86ce7c1a3fc1f4eae2d8136fc0d879fbde5301 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java
@@ -34,8 +34,17 @@ public final class CraftMinecartHopper extends CraftMinecartContainer implements
((MinecartHopper) this.getHandle()).setEnabled(enabled);
}
// Paper start
+
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.vehicle.MinecartHopper getHandleRaw() {
+ return (net.minecraft.world.entity.vehicle.MinecartHopper)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.vehicle.MinecartHopper getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.vehicle.MinecartHopper) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartTNT.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartTNT.java
index 79b608e89d4d1f76a58868c585bb87c82e2689b1..7884de5348f325ee12db41a521a042be4b33a793 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartTNT.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartTNT.java
@@ -42,8 +42,16 @@ public final class CraftMinecartTNT extends CraftMinecart implements ExplosiveMi
this.getHandle().explode(power);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.vehicle.MinecartTNT getHandleRaw() {
+ return (net.minecraft.world.entity.vehicle.MinecartTNT)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public MinecartTNT getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (MinecartTNT) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
index 5f9f7e325e3e0276f7a475c4a4725cc0e1b54afd..b6721b3388a5c921e9e621798329f17434683a87 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
@@ -54,8 +54,16 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob, io.pape
return (sound != null) ? CraftSound.minecraftToBukkit(sound) : null;
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.Mob getHandleRaw() {
+ return (net.minecraft.world.entity.Mob)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.Mob getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.Mob) this.entity;
}
@@ -63,7 +71,7 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob, io.pape
@Override
public void setHandle(net.minecraft.world.entity.Entity entity) {
super.setHandle(entity);
- paperPathfinder.setHandle(getHandle());
+ paperPathfinder.setHandle((net.minecraft.world.entity.Mob)entity); // Folia - region threading
}
// Paper end - Mob Pathfinding API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMonster.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMonster.java
index 706c74c832f6893df3797023f68add31139c7d57..1cf155fc23f13691f86673eac3084d7530d69ab5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMonster.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMonster.java
@@ -9,8 +9,16 @@ public class CraftMonster extends CraftCreature implements Monster, CraftEnemy {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Monster getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Monster)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.Monster getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Monster) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java
index 5c5b64bd058684520fa175bfd10622ff57856b7c..8acaa5f8153d643e2558110bb7be512514a27532 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java
@@ -19,6 +19,13 @@ public class CraftMushroomCow extends CraftCow implements MushroomCow, io.paperm
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.MushroomCow getHandleRaw() {
+ return (net.minecraft.world.entity.animal.MushroomCow)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public boolean hasEffectsForNextStew() {
SuspiciousStewEffects stewEffects = this.getHandle().stewEffects;
@@ -94,6 +101,7 @@ public class CraftMushroomCow extends CraftCow implements MushroomCow, io.paperm
@Override
public net.minecraft.world.entity.animal.MushroomCow getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.MushroomCow) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftOcelot.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftOcelot.java
index 5c60a30e80448fbf04b5fa4b1ef12fb2ee99bfd5..4ba52939450c0a89e5ba1fa57a84b3ceccb9fef0 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftOcelot.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftOcelot.java
@@ -9,8 +9,16 @@ public class CraftOcelot extends CraftAnimals implements Ocelot {
super(server, ocelot);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.Ocelot getHandleRaw() {
+ return (net.minecraft.world.entity.animal.Ocelot)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.Ocelot getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.Ocelot) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftOminousItemSpawner.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftOminousItemSpawner.java
index ecdac2cf74e99f0d69e053dece11ab891973dc2b..fa365c38c9e0f671df1481c8b36bc993eee42afd 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftOminousItemSpawner.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftOminousItemSpawner.java
@@ -13,6 +13,7 @@ public class CraftOminousItemSpawner extends CraftEntity implements OminousItemS
@Override
public net.minecraft.world.entity.OminousItemSpawner getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.OminousItemSpawner) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPainting.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPainting.java
index 98a4463c9f194f33f4f85d95a0b9fa061cf6faaf..50c1259a16db9f7f134ea6aeb43f29dc100214d3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPainting.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPainting.java
@@ -50,8 +50,16 @@ public class CraftPainting extends CraftHanging implements Painting {
return false;
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.decoration.Painting getHandleRaw() {
+ return (net.minecraft.world.entity.decoration.Painting)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.decoration.Painting getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.decoration.Painting) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPanda.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPanda.java
index 01d104d91de9e1319d27e39d3f474318c7809486..c298b263175dc82097c0ad2c35194f3e326c6658 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPanda.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPanda.java
@@ -11,8 +11,16 @@ public class CraftPanda extends CraftAnimals implements Panda {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.Panda getHandleRaw() {
+ return (net.minecraft.world.entity.animal.Panda)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.Panda getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.Panda) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftParrot.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftParrot.java
index 04d6cf6a1f3ae8316e3b2862c2d1b04e84a3b20a..4ed79610b50be635a7a7c8a8f7d7af8f91ce2d0d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftParrot.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftParrot.java
@@ -11,8 +11,16 @@ public class CraftParrot extends CraftTameableAnimal implements Parrot {
super(server, parrot);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.Parrot getHandleRaw() {
+ return (net.minecraft.world.entity.animal.Parrot)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.Parrot getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.Parrot) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java
index 83e77c6d287d8e239d2f55f3e9f19ef74946be7c..10e385066d29834eb3d8c9d539bb8655407cabb5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java
@@ -9,8 +9,16 @@ public class CraftPhantom extends CraftFlying implements Phantom, CraftEnemy {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Phantom getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Phantom)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.Phantom getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Phantom) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPig.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPig.java
index 8016c810aeaf6ee953bca549bc1e7f9a85f860fc..e96e58fa4fb2a73e3e44c5213c73f332df4daa97 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPig.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPig.java
@@ -55,8 +55,16 @@ public class CraftPig extends CraftAnimals implements Pig {
return Material.CARROT_ON_A_STICK;
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.Pig getHandleRaw() {
+ return (net.minecraft.world.entity.animal.Pig)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.Pig getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.Pig) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPigZombie.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPigZombie.java
index 49beb836d2801aadf869feefa602616daebe633f..d220874f678649acfae549691262c370f0228908 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPigZombie.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPigZombie.java
@@ -30,8 +30,16 @@ public class CraftPigZombie extends CraftZombie implements PigZombie {
return this.getAnger() > 0;
}
+ // Folia start - region threading
+ @Override
+ public ZombifiedPiglin getHandleRaw() {
+ return (ZombifiedPiglin)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public ZombifiedPiglin getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (ZombifiedPiglin) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java
index 5124a383b60b2c8de89fa992547d0c61db760c21..d75230de45102434660b3b7926a804d26e10ab2c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java
@@ -75,8 +75,16 @@ public class CraftPiglin extends CraftPiglinAbstract implements Piglin, com.dest
return new CraftInventory(this.getHandle().inventory);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.piglin.Piglin getHandleRaw() {
+ return (net.minecraft.world.entity.monster.piglin.Piglin)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.piglin.Piglin getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.piglin.Piglin) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglinAbstract.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglinAbstract.java
index e7957d6051244ba410f8633f9c16eeb8c5ac3ce0..f8465f75c15d96ccd82ee394c9e658966837ad07 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglinAbstract.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglinAbstract.java
@@ -95,8 +95,16 @@ public class CraftPiglinAbstract extends CraftMonster implements PiglinAbstract
public void setBreed(boolean b) {
}
+ // Folia start - region threading
+ @Override
+ public AbstractPiglin getHandleRaw() {
+ return (AbstractPiglin)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public AbstractPiglin getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (AbstractPiglin) super.getHandle();
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglinBrute.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglinBrute.java
index be874dc973fe632e8ace86041392ca69beaefd16..efb64160089eeb6be8faf7790989909145c22a4b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglinBrute.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglinBrute.java
@@ -9,8 +9,16 @@ public class CraftPiglinBrute extends CraftPiglinAbstract implements PiglinBrute
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.piglin.PiglinBrute getHandleRaw() {
+ return (net.minecraft.world.entity.monster.piglin.PiglinBrute)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.piglin.PiglinBrute getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.piglin.PiglinBrute) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPillager.java
index 2638c341bc02f201f7ab17fdebcdbdf3a7ec05bf..074b2919be2b5544b0a46e6cd32f6c57dad6bfdc 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPillager.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPillager.java
@@ -11,8 +11,16 @@ public class CraftPillager extends CraftIllager implements Pillager, com.destroy
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Pillager getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Pillager)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.Pillager getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Pillager) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0e3eed03f307a414effdd30414b8d01797349908..28c6923c90ca106256ca75769828cd62d5542ca7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -669,7 +669,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void kick(net.kyori.adventure.text.Component message, org.bukkit.event.player.PlayerKickEvent.Cause cause) {
- org.spigotmc.AsyncCatcher.catchOp("player kick");
+ //org.spigotmc.AsyncCatcher.catchOp("player kick"); // Folia - region threading - no longer needed
final ServerGamePacketListenerImpl connection = this.getHandle().connection;
if (connection != null) {
connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message, cause);
@@ -2311,9 +2311,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this;
}
+ // Folia start - region threading
+ @Override
+ public ServerPlayer getHandleRaw() {
+ return (ServerPlayer)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public ServerPlayer getHandle() {
- return (ServerPlayer) this.entity;
+ return (ServerPlayer) this.entity; // Folia - region threading - no checks for players, as it's a total mess
}
public void setHandle(final ServerPlayer entity) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPolarBear.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPolarBear.java
index fe075cfdf3097d6cb768e71b8cc360abb8eaf367..657886dfb8e152ed4a64a64878da23526dad0160 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPolarBear.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPolarBear.java
@@ -8,8 +8,17 @@ public class CraftPolarBear extends CraftAnimals implements PolarBear {
public CraftPolarBear(CraftServer server, net.minecraft.world.entity.animal.PolarBear entity) {
super(server, entity);
}
+
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.PolarBear getHandleRaw() {
+ return (net.minecraft.world.entity.animal.PolarBear)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.PolarBear getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.PolarBear) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftProjectile.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftProjectile.java
index 4f1fa7dec78970bdfc184d3c1f1632dc9d75a574..99fd39c60d1b0a50bddf7b9b9f45f22c189a2f25 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftProjectile.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftProjectile.java
@@ -12,8 +12,16 @@ public abstract class CraftProjectile extends AbstractProjectile implements Proj
// Paper - moved to AbstractProjectile
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.projectile.Projectile getHandleRaw() {
+ return (net.minecraft.world.entity.projectile.Projectile)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.projectile.Projectile getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.projectile.Projectile) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPufferFish.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPufferFish.java
index 35a8219734633529325430810e88755b2dd23125..7ba16121cb1828cf5c0ff8f027fa05e9c1814ffa 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPufferFish.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPufferFish.java
@@ -10,8 +10,16 @@ public class CraftPufferFish extends CraftFish implements PufferFish {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public Pufferfish getHandleRaw() {
+ return (Pufferfish)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public Pufferfish getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (Pufferfish) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java
index 519ef701a7d6534f7cb516f6296b95ee521f661d..6407b4e6ca793a676e7d669920ae90b762207970 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java
@@ -10,8 +10,16 @@ public class CraftRabbit extends CraftAnimals implements Rabbit {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.Rabbit getHandleRaw() {
+ return (net.minecraft.world.entity.animal.Rabbit)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.Rabbit getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.Rabbit) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftRaider.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftRaider.java
index 763c368e299588f9a0e085a8a5e04e97e1f33428..3e85638f3941c2085a7ddb102d0ccc23446cc1d6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftRaider.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftRaider.java
@@ -16,8 +16,16 @@ public abstract class CraftRaider extends CraftMonster implements Raider {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.raid.Raider getHandleRaw() {
+ return (net.minecraft.world.entity.raid.Raider)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.raid.Raider getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.raid.Raider) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftRavager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftRavager.java
index 09796ce15658e3f7c223a265a547a51ee729ed40..bfca2951d18f7451787877b5a6503b0572945447 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftRavager.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftRavager.java
@@ -9,8 +9,16 @@ public class CraftRavager extends CraftRaider implements Ravager {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Ravager getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Ravager)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.Ravager getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Ravager) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSalmon.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSalmon.java
index d4d8ce60098c74508e2de9541bf6534988779764..bf4b61e56345b1f2ee83d8aceaf66c199590c258 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSalmon.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSalmon.java
@@ -9,8 +9,16 @@ public class CraftSalmon extends io.papermc.paper.entity.PaperSchoolableFish imp
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.Salmon getHandleRaw() {
+ return (net.minecraft.world.entity.animal.Salmon)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.Salmon getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.Salmon) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSheep.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSheep.java
index 37291d7ad9fdf0fe78894f82a418f40bb581f58b..6c7e54a929b46fd160726e41bf63023a8622d044 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSheep.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSheep.java
@@ -29,8 +29,16 @@ public class CraftSheep extends CraftAnimals implements Sheep, io.papermc.paper.
this.getHandle().setSheared(flag);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.Sheep getHandleRaw() {
+ return (net.minecraft.world.entity.animal.Sheep)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.Sheep getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.Sheep) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftShulker.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftShulker.java
index 05ec06b71642ab1ef03829039f7ac1e4c527ee50..1e1e908cbc08df06996128e3dd6d277a19f9a2df 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftShulker.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftShulker.java
@@ -18,8 +18,16 @@ public class CraftShulker extends CraftGolem implements Shulker, CraftEnemy {
return "CraftShulker";
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Shulker getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Shulker)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.Shulker getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Shulker) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftShulkerBullet.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftShulkerBullet.java
index b3797a43eeee11cb7ae0774d61bd5f195d0aa3ad..d045d50d1cfccb696153b8c33e86e193194271fc 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftShulkerBullet.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftShulkerBullet.java
@@ -69,8 +69,16 @@ public class CraftShulkerBullet extends AbstractProjectile implements ShulkerBul
return "CraftShulkerBullet";
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.projectile.ShulkerBullet getHandleRaw() {
+ return (net.minecraft.world.entity.projectile.ShulkerBullet)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.projectile.ShulkerBullet getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.projectile.ShulkerBullet) this.entity;
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSilverfish.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSilverfish.java
index 7c75d78e5e28d7320c6dbe979bcd576658fb310b..a25ca7fa49a3bb213f6af5804079b2efe43ef0e4 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSilverfish.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSilverfish.java
@@ -8,8 +8,16 @@ public class CraftSilverfish extends CraftMonster implements Silverfish {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Silverfish getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Silverfish)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.Silverfish getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Silverfish) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSizedFireball.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSizedFireball.java
index de3327812c08b3bb8f5907ae657f67962d1e4e8b..c479f4adb945e8bb6ea2279ad23d679ca0dee606 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSizedFireball.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSizedFireball.java
@@ -27,8 +27,16 @@ public class CraftSizedFireball extends CraftFireball implements SizedFireball {
this.getHandle().setItem(CraftItemStack.asNMSCopy(item));
}
+ // Folia start - region threading
+ @Override
+ public Fireball getHandleRaw() {
+ return (Fireball)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public Fireball getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (Fireball) this.entity;
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java
index 6f98da9be6aef35e3b5c940188b872459a383c8e..dc93b8aaf48671d66d3bb3fb413b83fc4b4b26cf 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java
@@ -31,8 +31,16 @@ public class CraftSkeleton extends CraftAbstractSkeleton implements Skeleton {
}
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Skeleton getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Skeleton)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.Skeleton getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Skeleton) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java
index fbb47491dcc75f8247dee9f123f946f99ef1467f..6cc1ea31340298037c2a00d64d70928f31278a4a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java
@@ -20,8 +20,16 @@ public class CraftSkeletonHorse extends CraftAbstractHorse implements SkeletonHo
return Variant.SKELETON_HORSE;
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.horse.SkeletonHorse getHandleRaw() {
+ return (net.minecraft.world.entity.animal.horse.SkeletonHorse)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.horse.SkeletonHorse getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.horse.SkeletonHorse) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java
index e48f7d1cbec4a2319745ba48a5d44ab9925214e2..27b07865edfa659d9cdfcf2d84935ad313472e87 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java
@@ -19,8 +19,16 @@ public class CraftSlime extends CraftMob implements Slime, CraftEnemy {
this.getHandle().setSize(size, /* true */ getHandle().isAlive()); // Paper - fix dead slime setSize invincibility
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Slime getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Slime)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.Slime getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Slime) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSmallFireball.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSmallFireball.java
index 072df206858944ef78179b0a6d61ed990a844d2b..71625cc4e4b2fd3773baf1b2c1ea7e463b854ffa 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSmallFireball.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSmallFireball.java
@@ -8,8 +8,16 @@ public class CraftSmallFireball extends CraftSizedFireball implements SmallFireb
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.projectile.SmallFireball getHandleRaw() {
+ return (net.minecraft.world.entity.projectile.SmallFireball)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.projectile.SmallFireball getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.projectile.SmallFireball) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSniffer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSniffer.java
index 555337018fe218ac5a296a5e6a1d82720fee05e1..873b7e7a05b3465b79a82ed583ce16bb245ebcbf 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSniffer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSniffer.java
@@ -16,8 +16,16 @@ public class CraftSniffer extends CraftAnimals implements Sniffer {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.sniffer.Sniffer getHandleRaw() {
+ return (net.minecraft.world.entity.animal.sniffer.Sniffer)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.sniffer.Sniffer getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.sniffer.Sniffer) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowball.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowball.java
index d959825fd11a94aba175934cd7739544a23958fc..9f53ba11a2adabdebd70eee5a811fec7dccd7b10 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowball.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowball.java
@@ -8,8 +8,16 @@ public class CraftSnowball extends CraftThrowableProjectile implements Snowball
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.projectile.Snowball getHandleRaw() {
+ return (net.minecraft.world.entity.projectile.Snowball)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.projectile.Snowball getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.projectile.Snowball) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java
index 4ce2373ff71c3c1b8951646e057587a3ab09e145..6f88f18fc23cb793d4394b80201e40b09a0a7f9d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java
@@ -19,8 +19,16 @@ public class CraftSnowman extends CraftGolem implements Snowman, com.destroystok
this.getHandle().setPumpkin(!derpMode);
}
+ // Folia start - region threading
+ @Override
+ public SnowGolem getHandleRaw() {
+ return (SnowGolem)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public SnowGolem getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (SnowGolem) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSpectralArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSpectralArrow.java
index 70f1f8740091d5a3d5983227ef2e6e166bb6ce7e..4886c9ba4bf952415ee4b1395adfeca8d928cdf5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSpectralArrow.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSpectralArrow.java
@@ -9,8 +9,16 @@ public class CraftSpectralArrow extends CraftAbstractArrow implements SpectralAr
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.projectile.SpectralArrow getHandleRaw() {
+ return (net.minecraft.world.entity.projectile.SpectralArrow)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.projectile.SpectralArrow getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.projectile.SpectralArrow) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSpellcaster.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSpellcaster.java
index 525827f1747631fa108be7e1b7395b47d33aa397..3ec5d458a895300da462f63bae683980a741e477 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSpellcaster.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSpellcaster.java
@@ -12,8 +12,16 @@ public class CraftSpellcaster extends CraftIllager implements Spellcaster {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public SpellcasterIllager getHandleRaw() {
+ return (SpellcasterIllager)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public SpellcasterIllager getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (SpellcasterIllager) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSpider.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSpider.java
index b4afc37c21fc478df44fca7ec3fbc33d337dc6b7..bf3236f673118539d7cfb883bcdf84de7ae5bd73 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSpider.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSpider.java
@@ -9,8 +9,16 @@ public class CraftSpider extends CraftMonster implements Spider {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Spider getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Spider)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.Spider getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Spider) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSquid.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSquid.java
index a6e3b61c391a8b266d2b030d9ba600ac6be76952..abc26a620552659fbcfbcbb90a3fd203f995c46f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSquid.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSquid.java
@@ -9,8 +9,16 @@ public class CraftSquid extends CraftWaterMob implements Squid {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.Squid getHandleRaw() {
+ return (net.minecraft.world.entity.animal.Squid)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.Squid getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.Squid) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftStrider.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftStrider.java
index 9472a6f9c9584048abf1f8d11ab6254b7c7a287d..de8f656818192f35cca228724db3d17ede40b556 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftStrider.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftStrider.java
@@ -65,8 +65,16 @@ public class CraftStrider extends CraftAnimals implements Strider {
return Material.WARPED_FUNGUS_ON_A_STICK;
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Strider getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Strider)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.Strider getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Strider) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java
index dac3d34677688ac560bc1be2087a08479ef71b87..ec4ae01daa16139b4d2d42c3771eb51d00f55c0a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java
@@ -42,8 +42,16 @@ public class CraftTNTPrimed extends CraftEntity implements TNTPrimed {
this.getHandle().setFuse(fuseTicks);
}
+ // Folia start - region threading
+ @Override
+ public PrimedTnt getHandleRaw() {
+ return (PrimedTnt)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public PrimedTnt getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (PrimedTnt) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTadpole.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTadpole.java
index d7c6a0bbc5671ea8f2488230c94df5146a1e98b9..ea001c3e91478cde59eb6b7663013d43554e5fb5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTadpole.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTadpole.java
@@ -9,8 +9,16 @@ public class CraftTadpole extends CraftFish implements org.bukkit.entity.Tadpole
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public Tadpole getHandleRaw() {
+ return (Tadpole)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public Tadpole getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (Tadpole) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java
index cedb8e67e208cdf954d052a4f0a100c1c07a962b..8bf3936ad7a42a98a14e82fcabd238712e8532c8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java
@@ -12,8 +12,16 @@ public class CraftTameableAnimal extends CraftAnimals implements Tameable, Creat
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public TamableAnimal getHandleRaw() {
+ return (TamableAnimal)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public TamableAnimal getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (TamableAnimal) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTextDisplay.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTextDisplay.java
index 9ef939b76d06874b856e0c850addb364146f5a00..7dfed8c0be93bc2083ea40def6e2a806d336094e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTextDisplay.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTextDisplay.java
@@ -13,8 +13,16 @@ public class CraftTextDisplay extends CraftDisplay implements TextDisplay {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.Display.TextDisplay getHandleRaw() {
+ return (net.minecraft.world.entity.Display.TextDisplay)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.Display.TextDisplay getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.Display.TextDisplay) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrowableProjectile.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrowableProjectile.java
index bf7b111abdf42969218a3608d86a3313432bc0a0..b2b1b7ad56d0adc452b32a866fa0c6682fcd4882 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrowableProjectile.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrowableProjectile.java
@@ -26,8 +26,16 @@ public abstract class CraftThrowableProjectile extends CraftProjectile implement
this.getHandle().setItem(CraftItemStack.asNMSCopy(item));
}
+ // Folia start - region threading
+ @Override
+ public ThrowableItemProjectile getHandleRaw() {
+ return (ThrowableItemProjectile)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public ThrowableItemProjectile getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (ThrowableItemProjectile) this.entity;
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownExpBottle.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownExpBottle.java
index 5e7fef664c56d6087502e56a0eb4fc07d34ade9f..00d578700c09cab5b5ae99bcb27fa17048ac24b1 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownExpBottle.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownExpBottle.java
@@ -9,8 +9,16 @@ public class CraftThrownExpBottle extends CraftThrowableProjectile implements Th
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public ThrownExperienceBottle getHandleRaw() {
+ return (ThrownExperienceBottle)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public ThrownExperienceBottle getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (ThrownExperienceBottle) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java
index 65b6de9d21da6843d7c7087f0dea98d3b75f24cf..8988f2a1e3fe6a296c245e893ddb927da1d59167 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java
@@ -61,8 +61,17 @@ public class CraftThrownPotion extends CraftThrowableProjectile implements Throw
this.getHandle().splash(null);
}
// Paper end
+
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.projectile.ThrownPotion getHandleRaw() {
+ return (net.minecraft.world.entity.projectile.ThrownPotion)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.projectile.ThrownPotion getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.projectile.ThrownPotion) this.entity;
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTraderLlama.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTraderLlama.java
index 4b3a764114c8372e1549dadeeced26dc7727f2d1..b800efe68124c27f97114a69a096fca2d66e671e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTraderLlama.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTraderLlama.java
@@ -9,8 +9,16 @@ public class CraftTraderLlama extends CraftLlama implements TraderLlama {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.horse.TraderLlama getHandleRaw() {
+ return (net.minecraft.world.entity.animal.horse.TraderLlama)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.horse.TraderLlama getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.horse.TraderLlama) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java
index 4fc893378fb0568ddcffc7593d66df6bfe23f659..5ddc96b17ddbd152929b0548bfedc802bd6dd7ca 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java
@@ -12,8 +12,16 @@ public class CraftTrident extends CraftAbstractArrow implements Trident {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public ThrownTrident getHandleRaw() {
+ return (ThrownTrident)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public ThrownTrident getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (ThrownTrident) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTropicalFish.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTropicalFish.java
index 9e53c30801c700719c78c0fd521fd615c94e02c8..11884c20e73846ec95288edcb514d3ae638eb803 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTropicalFish.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTropicalFish.java
@@ -13,8 +13,16 @@ public class CraftTropicalFish extends io.papermc.paper.entity.PaperSchoolableFi
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.TropicalFish getHandleRaw() {
+ return (net.minecraft.world.entity.animal.TropicalFish)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.TropicalFish getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.TropicalFish) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java
index d44e6f4bb682d18c1497eee9fb2802f2bda6e840..a857258419c666a0fe38f54a6197d19c84891028 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java
@@ -9,8 +9,16 @@ public class CraftTurtle extends CraftAnimals implements Turtle {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.Turtle getHandleRaw() {
+ return (net.minecraft.world.entity.animal.Turtle)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.Turtle getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.Turtle) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java
index e9ec3455eabc473e104b5342a615a38c1ac25a4f..3a65ae7e6ac1894855e4eafecc9c2bb87476298f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java
@@ -13,8 +13,16 @@ public class CraftVex extends CraftMonster implements Vex {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Vex getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Vex)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.Vex getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Vex) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
index bd2987fa1fb194a581567134ed980e8fc043f435..46c4a33c4cb82049aa60fc7fc47707dcbd8c733e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
@@ -33,8 +33,16 @@ public class CraftVillager extends CraftAbstractVillager implements Villager {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.npc.Villager getHandleRaw() {
+ return (net.minecraft.world.entity.npc.Villager)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.npc.Villager getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.npc.Villager) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java
index 3aa23d9f22d5cd22231293fd7d1ca4cb79eb7cb3..e705d49eafcf1def6e849bfc0ded4b7269a40ffb 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java
@@ -14,8 +14,16 @@ public class CraftVillagerZombie extends CraftZombie implements ZombieVillager {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.ZombieVillager getHandleRaw() {
+ return (net.minecraft.world.entity.monster.ZombieVillager)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.ZombieVillager getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.ZombieVillager) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java
index bcd3370bc48520ea4bb53af25b892131d6ca0b33..8be282b028bc30056afc8852e8f47b287b238e73 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java
@@ -9,8 +9,16 @@ public class CraftVindicator extends CraftIllager implements Vindicator {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Vindicator getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Vindicator)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.Vindicator getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Vindicator) super.getHandle();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWanderingTrader.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWanderingTrader.java
index 3cceefa0d6278924a19641a49bdf16bcdacb2233..07d6b1296aeee0de3455380a8aeaedc8a9344735 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWanderingTrader.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWanderingTrader.java
@@ -9,8 +9,16 @@ public class CraftWanderingTrader extends CraftAbstractVillager implements Wande
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.npc.WanderingTrader getHandleRaw() {
+ return (net.minecraft.world.entity.npc.WanderingTrader)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.npc.WanderingTrader getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.npc.WanderingTrader) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWarden.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWarden.java
index c284eb96a1e330078076cbe61f0f6e2ff4ed89bd..a53dee61a4669ac9c1d051ad9f881230a186e92c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWarden.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWarden.java
@@ -15,8 +15,16 @@ public class CraftWarden extends CraftMonster implements org.bukkit.entity.Warde
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public Warden getHandleRaw() {
+ return (Warden)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public Warden getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (Warden) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWaterMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWaterMob.java
index 1b347deb6eb0b39c4a23936f7cd387421f06350d..4f26f0caca8a97d7770a569a65c1addaf6e9512c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWaterMob.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWaterMob.java
@@ -10,8 +10,16 @@ public class CraftWaterMob extends CraftCreature implements WaterMob {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public WaterAnimal getHandleRaw() {
+ return (WaterAnimal)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public WaterAnimal getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (WaterAnimal) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWindCharge.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWindCharge.java
index 46447b9651dc48181916ce1306ee5deec397be12..c26120711251a17b558a97ae0e20789d5c33b104 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWindCharge.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWindCharge.java
@@ -10,6 +10,7 @@ public class CraftWindCharge extends CraftAbstractWindCharge implements WindChar
@Override
public net.minecraft.world.entity.projectile.windcharge.WindCharge getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.projectile.windcharge.WindCharge) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java
index 4b3d783cabcb2de1a67d7fbfb6f525bfb493aed1..216c97fb1d611b84322927c6eb97871dd05cf600 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java
@@ -15,8 +15,16 @@ public class CraftWitch extends CraftRaider implements Witch, com.destroystokyo.
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Witch getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Witch)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.Witch getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Witch) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java
index 7881c6253c1d652c0c0d54a9a8accdf0a1ff0f3e..077b5685ccd1b5972ef92aa759ebabe5ec6d23c6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java
@@ -21,8 +21,16 @@ public class CraftWither extends CraftMonster implements Wither, com.destroystok
}
}
+ // Folia start - region threading
+ @Override
+ public WitherBoss getHandleRaw() {
+ return (WitherBoss)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public WitherBoss getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (WitherBoss) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitherSkull.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitherSkull.java
index bc978391255c9414e06ff393f2e6707d329d020a..8d436a1453c8a66422c2a735764273176a6a4545 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitherSkull.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitherSkull.java
@@ -18,8 +18,16 @@ public class CraftWitherSkull extends CraftFireball implements WitherSkull {
return this.getHandle().isDangerous();
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.projectile.WitherSkull getHandleRaw() {
+ return (net.minecraft.world.entity.projectile.WitherSkull)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.projectile.WitherSkull getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.projectile.WitherSkull) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java
index 86574da257731de7646a712ed73384955fe35aa3..94b699c156884c28c017b528d07f21c041b4ceb1 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java
@@ -31,8 +31,16 @@ public class CraftWolf extends CraftTameableAnimal implements Wolf {
}
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.animal.Wolf getHandleRaw() {
+ return (net.minecraft.world.entity.animal.Wolf)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.animal.Wolf getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.animal.Wolf) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftZoglin.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftZoglin.java
index c134c4bb8c0377ceb7f8a5c40c94fd6312a9e448..d334e4a3ea075670e0aa7ea1429ffe4231eb0559 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftZoglin.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftZoglin.java
@@ -19,8 +19,16 @@ public class CraftZoglin extends CraftMonster implements Zoglin {
this.getHandle().setBaby(flag);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Zoglin getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Zoglin)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.Zoglin getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Zoglin) this.entity;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java
index 46336111dcf62a29390e724b1879c84c697076e9..dbb43c825724c3f13171e8991d53e7d40899670d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java
@@ -12,8 +12,16 @@ public class CraftZombie extends CraftMonster implements Zombie {
super(server, entity);
}
+ // Folia start - region threading
+ @Override
+ public net.minecraft.world.entity.monster.Zombie getHandleRaw() {
+ return (net.minecraft.world.entity.monster.Zombie)this.entity;
+ }
+ // Folia end - region threading
+
@Override
public net.minecraft.world.entity.monster.Zombie getHandle() {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.entity, "Accessing entity state off owning region's thread"); // Folia - region threading
return (net.minecraft.world.entity.monster.Zombie) this.entity;
}