Everything posted by GodOfYeti
-
updating texture
couldnt I do this and it would do that samething basicly just return the texture public IIcon getIcon(IIconRegister reg, int side){ if(TileEntityAirGeneratorBlock.isActive == true){ return this.icons[side] = reg.registerIcon(RefStrings.MODID + ":airGeneratorFrontActivated"); } return this.icons[side] = reg.registerIcon(RefStrings.MODID + ":airGeneratorFrontDeactivated"); }
-
updating texture
Im sorry I dont under stand that function if you could expand on how it should be ran that would be great but please dont just give me the entire code
-
updating texture
I have a generator that set a boolean isActive to true or false but I want to change a texture depending on boolean how can I do this
-
updating texture
How can I get my block to update texture
-
Crashing on right click
Thanks man and you said there is alot wrong with my code, what might that be
-
Crashing on right click
I keep crashing on right click package com.linumhost.Items; import com.linumhost.Blocks.Blocks; import com.linumhost.TileEntity.TileEntityConduitPipe; import net.minecraft.block.Block; import net.minecraft.block.BlockAir; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; public class Wrench extends Item{ private static Block[] canWrench = new Block[1]; //private static TileEntity[] entityName = new TileEntity[1]; TileEntityConduitPipe entity = new TileEntityConduitPipe(); private boolean wrenchable; public static void populateArray(){ canWrench[0] = Blocks.conduit; // entityName[0] = new TileEntityConduitPipe(); } public static void setupEntity(){ } @Override public boolean onItemUse(ItemStack item, EntityPlayer player, World world, int x, int y, int z, int side, float blockx, float blocky, float blockz) { if(!world.isRemote) { for(int i = 0; i < canWrench.length; i++){ if(world.getBlock(x, y, z) == canWrench[i]){ System.out.println(canWrench[i]); //world.setBlock(posx, posy, posx, ); wrenchable = true; world.removeTileEntity(x,y,z); this.breakBlock(world, x, y, z); break; }else if(world.getBlock(x, y, z) != canWrench[i]){ System.out.println(canWrench[i]); wrenchable = false; break; } } return wrenchable; } return false; } private void breakBlock(World world, int x, int y, int z){ for(int i = 0; i < canWrench.length; i++){ if(world.getBlock(x, y, z) == canWrench[i]){ world.getBlock(x, y, z).dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0); world.setBlockToAir(x, y, z); } } } public void getWrenchableBlock(World world, int x, int y, int z){ } } ---- Minecraft Crash Report ---- // I let you down. Sorry Time: 1/29/15 10:56 PM Description: Ticking memory connection java.lang.RuntimeException: class com.linumhost.TileEntity.TileEntityConduitPipe is missing a mapping! This is a bug! at net.minecraft.tileentity.TileEntity.writeToNBT(TileEntity.java:96) at net.minecraftforge.common.util.BlockSnapshot.<init>(BlockSnapshot.java:52) at net.minecraftforge.common.util.BlockSnapshot.<init>(BlockSnapshot.java:81) at net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(BlockSnapshot.java:107) at net.minecraft.world.World.setBlock(World.java:515) at net.minecraft.world.World.setBlockToAir(World.java:651) at com.linumhost.Items.Wrench.breakBlock(Wrench.java:62) at com.linumhost.Items.Wrench.onItemUse(Wrench.java:45) at net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(ForgeHooks.java:456) at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:142) at net.minecraft.server.management.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:422) at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:593) at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:74) at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:122) at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at net.minecraft.tileentity.TileEntity.writeToNBT(TileEntity.java:96) at net.minecraftforge.common.util.BlockSnapshot.<init>(BlockSnapshot.java:52) at net.minecraftforge.common.util.BlockSnapshot.<init>(BlockSnapshot.java:81) at net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(BlockSnapshot.java:107) at net.minecraft.world.World.setBlock(World.java:515) at net.minecraft.world.World.setBlockToAir(World.java:651) at com.linumhost.Items.Wrench.breakBlock(Wrench.java:62) at com.linumhost.Items.Wrench.onItemUse(Wrench.java:45) at net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(ForgeHooks.java:456) at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:142) at net.minecraft.server.management.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:422) at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:593) at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:74) at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:122) at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) -- Ticking connection -- Details: Connection: net.minecraft.network.NetworkManager@4b256e18 Stacktrace: at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) -- System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 8.1 (amd64) version 6.3 Java Version: 1.8.0_25, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 697297448 bytes (664 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.05 FML v7.10.85.1230 Minecraft Forge 10.13.2.1230 5 mods loaded, 5 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available FML{7.10.85.1230} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.2.1230.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Forge{10.13.2.1230} [Minecraft Forge] (forgeSrc-1.7.10-10.13.2.1230.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available servermod{1.0} [server Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available testmod{1.0} [Test Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Player Count: 1 / 8; [EntityPlayerMP['Player140'/236, l='New World', x=1641.38, y=4.00, z=254.37]] Type: Integrated Server (map_client.txt) Is Modded: Definitely; Client brand changed to 'fml,forge'
-
[1.7.10]Boost player in the direction he is facing
I guess that is true
-
[1.7.10]Boost player in the direction he is facing
Couldnt you get his current position and depending on what direction he is facing (ForgeDirection) you can set his x, y, or z depending on direction
-
Tile Entity array
Ok so I want to call tile entity in array so I can remove the entity with a for loop easily
-
replace block with air
its telling me "air cannot be resolved or is not a field"
-
replace block with air
How can I replace a block with air
-
Help checking block
Solved, simple but yet impossible mistake to find turns out I was checking if "i > canWrench.length" when i should of checked if "i < canWrench.length"
-
Help checking block
It gets to the for loop and just stops
-
Game Crash 1.7.2
seems like its error while rendering
-
Help checking block
I cant seem to get this to work package com.linumhost.Items; import com.linumhost.Blocks.Blocks; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class Wrench extends Item{ private static Block[] canWrench = new Block[1]; public static void populateArray(){ canWrench[0] = Blocks.conduit; } public boolean onItemUse(ItemStack item, EntityPlayer player, World world, int posx, int posy, int posz, int side, float x, float y, float z) { if(!world.isRemote) { for(int i = 0; i > canWrench.length; i++){ if(world.getBlock(posx, posy, posz) == canWrench[i]){ System.out.println(canWrench[i]); return true; } return false; } return false; } return false; } }
-
rendering
Ok let me try again I have a pipe and it is a connected tectures type of pipe and I was wondering how I could make the core show show up as the icon for the player in hand its a 5x21 texture and I just want to show the 5x5 part of it
-
rendering
I made a pipe but was wondering how I can render it as a icon
-
rendering
How can I render my custom pipe as a icon
-
Gui
Ok and another gui related issue, if I use a static variable it will update on the gui from the tile but if I use for example getEnergyStored() it just returns once
-
Gui
I see your using the cofh api, how exactly could I use it im not sure on how to add apis yet
-
Gui
Ok but now back to the issue how can I invert the way it displays the texture
- Gui
-
Gui
Im sorry how would I achieve this.
-
Gui
Heres the badly laid out gui code I threw together in like 2 minutes at school package com.linumhost.Gui; import java.awt.Font; import java.awt.font.FontRenderContext; import java.awt.geom.AffineTransform; import java.text.SimpleDateFormat; import java.util.Date; import org.lwjgl.opengl.GL11; import com.linumhost.Blocks.AirGenerator; import com.linumhost.TileEntity.TileEntityAirGeneratorBlock; import com.linumhost.lib.RefStrings; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ChatComponentText; import net.minecraft.util.ResourceLocation; public class AirGeneratorGui extends GuiScreen { Minecraft mc = Minecraft.getMinecraft(); GuiButton testButton; EntityPlayer player = mc.thePlayer; TileEntityAirGeneratorBlock tile = new TileEntityAirGeneratorBlock(); String title = "Info Block"; AffineTransform affinetransform = new AffineTransform(); FontRenderContext frc = new FontRenderContext(affinetransform,true,true); Font font = new Font("Tahoma", Font.PLAIN, 12); int titleWidth = (int)(font.getStringBounds(title, frc).getWidth()); int titleheight = (int)(font.getStringBounds(title, frc).getHeight()); int tabWidth = 61 + 10; int titleXPos = (tabWidth - titleWidth) / 2; //int powerDisplayHeight = 100 / tile.getEnergyStored(); SimpleDateFormat sdf = new SimpleDateFormat("h:mm a"); String time = sdf.format(new Date()); public final int xPowerDisplay = 19; public final int yPowerDisplay = 53; public final int xSizeOfStorage = 13; public final int ySizeOfStorage = 47; public final int xSizeOfInside = 252; public final int ySizeOfInside = 139; public final int xSizeOfTexture = 256; public final int ySizeOfTexture = 156; public final int xSizeOfInterier = 226; public final int ySizeOfInterier = 113; public final int xSizeOfSideGap = 11; public final int ySizeOfSideGap = 115; public final int xSizeOfTopGap = 228; public final int ySizeOfTopGap = 11; public final int xSizeOfBottomGap = xSizeOfTopGap; public final int ySizeOfBottomGap = ySizeOfTopGap; @Override public void drawScreen(int x, int y, float f){ int xPos = (this.width - xSizeOfTexture) / 2; int yPos = (this.height - ySizeOfTexture) / 2; int levelPosX = (xSizeOfTexture) / 2; int levelPosY = (ySizeOfTexture) / 2; int xPowerDisplayPos = (this.width - 19) / 2; int yPowerDisplayPos = (this.height - 53) / 2; int bottom = (ySizeOfTexture - 20 - 2); GL11.glColor4f(1F, 1F, 1F, 1F); mc.renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID, "/textures/gui/airGeneratorBg.png")); drawDefaultBackground(); drawTexturedModalRect(xPos, yPos, 0, 0, xSizeOfTexture, ySizeOfTexture); GL11.glColor4f(1F, 1F, 1F, 1F); mc.renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID, "/textures/gui/energyStorageBar.png")); drawTexturedModalRect(xPos + 137 - xSizeOfStorage, yPos + 63 , 0, 0, xSizeOfStorage, (tile.getEnergyStored()*ySizeOfStorage)/ tile.getMaxEnergyStored()); //drawRect(xPos + 5, bottom + 40, 30, 100, 0x000000); //drawRect(xPos + 5, bottom + 40, 30, powerDisplayHeight, 0xd01414); fontRendererObj.drawString("Air Gen.", xPos + 10 + titleXPos, yPos + 4, 0x000000); fontRendererObj.drawString("Power: " + tile.storage + "/" + tile.getMaxEnergyStored(), xPos + xSizeOfSideGap + 5 , yPos + ySizeOfBottomGap + 100, 0x000000); super.drawScreen(x, y, f); } public void initGui(){ int xSize = 100; int ySize = 20; int xPos = (xSizeOfTexture) / 2; int yPos = (ySizeOfTexture) / 2; int bottom = (ySizeOfTexture - ySize - 2); buttonList.clear(); super.initGui(); } @Override public boolean doesGuiPauseGame(){ return false; } }
-
Gui
Ok so im working on a gui to display power, but so far I have ran into a problem my power display shows the bar correctly when full but when its filling it displays top going to the bottom but I need to invert it how can I do this
IPS spam blocked by CleanTalk.