MultiMote
Forge Modder-
Posts
257 -
Joined
-
Last visited
Everything posted by MultiMote
-
Your your schematic getter returns null. Search in log for "I can't load schematic, because ...".
-
Your code is correct. And you can pass meta directly, byte normally casts to int (world.setBlock(cx, cy, cz, b, spring.data[і]), 2); ). And another thing. Schematic spring = SchematicLoader.get("spring"); Don't forget to add extention to filename if you didnt do it.
-
Wtf?
-
How to disable rendering for some sides from specified blocks
MultiMote replied to rafradek's topic in Modder Support
Block.class public boolean shouldSideBeRendered(IBlockAccess iblockaccess, x, y, z, side) { return true; } -
So remove the player attack task?
-
[Unresolved] IItem Renderer only works for 1 Block
MultiMote replied to Kimpton's topic in Modder Support
1. Why do you use IItemRenderer instead of TileEntitySpecialRenderer? 2. To have TileEntity block must extend BlockContainer and have function @Override public TileEntity createNewTileEntity(World world, int i) { return new TileEntityBlock(); } 3. Also you should register your TileEntityBlock GameRegistry.registerTileEntity(TileEntityBlock.class, "tileEntityBlock"); 4. What do you want to do? -
What mob must do?
-
I think you should add this to entity constructor: this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false)); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); And to set damage use this: protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(3.0D); }
-
[1.7.2] Printing Chat To Specific Player + Chat Colour
MultiMote replied to qpwoeiruty's topic in Modder Support
targetPlayer.addChatMessage(new ChatComponentText("TEXT HERE").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.AQUA))); or targetPlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "TEXT HERE")); -
[1.7.2] Printing Chat To Specific Player + Chat Colour
MultiMote replied to qpwoeiruty's topic in Modder Support
targetPlayer.addChatMessage(new ChatComponentText("TEXT HERE")); -
How to move items towards the player?
MultiMote replied to Toastrackenigma's topic in Modder Support
m? -
How to move items towards the player?
MultiMote replied to Toastrackenigma's topic in Modder Support
Have fun public ItemStack onItemRightClick(ItemStack is, World world, EntityPlayer ep) { double radius = 5; List<EntityItem> items = world.getEntitiesWithinAABB(EntityItem.class, ep.boundingBox.expand(radius, radius, radius)); for(EntityItem it : items){ double distX = ep.posX - it.posX; double distZ = ep.posZ - it.posZ; double distY = it.posY+1.5D - ep.posY; double dir = Math.atan2(distZ, distX); double speed = 1F / it.getDistanceToEntity(ep) * 0.5; if (distY<0) { it.motionY += speed; } it.motionX = Math.cos(dir) * speed; it.motionZ = Math.sin(dir) * speed; } return is; } -
Use this getter: ResourceLocation resourcelocation = AbstractClientPlayer.locationStevePng; String username = "Someone"; if (username > 0) { resourcelocation = AbstractClientPlayer.getLocationSkin(username); AbstractClientPlayer.getDownloadImageSkin(resourcelocation, username); }
-
[1.7.10]Block item icon inside of GUI, renderToolTip rendering below
MultiMote replied to Raizunne's topic in Modder Support
It's zLevel problem, i think you should post your code. -
How to move items towards the player?
MultiMote replied to Toastrackenigma's topic in Modder Support
I mean you can use that method code as example and write your own =D -
Create class that extends GuiButton. And override GuiButton's render code.
-
protected void onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer entity) { if(!par2World.isRemote) //do nothing at client par2World.setWorldTime(par2World.getWorldTime() + 16000); }
-
Yes, data[0] is the block[0]'s metadata.
-
@diesieben07 but it cause showing item tooltip & resets itemusecount every update tick. Is there a way to prevent this?
-
[1.7.2] [SOLVED] Colored and Translated text message
MultiMote replied to Bektor's topic in Modder Support
event.player.addChatMessage(new ChatComponentTranslation("msg.config_update.name").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_RED))); -
public Schematic get(String schemname){ try { InputStream is = this.getClass().getClassLoader().getResourceAsStream("assets/mymod/schem/"+schemname); NBTTagCompound nbtdata = CompressedStreamTools.readCompressed(is); short width = nbtdata.getShort("Width"); short height = nbtdata.getShort("Height"); short length = nbtdata.getShort("Length"); byte[] blocks = nbtdata.getByteArray("Blocks"); byte[] data = nbtdata.getByteArray("Data"); System.out.println("schem size:" + width + " x " + height + " x " + length); NBTTagList tileentities = nbtdata.getTagList("TileEntities", 10); is.close(); return new Schematic(tileentities, width, height, length, blocks, data); } catch (Exception e) { System.out.println("I can't load schematic, because " + e.toString()); return null; } } public class Schematic{ public NBTTagList tileentities; public short width; public short height; public short length; public byte[] blocks; public byte[] data; public Schematic(NBTTagList tileentities, short width, short height, short length, byte[] blocks, byte[] data){ this.tileentities = tileentities; this.width = width; this.height = height; this.length = length; this.blocks = blocks; this.data = data; } } And it's from my item code, maybe it can help you: public boolean onItemUse(ItemStack is, EntityPlayer placer, World world, int x, int y, int z, int side, float px, float py, float pz) { if(!world.isRemote && !blocked && delay<=0 && side == 1 && placer.capabilities.isCreativeMode){ blocked = true; delay = 20; int rotation = OtherUtils.getPlayerRotationSide(placer); SchemUtils.Schematic sh = sut.get(schematic); if(sh==null){ placer.addChatMessage(new ChatComponentText("Schematic is dead!")); this.setUnlocalizedName("builder_corrupt"); return false;} if(logBuilding)placer.addChatMessage(new ChatComponentText("Building started.")); int i = 0; for(int sy = 0; sy < sh.height; sy++) for(int sz = 0; sz < sh.length; sz++) for(int sx = 0; sx < sh.width; sx++){ Block b = Block.getBlockById(sh.blocks[i]); if(b!= Blocks.air) { int rx = SchemUtils.blockCoordsRotation(sx - this.getxShift(), sz, rotation)[0]; int rz = SchemUtils.blockCoordsRotation(sx - this.getxShift(), sz, rotation)[1]; world.setBlockToAir(x + rx, y + ylevel + sy, z + rz); world.setBlock(x+rx, y+ylevel+sy, z+rz, b, SchemUtils.rotateMeta(sh.blocks[i], sh.data[i], rotation ), 2); } i++; } if (sh.tileentities != null) { for (int i1 = 0; i1 < sh.tileentities.tagCount(); ++i1) { NBTTagCompound nbttagcompound4 = sh.tileentities.getCompoundTagAt(i1); TileEntity tileentity = TileEntity.createAndLoadEntity(nbttagcompound4); if (tileentity != null) { int[] conv2 = SchemUtils.blockCoordsRotation(tileentity.xCoord - this.getxShift(), tileentity.zCoord, rotation); tileentity.xCoord = x + conv2[0]; tileentity.yCoord += y+ylevel; tileentity.zCoord = z + conv2[1]; world.setTileEntity(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord, tileentity); } } } if(logBuilding) placer.addChatMessage(new ChatComponentText("Building finished.")); blocked = false; return true; } return false; }
-
world.getBlock(x, y-1, z) ?
-
Iterator it = Block.blockRegistry.iterator(); ArrayList<String> vanillaBlocks = new ArrayList<String>(); while (it.hasNext()) { Block b = (Block)it.next(); vanillaBlocks.add(b.getLocalizedName()); } System.out.println(vanillaBlocks.toString());