Jump to content

kauan99

Members
  • Posts

    210
  • Joined

  • Last visited

Everything posted by kauan99

  1. I found a way around it and I don't need to transform the classes anymore, but I still wish to know if the implementations of class transformers need a separate mod or just some kind of registration. In case I ever need to transform a class.
  2. I really need to patch getMaxLevel() of some of the subclasses of Enchantment class. I'm trying to learn this ASM thing, but this is hell (I wish we had a wrapper to be able to write stuff in plain java, something like ASMHelper.replaceMethod(SomeMinecraftClass.class, "methodName", methodBody), where method body would be a String written in java.) Can I have my IFMLLoadingPlugin and my IClassTransformer implementations inside my normal mod or do I need a separate mod that will be treated specially by FML?
  3. we have to make the backup ourselves (by clicking the backup button) and download it via filezilla, and then upload it when needed. something must have gone wrong either during execution of their backup tool or during the file transfer (which is very unlikely. FTP is a very reliable protocol) I got the world fixed by loading it in singleplayer and then saving and exiting minecraft. then I went checking every file in my local world, and I used each one that had been recently modified to overwrite their remote counterpart via filezilla. the world is fixed, but it took me some time...
  4. I agree 100%. I might even host my server at home, since I have a fairly powerful PC sitting idly at the moment.
  5. thanks, but it didnt work. I still have the same error http://pastebin.com/ALLeAhCa
  6. I have a server and ggservers changed the host again. during backup, somehow my world got corrupted. what can I do? I tried MCEdit but it crashes too after a while. I tried to use "repair regions" but it's still not good. this is the first time this happens and I don't know anything about minecraft raw data or even MCEdit. MCEdit says check data of chunk 18, -8 was incorrect, but so what? what can I do about it? help me, or my friends are going to kill me :'(
  7. pretty similar to what I came up with. this is probably the only decent way to do it, since we both came up with virtually the same solution.
  8. here is a way of implementing an item with a cooldown without the need of any hack: /** * you can extend this class to implement any item that has a cooldown * @author Kauan99 * */ public class CooldownItem extends Item { final int cooldown;//in ticks. ideally, minecraft runs at 20 ticks per second public CooldownItem(int cooldown) { super();//if you extend something else, you have to call the proper constructor this.cooldown = cooldown; } @Override public void onCreated(ItemStack stack, World world, EntityPlayer player) { /* * this method can be used to create the NBT if the item is crafted on a workbench. * wont be invoked in creative though (I think) */ if(stack.stackTagCompound == null) stack.stackTagCompound = new NBTTagCompound(); stack.stackTagCompound.setLong("lastuse", world.getTotalWorldTime()); } @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { if(!world.isRemote) { if(stack.stackTagCompound != null) { if(!isOnCoolDown(stack, world)) { stack.stackTagCompound.setLong("lastuse", world.getTotalWorldTime()); doAction(stack, world, player); } else { /* * this message here just for test purposes. you could remove this else clause entirely in your actual code */ player.addChatMessage(new ChatComponentText("you could not use the item because it's on cooldown. wait " + (cooldown - (world.getTotalWorldTime() - stack.stackTagCompound.getLong("lastuse"))) + " more ticks to use it")); } } else { stack.stackTagCompound = new NBTTagCompound(); stack.stackTagCompound.setLong("lastuse", world.getTotalWorldTime()); /* * bellow we have an example of recursion. this method calls itself, but we are certain this will happen only * once for each item stack */ return this.onItemRightClick(stack, world, player); } } return stack; /* * or you could make this class extend something that already does stuff when used. just replace line above with * return super.onRightClick(stack, world, player); */ } /** * override this each item that has a cooldown * @param stack * @param world * @param player */ protected void doAction(ItemStack stack, World world, EntityPlayer player) { //possibly cause damage to the item stack and whatever else you want it to do. //message bellow just for test purposes, remove it in your actual code. player.addChatMessage(new ChatComponentText("the item is doing its thing")); } public boolean isOnCoolDown(ItemStack stack, World world) { long lastUse = stack.stackTagCompound.getLong("lastuse"); long rightNow = world.getTotalWorldTime(); return rightNow - lastUse < cooldown; } } edit: no idea why the indentation got all messed up, but if you paste that into eclipse and ctrl+i the code it will get properly indented.
  9. I think the world the player is in is what he wants. but you're right, there are a lot of better ways of implementing that. I was just answering the question of how to get the world even if you don't have an entity or a direct reference to the world in your method.
  10. your exception is caused by overflowing the stack. the stack is a portion of memory. when you invoke a method, you put its parameters references/values and all references/values declared locally in your method on the top of the stack. once the method returns, it "gets pulled out of the stack" (not actually, it's just a simple decrement in a pointer, but for the purposes of this explanation, lets assume it does get pulled out of the stack) if one method A invokes another method B, B is stacked on top of A. then if B invokes A, A is stacked on top B, and so on... there are cases when this is actually what you want to do (google Recursion), but in your case it's not, because what you're doing is similar to a infinte loop, it's infinite recursion. but the stack is a finite portion of memory, and if you keep stacking stuff on it, it will become full and will halt execution. TL;DR: you can't invoke methodA from inside methodB and then invoke methodB from inside methodA to the infinity, or you'll crash. EDIT.: I still think you can get the world if you do MinecraftServer.getServer().getEntityWorld(). worse case scenario you'll get only the overworld, but I think that's not what will happen. I think Forge overrides the way minecraft implements the different dimensions. remove the infinite recursion from your code and try once more.
  11. I think all the worldObjs are just various references to the same world object. I think the dimensions are handled by forge in a different way than vanilla. but this is just a guess. he could try it, if it works, fine.
  12. try MinecraftServer.getServer().getEntityWorld() (unless it's client side, then you do the equivalent, but for client)
  13. anticipating the fact that the service that provides a host for my server will probably install cauldron again after I complained about how bad my TPS was, I'm bringing this issue back. what am I doing in that method that I have to do differently with cauldron?. thanks.
  14. the service provider will move my server to a different host (again). I hope they don't install cauldron again. I asked them not to, but you never know with those guys. and if cauldron is the only way, I'll have to learn how to make my mod compatiple with cauldron, which is hard cause the cauldron project is abandoned and I suspect moderation here frowns uppon questions about modding for it.
  15. oh sorry, I wasn't clear enough. ForgeEssentials is not the problem. as I read that snapshot, even to my layman's eye it was clear that ForgeEssentials resource usage is pretty optimal. I also asked the devs and they confirmed that ForgeEssentials is very light on the host. I'm just asking if anyone experienced with profiler snapshots could take a look at it and see if they can pinpoint the likely cause of my lag issues.
  16. after I removed Cauldron from my server and replaced it with ForgeEssentials, my server has been reporting running ~5K ticks behind or more. I downloaded FastCraft 1.22 and Sampler. FastCraft didn't do much, so I ran Sampler and got the results, but I'm not sure what they mean. I want to know if this is a host problem, a server problem or a mod problem. could someone please chek the snapshot and maybe tell me what it means? thank you. https://www.dropbox.com/s/84u0ifavypd80gb/server-profiler-snapshot.nps?dl=1 oh, and here's a list of the mods I have installed. My server's host is provided by ggservers.net, and I pay a 3GB package, that in theory would allow me to have 36 players online, but I can't get 1 without this extreme lag. Minecraft Coder Pack;9.05;http: Forge Mod Loader;7.10.99.99; Minecraft Forge;10.13.4.1448; CodeChicken Core;1.0.7.46; Not Enough Items;1.0.5.111; FastCraft;1.22; debug;1.0; Additional Pipes;4.5.2; AppleCore;1.1.0; Battle Towers;1.5.2; Baubles;1.0.1.10; BuildCraft;7.0.20; BetterQuarry;1.7.10-0.1a; << my mod, a little addon for buildcraft Forestry for Minecraft;3.6.3.20; BuildCraft Compat;7.0.11; Custom Stuff 2;0.11.21; GumballMod;1.0.0; << my mod, first one I ever made. it was made using the modmaker Custom Stuff 2. only adds a few fluids. DrZhark's CustomSpawner;3.3.0;http://www.mocreatures.org DrZhark's Mo'Creatures Mod;6.3.1;http://www.mocreatures.org Dungeon Pack;1.7.10-1.0; Forge Essentials;1.4.3; Lycanites Mobs;1.12.0.0 - MC 1.7.10; Gumball's Weapons;1.7.10-0.2.26a; << my mod iChunUtil;4.2.2; Immibis Core;59.1.1; Just Another Spawner Compatibility Addon;1.2.0; Myths & Monsters Mod;1.7.10-1.0.2; MineTweaker 3;3.0.9B; Mod Control;1.2; Mod Tweaker 2;0.8.2; MorePlayerModels;1.7.10b; Morph;0.9.1; MrCrayfish's Furniture Mod;3.4.7; NEI Integration;1.0.7; Pam's HarvestCraft;1.7.10j; Railcraft;9.6.1.0; Sampler;1.45; SmoothBedrock;2.2.0.7; The Spice of Life;1.2.3; ttCore;MC1.7.10-0.1.0-67; Tubestuff;59.0.4; Waila;1.5.10; Waila Harvestability;1.1.2; WAILA Plugins;MC1.7.10-0.0.1-15; WorldEdit;6.0.2-SNAPSHOT; Dense Ores;1.0; Hunger Overhaul;1.7.10-1.0.0.jenkins75; Just Another Spawner;0.16.19;
  17. well I would have to somehow differentiate between respawning after death, changing worlds... I don't need the operation to run in any of those cases, only when I player enters the server.
  18. I need to run a really expensive chain of methods (it involves sending and receiving data over the network), and I need it only when a player joins the server. I wanted to know if there's a way to do it without the need to come up with a hacky handler of EntityJoinWorldEvent
  19. people from minecraftforum.net usually hate when their mods get posted in those sites, so I suppose you don't do anything to get your mod there; the webmaster puts does it if he feels like it.
  20. I don't know 1.8, but try fixing what's wrong with your mcmod.info and see where it goes from there?
  21. thanks guys. I wish I knew that language gradle uses better. I just copy paste stuff... It would be better if it would use a language more similar to java. Zen Scripts are scripts but are completely clear to anyone familiar with a C++ descendant
  22. one last thing can I exclude a whole package? like compileJava { exclude 'com/mymod/tests/' }
  23. I will use the first solution. the annotation is beyond me thanks!
  24. Nice. it can't be done annotating the class though?
×
×
  • Create New...

Important Information

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