Jump to content

yooksi

Members
  • Posts

    112
  • Joined

  • Last visited

Everything posted by yooksi

  1. Thank you, this worked for me in 1.10.
  2. For anyone else who might be having the same issue and wants to create custom bows without custom models, this is how I did it: link to the solution on GitHub. Hope it helps.
  3. Thank you for asking this question, I am having the same problem. Reading through the thread now.
  4. I had that problem as well, I think it's quite a common one.
  5. I know this might be a bit off-topic for this thread, but I just wanted to use the opportunity to ask, since my own thread did not give me much answers. Is there a way to tell log4j logger to print logs with a certain marker into a separate log file? I've been successful in creating my own logger that does that job, but I just feel there is a more simple way.
  6. This is basically what I was told in this thread, and I agree with it. More often then not, a non-coremod solution is quite possible, and usually a much better solution then editing base classes.
  7. Replacing the instances is a difficult yet sometimes the only viable solution. Thanks for suggesting it.
  8. Thanks for the advice, I will take a look at Forge's code and see where I could insert one. I do not wish to create a coremod, I would like to modify the content of the vanilla method during application runtime. There is a forum thread about a similar idea here, and it recommends using Access Transformers. Maybe what I am doing is considered creating a coremod, but this is not my intention. Access Transformers are.... A coremod Completely unnecessary as you can use Reflection Don't modify code, only the access level (public, private, protected). Is it possible to do what I want to do with reflection then?
  9. I do not wish to create a coremod, I would like to modify the content of the vanilla method during application runtime. There is a forum thread about a similar idea here, and it recommends using Access Transformers. Maybe what I am doing is considered creating a coremod, but this is not my intention. I would like to replicate what the developer called atomicstrykers did here. He was able to redirect all calls coming from World.getRawLight to his own custom method, and like that was able to control all the light values in World. The reason I am interested in this is because I would like to create a moving light source that moves with the player, like an item torch emitting light when held for example. What makes me worry about this is the optimization side, so would the way he did it be a better approach then manually setting the light values and sending them to world for update?
  10. What would be the easiest way of successfully modifying a vanilla method? I would like all calls coming to method A to be diverted to method B (which would be a custom method). If I could modify the method at runtime I would inject some code that just makes a call to method B, don't know if it works like that in reality. After searching online about this I've found out this is called reflection and that it's a very advanced procedure. However I've seen some mods around that have done exactly that, but I am having problems getting a grasp on how they did it. As always, any help would really be appreciated, thanks!
  11. To add a colour to your tooltip text you have to append a ChatFormatting element to the info argument in the addInformation method followed by your tooltip message. There is a lot of colours to choose from and you can find them as ChatFormatting elements under com.mojang.realmsclient.gui. You can also display the message in italic or bold. Here is an example: @SideOnly(Side.CLIENT) @Override public void addInformation(ItemStack stack, EntityPlayer player, java.util.List<String> info, boolean par4) { info.add(com.mojang.realmsclient.gui.ChatFormatting.BLUE + "This is a simple item."); info.add(com.mojang.realmsclient.gui.ChatFormatting.ITALIC + "It's colour is blue."); // newline } This method should always be client-side, I don't see how it would work server-side. The client is the one that displays the tooltip, the server can't do that. It could ask the client to display it, but the client would still have to be the one that actually displays it, so you would again need some custom code there.
  12. I decided to use your wrapper and come up with a secondary mod logging system. The system is currently setup to write errors, warnings and fatal logs to a separate text file in addition to being already printed to the console and written to the main log4j log file. This way I have a copy of all the logs I am really interested in. I can use that info (by checking the date and time) to find the stack trace in the FML-client log file. This is the best thing I could come up with, you can check it out here. I've also discovered this in the comment of the FMLPreInitializationEvent.getModLog() method: Could this be where we should create out log4j property file or is this some kind of custom Forge configuration file?
  13. It seems to me that it would be a lot easier to just setup my own logger and have it write to a dedicated text file. I don't know where to add that code and I think this all requires me to setup a log4j.properties file, which I've created with default values but don't know how to test to see if it loads. Well, at least I got the error and debug messages to work. That's gonna do good for now, thanks.
  14. Do I actually need to provide two different BlockStates? I would like to call an instant entity sync without actually changing the BlockState. And what about the flags, any idea what I should enter there?
  15. Aha, now I understand. The error log is displayed in the console but the debug log is not, instead it goes into the log file. I didn't know that. Can you give me a quick example of how to simply setup a marker to post all my mod debug stuff in a separate log file? When I check the log file for debug logs there is too much info I don't want to see, and sorting through that to find what I need can be a bit tiresome.
  16. Very nice, thank you for giving me examples. I will try them out in a second, but I am wondering what are these markers. Searching on the internet about them gives me a bunch of technical information, but for starters I just want to know what is the simplest application of them?
  17. I've been trying to figure this out for a while, the proper way of calling a TileEntity sync. I knew how to do it back in 1.8 by calling markBlockForUpdate(BlockPos) and markDirty() which would immediately trigger a call to getDescriptionPacket(). After removal of the first function I don't know how to do it any more as calling markDirty() alone doesn't seem to do anything or am I missing something... Does anyone know how we're suppose to do it in 1.10?
  18. What is the proper way of using a logger to log errors, debug information and other stuff I don't know about? I've tried to use it for debugging by calling logger.debug(msg) but I haven't been able to make it work, despite being in the actual debug mode. It was some time ago but I don't think I've been able to make it work for errors as well. How do you guys use the logger, and for what purposes?
  19. Welcome back to the world of modding. Hope you find some people to work with you.
  20. Since I've tried setting the motion and all that in the constructor and it didn't work (or at least I don't know how to make it work), could you please explain to me how I would manually save and load the entity from NBT to and from the world (to achieve basically the same thing as the registration does, just without the whole 'setting up the motion and fixing the weird teleportation glitch' shenanigans). Also where and how would you set the basic motion to correct this? Because I've tried overriding the dropBlockAsItemWithChance and implementing my own version of spawnAsEntity where I only changed the entity construction invocation, and I also tried copying the motion formation code from several sources and placing it in createNewEntity in my custom item class and nothing worked. Does your EntityItem extend EntityItem? Yes, it does.
  21. Quite a fishy post, no explanations or information, just "you work for me and write code, you get money".
  22. I would suggest to first actually see how much memory you have available. You can look this up in the Resource Monitor (I hope it's still called that in Windows 10). Here is a nice guide that explains the elements of the Resource Monitor: http://www.techrepublic.com/blog/windows-and-office/investigate-memory-usage-with-windows-7-resource-monitor/ TL;DR: The way to access the Resource Monitor is to first go into the Windows Task Mannager (CTRL + ALT + del, or CTRL + SHIFT + ESC for a more direct approach) and under the "Performance" tab you will find the Resource Monitor button. You want to have as much memory in the free and standby category. The memory in standby is cache memory which means it can be released if needed by other processes, and the free memory is well... free to use.
  23. If you're interested in doing some rayTracing or are in general going to be working with vectors I would suggest using these methods: final Vec3d posVec = player.getPositionEyes(1.0F); final Vec3d lookVec = player.getLookVec(); The first method gives you the position of the vector position of the players eyes and the second one is a vector that tells us where the player is looking at. The pitch and rotation data should be readily available in the EntityPlayer instance, just access it and search for rotationPitch, rotationYaw and rotationYawHead.
  24. Since I've tried setting the motion and all that in the constructor and it didn't work (or at least I don't know how to make it work), could you please explain to me how I would manually save and load the entity from NBT to and from the world (to achieve basically the same thing as the registration does, just without the whole 'setting up the motion and fixing the weird teleportation glitch' shenanigans). Also where and how would you set the basic motion to correct this? Because I've tried overriding the dropBlockAsItemWithChance and implementing my own version of spawnAsEntity where I only changed the entity construction invocation, and I also tried copying the motion formation code from several sources and placing it in createNewEntity in my custom item class and nothing worked.
  25. Thank you for spotting that, it was a mistake on my part when I was copy pasting. I didn't read it through enough. I've been experimenting a lot with it and I must have copied it in the stage when it said false. I am aware that it does not appear under this circumstances, the real problem appears when it does spawn. As I've said, the motion is way off and not to mention the weird teleportation effect (like some kind of lag).
×
×
  • Create New...

Important Information

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