Jump to content

czaarek99

Members
  • Posts

    33
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

czaarek99's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I know a coremod would probably make sense 99% of the time. But I can't use that this time. I looked through the github repo and couldn't figure out how they were modifying the code. EDIT: Yeah I must have been blind when I looked at the github repo last time: https://github.com/MinecraftForge/MinecraftForge/tree/master/patches/minecraft/net/minecraft And yes, im polish
  2. I have kind of an unusual question. I am creating something that is very out of the ordinary where I have to inject the code into minecraft. Anyway, I was wondering if forge directly modifies base classes? And if so which ones, is there a list?
  3. The mod is huge, he said I should look into the mod. Its like telling me to use java? I don't even know what item I should be looking into. Conisdering he said that the mod contain a solution i assume he knows what class/item it is at least.
  4. That does not help a lot, what even is enderIO? Does it have an item that does something similiar? If so what item and what class.
  5. I don't know if it matters? But I am trying to make a freecam mod, this mod allows you to move without sending the packets to the server so you move locally. Why I can't just do this manually in the minecraft classes and have to use forge is because I have a bunch of other mods that I want my players to use along with forge + my custom coded ones.
  6. I read this tutoria: http://www.minecraftforge.net/forum/index.php/topic,20135.0.html I think I understand how to create a new packet and then send it. But how can I cancel already existing packets? Like stop the client from sending the animation packet?
  7. There is something that I'd like to do but there are no forge hooks for. Is it possible to tell forge to replace something in vanilla class to my own liking? Or maybe replace the whole class? I'd still like to get the functionality of forge but still be able to perform what isn't possible in forge.
  8. I'll have a look into intercepting every GUI call... But those are many places. Anyway, I doubt I'll even be done with it today since I don't have much time left. Friends coming over and stuff. And having someone else look at it is probably a good idea too.
  9. Thank you! If you figure it out it would be nice if you also include the code as that makes it much easier for me to understand. Having some code to reference when reading how someone did it is always helpful.
  10. I'd love to use nameformat, but it only fires on the server? If you read the thread my code works properly, but if I try it out on a multiplayer server my events just refuse to fire.
  11. Basically I started this thread over here: http://www.minecraftforge.net/forum/index.php/topic,22260.0.html Basically what I'd like to do is intercept usernames and change them. Clientsided ONLY. The mod is not going to be installed on the server. If you read towards the few replies in the end of the thread you'll understand what problems this causes. I'd like an explanation of how this can be solved as I really have no idea. Using reflection on entityplayer didn't work. Maybe there is another event than NameEvent that you can tie into to change the display names? I have no idea.
  12. So I adventured down through the minecraft code all the way down. I eventually ended up in minecrafts EntityPlayer class. Anyway, how can I know which field is which? Since minecraft even decompiled has fields like this "field_151432_d". I can't access a field if I don't know which one to access. This is my code for modifying it for now, obviously won't work for above reason. @Subscribe public void everyTick(TickEvent everyTick){ EntityPlayer privateObject = new EntityPlayer("The Private Value") { }; Field displayNameField = EntityPlayer.class. getDeclaredField(displayName); displayNameField.setAccessible(true); String fieldValue = (String) privateStringField.get(privateObject); } EDIT: I had BedrockMiner try to accomplish this, but unfortunately it is impossible to modify for some reason. I am going to start a new thread concering this issue in specific, anyway thanks for all the help I got with proxies. Now I understand a proxy is pretty much useless for me since the mod will only be installed on one side. Link to new thread: http://www.minecraftforge.net/forum/index.php/topic,22449.0.html
  13. If you follow the call hierarchy, all of this just updates a field in EntityPlayer called displayName. It is private, but you can change it with Java reflection I think. So what if you did a ClientTickHandler and used Java reflection to inspect and modify (if necessary) the displayName field? I think this would still be limited to Client, so if you want other users to see the effect they'd have to use the mod too probably. If that doesn't work, I think you'd have to try to intercept the chat and the player rendering where they display names. Just intercepting it in chat would be a last rescue thing. Since I want the displayname to change everywhere, scoreboards, tab, etc etc. Anyway, If there is no other we I guess I'll have to modify everything seperately. The thing is, this forge modding is already hard for me and I only have some basic java knowledge. And I really have no idea how to do the reflection part. There are tutorials on the tickhandler but I can't find a suitable one for reflection. I mean, there surely are some but none seem to be giving me this information. Maybe you can link me to a good one?
  14. Yeah, it always prints false... So that means my mod is impossible and the server would need to have it installed? Edit: And yeah, the server won't have the mod installed. Only the client. I have seen hacked clients implementing friends list even without forge. Now, I'd just like to make a fancy friendslist for myself or whatever. I mean... It has to be possible. But what other event or how can I get it to fire?
  15. I read your tutorial, it showed pretty much the same thing as every other tutorial that I have read so far in 1. I have basically already seen all that. I did what you recommended but my events still refuse to fire in multiplayer. Is there a special way to register events in Multiplayer? Since that is what I am starting to think. And no ones tutorial really shows how to use the events in multiplayer. I tried making a few other events. None fire in multiplayer, never? Here are my classes once again: package com.czaarek99.FrameMod; /** * Created by Czarek on 2014-08-09. */ import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerEvent; @Mod(modid = FrameMod.modid, version = FrameMod.version) public class FrameMod { public static final String modid = "FrameMod"; public static final String version = "1.0 ALPHA"; @SidedProxy(clientSide = "com.czaarek99.FrameMod.ClientProxy", serverSide = "com.czaarek99.FrameMod.CommonProxy") public static CommonProxy proxy; @Mod.EventHandler public void init(FMLInitializationEvent event) { proxy.init(event); System.out.print("init fired!"); } } package com.czaarek99.FrameMod; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerEvent; /** * Created by Czarek on 2014-08-12. */ public class CommonProxy{ public void init(FMLInitializationEvent events){ FMLCommonHandler.instance().bus().register(new MyEventHandler()); MinecraftForge.EVENT_BUS.register(new MyEventHandler()); System.out.print("common init fired!"); } } package com.czaarek99.FrameMod; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.event.entity.player.PlayerEvent; /** * Created by Czarek on 2014-08-12. */ public class ClientProxy extends CommonProxy { @Override public void init(FMLInitializationEvent events){ super.init(events); System.out.print("client init fired!"); } } package com.czaarek99.FrameMod; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.event.entity.player.PlayerEvent; /** * Created by Czarek on 2014-08-14. */ public class MyEventHandler { @SubscribeEvent public void getName(PlayerEvent.NameFormat nameEvent){ if (nameEvent.username.equals("epicjellybean3")) { nameEvent.displayname = "Spy"; System.out.print("getname client fired!"); } } }
×
×
  • Create New...

Important Information

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