Jump to content
  • Home
  • Files
  • Docs
Status Updates
  • All Content

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • 1SDAN
The update for 1.13 is being worked on - please be patient. (Updated 02/19/19)

1SDAN

Members
 View Profile  See their activity
  • Content count

    24
  • Joined

    August 31, 2018
  • Last visited

    September 21, 2018

Community Reputation

0 Neutral

About 1SDAN

  • Rank
    Tree Puncher
  1. 1SDAN

    Get Block from String and Vice Versa

    1SDAN replied to 1SDAN's topic in Modder Support

    So if I give this a Block class it will give me the String (ie minecraft:oak_log) and vice versa? EDIT: Apparently not. Is the block to string one block.getRegistryName().toString()? EDIT2: I couldn't figure out how to convert a string to a resource location, but I've found Block.getBlockFromName(string). I'm going to do a couple tests to see what these two lines output and go from there.
    • September 6, 2018
    • 4 replies
  2. 1SDAN

    Get Block from String and Vice Versa

    1SDAN posted a topic in Modder Support

    I'm working on a config file where players can set custom behaviors for blocks of vanilla and my and other mods and am having trouble finding a method of turning a string to a block and back. I know it exists, but all of the results I found via google that might answer my question seem to be outdated.
    • September 5, 2018
    • 4 replies
  3. 1SDAN

    Notify Player of Error without Closing Game

    1SDAN replied to 1SDAN's topic in Modder Support

    Even in cases like changing block hardness where the game would still run fine even if it wasn't changed? NOTE: Block hardness is just an example, this is for the whole Block Health thing.
    • September 5, 2018
    • 7 replies
  4. 1SDAN

    Notify Player of Error without Closing Game

    1SDAN replied to 1SDAN's topic in Modder Support

    That seems a bit clunky. Wouldn't it be better to send a client side chat message to the player once they log in/when the mod loads, use ConfigChangedEvent.OnConfigChangedEvent to detect a change in the .cfg filess and reload them using ConfigManager.sync(TestMod3.MODID, Config.Type.INSTANCE) so players don't have to reload the game every time they make a mistake?
    • September 5, 2018
    • 7 replies
  5. 1SDAN

    Notify Player of Error without Closing Game

    1SDAN posted a topic in Modder Support

    What would be the best method of notifying players of a null pointer exception caused by an improperly edited .cfg file without closing the game? I'm currently using a try catch expression to avoid crashes, but I'm unsure of what method is standard practice for notifying users.
    • September 5, 2018
    • 7 replies
  6. 1SDAN

    Configurable per Block Variable

    1SDAN replied to 1SDAN's topic in Modder Support

    Oh it works with arrays? That helps a lot then. Thank you.
    • September 4, 2018
    • 10 replies
  7. 1SDAN

    Configurable per Block Variable

    1SDAN replied to 1SDAN's topic in Modder Support

    I'm looking at the config annotation documentation but am still having trouble. What I'd prefer is if there was a region in the .cfg file where players can enter the name of a block and couple of health-related values, which the mod would use to fill an array of values. I'm completely clueless as to how I would go about this. It seems the config annotation requires you to define the individual variables ahead of time, unless I'm misunderstanding this.
    • September 4, 2018
    • 10 replies
  8. 1SDAN

    Best Way to Give Blocks "Health"

    1SDAN replied to 1SDAN's topic in Modder Support

    Understood. I would normally have used int[] but animefan advised using Float or Integer so I was misled to thinking it'd be better.
    • September 4, 2018
    • 22 replies
  9. 1SDAN

    Best Way to Give Blocks "Health"

    1SDAN replied to 1SDAN's topic in Modder Support

    Funny enough, this is the exact implementation I went with. Since starting this thread I've moved from Short, Integer maps to Short, Integer[] maps, does fastutil support something like this? I'm looking at the shorts package and can't find anything of the like.
    • September 4, 2018
    • 22 replies
  10. 1SDAN

    Best Way to Give Blocks "Health"

    1SDAN replied to 1SDAN's topic in Modder Support

    I just noticed I typed String instead of Integer. (Short/String/Long instead of Short/Integer/Long)... *faceplam*
    • September 4, 2018
    • 22 replies
  11. 1SDAN

    Best Way to Give Blocks "Health"

    1SDAN replied to 1SDAN's topic in Modder Support

    Your comment is a bit vague, are you saying I should use a Map<Short,Int> or a series of Longs/Strings/Shorts that when combined contain 16x256x16 X digit integers?
    • September 3, 2018
    • 22 replies
  12. 1SDAN

    Best Way to Give Blocks "Health"

    1SDAN replied to 1SDAN's topic in Modder Support

    I'm having trouble finding a method of iterating through an NBTTagCompound. It seems like I'm finding this a lot more difficult than it should be. I'm trying to use it in the following code: public static class QubHealthStorage implements Capability.IStorage<IQubHealth> { @Nullable @Override public NBTBase writeNBT(Capability<IQubHealth> capability, IQubHealth instance, EnumFacing side) { return new NBTTagInt(instance.get()); } @Override public void readNBT(Capability<IQubHealth> capability, IQubHealth instance, EnumFacing side, NBTBase nbt) { if (nbt instanceof NBTTagInt) { // The state is being loaded and not updated. We set the value silently to avoid unnecessary dirty chunks instance.set(((NBTTagInt) nbt).getInt(), false); } } } That's the int implementation. This is what I have in my current Map implementation public static class QubHealthStorage implements Capability.IStorage<IQubHealth> { @Nullable @Override public NBTBase writeNBT(Capability<IQubHealth> capability, IQubHealth instance, EnumFacing side) { NBTTagCompound compound = new NBTTagCompound(); for (Entry<BlockPos, Integer> entry : instance.get().entrySet()) { compound.setInteger(entry.getKey().toString(), entry.getValue()); } return compound; } @Override public void readNBT(Capability<IQubHealth> capability, IQubHealth instance, EnumFacing side, NBTBase nbt) { if (nbt instanceof NBTTagCompound) { //iterate through compound and set values } } } Seems like it'll end up being a lot less hassle, thanks.
    • September 3, 2018
    • 22 replies
  13. 1SDAN

    Best Way to Give Blocks "Health"

    1SDAN replied to 1SDAN's topic in Modder Support

    If my understanding of Chunk Capabilities (based on the example mod) is correct, I need an IStorage, which requires the use of an NBT tag matching the type of the variable. However there's no NBTTagMap class. Did I do something wrong? Must I make my own?
    • September 3, 2018
    • 22 replies
  14. 1SDAN

    Best Way to Give Blocks "Health"

    1SDAN replied to 1SDAN's topic in Modder Support

    Am I correct in that this means I will have to create a 3D array in order to store per-block values?
    • September 3, 2018
    • 22 replies
  15. 1SDAN

    Prevent block from breaking but drop loot

    1SDAN replied to 1SDAN's topic in Modder Support

    As I said in the OP, BreakEvent seems to occur when you first click on a block, not when you break it. EDIT: Seems like I was wrong. My original implementation is working now, strange.
    • September 3, 2018
    • 5 replies
  • All Activity
  • Home
  • 1SDAN
  • Theme
  • Contact Us

Copyright © 2017 ForgeDevelopment LLC Powered by Invision Community