andrepl / BuildInABox

Carry prefab buildings in enderchests.
3 stars 6 forks source link

Boxes turn to enderchests after server restarts #2

Closed Chakyl closed 11 years ago

Chakyl commented 11 years ago

Whenever the server is restarted, all the biabs' turn into normal enderchests. The only way to fix it is to use /reload, but that shouldn't be necessary. On top of that, some of the biabs' still are enderchests after /reload. Here is the error upon starting the server:

2013-05-29 20:21:29 [INFO] [BuildInABox] Enabling BuildInABox v0.1.6 2013-05-29 20:21:29 [SEVERE] Error occurred while enabling BuildInABox v0.1.6 (Is it up to date?) java.lang.NullPointerException at org.bukkit.Location.getBlock(Location.java:82) at com.norcode.bukkit.buildinabox.BuildChest.getBlock(BuildChest.java:126) at com.norcode.bukkit.buildinabox.BuildInABox.initializeDataStore(BuildInABox.java:262) at com.norcode.bukkit.buildinabox.BuildInABox.onEnable(BuildInABox.java:92) at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217) at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:457) at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:383) at org.bukkit.craftbukkit.v1_5_R3.CraftServer.loadPlugin(CraftServer.java:306) at org.bukkit.craftbukkit.v1_5_R3.CraftServer.enablePlugins(CraftServer.java:288) at net.minecraft.server.v1_5_R3.MinecraftServer.j(MinecraftServer.java:310) at net.minecraft.server.v1_5_R3.MinecraftServer.e(MinecraftServer.java:289) at net.minecraft.server.v1_5_R3.MinecraftServer.a(MinecraftServer.java:249) at net.minecraft.server.v1_5_R3.DedicatedServer.init(DedicatedServer.java:149) at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:388) at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573)

Also, my plugins: Plugins (35): TimTheEnchanter, SkyDiver, GroupManager, WorldEdit, TagAPI, ItemTagger, EasyJetpack, Vault, CombatTag, Grapple, uCars, WorldGuard, RealisticTNT, Shopkeepers, ServerHub, Permissions, PrettySigns, ChestBank, CrackShot, MicroJump, VariableTriggers, ScheduledAnnouncer2, BuildInABox, FirstJoinPlus, Votifier, GAListener, Essentials, CityWorld, ServerSigns, EssentialsSpawn, Multiverse-Core, EssentialsChat, Factions, rMessages, BattleTags

andrepl commented 11 years ago

Thanks for the report, I'm looking into it now. at first glance I suspect its caused by buildings in an unloaded world trying to be initialized on server startup. shouldn't be too difficult to fix, I'll try to have a development build to test in a couple hours.

andrepl commented 11 years ago

actually 2 possibilities. maybe you can help narrow it down, is there any possibility that a world or chunk/region file was deleted?

the other option is that it just doesn't play nicely with multiverse yet (the world isn't loaded on startup) which still shouldn't be a big deal to fix.

andrepl commented 11 years ago

http://mcgitlab.norcode.com:8081/job/BuildInABox/84/com.norcode.bukkit.buildinabox$BuildInABox/

See if this build fixes your problem please

Chakyl commented 11 years ago

Sorry for the late response- No dice, biab's still require /reload to work correctly.

andrepl commented 11 years ago

Ok I installed multiverse and did some testing, I think I have the problem figured out but it'll take some time to finish, I'll post another dev asap.

andrepl commented 11 years ago

Okay, this one works for me:

http://mcgitlab.norcode.com:8081/job/BuildInABox/99/com.norcode.bukkit.buildinabox$BuildInABox/

Chakyl commented 11 years ago

Working perfectly now, thanks.

andrepl commented 11 years ago

WOO!

Chakyl commented 11 years ago

Take back that "WOO!" restarting the server after the first time installing made it work, but after the second time restarting it went back to its evil ways. I tested this twice.

Error again:

2013-06-02 02:44:09 [INFO] [BuildInABox] Enabling BuildInABox v0.1.5 2013-06-02 02:44:09 [SEVERE] Error occurred while enabling BuildInABox v0.1.5 (Is it up to date?) java.lang.NullPointerException at org.bukkit.Location.getBlock(Location.java:82) at com.norcode.bukkit.buildinabox.BuildChest.getBlock(BuildChest.java:123) at com.norcode.bukkit.buildinabox.BuildInABox.initializeDataStore(BuildInABox.java:219) at com.norcode.bukkit.buildinabox.BuildInABox.onEnable(BuildInABox.java:79) at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217) at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:457) at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:383) at org.bukkit.craftbukkit.v1_5_R3.CraftServer.loadPlugin(CraftServer.java:306) at org.bukkit.craftbukkit.v1_5_R3.CraftServer.enablePlugins(CraftServer.java:288) at net.minecraft.server.v1_5_R3.MinecraftServer.j(MinecraftServer.java:310) at net.minecraft.server.v1_5_R3.MinecraftServer.e(MinecraftServer.java:289) at net.minecraft.server.v1_5_R3.MinecraftServer.a(MinecraftServer.java:249) at net.minecraft.server.v1_5_R3.DedicatedServer.init(DedicatedServer.java:149) at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:388) at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573)

andrepl commented 11 years ago

2013-06-02 02:44:09 [INFO] [BuildInABox] Enabling BuildInABox v0.1.5 2013-06-02 02:44:09 [SEVERE] Error occurred while enabling BuildInABox v0.1.5 (Is it up to date?)

You reverted to an old version somehow in between... should be 0.2.0-SNAPSHOT

if you have 2 copies of the plugin with different filenames the server may be randomly choosing one to load at startup.

Chakyl commented 11 years ago

I don't know why that's happening, I swear it's 2.0 http://i.imgur.com/wqEwUEt.jpg

Chakyl commented 11 years ago

I just tried an install on my other server (Running Bungeecord). Same thing happened, but no error.

07:06:35 [INFO] Plugins (34): TimTheEnchanter, bPermissions, WorldEdit, EssentialPads, CommandBook, Vault, pvpstats, Multiverse-Core, BananaChunk, Grapple, WorldGuard, bChatManager, ServerHub, SurvivalGames, CoreProtect, Chester, PrettySigns, CrackShot, MicroJump, VariableTriggers, ScheduledAnnouncer2, ProtocolLib, FirstJoinPlus, mwParkour2, Fe, rMessages, ServerSigns, HeavySpleef, TagAPI, NameTags, Paintball, ItemRenamer, pvparena, BKCommonLib

Chakyl commented 11 years ago

Ok, finally figured it out. It turns out auto-updating was breaking the plugin, so I turned that off in the configuration. Now the plugin loads up 2.0 fine every time I restart. That being said, these glitches (Not really game breaking) are present:

Other than those two, everything is in tip-top shape.

andrepl commented 11 years ago

The auto-updater was my first hunch, but I wasn't able to reproduce the problem. It wasn't updating while running a -SNAPSHOT build (intended behaviour). I also did a (admittedly quick) test of compatibility between 0.1.5 and 0.2.0 builds and again, I didn't have a problem but I'll set up a more extensive test.

SonarBeserk commented 11 years ago

Still happening as of build 110

andrepl commented 11 years ago

@SonarBeserk What exactly is still happening? The build-animation settings should be fixed now, as should the original ticket issue. The only thing I know of that is still happening here is the blocks from 0.1.5 being breakable after upgrading to 0.2.0.

SonarBeserk commented 11 years ago

the biab chests dont seem to be saved properly on shutdown. they arnt recognized as biab chests on restart.

andrepl commented 11 years ago

Are there any console errors? can you reproduce it consistently every time? everything is surviving restarts just fine on my end. a startup log of the failed restart with debug: true would be helpful

SonarBeserk commented 11 years ago

I dont see any debug about saving the chests or anything, nor information about loading them on startup.

andrepl commented 11 years ago

http://mcgitlab.norcode.com:8081/job/BuildInABox/111/com.norcode.bukkit.buildinabox$BuildInABox/ This build adds a lot of debugging on startup, it should help track down the problem.

SonarBeserk commented 11 years ago

chests seem to be being found but are still not loaded as BIAB chests.

SonarBeserk commented 11 years ago

my chests.yml http://pastie.org/8002216

startup output

5:07:18 PM [INFO] [BuildInABox] Loading chest: 1 5:07:18 PM [INFO] [BuildInABox] ... id 1 5:07:18 PM [INFO] [BuildInABox] ... location: world;279;62;302

andrepl commented 11 years ago

is this still an issue?

SonarBeserk commented 11 years ago

Still an issue. have you double checked you are loading the location the same way you save it?

andrepl commented 11 years ago

I have tested it with your 'awesome' schematic with 2 enderchests as well as a few of my own, and I can't reproduce this problem, all buildings are fully functional when my server restarts... I'm going to need to need more information to reproduce the issue locally.

as well as any other out-of-the-ordinary details you can provide. for example,

it's not a simple case of biab's not loading, because they are in every test i've thrown at them, there is something amiss.

SonarBeserk commented 11 years ago

config.yml http://pastie.org/8006066 server.log http://pastie.org/8006073 chests.yml http://pastie.org/8006075 plans.yml http://pastie.org/8006080

schematics https://www.dropbox.com/s/t7q2beluuezl7f1/schematics.zip

the chest is not recognized on restart, the builds stop being protected. i am running build 117

the chest is in the main world. no multiverse, the autoupdater is off.

msg me on the irc if you wish to borrow use of my test server.

andrepl commented 11 years ago

2013-06-04 14:51:01 [SEVERE] [BuildInABox] Plugin BuildInABox v0.2.0-SNAPSHOT has failed to register events for class com.norcode.bukkit.buildinabox.BuildInABox because net/milkbowl/vault/economy/Economy does not exist.

Does installing vault fix the issue? possibly vault + an economy plugin.

andrepl commented 11 years ago

It was an issue with the plugin load order I think. Build 118 should fix it.

SonarBeserk commented 11 years ago

fixed as of 120.

Chakyl commented 11 years ago

Using build #130, they still turn to enderchests on restarts. Even /reload doesn't fix the problem. Error:

0:56:59 [SEVERE] Error occurred while enabling BuildInABox v0.2.1-SNAPSHOT (Is it up to date?) java.lang.NullPointerException at com.norcode.bukkit.buildinabox.BuildChest.protectBlocks(BuildChest.java:220) at com.norcode.bukkit.buildinabox.datastore.YamlDataStore.loadChests(YamlDataStore.java:110) at com.norcode.bukkit.buildinabox.datastore.YamlDataStore.load(YamlDataStore.java:131) at com.norcode.bukkit.buildinabox.BuildInABox.initializeDataStore(BuildInABox.java:267) at com.norcode.bukkit.buildinabox.BuildInABox.onEnable(BuildInABox.java:86) at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217) at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:457) at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:383) at org.bukkit.craftbukkit.v1_5_R3.CraftServer.loadPlugin(CraftServer.java:306) at org.bukkit.craftbukkit.v1_5_R3.CraftServer.enablePlugins(CraftServer.java:288) at net.minecraft.server.v1_5_R3.MinecraftServer.j(MinecraftServer.java:310) at net.minecraft.server.v1_5_R3.MinecraftServer.e(MinecraftServer.java:289) at net.minecraft.server.v1_5_R3.MinecraftServer.a(MinecraftServer.java:249) at net.minecraft.server.v1_5_R3.DedicatedServer.init(DedicatedServer.java:149) at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:388) at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573)

andrepl commented 11 years ago

I assume this is the same installation that the previous errors came from? have you (or are you able to) just delete the BIAB data and start fresh? The problem right now is that you have a BIAB in your world somewhere which refers to a BuildingPlan which doesn't exist in your plans.yml anymore. I'm going to upload a new release which will clean up the problem records, but there are going to be a few biab's in your world that don't work anymore. an unfortunate side effect of early adoption, sorry :(

Chakyl commented 11 years ago

Thanks, it seems to be working now. I don't really mind the missing BIABs; my players understand that the gamemode is in Beta/Alpha, so glitches do happen.