Jump to content

DJD

Members
  • Posts

    64
  • Joined

  • Last visited

Everything posted by DJD

  1. What would be the way to take the value "smooth_granite" to the Enum value needed for the property "Variant". I can find the right property, but it seems that setting the value can get a bit... convoluted
  2. My bad I meant block.getExtendedState seems to repeat block.getBlockState (except in the case of fences). It seems to usually repeat block.getBlockState in most cases. I think if I could clarify the proper usages of block.getActualState, block.getBlockState, and block.getExtendedState it would clarify things in my muddled mind
  3. And its the same with extended properties ? Getting the extended properties seems to repeat the values of properties, except in cases like fences etc where properties appear to be always false and the extended provides the correct property values. Would it be proper to skip using GetProperties and just get the GetExtendedProperties instead ? Or do should you still go through properties then extended properties ? Working with vanilla blocks only atm of course.....
  4. If you put a block's properties and extended properties in say a file (for reading in), such like: minecraft:stone,([variant=smooth_granite]) and want to place it elsewhere in the world, how would one go about setting the "variant" property of that Block to "smooth_granite" and then placing it in the world ?
  5. I think my confusion is that since I'm new to modding this game, the previous version (1.7) did things differently and when I look for examples, I get stuff that's for the previous version. The info out there seems a bit muddled right now for a newbie, and depending on which version you are modding for. I'm sure things will clear up just in time for 1.9 to hit I've got a basic mod working (proxies, commands, extended player properties etc) and a very basic cut/paste model (that's where I need to get and save all the properties of the blockstate). Now I want to get a list of each block selected and its various properties (in vanilla of course)..... So much to do
  6. What is the best way to take a block that exists in the world and generate all the known info about that block (including its current states, etc) ? I can get the Base state (and then there's default state- not really sure what the real difference is but I'm sure its something crucial) and list its IProperties, but not the current value that they are set to. I think it would clarify (at least in my mind) the proper way to use Blockstates and IBlockStates to do things in world. Maybe its just late here for me or I really am confused... Probably both....
  7. Thanks for the direction. Not sure if I need MouseInputEvent or not but flailing around in code for awhile should give some results I'm thinking "grab" command starts the ball rolling, then getting the points. Should be interesting doing some research on IExtendedEntityProperties...
  8. I need to be able to define an area bounded by 3 blocks as chosen by the player. What would be a good methodology to execute this ? Ideally, each click stores the Vec3 of where it was clicked (will this work if the click is on a "air" block ?) then when 3 Vec3 have been collected, I perform operations on the area bounded by the 3 Vec3's (either on a command I can register or even better upon receiving the 3rd Vec3). Not sure this is practical though......
  9. So that's what I wasn't figuring out from the tutorials ! I thought they had to belong to the ServerStart event (like the commands do)..... BTW "chat stuff" does some other things as well (or can if needed). Centralized coding helps when things seem to change from version to version (such as chat handling changing from previous versions)..... So to summarize if I got this correct: 1. register EventHandlers in preInit. 2. register Commands in serverStart.
  10. Thanks for pointing me in the right direction. Getting which events fire at which times (I tried the PlayerLoggedInEvent and it didn't work) is the struggle... Nothing a little flailing around in code won't cure Got it working.. sort of..... public class ServerEventHandler { private MessageHandler msg = new MessageHandler(); @SubscribeEvent public void PlayerJoinsWorldEvent(EntityJoinWorldEvent e) { if (e.entity instanceof EntityPlayer) { msg.chat(e.entity, "Hello MINECRAFT !"); } } } I registered it in my serverStart(FMLServerStartingEvent e) by: MinecraftForge.EVENT_BUS.register(new ServerEventHandler()); but it sends the message twice. Its got to be something obvious I'm doing wrong....... BTW MessageHandler() is a custom messaging class my mod uses and its not the problem (same effect occurs if I just sysout it to the log)....
  11. I'm still trying to wrap my head around the proper way to handle events (such as player entering a world etc)..... For some background: 1. I know Java. 2. I've got a working mod framework (e.g. handles commands etc). What would be the proper way to send a message to a player's chat when he first enters the world from my mod ? I think a good example would clarify the whole issue for me... kind of like a "hello world !" simple program is usually the 1st type of program most folks create when 1st learning a language
  12. Thanks ! Once I got past to use SubscrubeEvent rather than ForgeSubscribe (older examples tutorials etc) I was pointed in the right direction..... It seems a lot of work for little payout but at least it got me up to speed on event handling
  13. My mod does a bit of output to the chat window for a player, but since the chat font is not a fixed width, the alignments get a little wacky at times. Are there any good ways to get this done ?
  14. Think its the best solution atm.....
  15. I have a lot of formatted input with System.getProperty("line.separator") s in them. It displays fine except that the CR appears at the end of each line that has them. I could write something that splits the lines individually (and removes the character) before sending them to chat, but I was hoping there was a "cleaner" since the only thing wrong is the CR symbol being displayed..... [update] Barring another way, that's what I did, splitting the line into separate lines and sending them one at a time to chat. Note I only had to do this for the CR. I just wish there were a "better way"
  16. Currently I've got a lot of formatted strings that I send to a player's chat window (including some multiple lines).... Is there a way to suppress the (CR) that prints in the chat window ? Or it only possible by rebuilding all the formatting using IChatComponent primatives instead ?
  17. Then this thread is truly resolved then I hope it is of use to any future modders......
  18. I'll probably go with the central idea first, because the way this thing has been created it would be easier to split it up later than try to put it all in one. Would be a good test anyway
  19. Can you please clarify ? I don't see a "world" folder under my minecraft (I am running a few mods now).... If you mean by a save file, then it is not specific to that particular world per se but used by the mod to generate stuff.....
  20. Think Diablo 3 and how it handles its "randomness". it only has a few sections it uses over and over again with a few things changed to create a sense randomness. I've got the design for storage handling, buffering etc down, so without getting into more boring details, my thoughts are like this: The mod allows the generation of geomorphic sections with variations amongst the internal elements of each geomorph (e.g. a length of corridor with mostly cobblestone but sometimes will generate with a cracked cobblestone or whatever).... To do so requires 3 types of files: Structures: which blocks go where), Themes: groups of blocks with similar properties (e.g. cobblestone dungeon) Plans: The "how to" place the geomorphs so that they make sense (corridors things connect etc) and the randomness of it all. These files are editable by hand, but some of the things that would be better to do inside Minecraft to ease the design burden. (such as grab a section of blocks and save to a buffer for later output).... A buffered structure (there can be more than one) can be "placed" and individual blocks "modified" and saved to the buffer. Which of course can be saved off (and hand edited later if desired instead of clunking around typing commands when one sees what needs to be done). So there will be commands for: Getting/Setting structures Getting/Setting plans Managing the buffer a little (e.g. structures and plans currently loaded) without having to save the whole thing, edit it in a text file and bring it back in. All of this is done in creative mode. For generation and actually playing, the Plans files are used to generate random geomorphic things (can be dungeon, town or whatever). So... maybe that wasn't so short after all It would be nice to handle the commands centrally (e.g. for error trapping and messaging purposes (e.g. output to player's chat)) rather than have a bunch of commands that each have to have their own error handling/messaging/IO etc.....
  21. I guess its also a question of if when you register a command with MC, A) does it have to re-instantiate itself whenever a command is executed or B) does it reside out there when registered to be waiting to be used until MC shuts down. If A then a bunch a smaller footprint (individual commands) would be better If B then a central command handler seems would be fine (and it simplifies error trapping, messaging etc etc).....
  22. So I'll put it in a folder of my own creation of the root....
  23. So if I have say 40 commands I should register each one individually ? Seems kind of archaic..... Each command does only one thing. My thinking is I have a base command (telling to use my mod) followed by a space followed by the command and any parameters I can create a centralized command handling system that won't mung up anyone else's mod commands.... mod Do something mod Do something toSomething mod Help etc... I register mod (or whatever I will call it) as a single command but handle the 1st parameter as the command and anything else entered as a parameter. Is this a bad thing (e.g. will the engine balk at this) or am I overthinking this whole thing ?
  24. My mod generates data that needs to be saved so it can be recalled later (structures etc), so basically user generated text files and potential subfolders with those files in it..... So, to restate clearer: Where do you put user generated files (generated by the mod) so that they don't clobber something else ? It would seem to make sense to put is as a subdirectory to your mod where ever you place your mod files, but , if not there, then where is the best place to put these (as a named subdirectory off the root would seem kind of inappropriate) ?
  25. Thank you ! That helps a lot knowing I can encapsulate my commands for my mod with one register. Or should I break each command out seperately ? e.g I say i've got a Do command and a Go command. Register them seperately or as one "mega command" (e.g. say "mod" and handle the Do and Go commands in there ?)
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.