-
Posts
1689 -
Joined
-
Last visited
-
Days Won
1
Everything posted by SanAndreaP
-
How do you register your entity? Can I see the code of it?
-
Didn't work.... That is not very descriptive... WHAT does not work exactly? And where's your code you're using?
-
You should use the LivingDropsEvent instead of the LivingDeathEvent, since it's specially designed to be fired when a mob srops something (even players I think)
-
Only for the mouse buttons. The movement must be either done in the PlayerController or somewhere else, I don't know. You could use for this a tickHandler, too, but use a render tick handler (which fires every render tick - which is bound to the FPS you get). I think to do so is to simply get the rotationYaw, rotationYawHead and rotationPitch of the Player, save those in local class variables everytime the movement is not blocked and if the movement shall be blocked, just set the values from the player to those from the local variables. You have to play wether the code goes into the tickStart or tickEnd method of your tickHandler. Please note this is a very ugly solution, but I think value assignments to variables shouldn't be that resource-consuming, so yeah.
-
You certainly can! I just don't have an example of it, because it requires a newer Forge than I can work with. (Specifically because my mod is a plugin to another mod which doesn't work past 664). But I have one! https://gist.github.com/SanAndreasP/44bbf54c283e1d246946
-
You can look at the BlockLog class. IIRC it does what you want.
-
You could also use the Events Forge providesto render HUD stuff, look at the RenderGameOverlayEvent class and its sub-classes to get more information.
-
Chat Handler and All user Commands and Time Handler (on SERVER)
SanAndreaP replied to Spycoclown's topic in Modder Support
@Override public EnumSet<TickType> ticks() { // TODO Auto-generated method stub return null; } You need to return something here. Example: https://github.com/SanAndreasP/TurretModv3/blob/master/sanandreasp/mods/TurretMod3/registry/SchedTickHandlerWorld.java#L28-L31 -
Chat Handler and All user Commands and Time Handler (on SERVER)
SanAndreaP replied to Spycoclown's topic in Modder Support
I suggest you to use an IScheduledTickHandler, since you can specify the ticks which should be between calls (20 ticks = 1 second) Also keep in mind that you need to register it with TickRegistry.registerScheduledTickHandler -
From what I've seen codewise in the error is that you (the thread poster) are trying to cast an Object (which is returned by the invoke method) into a boolean. You cannot cast Objects into primitive datatypes directly, except it's the wrapper object of that specific datatype, so I suggest you change the (boolean) to (Boolean). Boolean is the wrapper object class for the datatype boolean.
-
Multiple things I wish to know to simplify my life
SanAndreaP replied to Chainmanner's topic in Modder Support
Nope. Open up your reobf folder and look at the file names. Reobf only changes the references to vanilla classes and functions back to their obfuscated state (field_53829_b, func_23878_c, etc) so that the mod will actually work when added to the Minecraft jar. Would a third-party obfuscator work, maybe? most likely not, since they usually obfuscate everything, even the vanilla method / field / class names. -
For keys, there's unfortunately no way to lock them unless you use ASM, or a TickHandler. In case of a TickHandler, save the keyBindings array when MC starts, and check each tick (I suggest every 10 ticks, use a ScheduledTickHandler for that) if the key is the same as before, for each key. (You get the keybindings array from the GameSettings instance, probably in the Minecraft instance) For ASM, or if you want to submit a Pull Request, look up the net.minecraftforge.client.GuiControlsScrollPanel class, the method called elementClicked will fire if the user clicks on a key binding in the options menu. If this does nothing, it won't do anything to that key, no reassignment, not even attempting to do so. So the modified code for that method would look like: @Override protected void elementClicked(int i, boolean flag) { if (!flag && !options.keyBindings[i].isLocked) { // rest of the code } } Also I suggest to make the isLocked as a (public) field, so you can modify it even for vanilla KeyBindings. EDIT: I tested this and it even works for the mouse buttons.
-
Severe Inventory Glitch - Server/Client desync?
SanAndreaP replied to Reika's topic in Modder Support
Here is the thing. Even when the machine has no GUI or container - and thus does not interact with inventories in any way - the problem still persists. Then what I suggest is that you send a packet if the "inventory" you have in place (the itemstack array) changes. To do so, create a NBTTagCompound instance and write all of your items from the array into it (look at the TileEntityChest or TileEntityDispenser for code examples - writeToNBT / readFromNBT). To send the NBT to the client, look at this code: https://github.com/SanAndreasP/TurretModv3/blob/master/sanandreasp/mods/TurretMod3/registry/CommonProxy.java#L74-L86 To receive the NBT client-side, use this: https://github.com/SanAndreasP/TurretModv3/blob/master/sanandreasp/mods/TurretMod3/client/packet/PacketRecvPlayerNBT.java#L19 -
Severe Inventory Glitch - Server/Client desync?
SanAndreaP replied to Reika's topic in Modder Support
No, it's for ALL Inventories / Containers. I know that, because I update the player's inventory with that (and the player, as we all know, isn't a block). -
Forge won't install, I get 'Minecraft has crashed !' message
SanAndreaP replied to vibhuti's topic in Support & Bug Reports
Try without Optifine. -
Actually Techne exports only the model file. You have to make the render file for yourself (or use a pre-existing one). As for a TileEntity model, you need a TileEntitySpecialRenderer class and an ItemRenderer class (if you also want to render the model inside the inventory / when dropped / when held) Guis aren't THAT complicated. For some GUIs, look at my TurretMod3 source: https://github.com/SanAndreasP/TurretModv3/tree/master/sanandreasp/mods/TurretMod3 Features also TileEntities with custom models.
-
Yup, I use this a lot actually. Namely for packet sending (as I haven't figured out how to convert an EntityPlayer into a Player for use with sendPacketToPlayer, so I use sendPacketToNearby). You just cast the EntityPlayer to the Player: (Player)entityPlayer like you would do it the other way around when receiving the packet: (EntityPlayer)player
-
Severe Inventory Glitch - Server/Client desync?
SanAndreaP replied to Reika's topic in Modder Support
How do I sync an inventory? I know how to use 250 Custom Payload and 132 TE Data, but inventory? use containerInstance.detectAndSendChanges(); (or was it inventoryInstance instead of containerInstance? Try it out for yourself, one should work) -
Read the EAQ
-
Why do you extend Gui? Scratch that, You need this: RenderGameOverlayEvent.Pre or RenderGameOverlayEvent.Post not the RenderWorldLastEvent
-
[Solved]Making bows held properly by other players.
SanAndreaP replied to Noah_Beech's topic in Modder Support
Do you call your registerRenderThings AFTER you initialized your items? Other than that, it seems fine to me. -
[Solved]Making bows held properly by other players.
SanAndreaP replied to Noah_Beech's topic in Modder Support
-
Different hosting for the Scala-library.jar
SanAndreaP replied to tabshank's topic in Support & Bug Reports
this is the the truth, yersteday i have download the file 3mo, today after the post of LexManos, file size 10mo. There is a update of the zip file, after your "read the eaq". It's funny, you tell to people to read the eaq, but I think you don't know the content of the eaq or you just don't read post of people, in these case it's really wonderfull and paradoxal. Edit : I use the software free download manager for download the last zip, thats works not perfectly (zip corrupted, maybe server problem i see some errors server in log of the software) but scala-library.jar is not corrupted and the game work perfectly with forge and a mod (thaumcraft). Thanks again for the updates of the libs.zip Seriously? The quote I put there was the exact text from the EAQ! There are TWO links, the first is the fmllibs for Forge versions which are developed under Minecraft 1.4.7 and below, the second one is for the newer versions of Forge, and the second link includes the scala library. -
hm, but you would still have the vanilla keybinding in the options shown up (just set to an obscure value). Can't you "override" the keybindings for the inventory key with your own? So you wouldn't have to worry about setting the keybinding MC has to an obscure value.
-
Because that's the most ugly solution i've seen in a long time But unless you make a coremod, you have a better solution?