Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/03/17 in all areas

  1. You just need to create an NBT compound that contains your data of your area class, which may be a simple as the name to identify the compound as an Area and four integers (two sets to define two corners of the rectangle). If you have NBT tag it is very easy to append to world data and also to serialize into packets. I think the byte buffer helper class has ability to write / read NBT from packet payloads and world save data is already NBT so you just add your data and it will automatically get saved and loaded (you'll still need to read it out after loading) to and from file.
    1 point
  2. Well the first thing I'd ask is whether the areas can be represented "algorithmically" or if they need to be block by block. For example, if the GUI involves drawing rectangles to define the area then really only two points need to be saved per rectangle and I'm assuming there wouldn't be a great many overall areas. In other words, if you want to save rectangular areas I don't think you need to store information for every block within that area. For rectangles I'd just create a simple class to store the two corners and then make a list of those rectangles. I would probably save it on the server side as world data with a simply serializer. My next question is what exactly you mean by "protect" but assuming you mean it is not modifiable by players you can basically override/intercept all the player interaction with the blocks and cancel it if is within the areas. Lastly, for syncing between client and server it may happen "automatically" if the modifiability is determined by the server. I'm not sure exactly how breaking blocks works, but several things send the user input (the mouse click) to the server that then takes the action (or in your case prevents the action) and then the results are automatically synced back to client. However, there are other things like movement where the client tries to do some processing to make it smoother and that might cause visual glitches while the server sync catches up. So if you want client itself to be aware of the protected area, I would simply send a custom packet to the client whenever a player joins the world and resend any updates to all players if there is a change in the area definitions.
    1 point
  3. Could be that the proxy annotation has a typo. If you can't detect a mismatch yourself, then show us the class in which your declare your @SidedProxy annotation. Also show us how you organized the folders and files inside your source/main/java folder.
    1 point
  4. Caused by: net.minecraftforge.fml.common.LoaderException: java.lang.ClassNotFoundException: com.memoankara.spawner.proxy.ClientProxy Post your code. And please use code blocks and spoiler tags.
    1 point
×
×
  • Create New...

Important Information

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