Jump to content

Abastro

Forge Modder
  • Posts

    1075
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Abastro

  1. You will have the readonly access to the source code. There are various registries and events to change vanilla behavior and introduce your features. And imo for now the document page is nearly complete. You should find the way yourself if you want to do something beyond. EDIT: also in this forum we will help you if you have difficulties somewhere. If you know basics java.
  2. Here's mcForge forum. You may well not ask about MCP or code patching here. About forge, take a look at forgegradle - there's a great tutorial of Getting Started.
  3. Ofc you can use the code snippet above. So this is problem with a library, right? If a code does not give error, you can assume it works. Most of the time. Though you should take care to read the javadoc of methods/classes you use. For more than 5 quads, Use ImmutableList.builder() and put those quads into the builder. It'll build immutable list.
  4. You got something wrong here. 0 seems to be i instead Oh, and about markDirty, I forgot that! You should call it whereever you change WorldSavedData field value. In your case, it's whereever a camera changes.
  5. You mean readFromNBT and writeToNBT? That's simple. readFromNBT: read from nbt to fill up the fields of WorldSavedData. writeToNBT: write to nbt with the fields of WorldSavedData. So basically, you save your fields to NBT using writeToNBT, and load it later using readFromNBT.
  6. 1. You can't put polygon to the model within MC system. Instead, draw one with several quads. In case you don't know, You can put several quads into the immutable list for each side, either with immutable list builder or with ImmutableList#of.(when there are lesser than 5 entries) 2. Do you know basics of java? You should know how to use iteration properly to set up the code. Also, I think you should organize(and clean-up) your code. If you don't know java, go learn it first before working on this level of modding.
  7. You should state the model with your modid (So that it's like 'modid:podTest') when you refer to your own model. Otherwise the game will try to find the model in minecraft like: minecraft:models/block/podTest.json
  8. Use GuiOpenEvent, you can replace the gui there.
  9. I said you need to call something setBlock/setBlockStatee calls. Okay, if you can't understand.. I meant World::notifyBlockUpdate.
  10. Wrong subforum? Besides this is possible with putting file separators in the name, though it would be great if there's handy method for config subfolders.
  11. Relative scale of GUI is hardcoded, so you need to override existing GUI. Subscribe GuiOpenEvent and replace gui you want.
  12. It won't. Now vanilla logic only syncs basic tileentity data(types and positions). So you need to implement those methods to sync fields, while you don't need to design a custom packet. You wouldn't need getUpdateTag and handleUpdateTag. (Though I'm not sure) The packet has a NBTTagCompound contained which can be attained by ::getCompound(). Read the data from the compound. if(!world.isRemote) means you're working on server, while the opposite does on client. You shouldn't change any data values on client if it's not constantly updated one. Also you should always sync the fields from the server when it's needed. Besides, did you look into the setBlock method? It calls a method which is named updateBlock or similar. You need to call it.
  13. You don't, tileentity has a built-in logic for client-server synchronization. Look at my first reply. Regardless, you need to let game know that your TE is updated - similar case with World#setBlock.
  14. You should not call the client code directly. Look at what World#setBlock-blockstate version- calls to update the rendering.
  15. You shouldn't change data of client tileentity, rather than that sync the data from server. I answered about syncing here.
  16. I mean, how does the result dependent on the items in the input slots? How about shaped/shapeless? Do one of those slots or one trait of the slots determine the result?
  17. You shouldn't be using any static fields and Item fields for that. Learn to use capabilities as data storage. https://mcforge.readthedocs.io/en/latest/datastorage/capabilities/
  18. Then it's not correctly patched. Please check if the movement input of the player is your custom one. Detecting it on some kind of key binding will be handy.
  19. I think you should do the same with biomePos(for World::getBiome), If I recall correctly the position is not the chunk coordinates, but positions of each block.
  20. It depends. Does the crafting result highly depend on the three slots? Then a system similar to IRecipe will work. If it only depends on one slot or one trait, then you don't need it. So what do you want with it?
  21. You are putting chunkX and chunkY directly to the position. It should be x and y, isn't it?
  22. Because you are not the same person when you get back to the code some time later and you'll wonder what was it. Readability is that important. Also the id is subjected to change on is important. Also the id is subjected to change on MC version update, so using the instance is better as at least it will give you some errors if the reference got changed. Chances are instance based code will work on the ID change. EDIT: Was it your own enchantment? If it's the case, you just can't use the if, it is highly subjected to change.
  23. Try checking if the method is called, and try printing the fields of the chest. Does the corresponding field changes when the adjacent chest is removed?
×
×
  • Create New...

Important Information

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