Skip to content

Commit

Permalink
Reset import
Browse files Browse the repository at this point in the history
  • Loading branch information
Lumine1909 committed Oct 28, 2024
1 parent 5686ff9 commit f8b6588
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions patches/server/0010-Fakeplayer-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -503,22 +503,14 @@ index b148cf247acdd36f856d0495cde4cc5ad32b5a2f..011d6c813781251c7f4041ad3a8396fb
private static final Logger LOGGER = LogUtils.getLogger();
private final File playerDir;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
index c9ecec5da937bc5458f69736b68ff6ae50aa5ebc..09c2e347e68f72fd00526b165156f2ca754d9ad3 100644
index c9ecec5da937bc5458f69736b68ff6ae50aa5ebc..decaea842c557adecb9d2d6e654376f0508721bd 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
@@ -58,6 +58,7 @@ import org.bukkit.entity.minecart.RideableMinecart;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionType;
+import org.leavesmc.leaves.entity.CraftBot;

public abstract class CraftRegionAccessor implements RegionAccessor {

@@ -428,6 +429,7 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
@@ -428,6 +428,7 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
@SuppressWarnings("unchecked")
public <T extends Entity> T addEntity(T entity) {
Preconditions.checkArgument(!entity.isInWorld(), "Entity has already been added to a world");
+ Preconditions.checkState(!(entity instanceof CraftBot), "[Leaves] Fakeplayers do not support changing world, Please use leaves fakeplayer-api instead!");
+ Preconditions.checkState(!(entity instanceof org.leavesmc.leaves.entity.CraftBot), "[Leaves] Fakeplayers do not support changing world, Please use leaves fakeplayer-api instead!");
net.minecraft.world.entity.Entity nmsEntity = ((CraftEntity) entity).getHandle();
if (nmsEntity.level() != this.getHandle().getLevel()) {
nmsEntity = nmsEntity.changeDimension(new DimensionTransition(this.getHandle().getLevel(), nmsEntity, DimensionTransition.DO_NOTHING));
Expand Down

0 comments on commit f8b6588

Please sign in to comment.