Jump to content

The_SlayerMC

Members
  • Posts

    209
  • Joined

  • Last visited

Everything posted by The_SlayerMC

  1. Wow, i derped really hard ahhaha.... So now im using this: int radius = 8; int centre = radius / 2, squareDistance = 0; int x1, y1, z1; for(x1 = centre - radius; x1 < centre + radius; x1++) for(y1 = centre - radius; y1 < centre + radius; y1++) for(z1 = centre - radius; z1 < centre + radius; z1++) { squareDistance = (x-centre) * (x-centre) + (y-centre) * (y-centre) + (z-centre) * (z-centre); /*if(squareDistance <= (radius) * (radius))*/ w.setBlock(x + x1, y + y1, z + z1, Blocks.bedrock); } And its generating a big square
  2. So now i've got this: int radius = 8; int centre = radius / 2, squareDistance = 0; for(x = centre - radius; x < centre + radius; x++) for(y = centre - radius; y < centre + radius; y++) for(z = centre - radius; z < centre + radius; z++) { squareDistance = (x-centre)*(x-centre) + (y-centre) * (y-centre) + (z-centre) * (z-centre); if(squareDistance <= radius) w.setBlock(x, y, z, Blocks.bedrock); } And it's still not making any sort of generation, even if i remove the 'if' statment
  3. I tried this just for a normal one: int radius = 8; int centre = radius / 2, squareDistance = 0; for(x = centre - radius; x < centre + radius; x++) for(y = centre - radius; y < centre + radius; y++) for(z = centre + radius; z < centre + radius; z++) { squareDistance = (x-centre)^2 + (y-centre)^2 + (z-centre)^2; /*if(squareDistance <= (radius)^2)*/ w.setBlock(x, y, z, Blocks.bedrock); } But nothing is seeming to generate at all
  4. Thanks! But can i make it so it generates random sized ones aswell?
  5. I don't think that biome blocks are metadata sensitive, you may have to make a new block with the same texture
  6. Hey, im trying to generate spheres for my dimension, but i cant quite get the sphere shape, all i can get is this: http://prntscr.com/4xam3y As you can tell, its making a circle shape but its turning out to be just a 1x block thick platform This is the code i wrote: int radius = 8; for(float i = 0; i < radius; i += 0.5) { for(float j = 0; j < 2 * Math.PI * i; j += 0.5) w.setBlock((int)Math.floor(x + Math.sin(j) * i), y + radius, (int)Math.floor(z + Math.cos(j) * i), Blocks.bedrock); } Whats the most efficient way to generate a sphere (a whole depth sphere)
  7. I'll probably get a wiki for it after it gets released. I could use some wiki makers tho
  8. ^^^ That. And the link to FML is also posted on this page. Oh thanks! I thought i missed something crutial haha I guess ill keep waiting for Forge 1.8 to come out, any release dates? I saw lex tweet that they have some betas a while back
  9. I didn't think forge 1.8 was out yet?! Where's the download?
  10. Hi, im using the drawBackground method inside GuiContainer and when i draw my texture its too small (i want it bigger than 256) when i scale the texture using GL11.glScalef(x, y, z); it makes it bigger but when i change the size of the screen it moves. So how do i get a scaled texture to stay in a ration depending on what the screen size is? I currently have this: public class GuiKaren extends GuiContainer { public GuiKaren() { super(new ContainerEmpty()); } @Override protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(new ResourceLocation(SlayerAPI.PREFIX + "textures/gui/people/karen.png")); int k = (this.width - this.xSize) / 2; int l = (this.height - this.ySize) / 2; GL11.glPushMatrix(); float scale = 1.0F; GL11.glScalef(scale, scale, scale); this.drawTexturedModalRect(k - 100, l, 0, 0, 220, 220); int guit = ClientTickHandler.guit; this.mc.getTextureManager().bindTexture(new ResourceLocation(SlayerAPI.PREFIX + "textures/gui/background.png")); if(guit > 5) { this.drawTexturedModalRect(k - 130, l - 120, 0, 0, 232, 100); } else if(guit < 5) { this.drawTexturedModalRect(k - 130, l - 120, 0, 102, 232, 100); } else { this.drawTexturedModalRect(k - 130, l - 120, 0, 0, 232, 100); } GL11.glPopMatrix(); } }
  11. There are some things that potions do that you can do without the potion itself, speed is one of them: player.capabilitys.setMoveSpeed(1.5F);
  12. No, the ores wouldnt generate because they use the vanilla WorldGenMinable and that removes the stone and places the ore. But what you can do is generate the ores yourself using WorldGenMinable(Spawn, amount, Replace)??
  13. You can register it either way, but i like to do it inside of the blocks/item class because it saves so much code haha
  14. Here is a file that i use, it works great and all you have to do is just extend the file for your new crop and fill in the blanks After you read the code, you should know how to use it.
  15. Hey, I've made my own machines for a new mod and I'm wondering how I could make the recipes be known using the NEI-API by ChickenBones, I've contacted ChickenBones but he hasn't been online for quite a while so I'm just wondering how i can get the API and how I could use it, because I have never actually used an API for my own mod. So if anyone has used this API or knows how two, can you help me?
  16. It's not that hard to look into the ore block file... @Override public Item getItemDropped(int par1, Random par2, int par3) { return Items.diamond; }
  17. Hey, ive got my render game overlay going but when i remove certain things, the rest dont have textures like so: *EDIT* Solved by doing this: if(event.type == ElementType.EXPERIENCE || event.type == ElementType.HEALTH || event.type == ElementType.FOOD || event.type == ElementType.AIR || event.type == ElementType.ARMOR) event.setCanceled(true); if(!Minecraft.getMinecraft().playerController.shouldDrawHUD() || !event.isCanceled()) return;
  18. Oh wow.... I can't believe that I missed that... HAHAHA woops
  19. public class GuiHandler implements IGuiHandler { private static int guiID = 0; public static int stats = guiID++, enrichmentTable = guiID++, incubator = guiID++; @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if(ID == stats) return new ContainerEmpty(); if(ID == enrichmentTable) return new ContainerEnrichedTable(player.inventory, world, x, y, z, player); if(ID == incubator) return new ContainerIncubator(player.inventory, new TileEntityIncubator()); return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if(ID == stats) return new GuiStats(); if(ID == enrichmentTable) return new GuiEnrichedEnchantmentTable(player.inventory, world, x, y, z, player); if(ID == incubator) return new GuiIncubator(player.inventory, new TileEntityIncubator()); return null; } }
  20. Ive made an incubator, but when you put the recipe inside the gui, it doesnt smelt and when you exit the gui the items inside it are gone! The block doesnt update like it should (go from idle to active) So can someone please help? Block registry: public static final Block incubatorIdle = new BlockIncubator("incubatorIdle", false); public static final Block incubatorActive = new BlockIncubator("incubatorActive", true); The block: The container: The tile entity: If i use this instead of just returning true: @Override public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; } I get this crash when i open the block:
  21. Or you could try the proper method if(player.getHeldItem().getItem() == Items.diamond) { //do stuff here }
  22. For the chest content code inside the structure code, do a if(!world.isRemote){ CODE }
  23. Okay, here is the new one: package net.essence.client; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.common.IExtendedEntityProperties; public class ModPlayerHealth implements IExtendedEntityProperties { private static int health; private static float regen; public static String NBT_NAME = "CustomPlayerHealth"; public static ModPlayerHealth INSTANCE = new ModPlayerHealth(); public ModPlayerHealth getPlayer(EntityPlayer player) { return (ModPlayerHealth)player.getExtendedProperties(NBT_NAME); } public void register(EntityPlayer player) { player.registerExtendedProperties(NBT_NAME, new ModPlayerHealth()); } @Override public void saveNBTData(NBTTagCompound n) { NBTTagCompound nbt = new NBTTagCompound(); nbt.setInteger("Health", 50); nbt.setFloat("Regen", 20F); nbt.setTag(NBT_NAME, nbt); } @Override public void loadNBTData(NBTTagCompound n) { NBTTagCompound nbt = (NBTTagCompound)n.getCompoundTag(NBT_NAME); health = nbt.getInteger("Health"); regen = nbt.getFloat("Regen"); } public void updateHealth() { if(health != 50) regen(1); else regen(0); if(health >= 50) health = 50; } public void regen(int amount) { if(regen == 0) health += amount; else regen -= 1; } public void removeHealth(int remove) { health -= remove; } public int getHealth() { return health; } public float getRegenTimer() { return regen; } @Override public void init(Entity entity, World world) { EntityPlayer player = (EntityPlayer)entity; } }
×
×
  • Create New...

Important Information

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