• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Problem!  RSS feed

 
Ash Whin
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi - I am a minecraft modder.


There is a programming problem for people to answer. This has been written to simulate what happens when items are dropped in minecraft!

Run these two class files in Eclipse. Please put up a solution for the defender() method so that I can make armor undroppable!

You must change defender() so that one line of "DIE" is produced, and one line of "SURRENDER", and one line of "DIE"... and so on

Currently, my defender() makes this pattern:



What I have been doing:
I have found that normal (non-armour location) items can be swapped by clicking one item with the other. Thus, with my current code that item will simply be replaced. Or, I could use if to test if an item exists, and give it a new location. That "new location" destroys the entire purpose of fixing locations of non-armour items.

However, armour cannot be swapped with other armour, or normal items! (Unless armour item is same type, which is not going to happen) So, the method above will work on armour. I am just trying to figure out how to, when minecraft source code has this random attacking method which makes me stunned.





 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ash Whin wrote:Run these two class files in Eclipse. Please put up a solution for the defender() method so that I can make armor undroppable!...

Sorry Ash, but this is a Java forum, not a coding service. I suspect you'll have more success with a targeted forum or blog.

Also: Isn't Minecraft proprietary code?

Winston
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston Gutkowski wrote:Also: Isn't Minecraft proprietary code?


Yes and no. Certain types of modding are allowed, even encouraged, but the licensing is rather mind numbing. I found this.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would suggest you consider coming up with a better subject. In a forum named "Java in General", a subject of "Java Problem" isn't terribly descriptive.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, what exactly is your question about?

I'm not surprised that you get that output when you run the code you posted. The main() method in class IntelliJ has an infinite loop where it continuously creates new DAFUQ objects. Each DAFUQ object creates a new IntelliJ object and calls attacker() on it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!