Turrets
Turrets
Automatic turrets for Bukkit servers (cleverly disguised as minecarts!)
I moved the project into Beta as there have been more people downloading and, I'm assuming, testing it, with no major issues. There is a lot going on in this plugin, and little changes can have far reaching consequences, let alone big changes, so I still won't stake my name on saying it absolutely won't mess anything on your server up. Please report any problems you have!
Currently working on: DisguiseCraft support. Give me your ideas on what you'd want from this :)
Details: I'm hooked into DisguiseCraft, just need ideas for what kind of features are desirable!
Download
I'll try and keep this up-to-date. If all goes as planned, this version should be the same or newer than the one linked to this BukkitDev entry.
A Jenkins job has been created to house dev builds. You can access it here!
v0.2.3a - Manual turret control!
For those of you antsy about getting a version for 1.4.4, here's an unofficial 1.4.4 dev build.
Link Removed: http://www.mediafire.com/download.php?85saz80idpsafef
Building turrets is easy: Just place a fence post, then right click with a minecart on top. It's so easy, even a guest could do it! (That's why Turrets has permissions support.)
Make sure you attach an ammo chest to the turret (see command page) or set turrets to have unlimited ammo (see config page).
Breaking turrets is also easy: Just left-click it until it breaks, just like a minecart.
Features
- Turrets target hostile mobs
- Turrets will avoid shooting through walls
- Turrets use ammo chests (configurable).
- Turrets are upgradable!
- Upgrade a turret by replacing the block under its fence post: iron -> gold -> diamond
- Better turrets can shoot faster, farther, more accurately
- Firing speed, range, and accuracy can be changed in the configuration
- Turrets are breakable! (With permissions, of course)
Possible future features
Commands
Permission Nodes
Also, thanks to damnnicholas for his YouTube video explaining the plugin.
Nice Work.
i cant find anyone else asking this, or find a page where it is said. if it does im sorry. anyway, when will it be for 1.6.2?
it also sometimes says:
2013-07-13 16:08:04 [SEVERE] Could not pass event PlayerInteractEvent to Turrets v0.2.6
org.bukkit.event.EventException
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427)
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462)
at org.bukkit.craftbukkit.v1_5_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:190)
at net.minecraft.server.v1_5_R3.PlayerInteractManager.interact(PlayerInteractManager.java:370)
at net.minecraft.server.v1_5_R3.PlayerConnection.a(PlayerConnection.java:637)
at net.minecraft.server.v1_5_R3.Packet15Place.handle(SourceFile:58)
at net.minecraft.server.v1_5_R3.NetworkManager.b(NetworkManager.java:292)
at net.minecraft.server.v1_5_R3.PlayerConnection.d(PlayerConnection.java:115)
at net.minecraft.server.v1_5_R3.ServerConnection.b(SourceFile:35)
at net.minecraft.server.v1_5_R3.DedicatedServerConnection.b(SourceFile:30)
at net.minecraft.server.v1_5_R3.MinecraftServer.r(MinecraftServer.java:581)
at net.minecraft.server.v1_5_R3.DedicatedServer.r(DedicatedServer.java:226)
at net.minecraft.server.v1_5_R3.MinecraftServer.q(MinecraftServer.java:477)
at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:410)
at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573)
Caused by: java.lang.NullPointerException
at me.azazad.turrets.TurretsListener.onPlayerInteract(TurretsListener.java:196)
at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425)
... 16 more
whenever I restart the server, it wipes the config and turret files :/ any fix for this?it also displays the error message: 2013-07-13 11:42:15 [INFO] [Turrets] Enabling Turrets v0.2.6 2013-07-13 11:42:15 [INFO] [Turrets] Config file loaded. 2013-07-13 11:42:15 [SEVERE] Error occurred while enabling Turrets v0.2.6 (Is it up to date?) java.lang.NullPointerException at me.azazad.turrets.nms.EntityRotatingTurret.<init>(EntityRotatingTurret.java:68) at me.azazad.turrets.Turret.<init>(Turret.java:40) at me.azazad.turrets.persistence.YAMLTurretDatabase.loadTurrets(YAMLTurretDatabase.java:65) at me.azazad.turrets.TurretsPlugin.loadAndSpawnTurrets(TurretsPlugin.java:282) at me.azazad.turrets.TurretsPlugin.onEnable(TurretsPlugin.java:133) 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:381) at org.bukkit.craftbukkit.v1_5_R3.CraftServer.loadPlugin(CraftServer.java:282) at org.bukkit.craftbukkit.v1_5_R3.CraftServer.enablePlugins(CraftServer.java:264) at net.minecraft.server.v1_5_R3.MinecraftServer.j(MinecraftServer.java:304) at net.minecraft.server.v1_5_R3.MinecraftServer.e(MinecraftServer.java:283) at net.minecraft.server.v1_5_R3.MinecraftServer.a(MinecraftServer.java:243) at net.minecraft.server.v1_5_R3.DedicatedServer.init(DedicatedServer.java:151) at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:382) at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573) Then all the turrets are gone.
Can you get it updated to 1.6.1 at your earliest convenience? Preferably before you worry about Fac. 2.0 as established servers have a bit of work ahead of them to upgrade to that anyway. Thanks.
@Devil_Boy
Factions code was for the now defunct factions 1.8. Factions have recoded completely and have this will not work for factions 2.0+ :/
When i get a moment i'll see if i can get it ported over to Factions 2.0 - they do have developers documentation now!
@Larskei
This means you need to update your Java to JRE 7.
i keep getting this error report PLZ HELP! [SEVERE] Could not load 'plugins/Turrets.jar' in folder 'plugins' org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: me/azazad/turrets/TurretsPlugin : Unsupported major.minor version 51.0 at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:184) at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:305) at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:230) at org.bukkit.craftbukkit.v1_5_R3.CraftServer.loadPlugins(CraftServer.java:239) at org.bukkit.craftbukkit.v1_5_R3.CraftServer.<init>(CraftServer.java:217) at net.minecraft.server.v1_5_R3.PlayerList.<init>(PlayerList.java:55) at net.minecraft.server.v1_5_R3.DedicatedPlayerList.<init>(SourceFile:11) at net.minecraft.server.v1_5_R3.DedicatedServer.init(DedicatedServer.java:106) at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:382) at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573) Caused by: java.lang.UnsupportedClassVersionError: me/azazad/turrets/TurretsPlugin : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader.java:80) at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:53) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:249) at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:173)
What about strength of turret (Instant Kill...) and hopefully making it easier to change accuracy and range instead of going through the config, also from far away it's not accurate whatsoever. Doesn't use any form of logic when trying to shoot. (Doesn't till up to go farther etc.)
Idea: For the disguisecraft support the turrets could be a wither and the heads would be were the arrows are shot from.
Been seeing this error a lot. Any Ideas?
2013-06-21 21:45:24 [SEVERE] Could not pass event VehicleDestroyEvent to Turrets v0.2.6 org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:30) at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:478) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:463) at net.minecraft.server.v1_5_R3.EntityMinecartAbstract.damageEntity(EntityMinecartAbstract.java:143) at me.azazad.turrets.nms.EntityRotatingTurret.damageEntity(EntityRotatingTurret.java:89) at net.minecraft.server.v1_5_R3.EntityHuman.attack(EntityHuman.java:874) at net.minecraft.server.v1_5_R3.PlayerConnection.a(PlayerConnection.java:1124) at net.minecraft.server.v1_5_R3.Packet7UseEntity.handle(SourceFile:36) at org.spigotmc.netty.NettyNetworkManager.b(NettyNetworkManager.java:215) at net.minecraft.server.v1_5_R3.PlayerConnection.d(PlayerConnection.java:115) at net.minecraft.server.v1_5_R3.ServerConnection.b(SourceFile:35) at org.spigotmc.MultiplexingServerConnection.b(MultiplexingServerConnection.java:72) at net.minecraft.server.v1_5_R3.MinecraftServer.r(MinecraftServer.java:583) at net.minecraft.server.v1_5_R3.DedicatedServer.r(DedicatedServer.java:227) at net.minecraft.server.v1_5_R3.MinecraftServer.q(MinecraftServer.java:472) at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:404) at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573) Caused by: java.lang.NullPointerException at me.azazad.turrets.TurretsListener.onVehicleDestroy(TurretsListener.java:286) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425) ... 18 more
May I have the source code?
we would like to make a turret that works with preset teams. So your turret wouldn't aim at your team. It has to pick the preset teams from our pvparena plugin.
is there any way you can hook this up to iconomy or any of such economy plugin, so that a person can pay to use this or build it?
@TheMikeness
Thing is, the Factions support code was made by SableDNah, so I don't know how it works :x
Perhaps you'll want to try different versions of Factions?
@Devil_Boy
I think I am using the currently accepted beta build; which is 1.5.2-r0.1 build 2771
@TheMikeness
That's a new exception O.o
What CraftBukkit version are you using?
I'm getting a crash with Turrets 0.2.6 when used with bukkit 1.5.2 and both Factions 1.6.x or 1.8.x when I create a turret, and the existing turrets will not initialize at all it seems, is there anything obvious that I'm doing wrong (note: it goes away if I remove Factions)?
Crash message:
2013-06-02 20:56:15 [SEVERE] net.minecraft.server.v1_5_R3.ReportedException: Ticking entity 2013-06-02 20:56:15 [SEVERE] at net.minecraft.server.v1_5_R3.MinecraftServer.r(MinecraftServer.java:567) 2013-06-02 20:56:15 [SEVERE] at net.minecraft.server.v1_5_R3.DedicatedServer.r(DedicatedServer.java:226) 2013-06-02 20:56:15 [SEVERE] at net.minecraft.server.v1_5_R3.MinecraftServer.q(MinecraftServer.java:477) 2013-06-02 20:56:15 [SEVERE] at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:410) 2013-06-02 20:56:15 [SEVERE] at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573) 2013-06-02 20:56:15 [SEVERE] Caused by: java.lang.NullPointerException 2013-06-02 20:56:15 [SEVERE] at com.massivecraft.factions.zcore.persist.PlayerEntityCollection.get(PlayerEntityCollection.java:33) 2013-06-02 20:56:15 [SEVERE] at me.azazad.bukkit.util.FactionsUtil.factionsCheck(FactionsUtil.java:14) 2013-06-02 20:56:15 [SEVERE] at me.azazad.turrets.nms.EntityRotatingTurret.filterTargets(EntityRotatingTurret.java:350) 2013-06-02 20:56:15 [SEVERE] at me.azazad.turrets.nms.EntityRotatingTurret.findTarget(EntityRotatingTurret.java:322) 2013-06-02 20:56:15 [SEVERE] at me.azazad.turrets.nms.EntityRotatingTurret.l_(EntityRotatingTurret.java:153) 2013-06-02 20:56:15 [SEVERE] at net.minecraft.server.v1_5_R3.World.entityJoinedWorld(World.java:1355) 2013-06-02 20:56:15 [SEVERE] at net.minecraft.server.v1_5_R3.WorldServer.entityJoinedWorld(WorldServer.java:614) 2013-06-02 20:56:15 [SEVERE] at net.minecraft.server.v1_5_R3.World.playerJoinedWorld(World.java:1336) 2013-06-02 20:56:15 [SEVERE] at net.minecraft.server.v1_5_R3.World.tickEntities(World.java:1224) 2013-06-02 20:56:15 [SEVERE] at net.minecraft.server.v1_5_R3.WorldServer.tickEntities(WorldServer.java:480) 2013-06-02 20:56:15 [SEVERE] at net.minecraft.server.v1_5_R3.MinecraftServer.r(MinecraftServer.java:563) 2013-06-02 20:56:15 [SEVERE] ... 4 more 2013-06-02 20:56:15 [SEVERE] Encountered an unexpected exception ReportedException net.minecraft.server.v1_5_R3.ReportedException: Ticking entity at net.minecraft.server.v1_5_R3.MinecraftServer.r(MinecraftServer.java:567) at net.minecraft.server.v1_5_R3.DedicatedServer.r(DedicatedServer.java:226) at net.minecraft.server.v1_5_R3.MinecraftServer.q(MinecraftServer.java:477) at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:410) at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573) Caused by: java.lang.NullPointerException at com.massivecraft.factions.zcore.persist.PlayerEntityCollection.get(PlayerEntityCollection.java:33) at me.azazad.bukkit.util.FactionsUtil.factionsCheck(FactionsUtil.java:14) at me.azazad.turrets.nms.EntityRotatingTurret.filterTargets(EntityRotatingTurret.java:350) at me.azazad.turrets.nms.EntityRotatingTurret.findTarget(EntityRotatingTurret.java:322) at me.azazad.turrets.nms.EntityRotatingTurret.l_(EntityRotatingTurret.java:153) at net.minecraft.server.v1_5_R3.World.entityJoinedWorld(World.java:1355) at net.minecraft.server.v1_5_R3.WorldServer.entityJoinedWorld(WorldServer.java:614) at net.minecraft.server.v1_5_R3.World.playerJoinedWorld(World.java:1336) at net.minecraft.server.v1_5_R3.World.tickEntities(World.java:1224) at net.minecraft.server.v1_5_R3.WorldServer.tickEntities(WorldServer.java:480) at net.minecraft.server.v1_5_R3.MinecraftServer.r(MinecraftServer.java:563) ... 4 more
Could turrets be configured to attack players from enemy factions? The "owner" faction of the turret could be determined by who owns the chunk it is in, making it ideal for protection faction lands.
I also want to stash these all over inside my TARDIS. Should an enemy get inside of her, I want them dead and fast.
I have found a few bugs, When you shoot an arrow at the turret it says turret destroyed and crashed the server. Another instance was when I did the pvp player command that to crashed the server. When the server recovered the turrets were missing even after I saved it. I do love the Idea and the work you have done so far :D Keep up the good work!!
@Lightning533
They do despawn on chunk unload. I have a couple work arounds:
set a command block with a day light sensor, which reloads the turrets everyday.
Or
Just give everyone the /turrets reload command and let them do it.