Abastro
Forge Modder-
Posts
1075 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Abastro
-
I doubt that it might work out of dev environment with any version. You should specify both the mcp name and srg name to get the field due to MC obfuscation. Use mcpbot to find the field srg name. Edit: so basically, do what choonster said.. ninja'd =<
-
Creating Registry for interfaces & Generic events
Abastro replied to Abastro's topic in Modder Support
Bump. Also I need substitution method and syncing. The providers which isn't present on the server should be dropped on client. -
Creating Registry for interfaces & Generic events
Abastro replied to Abastro's topic in Modder Support
How can I correctly load the list from file? Some of the entry could be missing. -
Creating Registry for interfaces & Generic events
Abastro replied to Abastro's topic in Modder Support
What I want is registry of providers, which provides styles and objects. They should be ordered, and some of them should be able to be selected/grouped/etc. with configuration & save file. Some of these have persistent name. Currently I'm going to implement it with a copy of forge registry - with the map replaced with either ordered map or list. Is there a better way? (I can't use simple list because it should be able to be loaded from the save file) -
Hello. I want to create registry for interface, because I need subsitution-capable iterable of the interfaces, which can be registered by other mods. How would I go with It? Also how genetic events work? Would subscribing with subclass of the event supertype class work?
-
Then just call setBlock with appropriate parameters. Or you require the player to place the block? Then there should be relevant methods.
-
Config Doesnt Update the File or the actual variable
Abastro replied to drok0920's topic in Modder Support
You should call it where you changes the field. Or anywhere you want to save your changes. -
Also, why don't use make use of x and y?
-
[Solved][1.10.2] Redstone power returned by TileEntity is always 0
Abastro replied to a topic in Modder Support
So while updateValue(0) isn't called on both server & client, both getValue gives 0? It couldn't be... -
[Solved][1.10.2] Redstone power returned by TileEntity is always 0
Abastro replied to a topic in Modder Support
So is the power value updated on the server? -
Well.. right.
-
If you want to do that on the server, there's a great example in TileEntitySign::onBlockActivated. Take a look at the method.
-
[Solved][1.10.2] Redstone power returned by TileEntity is always 0
Abastro replied to a topic in Modder Support
Probably because there's two copies of TileEntity, one is for server and another for client. Try checking that part using breakpoints. -
For iterating through potions, just find the registry object for potions and iterate on it. GameRegistry should hold the registry instance. (There could be one in Potion class as well) To use the mods on dev env: download deobfuscated version, and add that in the mods folder in the run directory (I'm not sure with this one: for now putting normal mod could work). You can also specify some kind of (optional) dependency with gradle. Also just in case: there are @ObjectHolder which allows access to the registered instances even from other mods. https://mcforge.readthedocs.io/en/latest/concepts/registries/
-
[1.12] Replacing one vanilla sound wipes out others
Abastro replied to DarkMorford's topic in Modder Support
I guess it shouldn't be in minecraft domain. It should under the domain for your own mod, i.e. assets/(modid)/sounds.json. Because the assets folder is to be merged. -
So for every ore ids, you check for the rocks. So it won't work if the rock has no ore id or more than 2 ids. Also I guess empty itemstack is thought as 'others'... Plus, when getting the result you look for the last rock slot, while take all of them later. Moreover, I think you remove the result item as well in ::getRemainingItems, but I'm not sure about this part. Besides, you can use @ObjectHolder. https://mcforge.readthedocs.io/en/latest/concepts/registries/
-
4. I mean, you should eliminate anh static reference about the WorldSavedData. The registry is static and the same for client and server, so it'll have problems. Just why do you need to get the Camera instance for their UUID oneverywhere? I think a player capability to save the cameras for each player should be enough.
-
[1.12] Event onDrawBlockHighlightEvent crash when I aim on an Entity
Abastro replied to Fifou_BE's topic in Modder Support
You don't need to check it when you're seeing an entity, right? Then before the getBlockState call, check if the target is on entity and if it is, don't do anything there( put return or similar). -
1. Don't reference Minecraft in the packet - it will crash on dedicated server. 2. Why bidirectional packet? No need to send it from client to server. Just move all non-rendeing logics to the server, and only send packet from client to server. 3. So you have the item ItemCamera to represent the camera. Why to have separate registry. 4. Certainly this is not the way to go; don't put the registry as WorldSavedData. Also don't make static reference of it. (It means it won't be loaded on time. Also WorldEvent are only called on server. So client-side one won't exist. Try running dedicated server to try this) 5. What's the supposed function of the camera and the monitor?
-
Just sync it from the server to the client, otherwise by editing client plauers could cheat. Client to server packet is mostly for sending the user input to the server.
-
1. For the worldsaveddata on map storage, you should only register it once(it's shared throughout worlds(. WorldEvent.Load is called every time the world is loaded, so you should find another event or check to allow only one world to load the data. Same for WorldEvent.Unload. 2. Why did you register the packet to both server and client? The logic should be on the server side. Client is only for the rendering and sending input to the server.
-
Strange. Would you update your code? Just in case you don't know: markDirty calls should be on server side.
-
Before that, check if it's called. Use either breakpoint or print statements.
-
You can't. If you really need it, provide it on WorldEvent.Load .
-
How do decompile and deobfuscate Minecraft code?
Abastro replied to s1320dazkj02's topic in Modder Support
Oops. Didn't take a look on it. Sorry.