Jump to content

SkylordJoel

Forge Modder
  • Posts

    52
  • Joined

  • Last visited

Everything posted by SkylordJoel

  1. 1) I am aware, but I do not wish to satisfy the new EULA. 2) It's to do with my dimension's custom GenLayer's getInts() method, I believe, however sadly I have no idea how to write these due to lack of documentation. Here's the code: https://github.com/AwesCorp/SpaceAge/blob/master/forge/mcp/src/minecraft/spaceage/planets/ontarine/GenLayerBiomesOntarine.java#L21-L34
  2. So I was really sad that my mod didn't run, but kept testing, and today it spat out something different in the log, which is here: http://pastebin.com/TwEESPCg From what I can see it implies that my biome's temperature isn't showing up, but I have checked the code, and it's there. Thanks, SkylordJoel
  3. I usually get more rendering bugs and framerate drops from those. Oh yeah, not to mention the fact that Minecraft only supports Java 6... Well, on Mac at least. If WarpDrive, Universal Electricity, RotaryCraft and MFFS all update to 1.7 or 1.8, then I will use it. EDIT: I forgot, also if the EULA changes back to it's 1.6.4 and earlier state.
  4. I find those versions lack human-readable names and are full of bugs and glitches, not to mention framerate drops, etc.
  5. Well, there's only one other thing I can think of - in the Ontarine generation algorithm, it replaces every single block at a certain y value with sand... I didn't understand really how to do that like Minecraft so I did it in the ChunkProvider where Minecraft generates trees.
  6. No, my IDs are set up fine. I think. I just recently moved all registration to preInit so that may have broken it. I'm not really familiar with the workings of breakpoints, but I did what you recommended, only to suffer another crash.
  7. Okay, it stuffed up for some reason and just gave me this error: An internal error occurred during: "Parsing heap dump from '/Users/skylordjoel/Desktop/mcp/SpaceAge v1.6.4/SpaceAge/forge/mcp/jars/java_pid14117.hprof'". Java heap space
  8. Well, for the first link, one of my planets is just pure ocean till about 50 blocks down so that might be it. I'm just about to do the heap analyser stuff.
  9. Hi, After initialising my new dimensions/planets, any world, new or otherwise, appears to crash with this log: http://pastebin.com/vbmSwBmJ Before this, my mod loaded with one gigabyte of RAM and half the current permgen size, so I'm pretty sure that it's the dimensions. The mod that includes the dimensions is SpaceAgePlanets, and the other mods whose source I have in my dev environment (ie the ones that I'm working on) are SpaceAge and WarpDrive. If required, I can give source code for any one of my dimensions. Thanks, SkylordJoel
  10. Ah. Apparently I never learnt that. I'll go test.
  11. So how exactly do I use them?
  12. Even if I change my custom xSize and custom ySize names and change it in the code (i.e. binding), the slots still don't work.
  13. By overriding I meant I thought that mine would be used since I thought it had higher priority than referencing it from parent classes.
  14. I was under the impression that mine overrides theirs. But how would I use theirs then?
  15. By the way this is 1.6.4 and some positions are not calculated yet: package cr0s.WarpDrive.client.gui; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.network.packet.Packet250CustomPayload; import net.minecraft.util.ResourceLocation; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; import uedevkit.gui.GuiSimpleBase; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import cr0s.WarpDrive.WarpDrive; import cr0s.WarpDrive.WarpDriveConfig; import cr0s.WarpDrive.client.ClientProxy; import cr0s.WarpDrive.common.container.ContainerProtocol; import cr0s.WarpDrive.tile.TileEntityProtocol; @SideOnly(Side.CLIENT) public class GUIProtocol extends GuiSimpleBase { /*TODO * List of stuff: * dim_getP - done * dim_setP - done * dim_getN - done * dim_setN - done * setMode - done * setDistance - done * setDirection - done * getAttachedPlayers - done * summon * summonAll - done * getX - done * getY - done * getZ - done * energyRemaining For Core * doJump - done * getShipSize - done * setBeaconFrequency - unused * getDx - done * getDz - dome * setCoreFrequency - more like ship name, done * isInSpace - done * isInHyperspace - done * setTargetJumpgate*/ int xSize = 256; int ySize = 256; private static final ResourceLocation furnaceGuiTextures = new ResourceLocation(WarpDrive.modid + ":textures/gui/" + "guiWarpInterface_alternate.png");//ClientProxy.warpInterfaceGui/*"textures/gui/container/furnace.png"*/); private TileEntityProtocol furnaceInventory; private GuiTextField front; private GuiTextField back; private GuiTextField left; private GuiTextField right; private GuiTextField up; private GuiTextField down; private GuiTextField distance; private GuiTextField mode; private GuiTextField direction; private GuiTextField shipName; //private GuiTextField beaconInput; UNUSED private char[] allowedChars = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; private char[] modeChars = { '0'/*jump/long jump*/, '1'/*To hyperspace*/, '2'/*jumpgate*//*, '3'/*jump to different dimensions*/ }; private char[] directionChars = { '0'/*up*/, '1'/*down*/, '2'/*left*/, '3'/*right*/, '4'/*forward*/, '5'/*back*/ }; public GUIProtocol(InventoryPlayer par1InventoryPlayer, TileEntityProtocol tile_entity) { super(new ContainerProtocol(par1InventoryPlayer, tile_entity)); this.furnaceInventory = tile_entity; } int grey = 4210752; int sizex = -14;//10-24 int sizey = -12; int dimensionx = -25; int dimensiony = 132; int blocksx; int blocksy; int coord0x; int coord0y; int pixelsPerWord = 10; String size0 = "Amount of blocks from Core to be moved: "; /** * Draw the foreground layer for the GuiContainer (everything in front of the items) */ protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { String s = this.furnaceInventory.isInvNameLocalized() ? this.furnaceInventory.getInvName() : I18n.getString(this.furnaceInventory.getInvName()); this.fontRenderer.drawString(s, this.xSize / 2 - this.fontRenderer.getStringWidth(s) / 2, 6, 4210752); this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752); String size1 = furnaceInventory.getFront() + ", Right: " + furnaceInventory.getRight() + ", Up: " + furnaceInventory.getUp(); String size2 = "Back: " + furnaceInventory.getBack() + ", Left: " + furnaceInventory.getLeft() + ", Down: " + furnaceInventory.getDown(); String dimension = furnaceInventory.currentDimension(); String blocks = "Ship Size: " + String.valueOf(furnaceInventory.getShipSize()); String coord0 = "Coordinates: "; String coord1 = "X: " + String.valueOf(furnaceInventory.getCoreX()); String coord2 = "Y: " + String.valueOf(furnaceInventory.getCoreY()); String coord3 = "Z: " + String.valueOf(furnaceInventory.getCoreZ()); String coord4 = "Destination Coordinates: "; String coord5 = "X: " + String.valueOf(furnaceInventory.getDestX()); //String coord6 = "Y: " + String.valueOf(furnaceInventory.getDestY()); String coord7 = "Z: " + String.valueOf(furnaceInventory.getDestZ()); write(size0, sizex, sizey, grey); //Title write(size1, sizex, sizey + pixelsPerWord, grey); //setP write(size2, sizex, sizey + (2 * pixelsPerWord), grey); //setN write(dimension, dimensionx, dimensiony, grey); write(coord0, coord0x, coord0y, grey); write(coord1, coord0x + pixelsPerWord, coord0y, grey); write(coord2, coord0x + 2 * (pixelsPerWord), coord0y, grey); write(coord3, coord0x + 3 * (pixelsPerWord), coord0y, grey); write(coord4, coord0x + 5 * (pixelsPerWord), coord0y, grey); write(coord5, coord0x + 6 * (pixelsPerWord), coord0y, grey); write(coord7, coord0x + 7 * (pixelsPerWord), coord0y, grey); write(blocks, blocksx, blocksy, grey); front.drawTextBox(); back.drawTextBox(); left.drawTextBox(); right.drawTextBox(); up.drawTextBox(); down.drawTextBox(); distance.drawTextBox(); mode.drawTextBox(); direction.drawTextBox(); shipName.drawTextBox(); //beaconInput.drawTextBox(); UNUSED } /** * Draw the background layer for the GuiContainer (everything behind the items) */ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(furnaceGuiTextures); int k = (this.width - this.xSize) / 2; int l = (this.height - this.ySize) / 2; this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); int i1; //FLAME - DON'T NEED /*if (this.furnaceInventory.isBurning()) { i1 = this.furnaceInventory.getBurnTimeRemainingScaled(12); this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2); }*/ //GIANT ARROW - DON'T NEED /*i1 = this.furnaceInventory.getCookProgressScaled(24); this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16);*/ } @Override public void initGui() { super.initGui(); buttonList.clear(); Keyboard.enableRepeatEvents(true); //int biX = 0; UNUSED //int biY = 0; UNUSED int frontX = 0; //TODO int frontY = 0; int diX = 0; int diY = 0; int dirX = 0; int dirY = 0; int moX = 0; int moY = 0; int sNX = 58; int sNY = -33; int inputLength = 30; int inputWidth = 20; //applyBasicAttributes(beaconInput); UNUSED shipName = new GuiTextField(this.fontRenderer, sNX, sNY, inputLength * 2, inputWidth); shipName.setMaxStringLength(10); direction = new GuiTextField(this.fontRenderer, dirX, dirY, inputLength, inputWidth); direction.setMaxStringLength(1); mode = new GuiTextField(this.fontRenderer, moX, moY, inputLength, inputWidth); mode.setMaxStringLength(1); distance = new GuiTextField(this.fontRenderer, diX, diY, inputLength, inputWidth); distance.setMaxStringLength(3); front = new GuiTextField(this.fontRenderer, frontX, frontY, inputLength, inputWidth); front.setMaxStringLength(3); back = new GuiTextField(this.fontRenderer, frontX, frontY + pixelsPerWord, inputLength, inputWidth); back.setMaxStringLength(3); left = new GuiTextField(this.fontRenderer, frontX, frontY + (2 * pixelsPerWord), inputLength, inputWidth); left.setMaxStringLength(3); right = new GuiTextField(this.fontRenderer, frontX, frontY + (3 * pixelsPerWord), inputLength, inputWidth); right.setMaxStringLength(3); up = new GuiTextField(this.fontRenderer, frontX, frontY + (4 * pixelsPerWord), inputLength, inputWidth); up.setMaxStringLength(3); down = new GuiTextField(this.fontRenderer, frontX, frontY + (5 * pixelsPerWord), inputLength, inputWidth); down.setMaxStringLength(3); applyBasicAttributes(front); applyBasicAttributes(back); applyBasicAttributes(right); applyBasicAttributes(left); applyBasicAttributes(up); applyBasicAttributes(down); applyBasicAttributes(distance); applyBasicAttributes(mode); applyBasicAttributes(direction); applyBasicAttributes(shipName); //beaconInput = new GuiTextField(this.fontRenderer, biX, biY, inputLength, inputWidth); UNUSED //beaconInput.setMaxStringLength(2); UNUSED /**/buttonList.add(new GuiButton(0/*button number, maybe for mod, else gui*/, guiLeft - 26/*Location in relation to left in pixels*/, guiTop + 177/*Location in relation to top in pixels*/, 30/*Length in pixels*/, 20/*Height in pixels*/, "Jump"/*Text on button*/)); /**/buttonList.add(new GuiButton(1/*button number, maybe for mod, else gui*/, guiLeft - 26/*Location in relation to left in pixels*/, guiTop + 157/*Location in relation to top in pixels*/, 60/*Length in pixels*/, 20/*Height in pixels*/, "Summon All"/*Text on button*/)); buttonList.add(new GuiButton(2, guiLeft + 4/*217: -40*/, guiTop + 177/*227: -45*/, 30, 20, "Wiki")); } public void applyBasicAttributes(GuiTextField field) { //if(field != null) { field.setEnableBackgroundDrawing(true); field.setFocused(false); field.setCanLoseFocus(true); //} } @Override protected void keyTyped(char par1, int par2) { if(anyTextBoxFocused()) { if(par1 != 27) { if(shipName.textboxKeyTyped(par1, par2)) { shipName(); } if(isValidChar(par1)) { //super.keyTyped(par1, par2); if(front.textboxKeyTyped(par1, par2)) { simpleTextPacket("WarpDrive_F", this.front, 4); } else if(back.textboxKeyTyped(par1, par2)) { simpleTextPacket("WarpDrive_B", this.back, 4); } else if(left.textboxKeyTyped(par1, par2)) { simpleTextPacket("WarpDrive_L", this.left, 4); } else if(right.textboxKeyTyped(par1, par2)) { simpleTextPacket("WarpDrive_R", this.right, 4); } else if(up.textboxKeyTyped(par1, par2)) { simpleTextPacket("WarpDrive_U", this.up, 4); } else if(down.textboxKeyTyped(par1, par2)) { simpleTextPacket("WarpDrive_D", this.down, 4); } else if(distance.textboxKeyTyped(par1, par2)) { simpleTextPacket("WarpDrive_Dis", this.distance, 4); } else if(isValidModeChar(par1)) { if(mode.textboxKeyTyped(par1, par2)) { modeTextPacket("WarpDrive_M", this.mode, 4); } else if(isValidDirectionChar(par1)) { if(direction.textboxKeyTyped(par1, par2)) { directionTextPacket("WarpDrive_Dir", this.direction, 4); } } //} else if(beaconInput.textboxKeyTyped(par1, par2)) {UNUSED //simpleTextPacket("WarpDrive_Protocol", this.beaconInput.getText().getBytes())); UNUSED } } else { super.keyTyped(par1, par2); } } } else if (par1 == 27) { mc.thePlayer.closeScreen(); } } public boolean anyTextBoxFocused() { return front.isFocused() || back.isFocused() || left.isFocused() || right.isFocused() || up.isFocused() || down.isFocused() || distance.isFocused() || mode.isFocused() || direction.isFocused() || shipName.isFocused(); } public void shipName() { ByteArrayOutputStream bos = new ByteArrayOutputStream(shipName.getText().length()); DataOutputStream output = new DataOutputStream(bos); try { String f = shipName.getText(); output.writeUTF(f); } catch(Exception e) { e.printStackTrace(); } Packet250CustomPayload packet = new Packet250CustomPayload(); packet.channel = "WarpDrive_SN"; packet.data = bos.toByteArray(); packet.length = bos.size(); this.mc.thePlayer.sendQueue.addToSendQueue(packet); } public void directionTextPacket(String channel, GuiTextField field, int bytes) { ByteArrayOutputStream bos = new ByteArrayOutputStream(bytes); DataOutputStream output = new DataOutputStream(bos); try { String f = field.getText(); int fI = Integer.parseInt(f); output.writeInt(fI); } catch(Exception e) { e.printStackTrace(); } Packet250CustomPayload packet = new Packet250CustomPayload(); packet.channel = channel; packet.data = bos.toByteArray(); packet.length = bos.size(); this.mc.thePlayer.sendQueue.addToSendQueue(packet); } private boolean isValidDirectionChar(char par1) { for(int x = 0; x <= this.directionChars.length; x++) { if(par1 == this.directionChars[x]) { return true; } } return false; } private boolean isValidModeChar(char par1) { for(int x = 0; x <= this.modeChars.length; x++) { if(par1 == this.modeChars[x]) { return true; } } return false; } public void modeTextPacket(String channel, GuiTextField field, int lengthOfBytesInField) { ByteArrayOutputStream bos = new ByteArrayOutputStream(lengthOfBytesInField); DataOutputStream output = new DataOutputStream(bos); try { String f = field.getText(); int fI = Integer.parseInt(f); output.writeInt(fI); } catch(Exception e) { e.printStackTrace(); } Packet250CustomPayload packet = new Packet250CustomPayload(); packet.channel = channel; packet.data = bos.toByteArray(); packet.length = bos.size(); this.mc.thePlayer.sendQueue.addToSendQueue(packet); } public void simpleTextPacket(String channel, GuiTextField field, int lengthOfBytesInField) { ByteArrayOutputStream bos = new ByteArrayOutputStream(lengthOfBytesInField); DataOutputStream output = new DataOutputStream(bos); try { String f = field.getText(); int fI = Integer.parseInt(f); output.writeInt(fI); } catch(Exception e) { e.printStackTrace(); } Packet250CustomPayload packet = new Packet250CustomPayload(); packet.channel = channel; packet.data = bos.toByteArray(); packet.length = bos.size(); this.mc.thePlayer.sendQueue.addToSendQueue(packet); } @Override protected void mouseClicked(int x, int y, int buttonClicked) { super.mouseClicked(x, y, buttonClicked); this.front.mouseClicked(x, y, buttonClicked); this.back.mouseClicked(x, y, buttonClicked); this.left.mouseClicked(x, y, buttonClicked); this.right.mouseClicked(x, y, buttonClicked); this.up.mouseClicked(x, y, buttonClicked); this.down.mouseClicked(x, y, buttonClicked); this.distance.mouseClicked(x, y, buttonClicked); this.mode.mouseClicked(x, y, buttonClicked); this.direction.mouseClicked(x, y, buttonClicked); this.shipName.mouseClicked(x, y, buttonClicked); //this.beaconInput.mouseClicked(x, y, buttonClicked); UNUSED } private boolean isValidChar(char par1) { for(int x = 0; x <= this.allowedChars.length; x++) { if(par1 == this.allowedChars[x]) { return true; } } return false; } @Override public void updateScreen() { this.front.updateCursorCounter(); this.back.updateCursorCounter(); this.left.updateCursorCounter(); this.right.updateCursorCounter(); this.up.updateCursorCounter(); this.down.updateCursorCounter(); this.distance.updateCursorCounter(); this.mode.updateCursorCounter(); this.direction.updateCursorCounter(); this.shipName.updateCursorCounter(); //this.beaconInput.updateCursorCounter(); UNUSED } @Override protected void actionPerformed(GuiButton button) { switch(button.id) { case 0: furnaceInventory.doJump(); System.out.println(furnaceInventory.getCoreFrequency() + " jumped from coordinates " + String.valueOf(furnaceInventory.getCoreX()) + ", " + String.valueOf(furnaceInventory.getCoreY()) + ", " + String.valueOf(furnaceInventory.getCoreZ())); break; case 1: furnaceInventory.setSummonAllFlag(true); break; //System.out.println("Clicked!");//ACTION PERFORMED ON BUTTON CLICK case 2: openURL("https://sites.google.com/site/spaceageminecraft/wiki/blocks/warp-interface"); } } @Override public void onGuiClosed() { super.onGuiClosed(); Keyboard.enableRepeatEvents(false); } @Override public void drawScreen(int par1, int par2, float par3) { super.drawScreen(par1, par2, par3); this.front.drawTextBox(); this.back.drawTextBox(); this.left.drawTextBox(); this.right.drawTextBox(); this.up.drawTextBox(); this.down.drawTextBox(); this.distance.drawTextBox(); this.mode.drawTextBox(); this.direction.drawTextBox(); this.shipName.drawTextBox(); } }
  16. I have set the xSize and ySize both to 256 already. All of the rendering works, it's just the items behaving weirdly. Even GUI buttons work.
  17. Hi, For my protocol block, the gui is 256x256. When I open it, the items in the top two rows of the inventory work fine. However, the bottom two rows will throw out an item if you click on any of the items in the slots. Is there a way to avoid this? PS: I have identical code in other blocks without the expanded GUI, and they all work fine. Thanks, SkylordJoel SOLUTION: Have this as your constructor: public GUIWhatever(InventoryPlayer par1InventoryPlayer, TileEntityWhatever tile_entity) { super(new WhateverProtocol(par1InventoryPlayer, tile_entity)); this.inventory = tile_entity; this.xSize = customSize; this.ySize = customSize; }
  18. Here's the relevant code of my tile entity: int w = 142; int h = 68; int radius = 500; int scale = 25; public int translateX(int oldX) { int x = xCoord - oldX; x = x / (radius / scale); x = x + (w / 2); x = MathHelper.floor(x); return x; } public int translateZ(int oldZ) { int x = yCoord - oldZ; x = x / (radius / scale); x = x + (w / 2); x = MathHelper.floor(x); return x; } public void drawContact(int x, int y, int z, String name, int color) { int newX = translateX(x); int newZ = translateZ(z); int contactX = 176; int contactZ = 80; this.drawTexturedModalRect(newX, newZ, contactX, contactZ, 1 + color, 1); //paintutils.drawPixel(newX, newZ, color); write(name, newX - 3, newZ + 1, 4210752); //textOut(newX - 3, newZ + 1, "[" + name + "]", colors.white, colors.black); } public int scanAndDraw() { if (getCurrentEnergyValue() < radius * radius) { int hh = MathHelper.floor(h / 2); int hw = MathHelper.floor(w / 2); drawLine(hw - 5, hh - 1, hw + 5, hh - 1, 9843760); drawLine(hw - 5, hh, hw + 5, hh, 9843760); write("Insufficient Energy", hw-4/*TEST - DEBUG*/, hh/*TEST - DEBUG*/, 14540253);//(hw - 4, hh, "LOW POWER", 14540253, 9843760); drawLine(hw - 5, hh + 1, hw + 5, hh + 1, 9843760); return 0; } else { scanRadius(radius); redraw(); int numResults = getResultCount(); if ((numResults < 1) || (numResults > -1)) { for (int i = 0; i < numResults-1; i++) { //freq, cx, cy, cz = radar.getResult(i); String freq = getResultFrequency(i); int cx = Integer.parseInt(getResultX(i)); int cy = Integer.parseInt(getResultY(i)); int cz = Integer.parseInt(getResultZ(i)); drawContact(cx, cy, cz, freq, 0); } } } drawContact(xCoord/* radarX*/, yCoord/*radarY*/, zCoord/*radarZ*/, "RAD", 1); } public void drawPixelRed(int x, int y) { //this.drawTexturedModalRect(x, y, 176, 80, 1, 1); this.isDrawingRed = true; } public void drawPixelYellow(int x, int y) { //this.drawTexturedModalRect(x, y, 177, 80, 1, 1); this.isDrawingYellow = true; } public void drawPixelForeground(int x, int y) { //this.drawTexturedModalRect(x, y, 2, 1, 1, 1); this.isDrawingForeground = true; } public void drawLine(int startX, int startY, int endX, int endY, int nColour) { //later additions int minY; int maxX; int maxY; int startX2 = MathHelper.floor(startX); int startY2 = MathHelper.floor(startY); int endX2 = MathHelper.floor(endX); int endY2 = MathHelper.floor(endY); if(startX2 == endX2 && startY2 == endY2) { drawPixelForeground(startX2, startY2); return; } int minX = startX2 - endX2; if(minX == startX2) { minY = startY2; maxY = endY2; maxX = endX2; } else { minY = endY2; maxY = startY2; maxX = startX2; } int xDiff = maxX - minX; int yDiff = maxY - minY; if(xDiff > yDiff) { int y = minY; int dy = yDiff / xDiff; for(int x = minX; x < maxX; x++) { drawPixelForeground(x, MathHelper.floor(y + 0.5)); int y2 = y + dy; } } int x = minX; int dx = xDiff / yDiff; if(maxY >= minY) { for(int y = minX; y < maxY; y++) { drawPixelForeground(MathHelper.floor(x + 0.5), y); int x2 = x + dx; } for(int y = minY; y > maxY; y--) { drawPixelForeground(MathHelper.floor(x + 0.5), y); int x2 = x + dx; } } } public void redraw() { //shell.run("clear"); //colorScreen(3491355); drawLine(1, 1, w, 1, 1644054); //textOut(h, 1, "= W-Radar v0.1 =", 14540253, 1644054); //textOut(w - 3/*cursor x*/, 1/*cursor y*/, "[X]"/*text*/, 14540253/*text colour*/, 9843760); write("[X]", /*TEST FOR DEBUG*/w-3, /*TEST FOR DEBUG*/1, 14540253); drawLine(1, h, w, h, 1644054); } (it still has snippets from lua) So I want to know how to get the write()s and the drawTexturedModalRect()s in drawGuiForegroundLayer and BackgroundLayer respectively.
  19. It's for SpaceAge with the moving tile entities essentially WarpDrive's Warp Cores. I just added the constantly change bit so that noobs who think i'm an idiot don't write that I just code it directly with constants.
  20. No, not really. Just the fact that certain pixels will move around based on the movements of a tile entity. I just need to know how to get the code into the working part of a gui.
  21. Hi, How would I call a function (drawTexturedModalRect) that belongs in drawGuiBackgroundLayer but can't be in there since the variables constantly change? If you can't imagine what i'm talking about, think of it as how a minimap constantly changes but gets it's variables from the landscape. I get my variables from a piece of code that positions pixels (which I have already found a workaround for). Thanks, SkylordJoel
  22. Hi, I was coding in a new biome for SpaceAge, when I realised something: the biome engine has no support for metadata blocks. I had a look around, and the closest thing I found to a tutorial was this: 3. replaceBlocksForBiome in ChunkProviderGenerate assigns topblock and fillerblock id to abyte array you would need to make similar method that puts metadata info to abyteMeta array. 4. Finally Chunk chunk = new Chunk(this.worldObj, abyte, par1, par2); // Change in to: Chunk chunk = new Chunk(this.worldObj, abyte, abyteMeta, par1, par2); The third instruction was a bit vague and didn't tell you how to exactly. I want to know how to do that. All other mods seem to stray away from metadata blocks in world generation. Thanks, SKYLORDJOEL PS: Here is my replace blocks for biome method: public void replaceBlocksForBiome(int par1, int par2, byte[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase) { ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, par1, par2, par3ArrayOfByte, par4ArrayOfBiomeGenBase); MinecraftForge.EVENT_BUS.post(event); if (event.getResult() == Result.DENY) { return; } byte b0 = 63; double d0 = 0.03125D; this.stoneNoise = this.noiseGen4.generateNoiseOctaves(this.stoneNoise, par1 * 16, par2 * 16, 0, 16, 16, 1, d0 * 2.0D, d0 * 2.0D, d0 * 2.0D); for (int k = 0; k < 16; ++k) { for (int l = 0; l < 16; ++l) { BiomeGenBase biomegenbase = par4ArrayOfBiomeGenBase[l + k * 16]; float f = biomegenbase.getFloatTemperature(); int i1 = (int) (this.stoneNoise[k + l * 16] / 3.0D + 3.0D + this.rand.nextDouble() * 0.25D); int j1 = -1; byte topBlock = biomegenbase.topBlock; byte fillerBlock = biomegenbase.fillerBlock; byte topBlockMeta = biomegenplanets.topBlockMeta; byte fillerBlockMeta = biomegenplanets.fillerBlockMeta; for (int k1 = 127; k1 >= 0; --k1) { int l1 = (l * 16 + k) * 128 + k1; if (k1 <= 0 + this.rand.nextInt(5)) { par3ArrayOfByte[l1] = (byte) Block.bedrock.blockID; } else { byte b3 = par3ArrayOfByte[l1]; //block id for current block if (b3 == 0) { j1 = -1; } else if (b3 == SpaceAgeCore.hadesSurfaceID) { //originally stone - used cause the generator generates stone first if (j1 == -1) { if (i1 <= 0) { topBlock = 0; fillerBlock = (byte) SpaceAgeCore.hadesSurfaceID;//originally stone - under top and filler } else if (k1 >= b0 - 4 && k1 <= b0 + 1) { topBlock = biomegenbase.topBlock; fillerBlock = biomegenbase.fillerBlock; } if (k1 < b0 && topBlock == 0) { if (f < 0.15F) { topBlock = (byte) Block.ice.blockID; //lakes } } j1 = i1; if (k1 >= b0 - 1) { par3ArrayOfByte[l1] = topBlock; } else { par3ArrayOfByte[l1] = fillerBlock; } } else if (j1 > 0) { --j1; par3ArrayOfByte[l1] = fillerBlock; if (j1 == 0 && fillerBlock == SpaceAgeCore.hadesSurfaceID) { //originally sand j1 = this.rand.nextInt(4); fillerBlock = (byte) SpaceAgeCore.hadesSurfaceID; //sandstone } } } } } } } }
  23. Hi, I was making a generator for a UniversalElectricity add-on. I wanted to make it so that the generator had to have water in it and lava underneath to work. I have managed to get the lava working, however I ran into a problem with water. I searched the internet and apparently my class had to implement IFluidHandler. However, I am pretty dumbfounded on what to do with the methods. Quick Overview of what I want to do with this: Add a slot that holds buckets. Drain the water out of the bucket when inserted and put into internal tank. If tank has water and lava is underneath the generator will run. TileEntity: package spaceage.common.tile; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.util.Icon; import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import resonant.lib.prefab.vector.Cuboid; import spaceage.common.SpaceAgeCore; import universalelectricity.api.energy.EnergyStorageHandler; public class TileHeatGenerator extends TileEnergyDistribution implements IFluidHandler { @SideOnly(Side.CLIENT) public static Icon sside, bottom; public TileHeatGenerator() { super(Material.iron); energy = new EnergyStorageHandler(SpaceAgeCore.HEAT_ENERGY * 20); ioMap = 728; textureName = "heat_top"; bounds = new Cuboid(0, 0, 0, 1, 0.3f, 1); isOpaqueCube = false; normalRender = false; } @SideOnly(Side.CLIENT) @Override public void registerIcons(IconRegister iconReg) { sside = iconReg.registerIcon(SpaceAgeCore.modid + ":" + "heat_side"); bottom = iconReg.registerIcon(SpaceAgeCore.modid + ":" + "heat_bottom"); super.registerIcons(iconReg); } @Override @SideOnly(Side.CLIENT) public Icon getIcon(int side, int meta) { switch(side) { case 0: return bottom; default: return sside; } /*{ if (side == 0) { return solarPanel_bottom; } else if (side == 1) { return getIcon(); } return solarPanel_side;*/ } @Override public void updateEntity() { boolean powered = worldObj.getBlockId(xCoord, yCoord - 1, zCoord) == Block.lavaStill.blockID; if(powered == true) { this.energy.receiveEnergy(SpaceAgeCore.HEAT_ENERGY, true); markDistributionUpdate |= produce() > 0; } super.updateEntity(); } @Override public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { // TODO Auto-generated method stub return 0; } @Override public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { // TODO Auto-generated method stub return null; } @Override public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { // TODO Auto-generated method stub return null; } @Override public boolean canFill(ForgeDirection from, Fluid fluid) { // TODO Auto-generated method stub return false; } @Override public boolean canDrain(ForgeDirection from, Fluid fluid) { // TODO Auto-generated method stub return false; } @Override public FluidTankInfo[] getTankInfo(ForgeDirection from) { // TODO Auto-generated method stub return null; } }
  24. Hi, I wanted to make something which allows the player to fly whilst held. Thanks!
×
×
  • Create New...

Important Information

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