Coder Social home page Coder Social logo

xginko / villageroptimizer Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 4.0 546 KB

Save server resources by letting players disable their villager's AI

Home Page: https://modrinth.com/plugin/villageroptimizer

Java 100.00%
folia-supported minecraft-folia-plugin minecraft-paper-plugin minecraft-plugin optimization utility-plugin villagers anti-villager-lag villager-lag villager-plugin

villageroptimizer's Introduction

  • ๐ŸŒŠ I'm Ginko
  • ๐ŸŒฑ Iโ€™m currently learning Java.
  • ๐ŸŽง I love jazz and electronic music
  • ๐Ÿ“ซ Discord: xginko

villageroptimizer's People

Contributors

bonn2 avatar jd07159 avatar xginko avatar xiaoyueyoqwq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

villageroptimizer's Issues

1.21 Villager Enum Changes

As of the latest builds of paper and spigot Villager types and profession enums are no longer enums and are instead constants of their interface.

KennyTV
Plugin Developer An upstream update was just merged that moves cat and frog variants, map cursor types, and villager types+profession from enums to constants of an interface. There are basic compatibility measures in place, so you only need to do something now if:
you put any of these into an EnumMap/EnumSet or work on them with switch statements (make sure you also remove such use of them for similar type enums โ—),
you are using Paper-plugins (with the paper-plugin.yml), being exempt from the compatibility code, or
you are disabling plugin rewriting via the startup flag.
Going beyond this, please especially make sure you move away from Material.values() calls and instead get them via the Registry API (or the upstream compatible one)

Quote from the paper discord

It seems that whatever compatibility mitigations they tried to implement do not work for VillagerOptimizer as it now produces several Badtype on operand stack errors on startup.
Trimmed Error:

[16:44:32 ERROR]: [VillagerOptimizer] Failed initialising module 'OptimizeByWorkstation'.
java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    me/xginko/villageroptimizer/modules/optimization/OptimizeByWorkstation.lambda$onBlockPlace$2(Ljava/util/concurrent/atomic/AtomicBoolean;Ljava/util/concurrent/atomic/AtomicInteger;Lorg/bukkit/Location;Lorg/bukkit/entity/Villager$Profession;Lorg/bukkit/entity/Player;Lorg/bukkit/event/block/BlockPlaceEvent;Lorg/bukkit/block/Block;Lme/xginko/villageroptimizer/libs/morepaperlib/scheduling/ScheduledTask;)V @336: invokestatic
  Reason:
    Type 'org/bukkit/entity/Villager$Profession' (current frame, stack[1]) is not assignable to 'java/lang/Enum'

The workaround I have found for now is not update paper past paper-1.21-89. Which is still available on their Builds Explorer

Villagers sometimes disapper

Villagers sometimes disappear, but i'm not sure that's your issue

Also I have this error in logs, probably related:

[11:45:39] [Region Scheduler Thread #3/ERROR]: [ca.spottedleaf.moonrise.common.util.TickThread] Thread Region Scheduler Thread #3 failed main thread check: Accessing poi chunk off-main
java.lang.Throwable: null
at ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(TickThread.java:51) ~[folia-1.21.jar:1.21-DEV-177c892]
at net.minecraft.world.entity.ai.village.poi.PoiManager.getOrLoad(PoiManager.java:90) ~[folia-1.21.jar:1.21-DEV-177c892]
at net.minecraft.world.entity.ai.village.poi.PoiManager.exists(PoiManager.java:350) ~[folia-1.21.jar:1.21-DEV-177c892]
at net.minecraft.world.entity.ai.behavior.GoToPotentialJobSite.lambda$stop$2(GoToPotentialJobSite.java:52) ~[folia-1.21.jar:1.21-DEV-177c892]
at java.base/java.util.Optional.ifPresent(Optional.java:178) ~[?:?]
at net.minecraft.world.entity.ai.behavior.GoToPotentialJobSite.stop(GoToPotentialJobSite.java:47) ~[folia-1.21.jar:1.21-DEV-177c892]
at net.minecraft.world.entity.ai.behavior.GoToPotentialJobSite.stop(GoToPotentialJobSite.java:20) ~[folia-1.21.jar:1.21-DEV-177c892]
at net.minecraft.world.entity.ai.behavior.Behavior.doStop(Behavior.java:91) ~[folia-1.21.jar:1.21-DEV-177c892]
at net.minecraft.world.entity.ai.behavior.Behavior.tickOrStop(Behavior.java:80) ~[folia-1.21.jar:1.21-DEV-177c892]
at net.minecraft.world.entity.ai.Brain.tickEachRunningBehavior(Brain.java:463) ~[folia-1.21.jar:1.21-DEV-177c892]
at net.minecraft.world.entity.ai.Brain.tick(Brain.java:404) ~[folia-1.21.jar:1.21-DEV-177c892]
at net.minecraft.world.entity.npc.Villager.customServerAiStep(Villager.java:258) ~[folia-1.21.jar:1.21-DEV-177c892]
at net.minecraft.world.entity.npc.Villager.customServerAiStep(Villager.java:253) ~[folia-1.21.jar:1.21-DEV-177c892]
at net.minecraft.world.entity.Mob.serverAiStep(Mob.java:966) ~[folia-1.21.jar:1.21-DEV-177c892]
at net.minecraft.world.entity.LivingEntity.aiStep(LivingEntity.java:3489) ~[folia-1.21.jar:1.21-DEV-177c892]
at net.minecraft.world.entity.Mob.aiStep(Mob.java:698) ~[folia-1.21.jar:1.21-DEV-177c892]
at net.minecraft.world.entity.AgeableMob.aiStep(AgeableMob.java:155) ~[folia-1.21.jar:1.21-DEV-177c892]
at net.minecraft.world.entity.LivingEntity.tick(LivingEntity.java:3192) ~[folia-1.21.jar:1.21-DEV-177c892]
at net.minecraft.world.entity.Mob.tick(Mob.java:465) ~[folia-1.21.jar:1.21-DEV-177c892]
at net.minecraft.world.entity.npc.Villager.tick(Villager.java:300) ~[folia-1.21.jar:1.21-DEV-177c892]
at net.minecraft.world.entity.Entity.rideTick(Entity.java:2985) ~[folia-1.21.jar:1.21-DEV-177c892]
at net.minecraft.world.entity.LivingEntity.rideTick(LivingEntity.java:3745) ~[folia-1.21.jar:1.21-DEV-177c892]
at net.minecraft.server.level.ServerLevel.tickPassenger(ServerLevel.java:1446) ~[folia-1.21.jar:1.21-DEV-177c892]
at net.minecraft.server.level.ServerLevel.tickNonPassenger(ServerLevel.java:1411) ~[folia-1.21.jar:1.21-DEV-177c892]

Folia: 177c892
VillagerOptimizer: 1.6.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.