Jump to content

Mew

Members
  • Posts

    567
  • Joined

  • Last visited

Everything posted by Mew

  1. Go to the Icons and Textures tutorial on the wiki, it has the functions for the textures in it. I updated it
  2. Haha, no worries! Here is an example of what you want: public class GoldCommand implements ICommand{ @Override public int compareTo(Object arg0) { return 0; } @Override public String getCommandName() { return "gold"; } @Override public String getCommandUsage(ICommandSender icommandsender) { return "/gold <set|get|mod> player amount"; } @Override public List getCommandAliases() { List l = new ArrayList<String>(); l.add("gold"); return l; } @Override public void processCommand(ICommandSender icommandsender, String[] astring) { //hides // for(String s : TheMod.admins){ // if(s.equals(icommandsender.getCommandSenderName())){ if(astring.length != 3){ if(astring.length == 2){ if(astring[0].equals("get")){ List playerList = MinecraftServer.getServer().getConfigurationManager().playerEntityList; EntityPlayerMP player; for(int i =0; i < playerList.size(); i++){ player = (EntityPlayerMP)playerList.get(i); if(player.username.equals(astring[1])){ PlayerInfo info = Database.getPlayerInfo(player.username); icommandsender.sendChatToPlayer("<Server> player "+astring[1]+" has "+info.getGold()+" gold"); return; } } } } icommandsender.sendChatToPlayer(EnumChatFormatting.RED+getCommandUsage(icommandsender)); }else{ if(astring[0].equals("set")){ List playerList = MinecraftServer.getServer().getConfigurationManager().playerEntityList; EntityPlayerMP player; for(int i =0; i < playerList.size(); i++){ player = (EntityPlayerMP)playerList.get(i); if(player.username.equals(astring[1])){ try{ PlayerInfo info = Database.getPlayerInfo(player.username); info.setGold(Integer.parseInt(astring[2])); TheMod.proxy.sendRessourceToPlayer(player.username); return; }catch(Exception e){ icommandsender.sendChatToPlayer(EnumChatFormatting.RED+astring[2] +" is not a integer"); } } } }else if(astring[0].equals("mod")){ List playerList = MinecraftServer.getServer().getConfigurationManager().playerEntityList; EntityPlayerMP player; for(int i =0; i < playerList.size(); i++){ player = (EntityPlayerMP)playerList.get(i); if(player.username.equals(astring[1])){ try{ PlayerInfo info = Database.getPlayerInfo(player.username); info.modGold(Integer.parseInt(astring[2])); TheMod.proxy.sendRessourceToPlayer(player.username); return; }catch(Exception e){ icommandsender.sendChatToPlayer(EnumChatFormatting.RED+astring[2] +" is not a integer"); } } } } } // } // } //hidee icommandsender.sendChatToPlayer(EnumChatFormatting.RED+"dont try, we log every suspicious move"); } @Override public boolean canCommandSenderUseCommand(ICommandSender icommandsender) { return true; } @Override public List addTabCompletionOptions(ICommandSender icommandsender, String[] astring) { return null; } @Override public boolean isUsernameIndex(String[] astring, int i) { return false; } }
  3. He wasn't actually asking about aliases I believe. And that is wrong. What you returned in that method was nothing. Because you created a new array list that you hadn't added the aliases to. I believe he means sub commands of the command. i.e. /block <set/remove/pick> sort of thing.
  4. *Flourishes a bow* Thank you very much good sir! I am glad you have fixed your problem
  5. While your at it could you fix my MCVM?? (Magical Code Viewing Machine) Glad you solved it mate
  6. Have you looked at vanilla code?
  7. Well, the crash report is talking about the LanguageManager. So I believe that has to do with the language files. Unless logic is failing me...
  8. Well... I don't know why it is stuffing up then. Because from you crash report it has nothing to do with rendering... It has something to do with the language you are using. Are you using the original language files???
  9. My magical code viewing device is broken, sorry.
  10. Thanks I hope it works for you too
  11. That crash log is one for trying to launch the game. So I would say your launcher
  12. You have to have both. So like this: @Override public boolean handleRenderType(ItemStack ItemStack, ItemRenderType ItemRenderType) { switch(ItemRenderType) { case EQUIPPED_FIRST_PERSON: return true; break; case EQUIPPED: return true; break; default: return false; } } Then for the rendering: @Override public void renderItem(ItemRenderType ItemRenderType, ItemStack ItemStack, Object... Data) { switch(ItemRenderType) { case EQUIPPED: { Minecraft.getMinecraft().renderEngine.func_110577_a(new ResourceLocation("monsterhunter:textures/items/ItemRender/warHammer.png")); GL11.glPushMatrix(); float Scale = 1.75F; GL11.glRotatef(-110F, 0, 0F, 180F); GL11.glTranslatef(-1.6F, -0.3F, 0.F); boolean IsFirstPerson = false; if (Data[1] != null && Data[1] instanceof EntityPlayer) { if(!((EntityPlayer)Data[1] == Minecraft.getMinecraft().renderViewEntity && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 && !((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 180.0F))) { GL11.glTranslatef(0.165F, 0.1F, -0.75F); } else { IsFirstPerson = true; GL11.glRotatef(20F, 1.0F, -5.0F, -3.0F); GL11.glTranslatef(-0.1F, 1.6F, 0.3F); } } else { GL11.glTranslatef(0.05F, 0F, -0.27F); } GL11.glScalef(Scale, Scale, Scale); Hammer.render((Entity)Data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } break; case EQUIPPED_FIRST_PERSON: // the same code in the first case again break; default: break; } }
  13. Add case FIRST_PERSON: to all your switch statements. Then add the render code to the case in the second switch statement.
  14. I wouldn't do that. I (I am probably going to be told a better way) would use Forge events. For this specific thing I would use LivingDeathEvent. Then, checking if the entity that died was a mob I wanted to add a drop too, I would spawn a new EntityItem with the drop I wanted at the location the entity died in. Not sure how efficient it is (like I said, I will probably be told a better way), but it will work.
  15. I agree. A well-built GUI is SO much easier to use, also, it makes it easier for ANYONE to use it. Even a simple GUI is better than a command. For example, with a GUI I could have some buttons. I choose the button "Best" and type the item name I want in a text box next to it. It would then show a list underneath the search containing all the breads (I am searching for bread). But I can take that one step further. I do the same search, but I say, "Show me all items that have a price between (lets say) 0 - 50". This would show a list of the items in that price range and then display something like this: ICON FOR ITEM | ITEM NAME | PRICE | Then off you go! I would much prefer to use that then a command that would go: "The best bread is $1 from Such A Shop".
  16. If you want the visibility of the bow to draw faster, try changing when the bow texture changes. @SideOnly(Side.CLIENT) /** * Gets the Icon Index of the item currently held */ public Icon getItemIcon(ItemStack par1ItemStack, int par2) { Icon icon = super.getItemIcon(par1ItemStack, par2); if (par1ItemStack.itemID == Item.fishingRod.itemID && this.fishEntity != null) { icon = Item.fishingRod.func_94597_g(); } else { if (par1ItemStack.getItem().requiresMultipleRenderPasses()) { return par1ItemStack.getItem().getIcon(par1ItemStack, par2); } if (this.itemInUse != null && par1ItemStack.itemID == Item.bow.itemID) { int j = par1ItemStack.getMaxItemUseDuration() - this.itemInUseCount; if (j >= 18) { return Item.bow.getItemIconForUseDuration(2); } if (j > 13) { return Item.bow.getItemIconForUseDuration(1); } if (j > 0) { return Item.bow.getItemIconForUseDuration(0); } } icon = par1ItemStack.getItem().getIcon(par1ItemStack, par2, this, itemInUse, itemInUseCount); } return icon; } I found the above code in the EntityPlayer class. But that is not where you can edit it. Since you are wanting this for custom bows, that method should be like this: @SideOnly(Side.CLIENT) /** * Gets the Icon Index of the item currently held */ public Icon getItemIcon(ItemStack par1ItemStack, int par2) { int j = par1ItemStack.getMaxItemUseDuration() - this.itemInUseCount; if (j >= 18) { return Item.bow.getItemIconForUseDuration(2); } if (j > 13) { return Item.bow.getItemIconForUseDuration(1); } if (j > 0) { return Item.bow.getItemIconForUseDuration(0); } return icon; } Also, it would be a good idea to change it to the bowPull array directly, seeing as you can access it directly. I hope you get the drift of what to do
  17. Didn't I already give that in my earlier answer? I will agree that GoToLink's answer is a bit better though....
  18. I know I have seen this somewhere.... There is some class I BELIEVE is called StatCollector (or something very similar) which turns the name of what you put in to the language that is selected... (WTF? Why did I think it was stat collector?????) Okay after a little bit of searching, I have found this class: StringTranslate. Within that class is a public variable called currentLanguage. This gives the current language (obviously). This would only work with the Vanilla items I believe because I do not know of a way to have modded items change name depending on language. But then again, thats just me. So I guess you wouldn't really need the current language. You would just have to get the the registered name from LanguageRegistry. Thats what you really need. Because of that your job SHOULD be fairly easy. Anyway, I have to go now, you have really intrigued me with this question so I will be back to look later. I hope I have pointed you in the right direction. Looking back though I have started to ramble... Sorry
  19. Well that is fairly easy. public void onNeighbourBlockChange(parameters....) { boolean isShape = world.getBlockID(x, y, z); // check all the blocks that you want to be in your shape. if (isShape) { EntityToSpawn entity = new EntityToSpawn(world); entity.setPosition(x, y, z); // something like that world.spawnEntity(entity); } }
  20. "Awake-List"? What do you mean by that? Do you mean how to actually spawn it into the world? Because that's the only thing I can make out of that
  21. I believe that the code for that is in the pumpkin block. So to do what you wanted. You would need to have your block detect the shape you want via onNeighbourBlock method.
  22. Why not call, player.getHeldItem().getLocalizedName(); for the name of it?
  23. Well, from what I know when making a new tool material, you can't set the anvil rebuilding thing ma bob
  24. Not true. It is in the EnumToolMaterial Which could pose a problem
  25. Well then You could do the same thing. But then if you didn't want to do that, you could create the thread when you summon the boss. Sam concept really. And you would still need the LivingDeathEvent thing
×
×
  • Create New...

Important Information

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