Jump to content

Vinyarion

Members
  • Posts

    55
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Vinyarion

  1. You shouldn't be using the mcp.client.Start as your main class. You should be using net.minecraftforge.userdev.LaunchTesting instead. Or as diesieben said, let forge generate them for you.
  2. That is definitely not the right thing. If your Forge installer was "some/folders/forge-1.15.2-31.1.48-installer.jar", the log should be "some/folders/forge-1.15.2-31.1.48-installer.jar.log"
  3. Not to be rude, but have you even read the EULA? There's absolutely no reason this would be a copyright issue, unless you intended on distributing it in a non-standard way. https://account.mojang.com/documents/minecraft_eula
  4. You should probably ask this question to CustomNPCs, not Forge in general, unless you already have.
  5. Ok, yeah, it's really convoluted to use Forge to change the player model per se, but you could try subscribing to RenderPlayerEvent, canceling it, and rendering your own custom player model instead. This is probably the only way you would be able to get the amount of customizability you want.
  6. You should use the latest version of MCForge (for 1.15.2) if you want to get help here, for future reference. It's so everyone only has to think about one thing and not have to think about supporting 10 different versions of MC & Forge, each with different features, styles, capabilities, and bugs.
  7. Half true: if you want to remove-while-iterating, you will want to get the Collection's Iterator (Collection<T>: public default Iterator<T> iterator()). Iterators may or may not support element removal like this: if (!thingCollection.isEmpty()) { Iterator<Thing> itr = thingCollection.iterator(); do { Thing thing = itr.next(); if (shouldRemove(thing)) { itr.remove(); } } while (itr.hasNext()); } `Collection<T>` also should have a `default void removeIf(Predicate<T> returnTrueToRemove)` method that is more amenable to lambdas like you seem to want to use here (lambdas are really great like that, keep using them)
  8. Are you saying you are returning the original ItemStack reference in the getContainerItem method? I'm pretty sure you have to return a new/copy ItemStack, not just the same reference
  9. ClickEvent.Action.OPEN_URL
  10. Pretty sure Champion is talking about how the client gets notified that a container was opened. NetworkHooks is a good place to start looking on that front.
  11. If you create something really cool, someone might be willing to pay you to develop it. I've been offered cash to write custom mods/plugins, but I have no experience with monetizing like that. Many mod authors use adfly links to generate something, but it's not that much. Basically, either write something amazing that everyone wants, or write something that an amazing person wants.
  12. You should try to use Capabilities if possible. Personally, I would associate that data with the world/dimension, considering the following scenario: The player switches dimensions The dimension gets deleted, for some reason If the position was stored with the player, the player might die upon switching back If the position was stored with the dimension, you can treat it as if it is the first time any switching occured
  13. You might want to try looking at the Robot class (java.awt.Robot, I think). This class allows you to generate input actions that get processed exactly as if the user pressed the key etc. themselves.
  14. I have already implemented a system like this in 1.14.4, and am working on porting it to 1.15.2. From your post and your account age, my impression is that you don't understand much of what is necessary to do this. Here is an example of what it ended up looking like for me when I tried. It required a lot of coremodding, including rewriting the raytracing methods to account for rotated AABBs. I would like to further mention that "AABB" stands for axis-aligned bounding box, and there was a lot of vector math required to get things to trace these oxymorons. I would not recommend to new people to try adding this feature. To actually answer your question, you would need to do these things: Coremod the GameRenderer (if I remember right) to enable custom client tracing logic. Create some sort of RotatedAABB (I used a wrapped AABB that rotated the input and output tracing vectors) Rotate these correctly to the relevant entities during the trace call. If you want custom behavior based on where the attack hits, you need to send that information either before the vanilla attack packet, or in place of the vanilla attack packet. Profit
  15. If it's a client-only mod, you should definitely put this in the ClientSetupEvent, so you don't run the risk of strange missing class errors. There are also fields in the NetworkManager class that don't get initialized in the constructor. You may want to either scrape all the fields from the original instance of NetworkManager and copy them to your custom class or try to do something similar to the ClientPlayNetHandler.
  16. Issue has been resolved by cleaning out old Java installations from environment variables
  17. As far as I can tell, you just have to make sure that new fluids aren't registered to the WATER fluid tag.
  18. There isn't any server at the address `teheransana.minecraftserver.net`, apparently
  19. If your objective is to change it for other fluids, I would just make a custom particle that's pretty much a copy of the vanilla one, except you now have control over the color and rendering. Another more low-level way would be to use coremods, but those can cause many compatibility issues.
  20. You could listen for the `LivingDamageEvent` or the `LivingHurtEvent`, check `if (event.getAmount() >= 5)`, check `if (event.getEntityLiving() instanceof ServerPlayerEntity)`, and call `LivingEntity.addPotionEffect(EffectInstance)`, supplying your custom potion effect there.
  21. You might want to start with the `Client` inner class, and look at the method `public void playerRightClick(InputEvent.ClickInputEvent event)` in particular. This method catches the almost-raw input click and redirects right clicks to attack entities. It should be noted that this completely redirects inputs to use a custom packet for attacking entities, where I can more easily specify the hand being used and the behavior I want to result. Near the bottom, you will see custom rendering code that displays two mini-sword-icons instead of just one. Additionally, I am actually injecting a new field of type `DualWield` into the `LivingEntity` class with a coremod. This may or may not be something you want to do for just one item. In your case, and for only a few items, I might recommend taking the following actions: Intercept the right-click with a client listener for `InputEvent.ClickInputEvent` Check for your item (if (item instanceof YourItem) is likely best) If this is met: Send a custom attack packet Cancel the event Call `event.setSwingHand(true)` or call it with `false` and manually call `mc.player.swingArm(Hand.OFF_HAND)` In your custom packet, swap the player's held items without resetting the cooldown, call the vanilla behavior, and swap the items back This would be a lot more lightweight than my implementation, as I am adding a custom Stamina feature. Edit: For reference, you may want to take a look at https://github.com/SybylineNetwork/Anduril/blob/master/src/main/java/sybyline/anduril/network/C2SAttackEntity.java. This is how I made sure that the entity was properly attacked, as well as a consideration of the player's reach distance, something that I am a bit surprised that Forge doesn't do. I should probably make a pull/feature/bugfix request at some point about that. Edit 2: It is essential that the entity is attacked before the arm is swung, as arm swings reset attack cooldown.
  22. I recently wrote a mod that allows for true dual wielding attacks, you may want to take some inspiration from this: https://github.com/SybylineNetwork/Anduril/blob/master/src/main/java/sybyline/anduril/coremods/DualWield.java
  23. Take a look at your disenchanter block class: @Override public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult result) { if (!world.isRemote) { TileEntity tileEntity = world.getTileEntity(pos); if (tileEntity instanceof INamedContainerProvider){ NetworkHooks.openGui((ServerPlayerEntity) player, (INamedContainerProvider) tileEntity, tileEntity.getPos()); } else { throw new IllegalStateException("Our named container provider is missing."); } return true; } return super.onBlockActivated(state, world, pos, player, hand, result); } If you follow the control flow, the client-side block will always return super.onBlockActivated(state, world, pos, player, hand, result); The effects you are describing seem to be caused by the client and server following different paths here, the server returning true after opening the gui, and the client returning super.onBlockActivated, which I'm pretty sure defaults to false.
×
×
  • Create New...

Important Information

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