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.

Darki

Members
  • Joined

  • Last visited

Everything posted by Darki

  1. Now it works. But how can I change the hitbox so that the connectparts have also a hitbox? At the moment the core has only a hitbox. And how can I make a Energy System with Solar Panels and Generators and How can I transfer the energy?
  2. This means I did the if clause wrong?! Should I do this what you write down. If (this.worldObj.getTileEntity(xCoord+ForgeDirection.UP.offset...
  3. First of all I find another mistake: Second Problem what I write down first is this: The Pipe that you can see in the right up corner isnt a real pipe this is the first problem. Second problem: Why connect the pipes so wrong?! Here my TileEntityClass: package me.darki.ChemMix.TileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; public class TileEntityCable extends TileEntity{ /** * UP, DOWN, NORTH, EAST, SOUTH, WEST */ public ForgeDirection[] connections = new ForgeDirection[6]; public TileEntityCable(){ } public void updateEntity(){ this.updateConnections(); } public void updateConnections(){ if(this.worldObj.getTileEntity(xCoord, yCoord+1, zCoord) instanceof TileEntityCable) connections[0] = ForgeDirection.UP; else connections[0] = null; if(this.worldObj.getTileEntity(xCoord, yCoord-1, zCoord) instanceof TileEntityCable) connections[1] = ForgeDirection.DOWN; else connections[1] = null; if(this.worldObj.getTileEntity(xCoord, yCoord, zCoord-1) instanceof TileEntityCable) connections[2] = ForgeDirection.NORTH; else connections[2] = null; if(this.worldObj.getTileEntity(xCoord+1, yCoord, zCoord) instanceof TileEntityCable) connections[3] = ForgeDirection.EAST; else connections[3] = null; if(this.worldObj.getTileEntity(xCoord, yCoord, zCoord+1) instanceof TileEntityCable) connections[4] = ForgeDirection.SOUTH; else connections[4] = null; if(this.worldObj.getTileEntity(xCoord-1, yCoord, zCoord) instanceof TileEntityCable) connections[5] = ForgeDirection.WEST; else connections[5] = null; } }
  4. Can someone help?
  5. I am making a pipe at the moment and there is a mistake that I can't find. I am working on the connections to other pipes. When I place 2 pipes and I look at one of the two pipes one of the pipes will be invisible and an virtual pipe is spawning in the air above me. Here the Code: package me.darki.ChemMix.renderer; import org.lwjgl.opengl.GL11; import me.darki.ChemMix.ChemMix; import me.darki.ChemMix.TileEntity.TileEntityCable; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; public class TileEntityCableRenderer extends TileEntitySpecialRenderer{ ResourceLocation tex = new ResourceLocation("chemmix", "textures/models/cable.png"); static boolean drawInside = true; static float pixel = 1F/16F; static float texpixel = 1F/32F; public void renderTileEntityAt(TileEntity t, double translationX, double translationY, double translationZ, float f) { GL11.glTranslated(translationX, translationY, translationZ); GL11.glDisable(GL11.GL_LIGHTING); this.bindTexture(tex); { drawCore(t); drawConnector(ForgeDirection.NORTH); drawConnector(ForgeDirection.EAST); drawConnector(ForgeDirection.WEST); drawConnector(ForgeDirection.SOUTH); drawConnector(ForgeDirection.UP); drawConnector(ForgeDirection.DOWN); /**TileEntityCable cab = (TileEntityCable) t; for(int i = 0; i < cab.connections.length; i++){ if(cab.connections[i] != null){ drawConnector(cab.connections[i]); } }**/ } GL11.glEnable(GL11.GL_LIGHTING); GL11.glTranslated(-translationX, -translationY, -translationZ); } public static void drawConnector(ForgeDirection d){ Tessellator tess = Tessellator.instance; tess.startDrawingQuads(); { GL11.glTranslatef(0.5F, 0.5F, 0.5F); if(d.equals(ForgeDirection.UP)){ }else if(d.equals(ForgeDirection.DOWN)){ GL11.glRotatef(180, 1, 0, 0); }else if(d.equals(ForgeDirection.NORTH)){ GL11.glRotatef(90, 1, 0, 0); }else if(d.equals(ForgeDirection.SOUTH)){ GL11.glRotatef(270, 1, 0, 0); }else if(d.equals(ForgeDirection.WEST)){ GL11.glRotatef(90, 0, 0, 1); }else if(d.equals(ForgeDirection.EAST)){ GL11.glRotatef(270, 0, 0, 1); } GL11.glTranslatef(-0.5F, -0.5F, -0.5F); tess.addVertexWithUV(1-11*pixel/2, 1-11*pixel/2, 1-11*pixel/2, 5*texpixel, 5*texpixel); tess.addVertexWithUV(1-11*pixel/2, 1, 1-11*pixel/2, 10*texpixel, 5*texpixel); tess.addVertexWithUV(11*pixel/2, 1, 1-11*pixel/2, 10*texpixel, 0*texpixel); tess.addVertexWithUV(11*pixel/2, 1-11*pixel/2, 1-11*pixel/2, 5*texpixel, 0*texpixel); tess.addVertexWithUV(11*pixel/2, 1-11*pixel/2, 11*pixel/2, 5*texpixel, 5*texpixel); tess.addVertexWithUV(11*pixel/2, 1, 11*pixel/2, 10*texpixel, 5*texpixel); tess.addVertexWithUV(1-11*pixel/2, 1, 11*pixel/2, 10*texpixel, 0*texpixel); tess.addVertexWithUV(1-11*pixel/2, 1-11*pixel/2, 11*pixel/2, 5*texpixel, 0*texpixel); tess.addVertexWithUV(1-11*pixel/2, 1-11*pixel/2, 11*pixel/2, 5*texpixel, 5*texpixel); tess.addVertexWithUV(1-11*pixel/2, 1, 11*pixel/2, 10*texpixel, 5*texpixel); tess.addVertexWithUV(1-11*pixel/2, 1, 1-11*pixel/2, 10*texpixel, 0*texpixel); tess.addVertexWithUV(1-11*pixel/2, 1-11*pixel/2, 1-11*pixel/2, 5*texpixel, 0*texpixel); tess.addVertexWithUV(11*pixel/2, 1-11*pixel/2, 1-11*pixel/2, 5*texpixel, 5*texpixel); tess.addVertexWithUV(11*pixel/2, 1, 1-11*pixel/2, 10*texpixel, 5*texpixel); tess.addVertexWithUV(11*pixel/2, 1, 11*pixel/2, 10*texpixel, 0*texpixel); tess.addVertexWithUV(11*pixel/2, 1-11*pixel/2, 11*pixel/2, 5*texpixel, 0*texpixel); } tess.draw(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); if(d.equals(ForgeDirection.UP)){ }else if(d.equals(ForgeDirection.DOWN)){ GL11.glRotatef(-180, 1, 0, 0); }else if(d.equals(ForgeDirection.NORTH)){ GL11.glRotatef(-90, 1, 0, 0); }else if(d.equals(ForgeDirection.SOUTH)){ GL11.glRotatef(-270, 1, 0, 0); }else if(d.equals(ForgeDirection.WEST)){ GL11.glRotatef(-90, 0, 0, 1); }else if(d.equals(ForgeDirection.EAST)){ GL11.glRotatef(-270, 1, 0, 0); } GL11.glTranslatef(-0.5F, -0.5F, -0.5F); } public static void drawCore(TileEntity t){ Tessellator tess = Tessellator.instance; tess.startDrawingQuads(); { tess.addVertexWithUV(1-11*pixel/2, 11*pixel/2, 1-11*pixel/2, 5*texpixel, 5*texpixel); tess.addVertexWithUV(1-11*pixel/2, 1-11*pixel/2, 1-11*pixel/2, 5*texpixel, 0*texpixel); tess.addVertexWithUV(11*pixel/2, 1-11*pixel/2, 1-11*pixel/2, 0*texpixel, 0*texpixel); tess.addVertexWithUV(11*pixel/2, 11*pixel/2, 1-11*pixel/2, 0*texpixel, 5*texpixel); tess.addVertexWithUV(1-11*pixel/2, 11*pixel/2, 11*pixel/2, 5*texpixel, 5*texpixel); tess.addVertexWithUV(1-11*pixel/2, 1-11*pixel/2, 11*pixel/2, 5*texpixel, 0*texpixel); tess.addVertexWithUV(1-11*pixel/2, 1-11*pixel/2, 1-11*pixel/2, 0*texpixel, 0*texpixel); tess.addVertexWithUV(1-11*pixel/2, 11*pixel/2, 1-11*pixel/2, 0*texpixel, 5*texpixel); tess.addVertexWithUV(11*pixel/2, 11*pixel/2, 11*pixel/2, 5*texpixel, 5*texpixel); tess.addVertexWithUV(11*pixel/2, 1-11*pixel/2, 11*pixel/2, 5*texpixel, 0*texpixel); tess.addVertexWithUV(1-11*pixel/2, 1-11*pixel/2, 11*pixel/2, 0*texpixel, 0*texpixel); tess.addVertexWithUV(1-11*pixel/2, 11*pixel/2, 11*pixel/2, 0*texpixel, 5*texpixel); tess.addVertexWithUV(11*pixel/2, 11*pixel/2, 1-11*pixel/2, 5*texpixel, 5*texpixel); tess.addVertexWithUV(11*pixel/2, 1-11*pixel/2, 1-11*pixel/2, 5*texpixel, 0*texpixel); tess.addVertexWithUV(11*pixel/2, 1-11*pixel/2, 11*pixel/2, 0*texpixel, 0*texpixel); tess.addVertexWithUV(11*pixel/2, 11*pixel/2, 11*pixel/2, 0*texpixel, 5*texpixel); tess.addVertexWithUV(1-11*pixel/2, 1-11*pixel/2, 1-11*pixel/2, 5*texpixel, 5*texpixel); tess.addVertexWithUV(1-11*pixel/2, 1-11*pixel/2, 11*pixel/2, 5*texpixel, 0*texpixel); tess.addVertexWithUV(11*pixel/2, 1-11*pixel/2, 11*pixel/2, 0*texpixel, 0*texpixel); tess.addVertexWithUV(11*pixel/2, 1-11*pixel/2, 1-11*pixel/2, 0*texpixel, 5*texpixel); tess.addVertexWithUV(11*pixel/2, 11*pixel/2, 1-11*pixel/2, 5*texpixel, 5*texpixel); tess.addVertexWithUV(11*pixel/2, 11*pixel/2, 11*pixel/2, 5*texpixel, 0*texpixel); tess.addVertexWithUV(1-11*pixel/2, 11*pixel/2, 11*pixel/2, 0*texpixel, 0*texpixel); tess.addVertexWithUV(1-11*pixel/2, 11*pixel/2, 1-11*pixel/2, 0*texpixel, 5*texpixel); if(drawInside){ tess.addVertexWithUV(11*pixel/2, 11*pixel/2, 1-11*pixel/2, 0*texpixel, 5*texpixel); tess.addVertexWithUV(11*pixel/2, 1-11*pixel/2, 1-11*pixel/2, 0*texpixel, 0*texpixel); tess.addVertexWithUV(1-11*pixel/2, 1-11*pixel/2, 1-11*pixel/2, 5*texpixel, 0*texpixel); tess.addVertexWithUV(1-11*pixel/2, 11*pixel/2, 1-11*pixel/2, 5*texpixel, 5*texpixel); tess.addVertexWithUV(1-11*pixel/2, 11*pixel/2, 1-11*pixel/2, 0*texpixel, 5*texpixel); tess.addVertexWithUV(1-11*pixel/2, 1-11*pixel/2, 1-11*pixel/2, 0*texpixel, 0*texpixel); tess.addVertexWithUV(1-11*pixel/2, 1-11*pixel/2, 11*pixel/2, 5*texpixel, 0*texpixel); tess.addVertexWithUV(1-11*pixel/2, 11*pixel/2, 11*pixel/2, 5*texpixel, 5*texpixel); tess.addVertexWithUV(1-11*pixel/2, 11*pixel/2, 11*pixel/2, 0*texpixel, 5*texpixel); tess.addVertexWithUV(1-11*pixel/2, 1-11*pixel/2, 11*pixel/2, 0*texpixel, 0*texpixel); tess.addVertexWithUV(11*pixel/2, 1-11*pixel/2, 11*pixel/2, 5*texpixel, 0*texpixel); tess.addVertexWithUV(11*pixel/2, 11*pixel/2, 11*pixel/2, 5*texpixel, 5*texpixel); tess.addVertexWithUV(11*pixel/2, 11*pixel/2, 11*pixel/2, 0*texpixel, 5*texpixel); tess.addVertexWithUV(11*pixel/2, 1-11*pixel/2, 11*pixel/2, 0*texpixel, 0*texpixel); tess.addVertexWithUV(11*pixel/2, 1-11*pixel/2, 1-11*pixel/2, 5*texpixel, 0*texpixel); tess.addVertexWithUV(11*pixel/2, 11*pixel/2, 1-11*pixel/2, 5*texpixel, 5*texpixel); tess.addVertexWithUV(11*pixel/2, 1-11*pixel/2, 1-11*pixel/2, 0*texpixel, 5*texpixel); tess.addVertexWithUV(11*pixel/2, 1-11*pixel/2, 11*pixel/2, 0*texpixel, 0*texpixel); tess.addVertexWithUV(1-11*pixel/2, 1-11*pixel/2, 11*pixel/2, 5*texpixel, 0*texpixel); tess.addVertexWithUV(1-11*pixel/2, 1-11*pixel/2, 1-11*pixel/2, 5*texpixel, 5*texpixel); tess.addVertexWithUV(1-11*pixel/2, 11*pixel/2, 1-11*pixel/2, 0*texpixel, 5*texpixel); tess.addVertexWithUV(1-11*pixel/2, 11*pixel/2, 11*pixel/2, 0*texpixel, 0*texpixel); tess.addVertexWithUV(11*pixel/2, 11*pixel/2, 11*pixel/2, 5*texpixel, 0*texpixel); tess.addVertexWithUV(11*pixel/2, 11*pixel/2, 1-11*pixel/2, 5*texpixel, 5*texpixel); } } tess.draw(); } }
  6. I solved it on my own....I didn't set an Unlocalized Name for the Block so that it was null
  7. Ore I am very stupid at the moment
  8. But the block isn't null this is my own Block which I registered int the preInit Part
  9. Now there is a NullPointerException but why?! http://pastebin.com/rsD0LpUZ
  10. Now I changed it to generateSurface but now my Minecraft crashes: http://pastebin.com/xVdaDFQs
  11. I made an Ore Generator but it don't work. My own Ore isn't anywhere in the World. Here my Ore Generator: public class OreGenerator implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator,IChunkProvider chunkProvider) { switch(world.provider.dimensionId){ case -1: generateNether(world, random, chunkX * 16, chunkZ * 16); case 0: generateSurface(world, random, chunkX * 16, chunkZ * 16); case 1: generateEnd(world, random, chunkX * 16, chunkZ * 16); } } private void generateSurface(World world, Random random, int x, int z) { } private void generateEnd(World world, Random random, int x, int z) { } private void generateNether(World world, Random random, int x, int z) { oreGen(ChemMix.leavyumOre, world, random, x, z, 16, 16, 100, 15, 100, 60); } public void oreGen(Block b, World w, Random r, int posX, int posZ, int maxX, int maxZ, int maxAder, int spawnChance, int minY, int maxY){ int diffMinMaxY = maxY - minY; for(int i = 0; i < spawnChance; i++){ int posiX = posX + r.nextInt(maxX); int posiY = minY + r.nextInt(diffMinMaxY); int posiZ = posZ + r.nextInt(maxZ); (new WorldGenMinable(b, maxAder)).generate(w, r, posiX, posiY, posiZ); } } } I registered the Generator in the postInit part: GameRegistry.registerWorldGenerator(new OreGenerator(), 1);
  12. I've solved it, I forgot to make it public
  13. Hello, I have a problem. Well, I am making on a Mod that adds some new Ores and Ingots, but I have a problem with the SmeltingRecipes. First of all the Ores. I registered the ores in the preInit Part and the recipes in the init part but I can't put the ores in the furnace. Block: Block leavyumOre = new OreLeaviyum(Material.rock); GameRegistry.registerBlock(leavyumOre, "leavyumOre"); Recipe: GameRegistry.addSmelting(leavyumOre, new ItemStack(leavyumIngot), 10.0F);
  14. I solved it. I made it so: I have the method onBlockHarvested in the Block class and another meghod in the SpawnExSilverfish class the method in the SpawnExSilverfish class shows like: public static void name (World w, EntityPlayer p) ...and the code...and the only thing I did was that I write this method in the block class onBlockHarvested method an write in the () the parameter world and EntityPlayer of the onBlockHarvested event
  15. How can I do this I had an idea but it don't work^^
  16. No the thing is that i want to make a lucky block and I have a random class which will "activate" when you harvest the block and when you do that the random class search for an event so the explosive silverfish event. I connect the random class with the harvest event and the explosive silverfish event with the random class
  17. In the onBlockHarvested Event in the Block Class of the Block
  18. How can I get the world and the player from the server? Can I get it from MinecraftServer.getServer or something like that?!
  19. I am making on a Lucky Blocks Mod. Therefor I have Random Class (GENERATOR). The Random Method will activate when you destroy the block. The Output of the Random Gen is an Integer. So when you destroy the block a random number is "in" the integer then I would like to do it with IF: if(integer = 1) then should happen one of the events. For Example: The Explosive Silverfish. Summary: You break the Block and the method will activate and than it should happend
  20. Ohh ok, I am new and i think its a stupid question put how can I get the world and the player from the server I searched for tutorials but nothing found^^
  21. I made it so: public static void spawnExSilverfish(){ int i = 5; while(i != 0){ World world = Minecraft.getMinecraft().theWorld; EntityPlayer p = Minecraft.getMinecraft().thePlayer; EntitySilverfish sf = new EntitySilverfish(world); sf.setLocationAndAngles(p.posX, p.posY, p.posZ, 0, 0); world.spawnEntityInWorld(sf); EntityTNTPrimed tnt = new EntityTNTPrimed(world); tnt.fuse = 20 * 5; world.spawnEntityInWorld(tnt); tnt.mountEntity(sf); i--; } }
  22. Ok i tried this and it works but the silverfish don't move and when the tnt explodes nothing happend
  23. I want to try it on my own But OK i try it what lars said
  24. I tried this: ItemStack s = new ItemStack(Items.stone_sword); s.getMetadata(); s.addEnchantment(Enchantment.unbreaking, 10); s.addEnchantment(Enchantment.fireAspect, 10); s.setStackDisplayName("Hardi's P€nis"); EntityPlayer p = ; p.dropItem(s, true, true); But p is underlined because there where the 3 ? are must by something but I don't know what I put in there

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.