Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/09/17 in all areas

  1. It's huge and constantly changing and some events have sub events (e.g. CropGrowEvent.Pre vs. CropGrowEvent.Post) while others have a Phase (most TickEvents). So no, there isn't a comprehensive list. You can also do: Right click an event -> Open type hierarchy Double click Event Right click Event -> Open type hierarchy Note that in Eclipse ctrl-clicking on a class, method, or field name will jump to its declaration.
    1 point
  2. Open your IDE Find any event you know Open its parent class Goto 2 until at the Event class Right click -> open type hierarchy
    1 point
  3. Are you sure there is a field called "heal"? I looked at the Potion class and these are the fields I see: public class Potion extends net.minecraftforge.registries.IForgeRegistryEntry.Impl<Potion> { public static final RegistryNamespaced<ResourceLocation, Potion> REGISTRY = net.minecraftforge.registries.GameData.getWrapper(Potion.class); private final Map<IAttribute, AttributeModifier> attributeModifierMap = Maps.<IAttribute, AttributeModifier>newHashMap(); private final boolean isBadEffect; private final int liquidColor; private String name = ""; private int statusIconIndex = -1; private double effectiveness; private boolean beneficial; Also, if you really need to use Reflection (you usually don't though, so we should see if there is a way to accomplish what you want without it) you need to use the ReflectionHelper class. This is because the field and method names are obfuscated in the real game but in our development environment they are deobfuscated. So you need to reference the SRG mapped name as well, and the ReflectionHelper helps with that. If you don't, it will appear to work in the development environment but will fail when you build your mod.
    1 point
  4. Top of the workspace. GenPatches does a comparison between Clean and Forge.
    1 point
  5. Those commands are for creating a default workspace for that editor. You can do those bits manually from within Eclipse or IntelliJ. They're convenience functions.
    1 point
  6. Don't turn off PVP. What you want to do is create a modifier for the players to make them belong to a team. You could add a custom Capability that lists their Teamname for example. Now what you want to do is create an forge event https://mcforge.readthedocs.io/en/latest/events/intro/ in which you subscribe to the LivingHurtEvent, this event fires whenever a player is ABOUT to take damage. Now you make it only listen to players taking damage, you do this with a simple if statement. if(event.getEntity() instanceof EntityPlayer) Now you have an Event that will listen to the damage event. You can now use event.getSource() to get the damage source. Most damage sources in the game (Projectiles, sword attacks etc.) Will have a parameter that tells you who actually fired the arrow/used the sword. While the code below probably wouldn't work, since I removed the part about capabilities with a comment and you probably need a few null checks to make sure the damagesource has an Entity attached. This is what I imagine the event would end up looking like: @SubscribeEvent public void event(LivingHurtEvent event){ if(event.getEntity() instanceof EntityPlayer && event.getSource().getSourceOfDamage() instanceof EntityPlayer){ EntityPlayer hitter = (EntityPlayer)event.getSource().getSourceOfDamage(); //returns an Entity who caused the damage. EntityPlayer target = (EntityPlayer)event.getEntity(); //returns Entity who got hit. We already established this is a player. //Code to check the user's Capabilities and see if they have the same team here if(hitterCapability.getTeam == targetCapability.getTeam){ event.setCanceled(true); } } } now, adding capabilities to players is documented here: https://mcforge.readthedocs.io/en/latest/datastorage/capabilities/ and if you want to synch this up to the server side you probably want to use a packet, unless players don't get a team untill after they log in. Sorry for being a bit long while talking, I'm messaging away from home. I hope this helps a bit, if you have questions feel free to ask. Edit: Not every source of damage has a player source like I said before, make sure that the code you end up making takes this into account. If the source of the damage is an TNT block you might want to block the damage alltogether. The most basic use of blocking damage with a player source should block sources like hits, throwables, throwing potions(?) etc. But the things that are NOT blocked are mostly stuff with big AOE's, which means that that could possibly count as friendly fire when blowing stuff up.
    1 point
  7. Every block handles this differently. Beds and doors use a HALF property, but there's no indication of which direction the other half is (doors know it's down, beds have a FACING). Mod blocks may not even have that information available. I know that my windmill involves 3 different blocks. The millstone has an ORIENTATION property, the Axel knows which direction to look in (away from the millstone) and the windvanes know that the core of the axel (the hub joint, farthest from the millstone, where all the winevanes connect) is in one of six locations. It just checks all six. It gains a property afterwards, but it's assigned by the hub for looks.
    1 point
  8. Read the trinary expression again VERY carefully so you understand the RESULT of each logical subexpression. If that doesn't give you an aha moment, then run it in the debugger so you can step it. If necessary, write your own nested if-then-else statements to break it down to where you can grasp it.
    1 point
  9. I haven't encountered that error before, but I haven't tried to remove every vanilla recipe. My code doesn't delete any recipes, it just overrides them with new recipes that do nothing. Your code is only overriding vanilla recipes, it shouldn't be touching any mod recipes. Set an exception breakpoint for NullPointerException and filter it to only include exceptions thrown from the GuiButtonRecipeTab class. When this exception is thrown on line 146, look at what's null (I think it can only be the list local variable) and what the value of GuiButtonRecipeTab#category is.
    1 point
  10. Eclipse Java®. Stay safe, stay friendly™.
    1 point
  11. No no no, not-user-friendly is Blender. It took me 2 hours to move a camera and change the animation speed on an already complete scene. I lost track of the number of times I had to quit and start over.
    1 point
  12. Oh, that's a nifty little page there... thanks! You, draco, are a lifesaver.
    1 point
  13. Can you explain what exactly isn't working? 1) plants not showing up in creativeTabs for you to place during creative? 2) plants not being created during biome creation? 3) plants showing up in creativeTabs, but without proper texture? pink/black squares? etc...
    1 point
  14. Would it also be possible to get all of these variables directly from BlockDoublePlant and just reference them in my own mod? Or would I actually need to implement everything in the individual class for my own double plant? ie. public class BlockAplant extends BlockDoublePlant
    1 point
  15. If you have the player, you can use EntityPlayer#sendMessage(new TextComponentString("string").
    1 point
×
×
  • Create New...

Important Information

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