Jump to content

Tomson124

Members
  • Posts

    23
  • Joined

  • Last visited

Everything posted by Tomson124

  1. I am sorry but the problem is not keeping the entchantment (at least as far as I see) but is not even recognized at all.
  2. Someone reported a bug with my mod where you cannot combine the jetpack and the armor plating after you entchanted the the jetpack with a book in an anvil. I also could reproduce this. The strange thing is, that my custom recipe class which is extending ShapelessOreRecipe looks very similar to e.g. CoFH's but their recipes do work with entchanted ingredients and mine don't. I am still using "old" java recipes over the JSON ones, as I did not have the time to look into that and port everything over to this system. "UpgradingRecipeShapeless":
  3. Yeah I did, I am sorry but it is the first time that I have to deal with the client/server side interaction on my own. The current Config is read from the File and then parsed to the NBT. From there is will be read on item init to set the NBT values for each item. I guess I have to get the file on the server side an then write it to the NBT (or a variable) and get it from there on the client side for item init.
  4. I changed the side of the ConfigSync from Client to Server, but I guess that is not enough, right? public static void init() { SimplyJetpacks.logger.info("Registering network messages"); instance.registerMessage(MessageJetpackSync.class, MessageJetpackSync.class, 0, Side.CLIENT); instance.registerMessage(MessageConfigSync.class, MessageConfigSync.class, 1, Side.SERVER); instance.registerMessage(MessageKeyboardSync.class, MessageKeyboardSync.class, 2, Side.SERVER); instance.registerMessage(MessageKeyBind.class, MessageKeyBind.class, 4, Side.SERVER); }
  5. Recently I realized that if you change the config values of my mod (SimplyJetpacks 2), this changes also the values for the jetpacks on servers. The server configs are not changed as far as I know but it seems that always the client configs are loaded. Is there a way to change this, so it loads the config from the server, when the player is on a server?
  6. Sorry I misunderstood you. I now moved the method for creating the recipes into onRegisterRecipes() , too, and now it works. Thank you.
  7. I am doing it in the onRegisterRecipes() method (see post above). The RegistryHandler is registered during preInit see following:
  8. I am not that much of a fan of the new JSON recipe system, so that will probably be not my solution. I tried creating the bucket during that event but it tells me that a recipe is invalid shaped, as the bucket is null. I did it this way: @SubscribeEvent public void onRegisterRecipes(RegistryEvent.Register<IRecipe> event) { if (ModItems.integrateTE) { TEItems.initFluids(); } for(IRecipe recipe : RECIPES_TO_REGISTER) { event.getRegistry().register(recipe); } RECIPES_TO_REGISTER.clear(); } Where initFluids() looks as follows: public static void initFluids() { Fluid redstone = FluidRegistry.getFluid("redstone"); bucketRedstone = FluidUtil.getFilledBucket(new FluidStack(redstone, Fluid.BUCKET_VOLUME)); }
  9. I am currently updating my mod to 1.12 and am still pretty new to the new Registry system. In my mod I use a bucket with ThermalFoundation's Destabilized Redstone for crafting. For getting this bucket as an item I am using Fluid redstone = FluidRegistry.getFluid("redstone"); bucketRedstone = FluidUtil.getFilledBucket(new FluidStack(redstone, 1000)); This is called while preInit (before the Registry<IRecipe> event). But I always get the error: I already checked the fluid and the FluidStack for being null, but both are not, as the Fluid is initialized in the preInit, too. And ThermalFoundation is loaded before my mod. Now I found a way arround it by gathering the fluid in init phase and registering the 2 recipes which need the bucket also in init phase. But it doesn't seem right that it doesn't work the original way. What am I missing?
  10. Well that are some things I probably overlooked in rushing to get it finished ^^ Still learning java in a try and error/learning by doing kind of thing I tried the prevState as a field but didn't work either. I will move the "keys.add" in a seperate method which I call in the Cliemt proxy on init or preinit, maybe it is working then with a field.
  11. I am rewriting my KeyHandler class to also check for Mous button inputs, so the KeyBinding on MousButton also works for my mod. I found out how to check for a single mouse click, but I don't know why it is not working... Code looks like this:
  12. Thank you so much it is working now I wrote a small method which returns the IEnergyStorage of the item which should be charged: public IEnergyStorage getIEnergyStorage(ItemStack chargeItem) { if (chargeItem.hasCapability(CapabilityEnergy.ENERGY, null)) { return chargeItem.getCapability(CapabilityEnergy.ENERGY, null); } else if (chargeItem.getItem() instanceof IEnergyContainerItem) { return new EnergyConversionStorage((IEnergyContainerItem) chargeItem.getItem(), chargeItem); } return null; } I am reffering to that method when charging the Items, and it works perfectly fine. Just have to see if it also works with Items that do not implement ForgeEnergy, as I am not sure about that part: else if (chargeItem.getItem() instanceof IEnergyContainerItem) { return new EnergyConversionStorage((IEnergyContainerItem) chargeItem.getItem(), chargeItem); } But thank you a lot, I now also have a much better knowledge of Capabilites, too. Thank you for your patience with me ^^
  13. I assume that I don't do that, as I did no changes to the Item classe except overriding the initCapabilities... I thought I access the IEnergyStorage through the IEnergyContainerItem methods as they are delegated to the ForgeEnergy Capability, but probably I am understanding something wrong here. How would I access the IEnergyStorage then? By using the ForgeEnergy methods? If so, how would I use them? just returning the IEnergyContainerITem method or calculating it again?
  14. Thanks Now it works... kind of... I did the Forge Energy implementation because EnderIO items can only be charged by Forge Energy or TESLA, even after the implementation my fluxpacks don't charge EnderIO items I don't know why... Is there a way to check if a capability is loaded correctly? And I assume that I still can use the "normal" IEnergyContainerItem methods for energy usage, as I delegated them to the Capability in my EnergyConversionStorage
  15. The field was just a remaing piece of code from an earlier attempt... I now changed the EnergyConversionStorage like you said: And I adjusted the initCapabilities accordingly: @Override public ICapabilityProvider initCapabilities(ItemStack stack, NBTTagCompound nbt) { return new CapabilityProviderEnergy<>(new EnergyConversionStorage(this, stack), CapabilityEnergy.ENERGY, null); } But when I start minecraft, or more specifically when I load a world it crashes with the error:
  16. So I think I got it right, at least I did so until I ran into the first errors It currently looks like this:
  17. So to sum this up, I have to create my own CapabilityProvider which is then used in initCapabilities and I have to make a custom implementation of IEnergyStorage (like EnergyStorage) which also includes interaction with IEngeryContainerItem. But how do I tell the ForgeEnergy Capability that it has to use my custom IEnergyStorage implementation instead of the default one?
  18. Thank you. If I am right, I don't have to make my own ICapabilityProviders if I just use the default implementation from ForgeEnergy, right? Or do I need to do the exchange between ForgeEnergy and RF in the CapabilityProvider Implementation?
  19. Hey everyone, I am trying to implement ForgeEnergy as a second energy system in addtion to RF (and later also TELSA). I want to implement it in an item class wich extends the ItemArmor class. The page on ReadTheDocs about capabilities only describes it for TEs and ItemStacks... I am completly new to the capability system so I have absolutly no plan what to do. Maybe someone can explain it to me in a few sentences and can even provide an example. If it helps, the class I am talking about is this one: https://github.com/CyberdyneCC/SimplyJetpacks-2/blob/TomsonDev/src/main/java/tonius/simplyjetpacks/item/rewrite/ItemFluxpack.java Tomson124
  20. Okay I figured it out was just a really dumb mistake... I just forgot the "else" after the "if" But thanks everyone for the help
  21. So the error is just with my "debug" integer i... I see... The weird thing is that the exception is not caught ingame but it is not working like I supposed it to be either. if(!sprintKeyCheck && sprintToggleTimer != null && mc.thePlayer.movementInput.moveForward >= 1.0F && !mc.thePlayer.isCollidedHorizontally && (mc.thePlayer.getFoodStats().getFoodLevel() > 6.0F || mc.thePlayer.capabilities.allowFlying)) { if (sprintToggleTimer.getInt(mc.thePlayer) <= 0 && !mc.gameSettings.keyBindSprint.isKeyDown()) { sprintToggleTimer.setInt(mc.thePlayer, 7); sprintKeyCheck = true; } mc.thePlayer.setSprinting(true); } This (coupled with some other methodes) should make it possible to sprint in midair with the jetpack to activate its boost, but as a result I am always sprinting as soon as I am not on the ground which is not what should happen
  22. The one I had defined: "Unable to find field sprintToggleTimer"
  23. Hey everyone, I am currently in the process of updating a mod to 1.9.4 and I try to get rid of the Access Transformer, so I tried to get the variable with a Reflection but everytime I do "getInt" to the field it just catches an exception. int i; public ClientTickHandler() { try { sprintToggleTimer = ReflectionHelper.findField(EntityPlayerSP.class, "sprintToggleTimer", "field_71156_d"); i = sprintToggleTimer.getInt(mc.thePlayer); } catch (Exception e) { SimplyJetpacks.logger.error("Unable to find field \"sprintToggleTimer\""); } System.out.println("i = " + i); } Hope someone can help me
×
×
  • Create New...

Important Information

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