Jump to content

warjort

Members
  • Posts

    5420
  • Joined

  • Last visited

  • Days Won

    175

Everything posted by warjort

  1. Mixin questions are not answered here. You might be able to get an answer on the #non-api-modding Channel of the forge discord. But you will need to post more information than that stacktrace to get an answer.
  2. https://johann.loefflmann.net/en/software/jarfix/index.html
  3. Not something I know anything about. But I guess you want to use ForgeMod.ATTACK_RANGE (attack distance) instead of REACH_DISTANCE (block interactions)?
  4. You can't do it like that. Other registrations are not registered yet when the items get registered (blocks and items get registered first). https://forge.gemwire.uk/wiki/Registration You need to defer your default attributes construction until after the attributes are registered. e.g. using com.google.common.base.Suppliers to memoise it something like this (untested) code: private Supplier<Multimap<Attribute, AttributeModifier>> toolAttributes = Suppliers.memoize(this::createDefaultAttributes); private Multimap<Attribute, AttributeModifier> createDefaultAttributes() { ImmutableMultimap.Builder<Attribute, AttributeModifier> builder = ImmutableMultimap.builder(); builder.put(Attributes.ATTACK_DAMAGE, new AttributeModifier(BASE_ATTACK_DAMAGE_UUID, "Weapon modifier", this.attackDamage, AttributeModifier.Operation.ADDITION)); builder.put(Attributes.ATTACK_SPEED, new AttributeModifier(BASE_ATTACK_SPEED_UUID, "Weapon modifier", speed, AttributeModifier.Operation.ADDITION)); builder.put(ForgeMod.REACH_DISTANCE.get(), new AttributeModifier(ATTACK_REACH_MODIFIER, "Weapon modifier", reach, AttributeModifier.Operation.ADDITION)); return builder.build(); } then use this.toolAttributes.get() which will create it the first time you use it.
  5. Why don't you experiment and find out? Entity.save() net.minecraft.nbt.NbtIo
  6. You don't have an answerable question. All you say is something about your code doesn't work. The code you do show references other code you don't show and lacks context, so we can't even reverse engineer (guess) what your problem is. For a question about capabilities, you don't even show yours. One way to get people not to ignore your question is to put your code on github where they can run it for themselves (and see all the relevant code). But if you don't clearly define what the problem is, nobody can help you. "Please find the bug somewhere in this random code I wrote", is question that won't attract many answers.
  7. Now you have an issue with what I would guess is the immersive fx mod? Probably conflicting with optifine?
  8. See for example BlockItem.canFitInsideConstainerItem() or ShulkerBoxBlockEntity.canPlaceItemThroughFace() for how this recursion is stopped for shulker boxes. There are a number of different "hidden" limits on saved/networked data. The most notable is java's DataOutput.writeUTF() limit of 65535 for a String (really half that since String characters can be 2 bytes). You probably won't run into any of these of limits unless you are not being sensible.
  9. Configs are not available during mod initialisation. You access configs during Common/ClientSetup and later. https://forge.gemwire.uk/wiki/Stages_of_Modloading
  10. Download the correct version of optifine for the version of forge you are using.
  11. Create and register your own subclass of ShapedRecipe/Serializer and override the Recipe.matches() to not do the mirrored check. Example from a different thread that overrides the assemble() instead of matches() https://github.com/Choonster-Minecraft-Mods/TestMod3/blob/f171406e5ab59ac33e43c19a76109b584cfefe4c/src/main/java/choonster/testmod3/world/item/crafting/recipe/ShapedArmourUpgradeRecipe.java
  12. https://forge.gemwire.uk/wiki/Capabilities/Attaching
  13. Your Recipe needs to extends CraftingRecipe look at RecipeType.CRAFTING used by CraftingMenu.
  14. This is a crash in the java virtual machine, you need to report it on the link suggested: http:// https://bugreport.java.com/bugreport/crash.jsp
  15. I think your problem is caused by the ClientBoundSetEntityMotionPacket which clamps the maximum delta at +/- 3.9d Obviously, the same clamp doesn't happen to the real data on the server so there is an inconsistency.
  16. Not my area of expertise, but it looks like the NetherPortal code is "spread out". First you have NetherPortalBlock.entityInside() that sets the isInsidePortal flag for the entity. Then you have LocalPlayer.handleNetherPortalClient() that controls the timer. The timer is then used in GameRenderer.render() for renderConfusionOverlay(), GameRenderer.renderLevel() and (Forge)Gui.renderPortalOverlay() I'll leave it you to decide how much of this you can reuse. The latter is what you should be overriding for your overlay, see for example: https://forums.minecraftforge.net/topic/115993-how-to-remove-the-sight-cross-in-the-center-of-the-screen/#comment-512655 except you want VanillaGuiOverlay.PORTAL and to actually draw something, not just cancel the event.
  17. Try setting arrow.hasImpulse = true after you change the velocity. If you look at ServerEntity.sendChanges() that should cause it to send an update packet instead of waiting 20 ticks (the arrow's updateInterval).
  18. Eggs are item entities, they don't take fall damage. Block(Behaviour).entityInside() if you don't have a full block.
  19. Looks like an issue with the apoli mod, contact the mod author.
  20. Enough. You need to spend more than 5 minutes researching this. Instead of expecting us to write your mod for you. e.g. look at how the 2x2 crafting grid works in InventoryMenu
  21. You need to use the RecipeManager serverLevel.getServer().getRecipeManager() to find the Crafting(Shapeless)Recipe for the logs you have (assuming there is one). That is the only thing that associates logs with planks.
  22. (Re)read what I wrote above about recipes.
×
×
  • Create New...

Important Information

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