Jump to content

_bau5

Members
  • Posts

    30
  • Joined

  • Last visited

Everything posted by _bau5

  1. public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase living, ItemStack stack) { super.onBlockPlacedBy(world, x, y, z, living, stack); byte dir = 0; int plyrFacing = MathHelper.floor_double(((living.rotationYaw * 4F) / 360F) + 0.5D) & 3; if (plyrFacing == 0) dir = 2; if (plyrFacing == 1) dir = 5; if (plyrFacing == 2) dir = 3; if (plyrFacing == 3) dir = 4; TileEntity tpb = world.getBlockTileEntity(x, y, z); if (tpb != null && tpb instanceof TEProjectBenchII) { ((TEProjectBenchII)tpb).setDirection(dir); world.markBlockForUpdate(x, y, z); } } This works fine for me. Throw this in your Block class.
  2. I'm not sure about #3, but here are my thoughts on the other two. 1. I'm fairly certain that is a server-client issue, as in the client says you have a different amount of items than the server says you have. It's some sort of de-sync issue that could be attributed to a lot of different things. Just go into the debugging tool and work your way through it as it's running on the client, then the server, and see where they start to disagree. 2. Override the transferStackInSlot method and make sure it will only try to transfer 15, or however many makes 15, at a time to a single slot and leave the rest. I'm not really sure why it would be deleting it, because the default minecraft code will only transfer up to the slot limit and leave the rest.
  3. Think about it- during the preInitialization phase of Minecraft, do you think a player exists? Nope. Not until a world is loading. You'll need to use an event handler and run this code when a new world is loading and the player has been created.
  4. So the way recipes work, as I understand it, is that when you place the components in the grid, it's checked against the CraftingManager looking for matches in item types and layouts. I'm implementing a method of crafting that doesn't hinge on the 3x3, or any layout, crafting grid at all, just the raw components themselves. For vanilla recipes it works just fine, all IRecipes in the game (Shaped/Shapeless/Ore etc) have an array of all the item types and respective alternatives (such as for the ore dictionary recipes) so I can just go through and translate them all based on the case. However, this doesn't come as part of the interface, there is no way to be plainly given what's in the recipe. The only thing the interface offers is a way to check if it matches what is provided. So this leaves me with the problem I've run into: What way is there to universally access all the components of a crafting recipe across all the custom handlers? I'm starting to get the feeling there isn't. Which is inconvenient. SOLVED This was the solution I came up with. Used cpw's reflection helper to go through all the fields until it throws an ArrayOutOfBounds exception and then break. Easy peasy. try{ int i = 0; do{ try { Field f = rec.getClass().getDeclaredFields()[i++]; f.setAccessible(true); Object obj = f.get(rec); if(obj != null){ if(obj instanceof Object[]){ Object[] objArr = (Object[])obj; newRecItem.input = new Object[objArr.length]; for(int j = 0; j < objArr.length; j++){ Object obj2 = objArr[j]; newRecItem.input[j] = obj2; if(obj2 == null){ if(newRecItem.items == null) newRecItem.items = new ItemStack[objArr.length]; }else if(obj2 instanceof ItemStack){ if(newRecItem.items == null) newRecItem.items = new ItemStack[objArr.length]; newRecItem.items[j] = ((ItemStack)obj2).copy(); }else if(obj2 instanceof String){ ItemStack oreStack = OreDictionary.getOres((String)obj2).get(0); ItemStack newStack = new ItemStack(oreStack.itemID, oreStack.stackSize, OreDictionary.WILDCARD_VALUE); if(newRecItem.items == null) newRecItem.items = new ItemStack[objArr.length]; newRecItem.items[j] = newStack; }else{ System.out.println("ProjectBench: Unaccounted for object type, disabling recipe. " +obj2); newRecItem.forceDisable(); } } } } } catch(ArrayIndexOutOfBoundsException ex) { break; } catch(Exception ex){ newRecItem.forceDisable(); } } while(true);
  5. I'm trying to develop with NEI installed into the eclipse environment, but am not successfully getting it working. I've followed his instructions on the MCForum topic, added the _at.cfg's to the right places and all. But I am still getting this error: I googled it, others have had this problem, but no solution was ever posted. Any help would be great.
  6. My problem is: I'm trying to render some ItemStacks on the in game gui when looking at one of my entities. Now it works, but it seems that it isn't rendering the texture, as the pale-blue backdrop can be seen through where the render is supposed to be. Above you can see, circled in red, the problem. The stone on the left is rendered using the exact same call, but from the GuiIngame class, while the block on the right, that isn't being rendered correctly, is being called from outside the GuiIngame class. I am terrible, terrible at the OpenGL stuff, and am verging on scrapping this idea. Any ideas as to why this would be happening? My guess is it's due to differing states of the OpenGL render, but I've fiddled with it and can't get the textures to show. Here is the pertinent code. [embed=425,349][/embed]
  7. Thanks but I figured it out. Was having problems with the Forum so it took me awhile to edit the post.
  8. Multiple derps fixed. ------------------- I've got a Block that has a rendered block/item above it if there is a valid recipe in the crafting grid. But other players can't see the render until they open the bench themselves. Also, when the world loads, you can't see the render until you open the bench, regardless if there's a valid recipe in it. I figure this has something to do with packets, and have been working on trying to do this myself, but to no avail; I just can't seem to get any of it to work. The render class for the tile entity cannot see what's in the TileEntity's class. For instance; I have the packets set up to send the the items in the crafting grid, and receive it which works (mostly) right, aside from a few randomly returning null occasionally. But from within the TileEntity the correct output stack is fine and works, but the renderer only sees null. This really perplexes me. So anyways, any help would be fantastic. Thanks
  9. This can be sort of confusing...It's basically spread between three different classes. First, the Block: This part is fairly straight forward except that you want to be a subclass of BlockContainer. Example: https://github.com/bau5/ProjectBench/blob/master/bau5/mods/projectbench/common/ProjectBenchBlock.java Secondly, the TileEntity: The TileEntity holds all the information about the ItemStacks, what index they are within the inventory, all the logic about decreasing, increasing, and moving stacks, and the NBTTags that save what is held in the inventory. Example: https://github.com/bau5/ProjectBench/blob/master/bau5/mods/projectbench/common/TileEntityProjectBench.java Thirdly, the Container: Imagine this; if the GUI is what you, the client, sees and interacts with, the Container is what the server sees and interacts with. The container is where you lay out all the slots that the GUI will let the player interact with. Example: https://github.com/bau5/ProjectBench/blob/master/bau5/mods/projectbench/common/ContainerProjectBench.java Mine is a little different than the Minecraft workbench because I wanted the items to stay in the crafting matrix even when you close the GUI (the regular one tosses them on the ground). Hope this helps!
  10. I have a block that has a custom render for something above it. Single player it all works fine, but in smp i'm having some issues. In smp, only one player can see the render and for the anyone else they won't see the render until they open the GUI that is attached to the block's tile entity. The render is based off of a value in the tile entity. I'm assuming that this has something to do with client-server-client communication, but I'm not sure to deal with it. I read up on making a packet handler, but didn't quite understand how to implement it in my case.
  11. I got it....I finally got it. For some reason var6 and var7 were both zero, there must have been something weird going on with the get block light value method. I debugged the code for the enderman, figured out what were the appropriate values and hardcoded it in. Success.
  12. use this: int var5 = (int) (tpb.worldObj.getBlockLightValue(tpb.xCoord, tpb.yCoord, tpb.zCoord) / 15F * 240F); instead of this: int var5 = (int) (tpb.worldObj.getBlockLightValue(tpb.xCoord, tpb.yCoord, tpb.zCoord) / 15F); Still no change...So frustrating. Code now looks like this: glColor4f(1.0F, 1.0F, 1.0F, 1.0F); glPushMatrix(); glEnable(32826 /*rescale*/); glTranslatef((float)x,(float)y,(float)z); glTranslatef(0.5F, 1.2F, 0.5F); glScalef(0.3F, 0.3F, 0.3F); bindTextureByName("/terrain.png"); int var5 = (int) (tpb.worldObj.getBlockLightValue(tpb.xCoord, tpb.yCoord, tpb.zCoord) / 15F * 240F); int var6 = var5 % 65536; int var7 = var5 / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, var6 / 1.0F, var7 / 1.0F); renderBlocks.renderBlockAsItem(Block.blocksList[stack.itemID], stack.getItemDamage(), 1.0F); glDisable(32826 /* GL_RESCALE_NORMAL_EXT */); glPopMatrix(); glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
  13. int var5 = (int) (tpb.worldObj.getBlockLightValue(tpb.xCoord, tpb.yCoord, tpb.zCoord) / 15F); int var6 = var5 % 65536; int var7 = var5 / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, var6 / 1.0F, var7 / 1.0F); This is the closest I could come. Didn't change a thing. Here's the code on https://github.com/bau5/ProjectBench/blob/master/bau5/mods/projectbench/client/TEProjectBenchRenderer.java
  14. Thanks for the suggestion, but it didn't do anything. It's weird, it's like OpenGL isn't responding to any of the functions I throw in for lighting. I don't get it.
  15. Awesome, I'll try that when I can. Thanks for the suggestion
  16. Containers get most of their information from the TileEntity. Not the other way around. I've heard a lot of people talk about the container as the interface that the server sees, while the client sees the gui which the container populates WITH information from the tileentity. writeToNBT(...) and readFromNBT(...) are functions from TileEntity class, so if your tile entity does extend TileEntity, then you can override those functions. NBTTags are amazing, and can be used to store close to anything, if you work at it. Make sure with the writeToNBT(...) you're actually setting and reading them properly. If you're using NBTTagList make sure you're appending tags to that list with yourTagList.append(yourTag) and then subsequently setting that tagList to the actual tag, with tag.setTag("name" yourTagList. Perhaps this wasn't your question, perhaps this post is worthless. Hope it helps at least a bit, or something.
  17. I'm trying to render an item/block in game. However, the textures look to me like they are all in shades of grey. The textures are visible, barely, but the colors aren't there. It's just all grey. I've toyed around with the OpenGL functions, but quite frankly I'm crap at it and don't really know what's going on. Could use some help. Here is my code: @Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTick) { if(te == null || !(te instanceof TileEntityProjectBench)) { return; } TileEntityProjectBench tpb = (TileEntityProjectBench)te; renderBlocks = new RenderBlocks(te.worldObj); renderBlocks.renderBlockByRenderType(ProjectBench.instance.projectBench, (int)x, (int)y, (int)z); renderBlocks.useInventoryTint = false; ItemStack craftingResult = tpb.findRecipe(); if(craftingResult != null) { GL11.glPushMatrix(); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glDisable(GL11.GL_LIGHTING); GL11.glPushMatrix(); glTranslatef((float)x, (float)y, (float)z); glTranslatef(0.5F, 1.2F, 0.5F); glScalef(0.3F, 0.3F, 0.3F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.overrideTexture(craftingResult); this.renderBlocks.renderBlockAsItem(Block.blocksList[craftingResult.itemID], craftingResult.getItemDamage(), 1.0F); GL11.glPopMatrix(); GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glEnable(GL11.GL_LIGHTING); GL11.glPopMatrix(); } } Picture of problem: *Edit, sorry code isn't formatting correctly
  18. Got it. All I had to do was use the getServerGuiElement in my CommonProxy class...haha. so much pain for such a simple problem.
  19. Oh I was going to say I've looked over all that code and still can't get it right. Hm.
  20. Title says it all, When I try to pick up an item from the inventory of the player, or hotbar of the player, it quickly places it back in the slot. When I try to pick up an item that is in the inventory of my custom TileEntity, it disappears, never to be found again. I'm assuming this is a sync issue, but I'm not familiar with syncing the inventory on client with the server. Any help would be appreciated, especially in the form of a step by step walkthrough. Roughly what I have now: - Register the proxy, which contains the rendering for the tile entity - Register the gui handler with the NetworkRegistry - Register the block - Register the custom TileEntity - When the block is activated, open the Gui through openGui method in player - When the Gui is opened it makes a custom container based with the player inventory and the TileEntity passed to it. - The container adds a handful of slots for itself, along with the player inventory and hotbar. The last step is where the problems are. It draws all the slots right, no errors or anything, but when i click on any of the items that are in my inventory, it just places them back down. Thanks! Here's my code: (irrelevant code snipped.) Main class: @Mod(modid = "_bau5Alptraum", name = "Alptraum", version = "0.01") @NetworkMod(clientSideRequired=true, serverSideRequired=false, clientPacketHandlerSpec = @SidedPacketHandler(channels = {"_bau5Alptraum" }, packetHandler = ClientPacketHandler.class), serverPacketHandlerSpec = @SidedPacketHandler(channels = {"_bau5Alptraum" }, packetHandler = ServerPacketHandler.class)) public class Alptraum { @SidedProxy(clientSide = "_bau5.alptraum.ClientProxy", serverSide = "_bau5.alptraum.CommonProxy") public static CommonProxy proxy; @Instance private static Alptraum instance; @Init public void initAlptraum(FMLInitializationEvent event) { MinecraftForgeClient.preloadTexture(textureFile); proxy.registerRenderInformation(); NetworkRegistry.instance().registerGuiHandler(instance, proxy); registerBlocks(); registerItems(); initAlpVars(); initOthers(); initSounds(); } private void registerBlocks() { nightmareStone = new AlpStone(BnmStoneID, 0); blockUtility = new BlockUtility(BalpUtilityID, 0); GameRegistry.registerBlock(nightmareStone, _bau5.alptraum.AlpStoneItem.class); GameRegistry.registerBlock(blockUtility, _bau5.alptraum.utility.BlockUtilityItem.class); GameRegistry.registerTileEntity(TileEntityDiscoverer.class, "Alp Discoverer"); } } BlockUtil public class BlockUtility extends BlockContainer { public BlockUtility(int id, int meta) { super(id, meta, Material.rock); this.setBlockName("alpBlockUtility"); this.setHardness(0.6F); setCreativeTab(CreativeTabs.tabBlock); } @SideOnly(Side.CLIENT) public boolean onBlockActivated(World par1World, int i, int j, int k, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { par5EntityPlayer.openGui(Alptraum.instance(), 0, par1World, i, j, k); return true; } public TileEntity createNewTileEntity(World var1) { return new TileEntityDiscoverer(); } public boolean isOpaqueCube() { return false; } public int getRenderType() { return -1; } } TileEntity: package _bau5.alptraum.utility; import cpw.mods.fml.common.Side; import cpw.mods.fml.common.asm.SideOnly; import _bau5.alptraum.Alptraum; import net.minecraft.src.Block; import net.minecraft.src.EntityPlayer; import net.minecraft.src.IInventory; import net.minecraft.src.ItemStack; import net.minecraft.src.NBTTagCompound; import net.minecraft.src.NBTTagList; import net.minecraft.src.TileEntity; import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.ISidedInventory; public class TileEntityDiscoverer extends TileEntity implements IInventory, ISidedInventory { private ItemStack[] discovererStack = new ItemStack[12]; public ItemStack currentItem; public float angle = 0.0F; public final static float move_speed = 0.1f; public TileEntityDiscoverer() { discovererStack[0] = new ItemStack(Block.dirt); discovererStack[1] = new ItemStack(Alptraum.shiftingResidue); } public void updateEntity() { angle += move_speed; } @Override public int getSizeInventory() { return discovererStack.length; } @Override @SideOnly (Side.CLIENT) public ItemStack getStackInSlot(int var1) { return discovererStack[var1]; } @Override public ItemStack decrStackSize(int par1, int par2) { if (this.discovererStack[par1] != null) { ItemStack var3; if (this.discovererStack[par1].stackSize <= par2) { var3 = this.discovererStack[par1]; this.discovererStack[par1] = null; this.onInventoryChanged(); return var3; } else { var3 = this.discovererStack[par1].splitStack(par2); if (this.discovererStack[par1].stackSize == 0) { this.discovererStack[par1] = null; } this.onInventoryChanged(); return var3; } } else { return null; } } @Override public ItemStack getStackInSlotOnClosing(int par1) { if (this.discovererStack[par1] != null) { ItemStack var2 = this.discovererStack[par1]; this.discovererStack[par1] = null; return var2; } else { return null; } } @Override public void setInventorySlotContents(int var1, ItemStack stack) { this.discovererStack[var1] = stack; if (stack != null && stack.stackSize > this.getInventoryStackLimit()) { stack.stackSize = this.getInventoryStackLimit(); } onInventoryChanged(); } @Override public String getInvName() { return "discoveryInventory"; } @Override public int getInventoryStackLimit() { return 64; } @Override public boolean isUseableByPlayer(EntityPlayer var1) { return true; } public void readFromNBT(NBTTagCompound par1NBTTagCompound) { super.readFromNBT(par1NBTTagCompound); NBTTagList var2 = par1NBTTagCompound.getTagList("Items"); this.discovererStack = new ItemStack[this.getSizeInventory()]; for (int var3 = 0; var3 < var2.tagCount(); ++var3) { NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3); byte var5 = var4.getByte("Slot"); if (var5 >= 0 && var5 < this.discovererStack.length) { this.discovererStack[var5] = ItemStack.loadItemStackFromNBT(var4); } } } /** * Writes a tile entity to NBT. */ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { super.writeToNBT(par1NBTTagCompound); NBTTagList var2 = new NBTTagList(); for (int var3 = 0; var3 < this.discovererStack.length; ++var3) { if (this.discovererStack[var3] != null) { NBTTagCompound var4 = new NBTTagCompound(); var4.setByte("Slot", (byte)var3); this.discovererStack[var3].writeToNBT(var4); var2.appendTag(var4); } } par1NBTTagCompound.setTag("Items", var2); } @Override public void openChest() { } @Override public void closeChest() { } @Override public int getStartInventorySide(ForgeDirection side) { if (side == ForgeDirection.DOWN) return 1; if (side == ForgeDirection.UP) return 0; return 2; } @Override public int getSizeInventorySide(ForgeDirection side) { return 1; } } Gui: package _bau5.alptraum.utility; import org.lwjgl.opengl.GL11; import org.lwjgl.util.glu.GLU; import _bau5.alptraum.Alptraum; import net.minecraft.src.Container; import net.minecraft.src.EntityPlayer; import net.minecraft.src.GuiContainer; import net.minecraft.src.GuiScreen; import net.minecraft.src.GuiScreenBook; import net.minecraft.src.InventoryPlayer; import net.minecraft.src.ItemStack; import net.minecraft.src.ScaledResolution; import net.minecraft.src.StatCollector; public class GuiDiscoverer extends GuiContainer { private TileEntityDiscoverer discovererInventory; public GuiDiscoverer(InventoryPlayer playerInv, TileEntityDiscoverer discoverer) { super(new ContainerDiscoverer(playerInv, discoverer)); this.discovererInventory = discoverer; } public boolean doesGuiPauseGame() { return false; } protected void drawGuiContainerForegroundLayer() { this.fontRenderer.drawString("\u00A7d" + "Discoverer", 22, 6, 4210752); this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752); } /** * Draw the background layer for the GuiContainer (everything behind the items) */ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { int var4 = this.mc.renderEngine.getTexture("/_bau5/alptraum/Textures/GUI/discovery.png"); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.renderEngine.bindTexture(var4); int var5 = (this.width - this.xSize) / 2; int var6 = (this.height - this.ySize) / 2; this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize); } } Container: package _bau5.alptraum.utility; import _bau5.alptraum.ClientPacketHandler; import net.minecraft.client.Minecraft; import net.minecraft.src.Container; import net.minecraft.src.EntityPlayer; import net.minecraft.src.InventoryPlayer; import net.minecraft.src.ItemStack; import net.minecraft.src.Slot; public class ContainerDiscoverer extends Container { private TileEntityDiscoverer discoverer; public ContainerDiscoverer(InventoryPlayer invPlayer, TileEntityDiscoverer discoverer) { this.discoverer = discoverer; this.discoverer.openChest(); this.addSlotToContainer(new Slot(discoverer, 0, 39, 23)); this.addSlotToContainer(new Slot(discoverer, 1, 54, 23)); this.layoutContainer(invPlayer, discoverer); } public ItemStack slotClick (int slot, int button, boolean flag, EntityPlayer player) { ItemStack stack = super.slotClick(slot, button, flag, player); return stack; } private void layoutContainer(InventoryPlayer invPlayer, TileEntityDiscoverer discoverer2) { int var3; for (var3 = 0; var3 < 3; ++var3) { for (int var4 = 0; var4 < 9; ++var4) { this.addSlotToContainer(new Slot(invPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); } } for (var3 = 0; var3 < 9; ++var3) { this.addSlotToContainer(new Slot(invPlayer, var3, 8 + var3 * 18, 142)); } } public boolean canInteractWith(EntityPlayer par1EntityPlayer) { return true; } public ItemStack transferStackInSlot(int par1) { return null; } }
  21. Wow...one of the derpiest mistakes I've made...I had the coords for the spawn point inputted as the place to spawn the particle.... All working now....thanks man, thanks a lot.
  22. You're right, that works! Thanks. The only issue is now that I can't see it at all. I know its spawning and I know it's near me, just can't see it. I also know that it is finding the texture because it's overriding the other particles in the game (I know how to stop that, I was just making sure it was successfully finding my particle sprite sheet). Here's my particle's class. Sorry for the persistent problem guys package _bau5.alptraum; import org.lwjgl.opengl.GL11; import cpw.mods.fml.client.FMLClientHandler; import net.minecraft.src.EntityFX; import net.minecraft.src.Tessellator; import net.minecraft.src.World; import net.minecraftforge.client.ForgeHooksClient; public class TestEffect extends EntityFX { private int coolDown; public TestEffect(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { super(par1World, par2, par4, par6, par8, par10, par12); this.particleMaxAge = 100; this.worldObj = par1World; this.setParticleTextureIndex(0); coolDown = 0; } public String getTexture() { return Alptraum.particlesTextureFile; } public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { Tessellator tessellator1 = new Tessellator(); tessellator1.startDrawingQuads(); tessellator1.setBrightness(getBrightnessForRender(par2)); GL11.glBindTexture(GL11.GL_TEXTURE_2D, Alptraum.mc.renderEngine.getTexture(getTexture())); float f = (float)(getParticleTextureIndex() % 16) / 16F; float f1 = f + 0.0624375F; float f2 = (float)(getParticleTextureIndex() / 16) / 16F; float f3 = f2 + 0.0624375F; float f4 = 0.1F * particleScale; float f5 = (float)((prevPosX + (posX - prevPosX) * (double)par2) - interpPosX); float f6 = (float)((prevPosY + (posY - prevPosY) * (double)par2) - interpPosY); float f7 = (float)((prevPosZ + (posZ - prevPosZ) * (double)par2) - interpPosZ); float f8 = 1.0F; tessellator1.setColorOpaque_F(particleRed * f8, particleGreen * f8, particleBlue * f8); tessellator1.addVertexWithUV(f5 - par3 * f4 - par6 * f4, f6 - par4 * f4, f7 - par5 * f4 - par7 * f4, f1, f3); tessellator1.addVertexWithUV((f5 - par3 * f4) + par6 * f4, f6 + par4 * f4, (f7 - par5 * f4) + par7 * f4, f1, f2); tessellator1.addVertexWithUV(f5 + par3 * f4 + par6 * f4, f6 + par4 * f4, f7 + par5 * f4 + par7 * f4, f, f2); tessellator1.addVertexWithUV((f5 + par3 * f4) - par6 * f4, f6 - par4 * f4, (f7 + par5 * f4) - par7 * f4, f, f3); tessellator1.draw(); // GL11.glBindTexture(GL11.GL_TEXTURE_2D, Alptraum.mc.renderEngine.getTexture("/particles.png")); } /** * Called to update the entity's position/logic. */ public void onUpdate() { System.out.println("Alive"); double goodsX = WorldSensitiveInfo.locOfGoods[0]; double goodsY = WorldSensitiveInfo.locOfGoods[1]; double goodsZ = WorldSensitiveInfo.locOfGoods[2]; this.prevPosX = this.posX; this.prevPosY = this.posY; this.prevPosZ = this.posZ; coolDown++; if(worldObj.getClosestPlayer(posX, posY, posZ, 25D) != null && coolDown >= 50) { Alptraum.mc.sndManager.playSoundFX("mods.Alptraum.insanity", 1.0F, 1F); System.out.println("yaya"); coolDown = 0; } if (this.particleAge++ >= this.particleMaxAge) { this.setDead(); } this.motionY += 0.004D; this.moveEntity(this.motionX, this.motionY, this.motionZ); if (this.posY == this.prevPosY) { this.motionX *= 1.1D; this.motionZ *= 1.1D; } this.motionX *= 0.9599999785423279D; this.motionY *= 0.9599999785423279D; this.motionZ *= 0.9599999785423279D; if (this.onGround) { this.motionX *= 0.699999988079071D; this.motionZ *= 0.699999988079071D; } } }
  23. Sorry, just clarifying. Once again, the effectRenderer.addEffect will also spawn the particle at the same time?
  24. That will spawn them in the world as well?
  25. That's the name of my core class. I've initialized some heavily used variables there.
×
×
  • Create New...

Important Information

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