Coding Minecraft plugin (Jar) - plugins

I'm a newbie and I wanted to create a new plugin for my Minecraft server (a .jar file).
It has to make a whole tree (all the wood connected) fall breaking only one block.
I want it to be turned on or off using a specific in-game command.
Do you have any ideas?
Thank you!

I would start by looking at how to make a "hello world" plugin.
Find a tutorial online (there are many), for how to setup a basic plugin.
Once you have done that, have a look at this to setup an event listener.
https://bukkit.gamepedia.com/Event_API_Reference
Then, use this event instead of the example one
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/block/BlockBreakEvent.html
Lastly, loop through all the surrounding blocks and check if they are wood logs, if so: break them.
NOTE: This is not very detailed, this is more of a guidance for you to know what to lookup. Search around internet for how to do certain things. It will take time but stick to it. And feel free to ask questions when you are really stuck :)

Related

how would I find all the places in all blueprints where there is a call to ParallelFor()?

I'm trying to fix some incorrect calls to ParallelFor() that are appearing in performance profiles. I can't seem to find it in the Blueprint scripts in the Unreal Engine 4 project I'm working with. The Unreal documentation is sparse, and only tells me how to use it in C++.
Any ideas? I'm really concerned that I can't do a plain-text search for functions like this inside the Blueprint scripts. The Unreal Engine dev forums didn't help. The existing search mechanism via the search boxes appears to be for variables.
Using grep in the project folder fails.
There are many factors to muti-threading speedup, number of cores, utilization, memory, scheduler...
The problem may be external to the code.
On to the question:
Many of the built-in blueprint functions are implemented natively in C++.
I would suggest looking at the profiler call stack(tree view); Follow it up to something named similar to a node. This technique may fail for cross thread dispatches.
You will have to download the source code and look there to find the calls.
The other way is to build a debug build(with symbols) of the game and attach a debugger to the process.
The call was built-in to the framework in my case.
Thanks for pointing me in the right direction.
You can easily search trough all your BPs from withing the editor with
CTRL+SHIFT+F or window -> developer tools -> find in blueprints.
You get also there from within a blueprint, CTRL+F enter what you'r looking for, and on the right side there is kind of a book symbol in the same line where you can search all blueprints.

How can I add a Ender Dragon in Minecraft modding?

I have been looking around the Internet, and no one seems to know (or care) about my question :P. I would like to know how to add a Ender Dragon mob into Minecraft. I am using Eclipse, and Youth Digital software. If you don't know what that is, just give me something to copy and paste. I'm pretty noob-ish at coding at stuff, so any help will be appreciated. Thanks!
In my opinion, you need to watch a few more tutorials and understand more of the basics such as item creation. You should also have a look to see the basic principles of Java. Stack Overflow is a great place to get advice on specific problems but I am afraid that they do not like broader problems such as the one you present here.
From your question I assume you are asking how to "spawn" in the Ender Dragon rather than "add it". For this you will need to place this snippet in a method linked to an event handler:
EntityDragon dragon = new EntityDragon(worldIn);
worldIn.spawnEntity(dragon);
where worldIn is the world argument from the method.
However, I suggest that you watch more tutorials on YT to get the basics, then have a look at other peoples' mod code on Github.
(Quark is a great example of some simple modding mechanics, so I suggest you trawl its source code -> https://github.com/Vazkii/Quark/tree/master/src/main/java/vazkii/quark)

Show the history of a State Machine/Workflow

I'm trying to find a way to represent graphically the history of an operation inside an state machine. So if the operation has gone through state_1>state_2>state_3>state_2>state_4>end I would like to see that path visually.
We are using a Web-UI and a Java Backend, so any HTML-JS or Java library (that creates image files or something like this) should be ok for us. We are using JBMN for parts of the state machine, my initial approach was to find something related with it, but I haven't found anything
Any ideas?
Do you want to do some crazy animations? or just highlight the states that were already executed?
If you want to do that, you can use the jbpm designer that already provide that functionality.
Cheers

any way to synchonise between Redmine(or other issue trackers) and a plain text todo list?

I would like to access a Redmine taskbase via a simple text based interface - wondering what the shortest path would be (minimum investment/development).
Right now, this boils down to 2 use cases/phases:
Import a batch of tasks into Redmine from simple, wiki-based, bulletted TODO list, ie. plain text content. This is more of a one-off task, so a quick and dirty solution would be fine.
Later, some smooth two-way synchrosation would be great.. E.g. edit loads of tasks via some friendly plain text (or XML) in an editor, or scripting where I could manipulate all of them with simple text processing; then synchronise with Redmine and commit them back.
Any ideas on the easiest way to achieve these?
I'd prefer an external solution (i.e not touching the server), especially for the one-off import case; something like a neat IDE/editor/client, or a standalone Ruby script (e.g using the RM API).
If an appropriate RM plugin would be available, I would not resist giving it a try (can get root access from our lovely IT support:)..
Current ideas:
Emacs/Org-mode, looks like a great combination of a cool task manager UI and full plain text power. It seems rich enough to capture tags, states as well. This artice looks promising Orgmode and Roundup: Bridging public bugtrackers and local tasklists, although not exactly a perfect match.
org-mode parser in Ruby, could be used in an script with redmine-api access, or - worst case(for me, right now)- in newly developed RM plugin.. This looks like a good start: org-ruby
export RM->XML, process file, import XML->RM... not sure if this is supported?
I guess it's always possible to talk to the DB directly, but I'd prefer to avoid that.
Actually, I'm also interested a similar solution for Bugzilla.
At the simplest level, you could write a RM/Rails plugin that parses an Org-Mode task list, updating corresponding issues in the RM Model.
Equally, you can build a view for Redmine (again as a Rails plugin) to generate an org list of the current (or subset of) issues.
For Bugzilla I think you would be best off using the XML-RPC interface to do your issue comparison/update sync, so you'd have to take a very different approach from Redmine.
If you have any specific questions, please update your question, it's quite broad at the moment.
Update
At the moment, there are a few plugins which will probably help you figure out your solution, for example Nick Boltons xml import and Martin Liu's Redmine CSV Import Plugin but neither of these are going to completely solve the problem for you, just give you some useful starting point.
On the other hand, If you write a script that interacts with Redmine's REST api, you don't need it to be in any specific lanugage, in fact you could do it in Emacs-lisp, if the target users of the script are all Emacs aware, then this might well be the best way to do the job. (it would certainly be the most appealing option to me.)
Maybe this can be useful: https://github.com/fukamachi/redmine-el

Time to develop an option in Eclipse to modify a Java file source

I'm evaluating the possibility of developing an Eclipse plugin to modify the source code of some Java files.
The Eclipse plugin should:
add one menu option or context menu option to launch the modification process.
add a key binding
only alter the UI in that way when an editor has been open on a Java file.
the modification process would not open a dialog, or maybe, a very simple one.
the modification process would traverse the AST of the Java file and would modify it.
Considering that we have no experience with Eclipse plugins and we need spend time in reading docs, how much time do you estimate in developing that plugin?
Thanks in advance.
It's really not that difficult at all... I had students in my design patterns class doing it for an assignment (adding/removing javabean getters and setters)
See http://help.eclipse.org/ganymede/topic/org.eclipse.jdt.doc.isv/guide/jdt_api_manip.htm
[EDIT: added the following article reference]
And a great article on it at http://www.eclipse.org/articles/article.php?file=Article-JavaCodeManipulation_AST/index.html (from 2006 -- there may be a few API changes since)
Yes, writing plugins takes a little getting used to, but so does any API.
And you can modify the AST -- see the page I reference above.
(I should note that the above link is from the eclipse help, which can also be accessed via Help->Help Contents inside Eclipse -- there's a lot of good info in there, but it's just a starting point)
You'll probably spend quite some time cursing the complexity of the eclipse plugin system. There are some example plugin development projects that can be very helpful if they cover the area you're working in.
I'd say you're looking at 2-4 days of work, spent mainly getting familiar with the platform - someone with a lot of experience writing eclipse plugins would probably take no more than an hour.
However, your step 5 could be tricky. I don't know how easy it is to access and change the Java AST; my experience is based on developing an editor plugin for an exotic file format rather than Java code.
Well, the four first points are easy to achieve, even by monkey coders that look at the eclipse PDE documentation shipped with Eclipse. These can be achieve in 1 day of work, maybe 2.
The hardest point is really the fifth one and the kind of modification you expect to do. Acting directly on the editor content is simple, accessing the editor internal AST and modifying it is really a bigger challenge and I doubt that it could be achieve in less than a week by unexperimented people (it can take longer, depending of what kind of modification you want to apply).