Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-7937

Enabling minecart_improvements and spawning a minecart causes a hang

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • None
    • None
    • This server is running CraftBukkit version 4361-Spigot-5eb8a94-6029040 (MC: 1.21.3) (Implementing API version 1.21.3-R0.1-SNAPSHOT)
    • Yes

      "initial-enabled-packs=minecart_improvements,update_1_21,vanilla" was set in server.properties to enable the minecart speed gamerule.

      However, spawning a minecart via limitedregion seems to cause the server to hang. 

      Attached is a world generator plugin that will spawn a flat world with one minecart at random positions in every chunk (spawned via limitedregion).

      This is the code that spawns the minecart

      	@Override
      	public void populate(WorldInfo worldInfo, Random random, int chunkX, int chunkZ, LimitedRegion limitedRegion) {
      
      		int rawRandomX = chunkX*16 + random.nextInt(16);
      		int rawRandomZ = chunkZ*16 + random.nextInt(16);
      		
      		int y = getHighestGrassBlock(worldInfo, limitedRegion, rawRandomX, rawRandomZ);
      		if(y <= worldInfo.getMinHeight()) return;
      		
              limitedRegion.spawnEntity(
                      new Location(Bukkit.getWorld(worldInfo.getName()), rawRandomX + 0.5f, y + 1.5f, rawRandomZ + 0.5f),
                      EntityType.MINECART
              );
      	}
      

       

       

            Unassigned Unassigned
            leothepro555@gmail.com Hex_27
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: