EnergyCraft
EnergyCraft
Downloads:
Newest Version: 1.3.0 Beta | CB1.5.1-R0.1 Compatible!
EnergyCraft Reloaded by R_Shadowhand: Download Here
Description
Do you have tons of random things in your chests that are just taking up room?
This plugin solves that!
Now you can turn your useless cobblestone into diamonds with an "energy condenser".
Why Should I use it?
Although Equivalent Exchange has an Energy Condenser (not anymore), and is included in the tekkit pack, many people would prefer to be able to use such a feature without requiring client-side mods. This plugin will allow a server to have this feature, without any extra requirements, because it will only utilize vanilla blocks/graphics. While some people will flame this for directly copying EE, I disagree. EE requires client mods, whether single or multi-player. This plugin does not claim to be superior to EE, since many features are not implemented. It is simply an alternate that will work just fine in vanilla minecraft.
Features
- Use vanilla blocks to build a Equivalent Exchange-esque "Energy Condenser."
- Use EE's EMC values, or specify your own!
There will be a new video soon documenting all the newest features!
I've Got the Plugin. Now What?
Building The Condenser
Lets get started on building your first condenser!
There are four levels of condensers that can be built.
The higher the level, the less energy is lost through conversion (configurable)
The standard condenser recipe is:
Chest | Enchantment Table | Chest
Iron Block | Obsidian | Modifier Block
By default, here are the modifiers along with loss factors:
Level | Modifier | Loss % |
---|---|---|
1 | Gold Block | 35% |
2 | Emerald Block | 25% |
3 | Diamond Block | 10% |
4 | Beacon Block | 0% |
(Both the modifier block and % loss is fully configurable)
Using it
To set a target for the condenser, just right click the sign, or any part of the enchantment table!
Now, to get the condenser going, just dump anything you want into the INPUT (left) chest, and watch!
Please note, opening either IN or OUT chest requires the permission ec.use, or ownership over the condenser (see Permissions section)
Other Things
You can right click the sign/enchantment table while you're not holding anything to PAUSE/UNPAUSE the condenser. This change will be displayed on line 4 of the sign.
If you stop the server, all condensers will be saved to "condensers.sav", and loaded again upon server start. All EMC and items will be saved.
Left clicking the sign will reset the condenser, but only if you have the permission ec.reset
Condensing a damaged tool will only return a percent of it's total EMC.
(1 - (damage_value / max_damage)) * EMC_value
Setting a damaged tool as a target will create more tools with the same damage level. If you want to condense tools at full health, you must have one available to condense...
Commands
'/emc' will tell you the value of the item in your hand. This will return the FULL EMC value, so if your condenser has energy loss, the item will actually be worth less
'/ec reload' will reload the EMCConfig while the server is running. This allows for editing the config without stopping the server. All condensers and /emc will be updated the moment this command is run. This command requires the perm "ec.reload"
Permissions
Action | Owner | Needed Perm |
---|---|---|
Build | Doesn't Matter | "ec.build" |
Edit | Yes | none |
Edit | No | "ec.edit" |
Open | Yes | none |
Open | No | "ec.use" (see note) |
Break | Yes | "ec.build" |
Break | No | "ec.build" AND "ec.edit" |
Reset | Doesn't Matter | "ec.reset" |
/ec reload | n/a | "ec.reload" |
Get build/destroy messages | Doesn't Matter | "ec.broadcast" |
"Edit" means changing the target block, or pausing a condenser. Essentially, any right clicking the sign is an edit.
"Open" means accessing the I/O chests. This perm can be turned off in the config.
ec.use is unique in that you can give a user the ability to access any condenser with ec.use.* or specific condensers.
The perm format for a specific condenser is as follows: ec.use.[World]:[X]:[Y]:[Z]:[Orientation]
An example of a specific perm would be: ec.use.MyWorld:32:15:-135:2
To find the specific ID of a condenser, please check your condensers.sav file. The world, X, Y, and Z points are the location of the Iron block in the condenser. The orientation is a number 1-4, whose calculation is too difficult to explain. Please, just look in the sav file!
Configuration
The main config (config.yml) has the following options:
- check-interval: 1
- max-stack-condense: 4
- permission-to-use: false
- broadcast-messages: true
- level1: 41-35%
- level2: 133-25%
- level3: 57-10%
- level4: 138-0%
check-interval controls how often blocks in the INPUT chest will get condensed. 1 = once every .25 seconds. 2 = once every .5 seconds, etc... (Note, this is not exact because your server might lag or run slower/faster than it theoretically should)
max-stack-condense controls how many blocks are created at a time in the OUTPUT chest if there is extra EMC in the condenser.
permission-to-use turns ec.use on and off. When this is false, users do not need ec.use to access I/O
broadcast-messages Messages will only be broadcast to users with ec.broadcast. If this is false, no messages will be broadcast at all
levels The first number is the BlockID of the modifier block, and the second is the percent loss.
The EMC config (emcConfig.yml) has a option for every item ID.
- The values are stored as 'ID-DAMAGE_VALUE': EMC
- Some items are stored as 'ID-A':EMC - this means that regardless of the damage value, all items with that id will have the same EMC (like wool)
- Some are stored as 'ID-X':EMC - this means that this item can be damaged, and it's emc will be calculated as a percent of the given EMC, based on damage.
Notes
Source code will be available on my github
Plugin Idea by inventorman101, code by vsams14
My other plugins:
Thanks for the awesome plugin, however the permissions dont seem right, at least not on my server. Anyone who does not have the ec.build permission is unable to place diamond blocks, iron blocks, chests or enchantment tables. The check for building them seems wrong?
I am also getting the following error spamming my console even with 1.2.5
2012-11-06 08:20:32 [WARNING] [EnergyCraft] Task #4 for EnergyCraft v1.2.5 generated an exception java.lang.NullPointerException at org.bukkit.craftbukkit.inventory.CraftInventory.getSize(CraftInventory.java:38) at org.bukkit.craftbukkit.inventory.CraftInventory.getContents(CraftInventory.java:51) at org.bukkit.craftbukkit.inventory.CraftInventory.firstEmpty(CraftInventory.java:206) at com.github.vsams14.energycraft.Condenser.hasEmptySpace(Condenser.java:102) at com.github.vsams14.energycraft.Condenser.condense(Condenser.java:52) at com.github.vsams14.energycraft.CondenseTask.run(CondenseTask.java:9) at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:53) at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345) at net.minecraft.server.MinecraftServer.r(MinecraftServer.java:531) at net.minecraft.server.DedicatedServer.r(DedicatedServer.java:215) at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:495) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:428) at net.minecraft.server.ThreadServerApplication.run(SourceFile:818)
I concur with drsadistic.....problem solved :) Thanks for the quick fix!!! This plugin is awesome!
Works like a dream now, thank you sir.
Techrosis and drsadistic - both of your problems are solvable by updating to 1.2.5
Coolo1 if you want help with your error 33, I need the EXACT console output. Otherwise I don't know what's causing it. There is bound to be more than only line of error.
I'm getting something similar: [EnergyCraft] Task #13 for EnergyCraft v1.2.4 generated an exception java.lang.ArrayIndexOutOfBoundsException: 1 at com.github.vsams14.energycraft.Config.getName(Config.java:76) at com.github.vsams14.energycraft.Condenser.updateSign(Condenser.java:164) at com.github.vsams14.energycraft.CondenseTask.run(CondenseTask.java:10) at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:53) at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345) at net.minecraft.server.MinecraftServer.r(MinecraftServer.java:531) at net.minecraft.server.DedicatedServer.r(DedicatedServer.java:215) at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:495) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:428) at net.minecraft.server.ThreadServerApplication.run(SourceFile:818)
This plugin is exactly what I've been looking for, except that when I enable it and start my server, I'm hit with this:
2012-11-05 21:29:13 [WARNING] [EnergyCraft] Task #2 for EnergyCraft v1.2.4 generated an exception java.lang.ArrayIndexOutOfBoundsException: 1 at com.github.vsams14.energycraft.Config.getName(Config.java:76) at com.github.vsams14.energycraft.Condenser.updateSign(Condenser.java:164) at com.github.vsams14.energycraft.CondenseTask.run(CondenseTask.java:10) at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:53) at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345) at net.minecraft.server.MinecraftServer.r(MinecraftServer.java:531) at net.minecraft.server.DedicatedServer.r(DedicatedServer.java:215) at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:495) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:428) at net.minecraft.server.ThreadServerApplication.run(SourceFile:818)
Any help would be greatly appreciated.
I just updated with the latest yesterday. I was able to build a drill in MachinaCraft with no problem. Logged out and back in later and was unable to operation the Drill. After trying o rebuild the machine I discovered that I was unable to place the iron block needed. After trial and error I was able to place the Iron block ONLY when EnergyCraft was disabled.
@vsams14
I can confirm it works [Edit] Except for the Task 33 errors! ;D
I've modified code so that if it sees a line with
//
but no name, it defaults to the system name. This is now version 1.2.5Thanks to TerraVale and Coolo1 for helping find and eradicate this bug!
This means that all of the following are acceptable:
//
//
Glass Pane@vsams14
I used a diamond :o
I just tried an item OTHER than a diamond (not sure why I didn't do this in the first place) and it worked!
That narrows it down. What item are you setting the target to?
I think I've figured it out. I have a method that gets a name for the target item, and puts it on the sign.
To do this, it reads the config (emcConfig) and looks for the name after
"//"
If the
"//"
characters do not exist, it uses the internal bukkit name. However, I was adding items, and about 3/4 of them have the"//"
, but no name afterwards. So the code crashes because it doesn't know what to name the target.This is what I think the issue is. If you tell me the item, and it has a
"//"
but no name, then it will confirm my suspicions...@vsams14
Here:
http://pastebin.com/xVaLg9ve
This error repeats until you reset the condenser.
Hope it helps! :O
@TerraVale
Do any of the errors contain anything along the lines of 'com.github.vsams14.EnergyCraft'? That way I can take a look at the file/code that's causing the error? This didn't happen on my end after some testing, so I'll need your help to find out what's causing it.
Also, I'll fix the brackets :P
@vsams14
EDIT: I did a bit more looking into this strange error, here are the important bits. After making a condenser, right clicking the sign with the item you wish to create returns an error.
After which, spams the console with errors constantly until you reset the condenser :o
Things to note!
When you right click the sign to set the item you wish to convert EMC into, the operations all work properly. The item is placed in the output chest, and any items placed in the input chest are thereon converted. The noticeable aspect about it is that the sign is completely blank when you set an item to convert EMC into, and during this time you have access to the enchanting table (might help you find origin of error).
Thanks :)
I'd also like to note:
The world and coordinates in the Broke Condenser string does not have brackets around it ;)
Fixed bugs in v1.2.4
Hope it works better!
Also, the paypall question still applies.
vsams14
Added perms, and updated to v1.2.0
Have fun!
Also, if I set up a paypal, how many of you would be willing to donate for more features/faster updates? I'm a student, so money always helps... :/
vsams14
@vsams14
Great! This is an amazing plugin. I'm not amazing at plugin coding, although i'd be willing to try and help update it if you need help.
I'll be updating to 1.4 shortly, and will add the permissions code along with that. If there are any features that need to be added, let me know NOW so I can program them in. Also, it will be a while before we have EMC values for all items - I'm not even done with 1.3 stuff, so I'll update now, and patch that in later!
A permission node to allow people to build the condensers and to stop players who did not build it from changing the target item would suffice for my needs.