Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

SantacreeperLP

Members
  • Joined

  • Last visited

Everything posted by SantacreeperLP

  1. How can I check if another mod is loaded? Return with boolean (true/false) ~Legend
  2. No, Im readding the Thaumcraft 3 Wand Of Excavation to Thaumcraft 4 by request of a friend Youve a idea what the problem is?
  3. Hey, ive a question: Im building a Thaumcraft-Addon and Im creating a Wand-Of-Excavation item. It should harvest a block when right-clicking... But it only breaks the block with a destroy-animation, the block don't disappear and still exist... How can I fix it? Heres my source: package de.xthelegend.tcwands; import ibxm.Player; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; import thaumcraft.common.Thaumcraft; import thaumcraft.common.entities.projectile.EntityExplosiveOrb; import thaumcraft.common.items.wands.WandManager; import thaumcraft.common.lib.utils.BlockUtils; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemFishingRod; import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraft.world.WorldSettings; import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.event.world.BlockEvent; public class wand_of_excavation extends Item{ public wand_of_excavation() { super(); setUnlocalizedName(Reference.MODID + ":" + "wandexcavation"); setTextureName(Reference.MODID + ":" + "wandexcavation"); setMaxDamage(2500); canRepair = false; this.bFull3D = true; setCreativeTab(MainClass.tabWands); } @SideOnly(Side.CLIENT) public boolean isFull3D() { return true; } @SideOnly(Side.CLIENT) public boolean shouldRotateAroundWhenRendering() { return true; } @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { player.setItemInUse(stack, this.getMaxDamage()); return stack; } static HashMap<String, Long> soundDelay = new HashMap(); static HashMap<String, Object> beam = new HashMap(); static HashMap<String, Float> breakcount = new HashMap(); static HashMap<String, Integer> lastX = new HashMap(); static HashMap<String, Integer> lastY = new HashMap(); static HashMap<String, Integer> lastZ = new HashMap(); @Override public void onUsingTick(ItemStack stack, EntityPlayer p, int count) { String pp = "R" + p.getCommandSenderName(); if (!p.worldObj.isRemote) { pp = "S" + p.getCommandSenderName(); } if (soundDelay.get(pp) == null) { soundDelay.put(pp, 0L); } if (breakcount.get(pp) == null) { breakcount.put(pp, Float.valueOf(0.0f)); } if (lastX.get(pp) == null) { lastX.put(pp, 0); } if (lastY.get(pp) == null) { lastY.put(pp, 0); } if (lastZ.get(pp) == null) { lastZ.put(pp, 0); } MovingObjectPosition mop = BlockUtils.getTargetBlock(p.worldObj, (Entity)p, false); Vec3 v = p.getLookVec(); double tx = p.posX + v.xCoord * 10.0; double ty = p.posY + v.yCoord * 10.0; double tz = p.posZ + v.zCoord * 10.0; int impact = 0; if (mop != null) { tx = mop.hitVec.xCoord; ty = mop.hitVec.yCoord; tz = mop.hitVec.zCoord; impact = 5; if (!(p.worldObj.isRemote || soundDelay.get(pp) >= System.currentTimeMillis())) { p.worldObj.playSoundEffect(tx, ty, tz, "thaumcraft:rumble", 0.3f, 1.0f); soundDelay.put(pp, System.currentTimeMillis() + 1200); } } else { soundDelay.put(pp, 0L); } if (p.worldObj.isRemote) { beam.put(pp, Thaumcraft.proxy.beamCont(p.worldObj, p, tx, ty, tz, 2, 65382, false, impact > 0 ? 2.0f : 0.0f, beam.get(pp), impact)); } if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && p.worldObj.canMineBlock(p, mop.blockX, mop.blockY, mop.blockZ)) { Block bi = p.worldObj.getBlock(mop.blockX, mop.blockY, mop.blockZ); int md = p.worldObj.getBlockMetadata(mop.blockX, mop.blockY, mop.blockZ); float hardness = bi.getBlockHardness(p.worldObj, mop.blockX, mop.blockY, mop.blockZ); if (hardness >= 0.0f) { int pot = 1; float speed = 0.05f + (float)pot * 0.1f; if (bi.getMaterial() == Material.rock || bi.getMaterial() == Material.grass || bi.getMaterial() == Material.ground || bi.getMaterial() == Material.sand) { speed = 0.25f + (float)pot * 0.25f; } if (bi == Blocks.obsidian) { speed*=3.0f; } if (lastX.get(pp) == mop.blockX && lastY.get(pp) == mop.blockY && lastZ.get(pp) == mop.blockZ) { float bc = breakcount.get(pp).floatValue(); if (p.worldObj.isRemote && bc > 0.0f && bi != Blocks.air) { int progress = (int)(bc / hardness * 9.0f); Thaumcraft.proxy.excavateFX(mop.blockX, mop.blockY, mop.blockZ, p, Block.getIdFromBlock((Block)bi), md, progress); } if (p.worldObj.isRemote) { if (bc >= hardness) { breakcount.put(pp, Float.valueOf(0.0f)); } else { breakcount.put(pp, Float.valueOf(bc + speed)); } } else if (bc >= hardness ) { if (this.excavate(p.worldObj, stack, p, bi, md, mop.blockX, mop.blockY, mop.blockZ)) { stack.damageItem(200,p); } lastX.put(pp, Integer.MAX_VALUE); lastY.put(pp, Integer.MAX_VALUE); lastZ.put(pp, Integer.MAX_VALUE); breakcount.put(pp, Float.valueOf(0.0f)); } else { breakcount.put(pp, Float.valueOf(bc + speed)); } } else { lastX.put(pp, mop.blockX); lastY.put(pp, mop.blockY); lastZ.put(pp, mop.blockZ); breakcount.put(pp, Float.valueOf(0.0f)); } } } else { lastX.put(pp, Integer.MAX_VALUE); lastY.put(pp, Integer.MAX_VALUE); lastZ.put(pp, Integer.MAX_VALUE); breakcount.put(pp, Float.valueOf(0.0f)); } } private boolean excavate(World world, ItemStack stack, EntityPlayer player, Block block, int md, int x, int y, int z) { BlockEvent.BreakEvent event; WorldSettings.GameType gt = WorldSettings.GameType.SURVIVAL; if (player.capabilities.allowEdit) { if (player.capabilities.isCreativeMode) { gt = WorldSettings.GameType.CREATIVE; } } else { gt = WorldSettings.GameType.ADVENTURE; } if (!(event = ForgeHooks.onBlockBreakEvent((World)world, (WorldSettings.GameType)gt, (EntityPlayerMP)((EntityPlayerMP)player), (int)x, (int)y, (int)z)).isCanceled()) { int fortune = 0; boolean silk =false; if (silk && block.canSilkHarvest(player.worldObj, player, x, y, z, md)) { ArrayList<ItemStack> items = new ArrayList<ItemStack>(); ItemStack itemstack = BlockUtils.createStackedBlock(block, md); if (itemstack != null) { items.add(itemstack); } ForgeEventFactory.fireBlockHarvesting(items, (World)world, (Block)block, (int)x, (int)y, (int)z, (int)md, (int)0, (float)1.0f, (boolean)true, (EntityPlayer)player); for (ItemStack is : items) { BlockUtils.dropBlockAsItem(world, x, y, z, is, block); } } else { BlockUtils.dropBlockAsItemWithChance(world, block, x, y, z, md, 1.0f, fortune, player); block.dropXpOnBlockBreak(world, x, y, z, block.getExpDrop((IBlockAccess)world, md, fortune)); } world.setBlockToAir(x, y, z); world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock((Block)block) + (md << 12)); return true; } return false; } boolean breakNeighbour(EntityPlayer p, int x, int y, int z, Block block, int md, ItemStack stack) { List<ForgeDirection> directions = Arrays.asList(new ForgeDirection[]{ForgeDirection.DOWN, ForgeDirection.UP, ForgeDirection.NORTH, ForgeDirection.SOUTH, ForgeDirection.EAST, ForgeDirection.WEST}); Collections.shuffle(directions, p.worldObj.rand); for (ForgeDirection dir : directions) { if (p.worldObj.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ) != block || p.worldObj.getBlockMetadata(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ) != md || !this.excavate(p.worldObj, stack, p, block, md, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ)) continue; return true; } return false; } @Override public void onPlayerStoppedUsing(ItemStack stack, World world, EntityPlayer p, int count) { String pp = "R" + p.getCommandSenderName(); if (!p.worldObj.isRemote) { pp = "S" + p.getCommandSenderName(); } if (soundDelay.get(pp) == null) { soundDelay.put(pp, 0L); } if (breakcount.get(pp) == null) { breakcount.put(pp, Float.valueOf(0.0f)); } if (lastX.get(pp) == null) { lastX.put(pp, 0); } if (lastY.get(pp) == null) { lastY.put(pp, 0); } if (lastZ.get(pp) == null) { lastZ.put(pp, 0); } beam.put(pp, null); lastX.put(pp, Integer.MAX_VALUE); lastY.put(pp, Integer.MAX_VALUE); lastZ.put(pp, Integer.MAX_VALUE); breakcount.put(pp, Float.valueOf(0.0f)); } @Override public void onUpdate(ItemStack stack, World world, Entity entity, int p_77663_4_, boolean p_77663_5_) { if (stack.stackTagCompound != null && stack.stackTagCompound.hasKey("ench")) { stack.stackTagCompound.removeTag("ench"); } super.onUpdate(stack, world, entity, p_77663_4_, p_77663_5_); } }
  4. oh yea i realized that ;:DD
  5. Hey, I want to get the current damage of the item... I typed this.setMaxDamage(2000); and i called this function: @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { blablabla(); stack.damageItem(stack, player); } But i want that blablabla is only called if the damage is < 0;...How can I do this?
  6. Hey, i want to know how to use a ore-dictionary-registred-item in an crafting recipe?Thanks
  7. I don't know how to do it.. can you help me?
  8. how can I get frontSide .. meta = 0?
  9. Good day everyone , Ive a texture rendering problem with my Block... It should be rendered like a normal furnace, but its rendering like here: http://i.imgur.com/xYpjaHi.png In the inventory, it renders like it should, but the block doesnt recognize the front-direction, so its taking the side-icon on all 5 sides. Top and bottom are rendering like it should... Heres my code: package de.xthelegend.projectredextended.alloy_furnace; import java.util.Random; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.Item; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import de.xthelegend.projectredextended.lib.base.BaseContainer; import de.xthelegend.projectredextended.MainClass; import de.xthelegend.projectredextended.lib.base.GUI_NUMBER_IDS; public class BlockAlloyFurnace extends BaseContainer { public static IIcon textureTop; private IIcon textureBottom; private IIcon textureSide; private IIcon textureFrontOn; private IIcon textureFrontOff; public BlockAlloyFurnace() { super(Material.rock, TileAlloyFurnace.class); setBlockName(MainClass.MODID + ":" + "alloy_furnace"); setCreativeTab(MainClass.tab_expansion); } @Override @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { ForgeDirection s = ForgeDirection.getOrientation(side); // If is facing if (3 == side) { return textureFrontOff; } switch (s) { case UP: return textureTop; case DOWN: return textureBottom; case EAST: case NORTH: case SOUTH: case WEST: case UNKNOWN: return textureSide; default: break; } return null; } @SideOnly(Side.CLIENT) public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { TileAlloyFurnace te = (TileAlloyFurnace) world.getTileEntity(x, y, z); ForgeDirection forgeSide = ForgeDirection.getOrientation(side); if (forgeSide == ForgeDirection.UP) return textureTop; if (forgeSide == ForgeDirection.DOWN) return textureBottom; if (forgeSide == te.getFacingDirection()) return te.getIsActive() ? textureFrontOn : textureFrontOff; return textureSide; } @Override public boolean isOpaqueCube() { return true; } @Override @SideOnly(Side.CLIENT) public void randomDisplayTick(World world, int x, int y, int z, Random rnd) { TileAlloyFurnace te = (TileAlloyFurnace) world.getTileEntity(x, y, z); if (te.getIsActive()) { int l = te.getFacingDirection().ordinal(); float f = x + 0.5F; float f1 = y + 0.0F + rnd.nextFloat() * 6.0F / 16.0F; float f2 = z + 0.5F; float f3 = 0.52F; float f4 = rnd.nextFloat() * 0.6F - 0.3F; if (l == 4) { world.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); world.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); } else if (l == 5) { world.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); world.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); } else if (l == 2) { world.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D); world.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D); } else if (l == 3) { world.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D); world.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D); } } } // Not sure if you need this function. @Override public Item getItemDropped(int p_149650_1_, Random random, int p_149650_3_) { return Item.getItemFromBlock(MainClass.BlockAlloyFurnace); } @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister) { textureTop = iconRegister.registerIcon(MainClass.MODID + ":" + "alloyfurnace" + "_top"); textureBottom = iconRegister.registerIcon(MainClass.MODID + ":" + "alloyfurnace" + "_top"); textureSide = iconRegister.registerIcon(MainClass.MODID + ":" + "alloyfurnace" + "_side"); textureFrontOn = iconRegister.registerIcon(MainClass.MODID + ":" + "alloyfurnace" + "_front_active"); textureFrontOff = iconRegister.registerIcon(MainClass.MODID + ":" + "alloyfurnace" + "_front"); } @Override public int getLightValue(IBlockAccess world, int x, int y, int z) { TileAlloyFurnace te = (TileAlloyFurnace) world.getTileEntity(x, y, z); return te.getIsActive() ? 13 : 0; } @Override public GUI_NUMBER_IDS getGuiID() { return GUI_NUMBER_IDS.ALLOY_FURNACE; } @Override @SideOnly(Side.CLIENT) public int getRenderType() { return 0; } } The BlockContainer is just a normal Block Class with some improvments to the container, there isn't something special of rendering included. Hope you can help me, would be really nice Best regards, have a nice day, Santa
  10. thats true, but that doesnt make sense if it isnt working... Any other ideas?
  11. Hey Guys, Ive a rendering problem: TOP, BOTTOM and SIDE Textures render, but the FRONT texture == SIDE texture, but it should be the FRONT texture.. What am I doing wrong? Heres the script: public class BlockProjectTable extends BaseContainer { protected IIcon textureTop; protected IIcon textureBottom; protected IIcon textureSide; protected IIcon textureFront; public BlockProjectTable() { super(Material.wood, TileProjectTable.class); setBlockName(MainClass.MODID + ":" + "project_table"); setCreativeTab(MainClass.tab_expansion); } public BlockProjectTable(Class<? extends BaseTile> tileClass) { super(Material.wood, tileClass); } @Override @SideOnly(Side.CLIENT) public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { ForgeDirection s = ForgeDirection.getOrientation(side); // If is facing switch (s) { case UP: return textureTop; case DOWN: return textureBottom; case EAST: case NORTH: case SOUTH: case WEST: case UNKNOWN: return textureSide; default: break; } return null; } @Override @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { ForgeDirection s = ForgeDirection.getOrientation(side); if (meta == side) { return textureFront; } switch (s) { case UP: return textureTop; case DOWN: return textureBottom; case EAST: case NORTH: case SOUTH: case WEST: case UNKNOWN: return textureSide; default: break; } return null; } @Override public boolean isOpaqueCube() { return true; } @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister) { textureTop = iconRegister.registerIcon(MainClass.MODID + ":" + "projecttable_" + "up"); textureBottom = iconRegister.registerIcon(MainClass.MODID + ":" + "projecttable_" + "down"); textureSide = iconRegister.registerIcon(MainClass.MODID + ":" + "projecttable"+ "_side"); textureFront = iconRegister.registerIcon(MainClass.MODID + ":" + "projecttable" + "_side_front"); } @Override @SideOnly(Side.CLIENT) public int getRenderType() { return 0; } } INFO: BaseContainer is a class EXTENDS net.minecraft.block.Block and doesn't contain something about Icon... Hope you can help me ~Santa
  12. Hey, I want do download a forge-1.5.2-userdev version to use beared-octo-nemesis. Where can I get the version? Santa
  13. I decompiled my old 1.6 mod because I lost the source ^^
  14. Yea, i tried to set var6 == var5, but it doesnt seems to work ^^ Heres my whole class: import java.util.Random; import codechicken.lib.vec.Vector3; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; import de.xthelegend.projectredextended.lib.xawpnqf; import de.xthelegend.projectredextended.lib.nawapsk; public class WorldGenRubberTree extends WorldGenerator { public void putLeaves(World var1, int x, int y, int z) { Block var5 = var1.getBlock(x, y, z); var1.setBlock(x, y, z, MainClass.BlockRubberLeaves); } public boolean fillBlock(World var1, int x, int y, int z) { if (y >= 0 && y <= 126) { Block var5 = var1.getBlock(x, y, z); Block var6 = var5; if (var6 != null && var6.isWood(var1, x, y, z)) { return true; } else if (var6 != null && !var6.isLeaves(var1, x, y, z) && var5 != Blocks.tallgrass && var5 != Blocks.grass && var5 != Blocks.vine) { return false; } else { var1.setBlock(x, y, z, MainClass.BlockRubberWood); this.putLeaves(var1, x, y - 1, z); this.putLeaves(var1, x, y + 1, z); this.putLeaves(var1, x, y, z - 1); this.putLeaves(var1, x, y, z + 1); this.putLeaves(var1, x - 1, y, z); this.putLeaves(var1, x + 1, y, z); return true; } } else { return false; } } @Override public boolean generate(World var1, Random x, int y, int z, int var5) { int var9 = x.nextInt(6) + 25; if (z >= 1 && z + var9 + 2 <= var1.getHeight()) { Block var6; int var7; int var8; for (var7 = -1; var7 <= 1; ++var7) { for (var8 = -1; var8 <= 1; ++var8) { var6 = var1.getBlock(y + var7, z - 1, var5 + var8); if (var6 != Blocks.grass && var6 != Blocks.dirt) { return false; } } } byte var10 = 1; int var11; for (var11 = z; var11 < z + var9; ++var11) { if (var11 > z + 3) { var10 = 5; } for (var7 = y - var10; var7 <= y + var10; ++var7) { for (var8 = var5 - var10; var8 <= var5 + var10; ++var8) { var6 = var1.getBlock(var7, var11, var8); Block var12 = var6; /*Block.blocksList[var6];*/ if (var12 != null && !var12.isLeaves(var1, var7, var11, var8) && !var12.isWood(var1, var7, var11, var8) && var6 != Blocks.tallgrass && var6 != Blocks.grass && var6 != Blocks.vine) { return false; } } } } for (var7 = -1; var7 <= 1; ++var7) { for (var8 = -1; var8 <= 1; ++var8) { var1.setBlock(y + var7, z - 1, var5 + var8, Blocks.dirt); } } for (var11 = 0; var11 <= 6; ++var11) { for (var7 = -1; var7 <= 1; ++var7) { for (var8 = -1; var8 <= 1; ++var8) { var1.setBlock(y + var7, z + var11, var5 + var8, MainClass.BlockRubberWood); } } for (var7 = -1; var7 <= 1; ++var7) { if (x.nextInt(5) == 1 && var1.getBlock(y + var7, z + var11, var5 - 2) == Blocks.air) { var1.setBlock(y + var7, z + var11, var5 - 2, Blocks.vine); var1.setBlockMetadataWithNotify(y + var7, z + var11, var5 - 2, 1, 0); } if (x.nextInt(5) == 1 && var1.getBlock(y + var7, z + var11, var5 + 2) == Blocks.air) { var1.setBlock(y + var7, z + var11, var5 + 2, Blocks.vine); var1.setBlockMetadataWithNotify(y + var7, z + var11, var5 + 2, 4, 0); } } for (var8 = -1; var8 <= 1; ++var8) { if (x.nextInt(5) == 1 && var1.getBlock(y - 2, z + var11, var5 + var8) == Blocks.air) { var1.setBlock(y - 2, z + var11, var5 + var8, Blocks.vine); var1.setBlockMetadataWithNotify(y - 2, z + var11, var5 + var8, 8, 0); } if (x.nextInt(5) == 1 && var1.getBlock(y + 2, z + var11, var5 + var8) == Blocks.air) { var1.setBlock(y + 2, z + var11, var5 + var8, Blocks.vine); var1.setBlockMetadataWithNotify(y + 2, z + var11, var5 + var8, 2, 0); } } } Vector3 x3 = new Vector3(); Vector3 x4 = new Vector3(); int var14 = x.nextInt(100) + 10; int var17 = 0; while (var17 < var14) { x4.set((double)x.nextFloat() - 0.5D, (double)x.nextFloat(), (double)x.nextFloat() - 0.5D); x4.normalize(); double var18 = ((double)var14 / 10.0D + 4.0D) * (double)(1.0F + 1.0F * x.nextFloat()); x4.x *= var18; x4.z *= var18; x4.y = x4.y * (double)(var9 - 15) + (double)var14 / 10.0D; if (var14 < { switch (var14) { case 0: x3.set((double)(y - 1), (double)(z + 6), (double)(var5 - 1)); break; case 1: x3.set((double)(y - 1), (double)(z + 6), (double)var5); break; case 2: x3.set((double)(y - 1), (double)(z + 6), (double)(var5 + 1)); break; case 3: x3.set((double)y, (double)(z + 6), (double)(var5 + 1)); break; case 4: x3.set((double)(y + 1), (double)(z + 6), (double)(var5 + 1)); break; case 5: x3.set((double)(y + 1), (double)(z + 6), (double)var5); break; case 6: x3.set((double)(y + 1), (double)(z + 6), (double)(var5 - 1)); break; default: x3.set((double)y, (double)(z + 6), (double)(var5 - 1)); } } else { x3.set((double)(y + x.nextInt(3) - 1), (double)(z + 6), (double)(var5 + x.nextInt(3) - 1)); } long x0 = x.nextLong(); nawapsk var13 = new nawapsk(x3, x4, x0); while (true) { if (var13.iterate()) { Vector3 x2 = var13.get(); if (this.fillBlock(var1, (int)Math.floor(x2.x), (int)Math.floor(x2.y), (int)Math.floor(x2.z))) { continue; } } ++var17; break; } } return true; } else { return false; } } }
  15. Hey, Ive a question: Im trying to update my mod from 1.6.4 to 1.7.10; Block var5 = var1.getBlock(x, y, z); Block var6 = Block.blocksList[var5]; How can I write it the best in 1.7.10 since IDs are gone? Can you give me an example? Would be really nice:) Have a nice day, Santa
  16. ok, I did it ... Do you think its acceptable now ? http://minecraftforge.net/forum/Smileys/default/undecided.gif
  17. Hey guys, ive a problem: My worldgen doesn't generate anything... I registred the worldgen like that: I really don't know what I'm doing wrong... Can you please look at the source code and can say me whats wrong? Probably I set an invalid if parameter? Would be reeealy nice if you help me Thanks, have a nice day Legend GameRegistry.registerWorldGenerator(new WorldGeneratorProjectRedExtended(), 0); And here is the worldgenerator where i set how often the tree should be generated if (bgb == BiomeGenBase.jungle || bgb == BiomeGenBase.jungleHills) { for (int i = 0; i < 6; i++) { int x = chunkX * 16 + random.nextInt(16) + 8; int y = random.nextInt(128); int z = chunkZ * 16 + random.nextInt(16) + 8; (new WorldGenRubberTree()).generate(world, random, x, y, z); } } Here's the whole worldgen script: package de.xthelegend.projectredextended; import java.util.Random; import codechicken.lib.vec.Vector3; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; import de.xthelegend.projectredextended.lib.xawpnqf; import de.xthelegend.projectredextended.lib.nawapsk; public class WorldGenRubberTree extends WorldGenerator { public void putLeaves(World var1, int x, int y, int z) { Block var5 = var1.getBlock(x, y, z); var1.setBlock(x, y, z, MainClass.BlockRubberLeaves); } public boolean fillBlock(World var1, int x, int y, int z) { if (y >= 0 && y <= 126) { Block var5 = var1.getBlock(x, y, z); Block var6 = var5;/*Block.blocksList[var5];*/ if (var6 != null && var6.isWood(var1, x, y, z)) { return true; } else if (var6 != null && !var6.isLeaves(var1, x, y, z) && var5 != Blocks.tallgrass && var5 != Blocks.grass && var5 != Blocks.vine) { return false; } else { var1.setBlock(x, y, z, MainClass.BlockRubberWood); this.putLeaves(var1, x, y - 1, z); this.putLeaves(var1, x, y + 1, z); this.putLeaves(var1, x, y, z - 1); this.putLeaves(var1, x, y, z + 1); this.putLeaves(var1, x - 1, y, z); this.putLeaves(var1, x + 1, y, z); return true; } } else { return false; } } @Override public boolean generate(World var1, Random x, int y, int z, int var5) { int var9 = x.nextInt(6) + 25; if (z >= 1 && z + var9 + 2 <= var1.getHeight()) { Block var6; int var7; int var8; for (var7 = -1; var7 <= 1; ++var7) { for (var8 = -1; var8 <= 1; ++var8) { var6 = var1.getBlock(y + var7, z - 1, var5 + var8); if (var6 != Blocks.grass && var6 != Blocks.dirt) { return false; } } } byte var10 = 1; int var11; for (var11 = z; var11 < z + var9; ++var11) { if (var11 > z + 3) { var10 = 5; } for (var7 = y - var10; var7 <= y + var10; ++var7) { for (var8 = var5 - var10; var8 <= var5 + var10; ++var8) { var6 = var1.getBlock(var7, var11, var8); Block var12 = var6; /*Block.blocksList[var6];*/ if (var12 != null && !var12.isLeaves(var1, var7, var11, var8) && !var12.isWood(var1, var7, var11, var8) && var6 != Blocks.tallgrass && var6 != Blocks.grass && var6 != Blocks.vine) { return false; } } } } for (var7 = -1; var7 <= 1; ++var7) { for (var8 = -1; var8 <= 1; ++var8) { var1.setBlock(y + var7, z - 1, var5 + var8, Blocks.dirt); } } for (var11 = 0; var11 <= 6; ++var11) { for (var7 = -1; var7 <= 1; ++var7) { for (var8 = -1; var8 <= 1; ++var8) { var1.setBlock(y + var7, z + var11, var5 + var8, MainClass.BlockRubberWood); } } for (var7 = -1; var7 <= 1; ++var7) { if (x.nextInt(5) == 1 && var1.getBlock(y + var7, z + var11, var5 - 2) == Blocks.air) { var1.setBlock(y + var7, z + var11, var5 - 2, Blocks.vine); var1.setBlockMetadataWithNotify(y + var7, z + var11, var5 - 2, 1, 0); } if (x.nextInt(5) == 1 && var1.getBlock(y + var7, z + var11, var5 + 2) == Blocks.air) { var1.setBlock(y + var7, z + var11, var5 + 2, Blocks.vine); var1.setBlockMetadataWithNotify(y + var7, z + var11, var5 + 2, 4, 0); } } for (var8 = -1; var8 <= 1; ++var8) { if (x.nextInt(5) == 1 && var1.getBlock(y - 2, z + var11, var5 + var8) == Blocks.air) { var1.setBlock(y - 2, z + var11, var5 + var8, Blocks.vine); var1.setBlockMetadataWithNotify(y - 2, z + var11, var5 + var8, 8, 0); } if (x.nextInt(5) == 1 && var1.getBlock(y + 2, z + var11, var5 + var8) == Blocks.air) { var1.setBlock(y + 2, z + var11, var5 + var8, Blocks.vine); var1.setBlockMetadataWithNotify(y + 2, z + var11, var5 + var8, 2, 0); } } } Vector3 x3 = new Vector3(); Vector3 x4 = new Vector3(); int var14 = x.nextInt(100) + 10; int var17 = 0; while (var17 < var14) { x4.set((double)x.nextFloat() - 0.5D, (double)x.nextFloat(), (double)x.nextFloat() - 0.5D); x4.normalize(); double var18 = ((double)var14 / 10.0D + 4.0D) * (double)(1.0F + 1.0F * x.nextFloat()); x4.x *= var18; x4.z *= var18; x4.y = x4.y * (double)(var9 - 15) + (double)var14 / 10.0D; if (var14 < { switch (var14) { case 0: x3.set((double)(y - 1), (double)(z + 6), (double)(var5 - 1)); break; case 1: x3.set((double)(y - 1), (double)(z + 6), (double)var5); break; case 2: x3.set((double)(y - 1), (double)(z + 6), (double)(var5 + 1)); break; case 3: x3.set((double)y, (double)(z + 6), (double)(var5 + 1)); break; case 4: x3.set((double)(y + 1), (double)(z + 6), (double)(var5 + 1)); break; case 5: x3.set((double)(y + 1), (double)(z + 6), (double)var5); break; case 6: x3.set((double)(y + 1), (double)(z + 6), (double)(var5 - 1)); break; default: x3.set((double)y, (double)(z + 6), (double)(var5 - 1)); } } else { x3.set((double)(y + x.nextInt(3) - 1), (double)(z + 6), (double)(var5 + x.nextInt(3) - 1)); } long x0 = x.nextLong(); nawapsk var13 = new nawapsk(x3, x4, x0); while (true) { if (var13.iterate()) { Vector3 x2 = var13.get(); if (this.fillBlock(var1, (int)Math.floor(x2.x), (int)Math.floor(x2.y), (int)Math.floor(x2.z))) { continue; } } ++var17; break; } } return true; } else { return false; } } } I really dont know what im doing wrong Please help me, im trying for 5 hours now.. And I dont get a solution
  18. no, I dont get any method... it just stays: [20:23:19] [Client thread/INFO]: [CHAT] Player903 has just earned the achievement [Taking Inventory] [20:25:53] [Client thread/INFO]: [CHAT] Saved screenshot as 2015-06-21_20.25.52.png Is it the sapling or the worldgen? Could you probably check the code for mistakes? Would be really nice from you Have a nice day, ~Santa
  19. if (bgb == BiomeGenBase.jungle || bgb == BiomeGenBase.jungleHills) { for (int i = 0; i < 6; i++) { int x = chunkX * 16 + random.nextInt(16) + 8; int y = random.nextInt(128); int z = chunkZ * 16 + random.nextInt(16) + 8; (new WorldGenRubberTree()).generate(world, random, x, y, z); } } and in the main class : public static WorldGenerator WorldGeneratorProjectRedExtended; and in the Init part : GameRegistry.registerWorldGenerator(new WorldGeneratorProjectRedExtended(), 0); , so i think it should work youve another idea?
  20. Hey guys, ive a problem: My worldgen doesn't generate anything... I registred the worldgen like that: I really don't know what I'm doing wrong... Can you please look at the source code and can say me whats wrong? Probably I set an invalid if parameter? Would be reeealy nice if you help me Thanks, have a nice day Legend GameRegistry.registerWorldGenerator(new WorldGeneratorProjectRedExtended(), 0); And here is the worldgenerator where i set how often the tree should be generated if (bgb == BiomeGenBase.jungle || bgb == BiomeGenBase.jungleHills) { for (int i = 0; i < 6; i++) { int x = chunkX * 16 + random.nextInt(16) + 8; int y = random.nextInt(128); int z = chunkZ * 16 + random.nextInt(16) + 8; (new WorldGenRubberTree()).generate(world, random, x, y, z); } } Here's the whole worldgen script: package de.xthelegend.projectredextended; import java.util.Random; import codechicken.lib.vec.Vector3; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; import de.xthelegend.projectredextended.lib.xawpnqf; import de.xthelegend.projectredextended.lib.nawapsk; public class WorldGenRubberTree extends WorldGenerator { public void putLeaves(World var1, int x, int y, int z) { Block var5 = var1.getBlock(x, y, z); var1.setBlock(x, y, z, MainClass.BlockRubberLeaves); } public boolean fillBlock(World var1, int x, int y, int z) { if (y >= 0 && y <= 126) { Block var5 = var1.getBlock(x, y, z); Block var6 = var5;/*Block.blocksList[var5];*/ if (var6 != null && var6.isWood(var1, x, y, z)) { return true; } else if (var6 != null && !var6.isLeaves(var1, x, y, z) && var5 != Blocks.tallgrass && var5 != Blocks.grass && var5 != Blocks.vine) { return false; } else { var1.setBlock(x, y, z, MainClass.BlockRubberWood); this.putLeaves(var1, x, y - 1, z); this.putLeaves(var1, x, y + 1, z); this.putLeaves(var1, x, y, z - 1); this.putLeaves(var1, x, y, z + 1); this.putLeaves(var1, x - 1, y, z); this.putLeaves(var1, x + 1, y, z); return true; } } else { return false; } } @Override public boolean generate(World var1, Random x, int y, int z, int var5) { int var9 = x.nextInt(6) + 25; if (z >= 1 && z + var9 + 2 <= var1.getHeight()) { Block var6; int var7; int var8; for (var7 = -1; var7 <= 1; ++var7) { for (var8 = -1; var8 <= 1; ++var8) { var6 = var1.getBlock(y + var7, z - 1, var5 + var8); if (var6 != Blocks.grass && var6 != Blocks.dirt) { return false; } } } byte var10 = 1; int var11; for (var11 = z; var11 < z + var9; ++var11) { if (var11 > z + 3) { var10 = 5; } for (var7 = y - var10; var7 <= y + var10; ++var7) { for (var8 = var5 - var10; var8 <= var5 + var10; ++var8) { var6 = var1.getBlock(var7, var11, var8); Block var12 = var6; /*Block.blocksList[var6];*/ if (var12 != null && !var12.isLeaves(var1, var7, var11, var8) && !var12.isWood(var1, var7, var11, var8) && var6 != Blocks.tallgrass && var6 != Blocks.grass && var6 != Blocks.vine) { return false; } } } } for (var7 = -1; var7 <= 1; ++var7) { for (var8 = -1; var8 <= 1; ++var8) { var1.setBlock(y + var7, z - 1, var5 + var8, Blocks.dirt); } } for (var11 = 0; var11 <= 6; ++var11) { for (var7 = -1; var7 <= 1; ++var7) { for (var8 = -1; var8 <= 1; ++var8) { var1.setBlock(y + var7, z + var11, var5 + var8, MainClass.BlockRubberWood); } } for (var7 = -1; var7 <= 1; ++var7) { if (x.nextInt(5) == 1 && var1.getBlock(y + var7, z + var11, var5 - 2) == Blocks.air) { var1.setBlock(y + var7, z + var11, var5 - 2, Blocks.vine); var1.setBlockMetadataWithNotify(y + var7, z + var11, var5 - 2, 1, 0); } if (x.nextInt(5) == 1 && var1.getBlock(y + var7, z + var11, var5 + 2) == Blocks.air) { var1.setBlock(y + var7, z + var11, var5 + 2, Blocks.vine); var1.setBlockMetadataWithNotify(y + var7, z + var11, var5 + 2, 4, 0); } } for (var8 = -1; var8 <= 1; ++var8) { if (x.nextInt(5) == 1 && var1.getBlock(y - 2, z + var11, var5 + var8) == Blocks.air) { var1.setBlock(y - 2, z + var11, var5 + var8, Blocks.vine); var1.setBlockMetadataWithNotify(y - 2, z + var11, var5 + var8, 8, 0); } if (x.nextInt(5) == 1 && var1.getBlock(y + 2, z + var11, var5 + var8) == Blocks.air) { var1.setBlock(y + 2, z + var11, var5 + var8, Blocks.vine); var1.setBlockMetadataWithNotify(y + 2, z + var11, var5 + var8, 2, 0); } } } Vector3 x3 = new Vector3(); Vector3 x4 = new Vector3(); int var14 = x.nextInt(100) + 10; int var17 = 0; while (var17 < var14) { x4.set((double)x.nextFloat() - 0.5D, (double)x.nextFloat(), (double)x.nextFloat() - 0.5D); x4.normalize(); double var18 = ((double)var14 / 10.0D + 4.0D) * (double)(1.0F + 1.0F * x.nextFloat()); x4.x *= var18; x4.z *= var18; x4.y = x4.y * (double)(var9 - 15) + (double)var14 / 10.0D; if (var14 < { switch (var14) { case 0: x3.set((double)(y - 1), (double)(z + 6), (double)(var5 - 1)); break; case 1: x3.set((double)(y - 1), (double)(z + 6), (double)var5); break; case 2: x3.set((double)(y - 1), (double)(z + 6), (double)(var5 + 1)); break; case 3: x3.set((double)y, (double)(z + 6), (double)(var5 + 1)); break; case 4: x3.set((double)(y + 1), (double)(z + 6), (double)(var5 + 1)); break; case 5: x3.set((double)(y + 1), (double)(z + 6), (double)var5); break; case 6: x3.set((double)(y + 1), (double)(z + 6), (double)(var5 - 1)); break; default: x3.set((double)y, (double)(z + 6), (double)(var5 - 1)); } } else { x3.set((double)(y + x.nextInt(3) - 1), (double)(z + 6), (double)(var5 + x.nextInt(3) - 1)); } long x0 = x.nextLong(); nawapsk var13 = new nawapsk(x3, x4, x0); while (true) { if (var13.iterate()) { Vector3 x2 = var13.get(); if (this.fillBlock(var1, (int)Math.floor(x2.x), (int)Math.floor(x2.y), (int)Math.floor(x2.z))) { continue; } } ++var17; break; } } return true; } else { return false; } } } Would be really nice if you help me .. im hanging since 5 hours and I dont find a solution
  21. Hey, can you explain me how to set up a forge-1.7.10 workspace in Eclipse Thank you very much , have a nice day ~Legend<3
  22. Hey, I want to edit Project Red a bit for testing and so, i downloaded the github source.. On the folder, I typed gradlew setupDecompWorkspace and gradlew eclipse... I've the scala-compatible Eclipse version, but the workspace is empty... Whats wrong?
  23. Hey guys, ive a question : My pumpkin textures don't load. Im sure that the png-path is right... Heres the code : package de.xthelegend.etherealmagic.blocks; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import de.xthelegend.etherealmagic.reference.Reference; import net.minecraft.block.BlockDirectional; import net.minecraft.block.BlockRotatedPillar; import net.minecraft.block.material.Material; import net.minecraft.util.IIcon; import net.minecraft.block.BlockPumpkin; import net.minecraft.client.renderer.texture.IIconRegister; import de.xthelegend.etherealmagic.MainClass; public class BlockMagnetizationPumpkin extends BlockDirectional{ private boolean field_149985_a; @SideOnly(Side.CLIENT) private IIcon field_149984_b; @SideOnly(Side.CLIENT) private IIcon field_149986_M; public BlockMagnetizationPumpkin(Material mat,boolean isEnabled) { super(Material.gourd); setBlockTextureName(Reference.MODID + ":" + "magkin"); setBlockName("magnetization_pumpkin"); //super(mat); < gegeben mit gourd; this.setTickRandomly(true); this.field_149985_a = isEnabled; setCreativeTab(MainClass.tabMagnetization); // TODO Auto-generated constructor stub } @SideOnly(Side.CLIENT) public IIcon getIcon(int p_149691_1_, int p_149691_2_) { return p_149691_1_ == 1 ? this.field_149984_b : (p_149691_1_ == 0 ? this.field_149984_b : (p_149691_2_ == 2 && p_149691_1_ == 2 ? this.field_149986_M : (p_149691_2_ == 3 && p_149691_1_ == 5 ? this.field_149986_M : (p_149691_2_ == 0 && p_149691_1_ == 3 ? this.field_149986_M : (p_149691_2_ == 1 && p_149691_1_ == 4 ? this.field_149986_M : this.blockIcon))))); } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister reg) { this.field_149986_M = reg.registerIcon(this.getTextureName() + "_front" /*+ (this.field_149985_a ? "on" : "off"*/); this.field_149984_b = reg.registerIcon(this.getTextureName() + "_top"); this.blockIcon = reg.registerIcon(this.getTextureName() + "_side"); } }
  24. Hey guys, I've a question: My Item dropItem has metadatas up to 5. How can I tell my block that it drops the Item with metadata 3 or 4 when destroyed? public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { return dropItem; } Can you help me? I would be happy ~Legend

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.