Jump to content

brandon3055

Forge Modder
  • Posts

    444
  • Joined

  • Last visited

Everything posted by brandon3055

  1. Adding sounds is easy you simply put your audio files (format is .ogg) in assets/modid/sounds then all you have to do to have them loaded into the game is create a sounds.json file which you put in assets/modid it should look something like this { "charge": {"category": "block","sounds": [{"name": "charge","stream": false}]}, "discharge": {"category": "block","sounds": [{"name": "discharge","stream": false}]}, "boom": {"category": "block","sounds": [{"name": "boom","stream": false}]}, "beam": {"category": "block","sounds": [{"name": "beam","stream": false}]} } There are lots of tutorials about that if you look. You can then play the sound like any vanilla sound. (There are plenty of examples in the vanilla code) Edit: Example. worldObj.playSoundEffect(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D, "modid:boom", 10F, worldObj.rand.nextFloat() * 0.1F + 0.9F);
  2. Darn it i searched for about 10 minutes for a way to set equipment how did i not find that! As for recently hit it is something i need to access a lot and from what i have read it is best to use an AT for something you need to access a lot Unless i have a different idea of what is a lot?. (I have a mob grinder that sets it in every mob it kills) And i wanted an excuse to learn how to use it anyway. Edit: Turns out there was a problem with the way i had CCC and NEI setup that for some reason didnt show itself until i started messing with the AT.
  3. It annoys me to have to ask for help for something i thought would be (and probably is) very simple but here i am. I am trying to set up an access transformer for my mod and i almost have it figured out. Everything looks fine the private fields are showing as public in my IDE but when i try to start the game i get a weird crash i dont understand. Everything i have done to get this far: Created DraconicEvolution_at_at.cfg and put it in src\main\resources\META-INF Created MANIFEST.MF and put it the the same place (I have no idea what this is or what it dose can someone please explain) Added this to my build.gradle Is there anything i have left out or done incorrectly? I am trying to follow this wiki article http://www.minecraftforge.net/wiki/Using_Access_Transformers but its a bit of a jumbled mess spread across multiple versions.
  4. column 17 is this "useDependencyInformation": true try making true a string
  5. I dont know of any but its so simple you really shouldnt need one. Here is an example from my mod that sets a private value in an instance of EntityLivingBase ReflectionHelper.setPrivateValue(EntityLivingBase.class, mob, 60, new String[]{"recentlyHit", "field_70718_bc"}); The parameters are: The class that contains the field (must be the actual class not an extension) (is extension the rite word?) mob is the entity 60 is the value i am setting The two strings are the de obfuscated and obfuscated names of the field. You can find a list of all MCP name conversions in C:\Users\[username]\.gradle\caches\minecraft\de\oceanlabs\mcp\mcp_snapshot_nodoc\20140930\fields.txt
  6. Take a look at these two lines package com.tacocraft.Main; The location of your client proxy com.tacocraft.main.ClientProxy The location you have specified as your client proxy Your package names should be all lower case fix that and it should work. Edit: Darn you just beat me.
  7. Regarding your NBTHelper. That all looks fine but it really only dose half the job if you still have to check that the stack has a tag and if not add it that should all be handled by your handler so you can do setValue(stack, "Tag", value) and getValue(stack, "Tag", default) and not have to worry about anything else. If your not sure how to do that check out my NBTHelper As for the rest im still looking for the cause of your talismen problem i will get back to you if i find anything. Edit: In onUpdate in the item class why are you sending a message to the client? onUpdate is called both client and server side. Also it dosnt look like you are using extended properties correctly. @Override public void handleKeys() { if(Minecraft.getMinecraft().inGameHasFocus && Minecraft.getMinecraft().gameSettings.keyBindJump.getIsKeyPressed()) { ExtendedPlayer.spaceDown = true; } else { ExtendedPlayer.spaceDown = false; } } You are just changing the field in your ExtendedPlayer class which works because its client side but its not actually saving anything to the player. Edit 2: --stack.stackSize; should be all you need here. --stack.stackSize; if(player instanceof EntityPlayer) { ((EntityPlayer)player).inventory.setInventorySlotContents(((EntityPlayer)player).inventory.currentItem, null); } Regarding the durability resetting it dosnt look like you are actually changing the damage value so do you mean the nbt value is resetting? or did i miss something? Edit 3: found the problem because you are only setting ExtendedPlayer.isSpaceDown client side the following code is only running client side if(ExtendedPlayer.isSpaceDown((EntityPlayer)player)) { if(player.posY < Reference.HEIGHTLIMIT) { player.motionY += Reference.TERMINAL * Reference.THRUST; if(player.motionY > Reference.TERMINAL) { player.motionY = Reference.TERMINAL; } } NBTHelper.incrementIntSetDamage(stack, "Mana"); if(stack.stackTagCompound.getInteger("Mana") > this.getMaxDamage()) { --stack.stackSize; if(player instanceof EntityPlayer) { ((EntityPlayer)player).inventory.setInventorySlotContents(((EntityPlayer)player).inventory.currentItem, null); } } } Which means you are only changing the nbt client side so as soon as the client re syncs with the server by something such as the player relogging or going to another dimension the value is reset back to default. So to fix your problem you need to a) Learn how properly use IExtendedEntityPropertiys b) Use your key input handler to send a packet to the server when space is pressed that packet should contain a Boolean that says wether space is pressed or not and on reviving that packet set the property "isSpaceDown" for the player (you will have to set it client side aswell but that will be exactly the same just do it before you send the message to the server) BTW the reason it lets you fly as it is is because player motion is handled client side.
  8. Look at entityArrow code to see how it detects if it has hit an entity.
  9. His IMessage class is inside his IMessageHandler class isn't it supposed to be the other way around? Or dosnt it matter?
  10. Is this even a modding issue? If you are just trying to setup a modded server you are in the wrong place this is for modders with modding related problems.
  11. Well I'm not to sure about raytracing but post all of the relevant code and I will see if I can figure out what's.going on with the flight talismen. That should be fairly simple.
  12. Agreed i was just putting that out there. While on the topic of reflection i have quick question. I know that in order for reflection to work in both the compiled mod and your IDE you need to give it 2 strings both the obfuscated and de-obfuscated name of the variable you are changing but in every example i have seen there is a third usually a single letter. What is that for?
  13. I did something similar with my mod at the time i didnt know how to use reflection and in fact i may switch to that but this is what i came up with. It just make them angry at the player it just makes them angry so they will attack any nearby players. EntityPlayer player = event.entityPlayer; List list = world.getEntitiesWithinAABB(EntityPigZombie.class, AxisAlignedBB.getBoundingBox(player.posX - 32, player.posY - 32, player.posZ - 32, player.posX + 32, player.posY + 32, player.posZ + 32)); EntityZombie entityAtPlayer = new EntityPigZombie(world); entityAtPlayer.setPosition(player.posX, player.posY, player.posZ); boolean flag = false; for (int i = 0; i < list.size(); ++i) { Entity entity1 = (Entity) list.get(i); if (entity1 instanceof EntityPigZombie) { EntityPigZombie entitypigzombie = (EntityPigZombie) entity1; NBTTagCompound compound = new NBTTagCompound(); entitypigzombie.writeEntityToNBT(compound); compound.setShort("Anger", (short) 1000); entitypigzombie.readEntityFromNBT(compound); } } I could probably have used a for each loop instead of that foe loop.
  14. CarOre is of type Block and he is trying to get it to drop CDrop. By "It still drops itself" i think he means the blocks still drops its itemblock and not CDrop (@OP FIX YOUR NAMES!) Try adding the following to your block it should make your block drop an apple when harvested. If that works you can rule out the block as the problem. @Override public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { return Items.apple; }
  15. Almost identical to eclipse gradlew setupDecompWorkspace followed by gradlew idea
  16. More detail please what exactly are you trying to do?
  17. your using setVelocity where you should be using setPosition
  18. You need to use world.addWeatherEffect(effect) to spawn the entity in the world.
  19. Im fairly sure he just needs to use setPosition i ran into this problem when i first started messing with entitys. Im not sure why but when setting the position using entity.pos = the entity spawns at that position but immediately warps to 0, 0, 0 and falls out of the world.
  20. I used this tutorial to learn all about IExtendedEntityProperties it should tell you all you need to know. http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571567-1-7-2-1-6-4-eventhandler-and
  21. use entity.setPosition(x, y, z); instead of entity.posX=player.posX; entity.posZ=player.posZ; entity.posY=player.posY;
  22. LogHelper is just a helper class i use to print info to the console. Instead of printing true it prints [19:32:45] [server thread/INFO] [Draconic Evolution]: true its based on pahimars tutorial.
  23. Most of this is beyond my current knowledge so this may be a stupid question but i noticed toy setup your workspace in a way i am not familiar with. Have you tried creating a fresh workspace and using gradlew setupDecompWorkspace gradlew idea
  24. Regarding isFlightAllowed That only exists on a dedicated server so use. if(!world.isRemote && MinecraftServer.getServer().isDedicatedServer()) LogHelper.info(MinecraftServer.getServer().isFlightAllowed()); Edit: it looks like MinecraftServer.getServer().isFlightAllowed() actually dose work in ssp it just returns true. Is it possible you are trying to call it client side?
×
×
  • Create New...

Important Information

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