
Ewe Loon
Members-
Posts
158 -
Joined
-
Last visited
Everything posted by Ewe Loon
-
I'm not worried about multiplayer servers at this time, but i dont see any reason it should be a problem yes i did know that single player runs a server custom packet , yes looks like that will be the easiest solution, though knowing when to send them could be problematic, but doable "save name can change" , this is how i have been getting the world name @Override public ItemStack onItemRightClick(ItemStack i, World w, EntityPlayer p) { String wn=w.getWorldInfo().getWorldName()); ... } do worlds have a UUID ?
-
you need to be careful saving items and blocks , if you use writenbttag methods they save the internal id of the items and blocks, this could cause problems when loading into a different game, as the ids could be different you will need to write your own saving method, and use the Item's name
-
NO I am saving the data in the ItemStack NBTCompoundTag I am NOT trying to get it to work across different game saves here is a scenario I have a game running with multiple worlds world1) name: mainland type: normal Overworld world2) name: mainland_nether type: normal nether world3) name: mainland_the_end type: normal end world4) name: flatland type: flat Overworld world5) name: loonyland type: Amplified Overworld world6) name: expanse type: LargeBiome Overworld I have one of the tracker devices set to track location (world= loonyland x=1735.5 z=-456) when im in the loonyland world the device is surposed to points to the marked location when im in any other world it randomly flicks around the problem i am facing is that when rendering the screen i cannot tell which world i am in,
-
your welcome, I had the same problem too
-
when the item is configured, a location and the name of the world is stored in the nbtcompoundtag that is done server side, so the name is being stored correctly, this IS NOT the problem, that part works properly when the item is displayed in inventory or in hand, it uses icons similar to the compass (32 of them) if you are in the world it was configured to it will point to the location it is configured to, if you are in a different world it will flick about randomly well it would , but i cant get the world name client side while rendering
-
add System.out.println(name); just after getting the name, have a look at the way the names are formated also if the block you are testing for is always going to be the same type there is another way if its a minecraft block you will find them defined in Blocks , example Blocks.stained_glass_pane if its one of your blocks, define them as public static and you can compare directly from your Blocks class example here is a block and an item as defined in one of my mods public class MagicEnchantItems { public static Item rainbowdust = new QuickItem("rainbow_dust","itemdust_rainbow"); public static Block magicenchantmenttable = new BlockMagicTable(); public static void init() { GameRegistry.registerItem(rainbowdust, "itemdust"); GameRegistry.registerBlock(magicenchantmenttable, "magicenchantmenttable"); } } i can compair like this if (block==MagicEnchantItems.magicenchantmenttable){
-
? int q=1/0; that should error every time (is it) I also recommend putting @Override on the line before the overridden methods I also believe you need to do one of these extends BlockContainer implements ITileEntityProvider in your block class
-
to get the name of an Item use (i use this) String name=Item.itemRegistry.getNameForObject(item); try this for blocks (I havn't tested it) String name=Block.blockRegistry.getNameForObject(block);
-
its the world name that i want , (it happens to be the same name as the folder [usually])
-
I think you are using JRE8 , you need to be using JRE6 or JRE7, I think i read somewhere that jre7 works to change it right click on your project, select "Build Path" >> "Configure Build Path" select the "libraries" tab, and scroll to the bottom , and check which "JRE System library" you are using if its "jre8" you need to remove it and add [jre6] or [jre7] you will probably have to search for libraries, on windows search the "program files\java" folder or you wont find any
-
setting the stack size on items in inventory dosnt work, you need to change the item compleatly however there is a function to decrease the size of a stack player.inventory.decrStackSize(slotnumber, amounttodecreaseby); [\code] if you need to set the stack size do this [code] ItemStack itm=player.inventory.getStackInSlot(slotnumber); itm.stackSize=newamount; player.inventory.setInventorySlotContents(slotnumber,itm.copy()); [\code] notice the use of itm.copy() , thats makes a new stack the reason you have to replace the item completely, is that it compares the new item with the existing one so therefore if you try to put the item you took from the inventory back, it gets compared with itself, and dosnt get updated
-
i did that , thats how i know it dosnt work, the client returns "MpServer" event though the world name is "Borkland" I tried other single player worlds they all return the same thing this is for a tracking device and i need the world name during the public IIcon getIconIndex(ItemStack i) method, so i can set the icon to what is needed depending on the world
-
how do i get the name of the world that the player is in I need this for Client side Minecraft.getMinecraft().thePlayer.getEntityWorld().getWorldInfo().getWorldName(); does NOT work
-
How to break a Block with Items being dropped?
Ewe Loon replied to Bedrock_Miner's topic in Modder Support
this is taken from one of my mods Block bit = par1World.getBlock(x+xo, y+yo, z+zo); int met = par1World.getBlockMetadata(x+xo, y+yo, z+zo); if ((bit instanceof BlockLog)||(bit instanceof BlockLeavesBase)){ bit.harvestBlock(par1World, plr, x+xo, y+yo, z+zo,met); par1World.setBlockToAir(x+xo, y+yo, z+zo); } -
so, it appears its only used for sorting
-
try this RenderHelper.disableStandardItemLighting(); you might find something else in RenderHelper
-
Rendering a 3D representation of a block in a GUI?
Ewe Loon replied to McJty's topic in Modder Support
try these public boolean renderObject(int x, int y, Object itm, boolean highlight) { return renderObject(x,y,itm,highlight,150); } public boolean renderObject(int x, int y, Object itm, boolean highlight,float lvl) { zLevel = lvl; itemRender.zLevel = lvl; if (itm==null) return renderItemStack(null,x,y,"",highlight); if (itm instanceof Item) return renderItemStack(new ItemStack((Item)itm,1),x,y,"",highlight); if (itm instanceof Block) return renderItemStack(new ItemStack((Block)itm,1),x,y,"",highlight); if (itm instanceof ItemStack) return renderItemStackWithCount((ItemStack)itm,x,y,highlight); return renderItemStack(null,x,y,"",highlight); } public boolean renderItemStackWithCount(ItemStack itm, int xo, int yo, boolean highlight) { if (itm.stackSize==1) return renderItemStack(itm,xo,yo,"",highlight); else return renderItemStack(itm,xo,yo,""+itm.stackSize,highlight); } public boolean renderItemStack(ItemStack itm, int x, int y, String txt, boolean highlight){ GL11.glColor3f(1F, 1F, 1F); if (highlight){ GL11.glDisable(GL11.GL_LIGHTING); drawGradientRect(x, y, x+16, y+16, 0x80ffffff, 0xffffffff); } if (itm==null) return false; GL11.glPushMatrix(); GL11.glTranslatef(0.0F, 0.0F, 32.0F); GL11.glColor3f(1F, 1F, 1F); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glEnable(GL11.GL_LIGHTING); itemRender.renderItemAndEffectIntoGUI(fontRendererObj, this.mc.getTextureManager(), itm, x, y); itemRender.renderItemOverlayIntoGUI(fontRendererObj, this.mc.getTextureManager(), itm, x, y - 0, txt); GL11.glPopMatrix(); return true; } -
yeah, having the right imports helps, I have made that mistake myself if you have the "@Override" on the line above an error will show if the imports are wrong,
-
did you extend EntityWaterMob ? thats what the squid extends,
-
How do I check to see if a play has OP status ?
-
to override getSubItems add this into your Item Class, you can leave the @Override out of it if you like @Override public void getSubItems(Item itm, CreativeTabs tab, List lst) { for (int t=0;t<16;t++) lst.add(new ItemStack(itm,1,t)); } that should give you 16 of your item in the inventory tab 1 for each meta/damage value from 0 to 15 you are aware that addInformation is to add stuff to the tooltip only
-
there is a serious lack of information here, What Class ? I assume its your Item class since Item has this method in it What class are you extending have you overridden >> public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) or is the item damagable are you getting "If you can see this then there has been an error" showing ? also you might want to put System.out.println("Call to addinformation meta="+stack,getItemDamage()); as the first line in the method so you know if it is actually being called; if you havn't figured it out , use the little button with the "#" symbol to insert code
-
my suggestion is 1) get MCP , 2) decompile Minecraft, 3) have a look at the enderdragon, and bats in particular look at where they differ from the other entitys, since they are flying entities
-
does anyone know what IRecipe . getRecipeSize() is used for ?
-
if you want to create a simple blend of, for instance fur and spots, you could do this create each texture , fur and spots leave fur completely opaque but make the spots texture so only the spots show , the rest transparent then render 2 layers render the fur first, then render the spots a fraction above the fur if you use mpc and de-compile minecraft , you could look at how the horses are done, you might get another idea from that