Jump to content

Hamster_Furtif

Members
  • Posts

    100
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Hamster_Furtif

  1. Ho thank you ! Looks like I'm going to use a craft then.
  2. I found it ! [code load = EntityRenderer.class.getDeclaredMethod("loadShader", ResourceLocation.class); load.setAccessible(true); load.invoke(Minecraft.getMinecraft().entityRenderer, new ResourceLocation("shaders/post/invert.json")); You'll have a lot of try/catch to do but it works.
  3. Well, there is a super secret setting for this ! Look what you can get from this: if (GLContext.getCapabilities().OpenGL20 && OpenGlHelper.areShadersSupported()) { Minecraft.getMinecraft().entityRenderer.activateNextShader(); } I can't help you more, because I'm struggling too with those damn shaders ! I hope you'll find a solution, because I need that solution.
  4. Hey ! First, when you paste your code, use the # symbole just under the "Font Size" scrolling menu. Then, I suggest that you use a tileentity. I'm not sure, but I think that would work.
  5. The latest version is: package com.hamsterfurtif.masks.masques; import net.minecraft.init.Items; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import com.hamsterfurtif.masks.Masks; public class ItemMask extends ItemArmor{ public ItemMask(String nom) { super(Masks.armorMask, 1, 0); this.setMaxDamage(2); this.setUnlocalizedName("mask_"+nom); this.canRepair = true; this.setCreativeTab(Masks.tabMasks); } @Override public boolean getIsRepairable(ItemStack input, ItemStack repair) { boolean compatible = false; for (int i=0; i < Masks.masques.length; i++) { System.out.println("Trying to repair: "); System.out.println(input.getItem() == Masks.masques[i]); System.out.println("&&"); System.out.println(repair.getItem() == Items.clay_ball); if (input.getItem() == Masks.masques[i] && repair.getItem() == Items.clay_ball) compatible = true; } return compatible; } } With this in the main class: public static Item mask_clay = new ItemMask("clay"); public static Item mask_spider = new ItemMaskSpider(); public static Item mask_cow = new ItemMaskCow(); public static Item mask_mouton = new ItemMaskMouton(); public static Item mask_gardien = new ItemMaskGardien(); public static Item mask_squelette = new ItemMaskSquelette(); public static Item[] masques= {mask_clay, mask_spider, mask_cow, mask_mouton, mask_gardien, mask_squelette};
  6. I don't know how often I am allowed to "up" a thread, but... Up !
  7. What you sent me caused an error, so I used this: System.out.println("Trying to repair: "); System.out.println(input.getItem() == Masks.mask_cow); System.out.println("&&"); System.out.println(repair.getItem() == Items.clay_ball); return input.getItem() == Masks.mask_cow && repair.getItem() == Items.clay_ball; And it printed: Trying to repair true && true
  8. @Override public boolean getIsRepairable(ItemStack input, ItemStack repair) { //input is the itemStack to be repaired, repair is the itemStack that should repair this item. //Change the bronze items to your own. return input.getItem() == MyItems.bronze_helmet && repair.getItem() == MyItems.bronze_ingot; } This is not working. The weird thing is that it didn't work with: @Override public boolean getIsRepairable(ItemStack input, ItemStack repair) { return true; } And I know adding ? true : false is useless, but I tried everything I could.
  9. Hey ! I have created a custom armor (actually, it's only a helmet), but it doesn't repairs. Here is the code: public class ItemMask extends ItemArmor{ public ItemMask(String nom) { super(Masks.armorMask, 1, 0); this.setMaxDamage(2); this.setUnlocalizedName("mask_"+nom); this.canRepair = true; this.setCreativeTab(Masks.tabMasks); } @Override public boolean getIsRepairable(ItemStack input, ItemStack repair) { return repair.getItem() == Items.clay_ball ? true : false; } } Here is the ArmorMaterial: static int[] a = {1,1,1,1}; public static ArmorMaterial armorMask = EnumHelper.addArmorMaterial("armorMask", "mask", 2, a, 0); And even this doesn't work: @Override public boolean getIsRepairable(ItemStack input, ItemStack repair) { return true; } And there is something else: the armor doesn't break when it has 0HP, it takes one more hit to break it. Thank you for your help !
  10. Thanks guys, it's working now ! Here's the code if some of you are interested: public class EventCraftPyrite { @SubscribeEvent public void onCraft(PlayerInteractEvent event) { Block block = event.world.getBlockState(event.pos).getBlock(); if (block == KlondikCraft.pyrite_gold) { System.out.println("Block: OK"); EntityPlayer player = event.entityPlayer; if (player.getCurrentEquippedItem() != null) { Item item = player.getCurrentEquippedItem().getItem(); System.out.println(item.getUnlocalizedName()); if (item == Items.flint) { event.world.setBlockState(event.pos, KlondikCraft.pyrite_block.getDefaultState()); } } } } }
  11. First: -I love your avatar. Doge is my favorite meme. -It's called pyrite_gold because it's a fake gold block made of pyrite. Now... This doesn't work: public class EventCraftPyrite { @SubscribeEvent public void onCraft(PlayerInteractEvent event) { Block block = event.world.getBlockState(event.pos).getBlock(); if (block == KlondikCraft.pyrite_block) { EntityPlayer player = event.entityPlayer; Item item = player.getCurrentEquippedItem().getItem(); if (item != null) { if (item == Items.flint) { event.world.setBlockState(event.pos, KlondikCraft.pyrite_block.getDefaultState()); } } } } } Actually, even if you do have an Item in you hand (like flint) it crashs. But checkin if the item==null doesn't help, because is crashes at this line: Item item = player.getCurrentEquippedItem().getItem(); Because of this part: player.getCurrentEquippedItem().getItem() So this may be helpfull, but it doesn't help for THIS problem (even though it solve anotherone).
  12. Hey guys ! I a making an event, that turn a block into another when right-clicked with the flint. The only problem is... I can't detect what Item the player is holding. I looked for the solution on many topics, but the answer always was <<You are using a custom item, use the onItemRightClick method>>. So, here's my current event: public class EventCraftPyrite { @SubscribeEvent public void onCraft(PlayerInteractEvent event) { EntityPlayer player = event.entityPlayer; Item item = player.getCurrentEquippedItem().getItem(); Block block = event.world.getBlockState(event.pos).getBlock(); if (item == Items.flint && block == KlondikCraft.pyrite_gold) { event.world.setBlockState(event.pos, KlondikCraft.pyrite_block.getDefaultState()); } } } And when the game crash (beacause is does chrash), it tells my the problem is at this line: Item item = player.getCurrentEquippedItem().getItem(); I browsed a few forums, and learned that the getCurrentEquippedItem() method only works on client side. So, I would like to know, how can I check if the item my player is holding is flint ? Thank you !
  13. Yeah, thank you very much diesieben07 and brandon3055 ! Everything is fine now !
  14. Looks like a good idea, I'll try it as soon as the mod itself is working. EDIT : Ok, I understood, Eclipse can't find cpw.mods.fml.common.launcher.FMLTweaker because there is no cpw.mods.fml.common.launcher.FMLTweaker anywhere in the Libraries. What is the right version on this list please ? http://www.minecraftforge.net/forum/index.php/topic,27505.0.html
  15. Ok, I just installed what I think is the right version of forge ( it's the src version), and did all the gradlew and configuration stuff, but now I have a new problem, the game won't start. Here is the report : And here are pictures of the configuration panel, it may be useful:
  16. Well, to be honest, I don't even know what it is... But as you should see on this picture, I have most of the thing I should have, but I don't have the common.util for example. Maybe it's because I downloaded a too early version of Forge, before they had done everything ? The bottom of fml.bin:
  17. Hey everyone, I would like to know how to add the universal.jar file to my project, for I would like to use the EnumHelper class, could someone hlep me ? I have another small question : I would like to add damage t an item when it's used, but the damaged item gets <<healed>> when used again. Here is the item's class: Thank you very much for any help you can give me !
  18. Ho, I did not know the difference between Forge and FML... I took a look at this. I almost understood the difference. Thank you anyway!
  19. Hey guys ! I'm working on a small mod for 1.8, and I wonder : how do you make a new Item Material ? The 1.7 version allowed you to do this : EnumHelper.addToolMaterial(Stuff, otherstuff, morestuff, somestuffagain) What is the 1.8 equivalent ?
  20. Eternaldoom: I wanted to change the upper block metadata as the lower block's change, and as the getIcon function is kind of linked with the metadata, I thought it would be the easier way to do so. david476: In the world.destroyBlockInWorldPartially(posX, posY, posZ, 0, 2) function, what I am supposed to use as the two last arguments ? By the way, yes, I'm french.
  21. Thank you, it's fixed.
  22. Hi there ! I've created a two blocks tall corn crop. When you break the lower block, the upper block is supposed to break, but it doesn't !Also, if you grow a single crop at it's max, all the upper part of other crops, even when they're not totally grown, will render as grown as the most grown crop. And if I quit the game, with some corn in it, when I want to play on the save with corn, the came crashs. A few other details: -Bone powder doesn't work on the upper part -The "link" between the crops occur even if they don't share any X, Y, or Z axis The crash report Lower crop class: Upper crop class: A few screenshots to help you understand : 1rst stage for all I starts growing the middle crop only As you see, the upper blocks grow all together I break the middle crop Then all the lower crops. The upper blocks don't break. Even when they're not side by side, the upper blocks grow all together, even when they're not at the same height, or if they don't share any axes !
  23. Well, this is the basic minecraft method, but it works just fine. The problem comes when I add: public int getRenderType() { return 2; }
×
×
  • Create New...

Important Information

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