Jump to content

SackCastellon

Members
  • Posts

    180
  • Joined

  • Last visited

Everything posted by SackCastellon

  1. Use this: world.func_147439_a(x, y, z); func_147439_a is equals to getBlock
  2. I've been testing for a while but i didn't get the result i wanted. So, could you recommend me a good tutorial or else? Thanks.
  3. I want my custom bow to render as the vanilla one do: https://dl.dropboxusercontent.com/u/184200482/img/bow_vanilla.png[/img] Instead of the way it renders now: https://dl.dropboxusercontent.com/u/184200482/img/bow_custom.png[/img] Here's the code: package SackCastellon.betterwood.items; import java.util.List; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import SackCastellon.betterwood.api.Tabs; import SackCastellon.betterwood.loader.LoreLoader; import SackCastellon.betterwood.reference.Reference; public class ItemBow extends net.minecraft.item.ItemBow { private final IIcon[] iconArray = new IIcon[3]; private final String material; private final String materialLore; private final String lore = LoreLoader.Material; public ItemBow(ItemPartMaterial material) { this.setCreativeTab(Tabs.tabBW); this.setMaxStackSize(1); this.setUnlocalizedName("Bow"); this.setMaxDamage(384); this.material = material.getMaterial(); this.materialLore = material.getLore(); } @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { list.add(this.lore + ": " + this.materialLore); if (itemStack.isItemEnchanted()) { list.add(""); } } @Override public String getUnlocalizedName(ItemStack itemStack) { return super.getUnlocalizedName() + "." + this.material; } private String getPathForPull(int pull) { return Reference.TexturePath + "bow/" + pull + "/" + this.material; } @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { this.itemIcon = iconRegister.registerIcon(this.getPathForPull(0)); for (int i = 0; i < 3; ++i) { this.iconArray[i] = iconRegister.registerIcon(this.getPathForPull(i + 1)); } } @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { if(player.getItemInUse() == null) { return this.itemIcon; } int Pulling = stack.getMaxItemUseDuration() - useRemaining; if (Pulling >= 18) { return iconArray[2]; } else if (Pulling > 13) { return iconArray[1]; } else if (Pulling > 0) { return iconArray[0]; } return this.itemIcon; } } Thanks for helping
  4. Ok, i will test. edit: Solved
  5. I want to know how does the world.spawnParticle(String par1, double par2, double par3, double par4, double par5, double par6, double par7); method work. What is every par, basically. p.s.: i already know that the par1 is the particle name. So i need to know the rest of them. Thanks for helping.
  6. No, i haven't. It don't works :'( :'(
  7. Yes, i already thought about that, and it works: https://dl.dropboxusercontent.com/u/184200482/img/chat_version_message_1.png[/img] BUT, if i reduce the chat width: https://dl.dropboxusercontent.com/u/184200482/img/chat_version_message_2.png[/img] THEN, happens this: https://dl.dropboxusercontent.com/u/184200482/img/chat_version_message_3.png[/img] So, it's not solved at all.
  8. His problem is that it isn't effecting the whole string, it's only effecting until a new-line. yes, it's the problem I have. Do you know how to solve it?
  9. His problem is that it isn't effecting the whole string, it's only effecting until a new-line. *affecting, sorry, can't help it I don't see why it wouldn't carry over from line to line. In fact, it shouldn't, so your problem is in the link. Also, I asked if it was a clickable link because I'm fairly confident the link would reset the chat formatting, so if you put EnumChatFormatting.RED after your link it should show everything but the link in red. No that is not a clickable link (I don't know how to do it)
  10. The problem is the following: I've created a code to display a chat message with a red color: EnumChatFormatting.RED + ModInfo[0] + " (" + ModInfo[1] + ") is out of date! Please visit " + ModInfo[3] + " to get the latest version (" + ModInfo[2] +")"; But when i run minecraft i don't get the full message on red, only the first line: https://dl.dropboxusercontent.com/u/184200482/img/chat_version_message.png[/img] Does anybody know why does it happens and how to solve it? Thanks for helping.
  11. Then which one does i need to use?
  12. I've got a SubscribedEvent which is not loading. here is the code: Main.class package SackCastellon.core; import java.io.File; import net.minecraftforge.common.MinecraftForge; import SackCastellon.core.event.SkcEvent; import SackCastellon.core.proxy.CommonProxy; import SackCastellon.core.reference.Reference; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; @Mod(modid=Reference.ID, name=Reference.NAME, version=Reference.VERSION, dependencies=Reference.DEPENDENCIES) public class SKCCore { @Instance(Reference.ID) public static SKCCore instance; @SidedProxy(clientSide=Reference.CLPROXY, serverSide=Reference.CMPROXY) public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new SkcEvent()); System.out.println("Event Handler Initialized"); } @EventHandler public void load(FMLInitializationEvent event) {} @EventHandler public void postInit(FMLPostInitializationEvent event) {} } Event.class package SackCastellon.core.event; import SackCastellon.core.handler.ChatMessageHandler; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.PlayerEvent; public class SkcEvent { @SubscribeEvent public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event) { ChatMessageHandler.broadcastMessageToPlayers(event.player.getDisplayName()+ " is testing chat messages"); System.out.println(event.player.getDisplayName() + " logged In!"); } } P.S.: i know that the event doesn't load because i don't get "PlayerXXX logged In" on the log: Does anybody knows why it doesn't work? Thanks for helping. SOLUTION: Register the event handler by this way: FMLCommonHandler.instance().bus().register(new SkcEvent()); instesd this other: MinecraftForge.EVENT_BUS.register(new SkcEvent());
  13. It mean that MC have removed it, because there isn't any method called .addChatMessage(String) even nor any method with only a String
  14. There isn't a .addChatMessage(String); or some similar method in forge 996 (as i've looked for)
  15. While not technically wrong, that's not how it's done for blocks. Here's how Minecraft handles stone: public static final Block stone = (new BlockStone(1)).setHardness(1.5F).setResistance(10.0F).setStepSound(soundStoneFootstep).setUnlocalizedName("stone").setTextureName("stone"); Bonus hint: public void registerIcons(IconRegister par1IconRegister) { this.blockIcon = par1IconRegister.registerIcon(this.getTextureName()); } It's for normal blocks (a full cube), but i think that if it has a custom Renderer class, then it isn't a normal block, isn't it?
  16. Doesn't work in eclipse gives the following error: "Syntax error on tokens, ConstructorHeaderName expected instead" I works for me: public static Block myNewBlock = new Block(Material.someMaterial); GameRegistry.registerBlock(myNewBlock, "myBlock"); public static Block myNewItem = new Item(); GameRegistry.registerItem(myNewItem, "myItem");
  17. You have to tell where is the texture: Minecraft.getMinecraft().renderEngine.bindTexture("modID:textures/entities/textureName.png");
  18. just remove .setTexture()
  19. I'm assuming one of this function (.func_149663_c("CopperOre") .func_149658_d("CopperOre") form Base.java) is .setUnlocalizedName() and the other is maybe .setTexture(), so is possible your a telling the texture is at minecraft resource forlder edit: and the same with the Ingot.
  20. Sorry, I've been busy. I made this code, based on your, but doesn't work: SkcEventHandler.java SkcEvent.java PlayerLoginEvent.java ChatMessageHandler.java And the EventHandler initialized on the Main class: SKCCore.java
  21. I'm not verry good on Java, so how can i hook it?
  22. GameRegistry.registerBlock(block, name); GameRegistry.registerItem(item, name);
  23. That should work public static Item mysimpletool; mysimpletool = new ItemMySimpleTool().setUnlocalizedName("mysimpletool").setTextureName("yourmodid:mysimpletool"); GameRegistry.registerItem(mysimpletool, "mysimpletool"); Yes, it works, but i already used it
×
×
  • Create New...

Important Information

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