Jump to content

tiffit

Forge Modder
  • Posts

    242
  • Joined

  • Last visited

Everything posted by tiffit

  1. For the multiblock, I suggest that you find out how to make basic machines first. Search up something like "forge custom furnace tutorial" or something like that. A tile entity is basically an entity that exists as a block. The tile entity can update and store data.
  2. For the multiblocks, this is what my approach would be. Make a control block, that is needed for the multiblock to work. This block creates a tile entity when placed. The TE checks the spaces relative to it for all the blocks that are part of the multiblock. If it finds all the blocks it needs then it can start spawning entities.
  3. I mean.. you could check if you hit anything yourself whenever you swing and then run the code there. Like check if there is an entity wherever you swung. Bow and arrows.. those are a bit harder
  4. Huh.... Don't you need to add some stuff to the @mod? I might be wrong but I remember something like clientSide=true Wait, is the entire mod client sided?
  5. There is a detectAndSendChanges method? I wish I knew about this sooner. About the invalid itemstack, I found out what I was doing and fixed it. Thanks for the help!
  6. tiffit

    exported

    Don't use MCP... use forge MDK http://files.minecraftforge.net/
  7. I have made a tile entity that removes an item like the furnace as fuel. But, my problem is that whenever the item gets removed the client crashes with a NPE for rendering the item. Tile Entity: public class TileEntityTemperatureControlledChamber extends GenericDuelTankTileEntity { public boolean isUsingFire = false; public int room_temp = 21; public int itemMax = 60; public boolean itemType; public int currentItem = 0; public int temperature = room_temp; public static HashMap<Item, Boolean> getAllowedFuels(){ HashMap<Item, Boolean> hmap = new HashMap<Item, Boolean>(); hmap.put(Items.blaze_powder, true); hmap.put(Items.blaze_rod, true); hmap.put(Items.fire_charge, true); hmap.put(Item.getItemFromBlock(Blocks.ice), false); hmap.put(Item.getItemFromBlock(Blocks.packed_ice), false); hmap.put(Items.snowball, false); return hmap; } public TileEntityTemperatureControlledChamber() { super(Main.temperatureControlledChamber, 10000, Arrays.asList(Main.filteredWater)); } @Override public int getSizeInventory() { return 1; } @Override public void updateEntity(){ super.updateEntity(); Main.network.sendToDimension(new TCCServerPacket(xCoord, yCoord, zCoord, false, false, temperature), worldObj.provider.dimensionId); calculateIsUsingFire(); if(currentItem > 0){ if(itemType && temperature < 100){ temperature+=3; currentItem--; } if(!itemType && temperature > 0){ temperature--; currentItem--; } if(temperature < 0) temperature = 0; if(temperature > 100) temperature = 100; } if(currentItem == 0){ if(temperature < 21) temperature++; if(temperature > 21) temperature--; if(items[0] != null){ currentItem = itemMax; itemType = getAllowedFuels().get(items[0].getItem()); setInventorySlotContents(0, ISUtil.removeFromStack(1, items[0])); } } } private void calculateIsUsingFire(){ if(items[0] == null || !getAllowedFuels().containsKey(items[0].getItem())) return; Item item = items[0].getItem(); isUsingFire = getAllowedFuels().get(item); } } Crashlog:
  8. I am trying to make my server send a string to my client. Whenever I try doing this, I get "The received string length is longer than maximum allowed (27 > 20)". I have tried to shorten the string size to 20, but it still says (27 > 20). My to and from byte: @Override public void fromBytes(ByteBuf buf) { int size = buf.readShort(); List<GuiLoreBox> loreBox = new ArrayList<GuiLoreBox>(); //TODO ONLY ACCEPTS GUILOREBOX for(int i = 0; i < size; i++){ String text = ByteBufUtils.readUTF8String(buf); if(text.endsWith("_END")){ loreBox.add((GuiLoreBox) Translator.translate(text.replace("_END", ""))); }else{ List<String> cummulate = new ArrayList<String>(); String last = text; cummulate.add(last); while(!last.endsWith("_END")){ last = ByteBufUtils.readUTF8String(buf); cummulate.add(last); } String together = ""; for(String str : cummulate){ together += str; } loreBox.add((GuiLoreBox) Translator.translate(together.replace("_END", ""))); } } } @Override public void toBytes(ByteBuf buf) { buf.writeShort(lore.size()); for(int i = 0; i < lore.size(); i++){ String text = Translator.transcribe(lore.get(i)); if(text.length() < 16){ ByteBufUtils.writeUTF8String(buf, text + "_END"); }else{ List<String> splits = new ArrayList<String>(); while(text.length() >= 16){ String cut = text.substring(0, 16); if(text.length() >= 17) text = text.substring(17); else text = ""; } for(int j = 0; j < splits.size(); j++){ ByteBufUtils.writeUTF8String(buf, text + (j == splits.size() - 1 ? "_END" : "")); } } } } Error:
  9. Yes, I am aware but I can't find a way to run code whenever an item gets extracted.
  10. Is there an event that gets called when an itemstack gets extracted from a tileentity. For example, if an itemduct extracts 16 diamonds from my custom machine, is there anything that gets called?
  11. I'm confused, each pipe is a different tile entity, are they not?
  12. I'm pretty sure the texture has to be 256x256
  13. How do you know you did something wrong? Do you have a crash log? Is something not working? We need more details, so we know what to look for.
  14. Thats the thing though, i'm not trying to make a dimension such as the Nether or End or Aether, i'm trying to add a 4th Spatial Dimension... In minecraft you can only move up down (1 Dimension), left right (1 Dimension), forward and backward(1 Dimension, arriving at a total of 3 Dimensions in which you can travel)... I want to make a mod that would allow you to travel in a fourth Spatial Dimension, not another world like the End or Nether Ahh.. Ok, I understand now. Can't help you there, but someone else could.
  15. There are HUNDREDS and I mean HUNDREDS of tutorials online on how to make a custom dimension. There are ways with forge to make custom renders, again quick google search. If you have any problems with making a custom dimension, then ask us that, as you should NEVER need to modify base classes. Not using forge loses you access to compatibility with other mods, and the whole forge API. Forge is not only for small mods, many large mods would be very difficult to make without forge. One of these mods would be Aether II (which adds a dimension).
  16. [lmgtfy]Java reflection tutorial[/lmgtfy] But really, you don't want to edit base classes, you really don't, or else you will turn out like this guy. Don't be that guy. Why exactly do you want to edit nibblearray, because 99% of the time, there is already something that can do what you want. If you happen to fall in that 1% you can make a request to have forge add this.
  17. Nevermind, I looked at the buildcraft source (line 408) and found what to do.
  18. Wish there was a facepalm emoji, because I am an idiot for assuming that by default it has an icon. [move]But I mean, I got whatever this is, so that will have to do.[/move] How exactly do I add an icon for a fluid?
  19. I am trying to make a GUI that displays fluids inside. I got water to work, but I am not able to get my custom fluid to work. It says null pointer exception when it tries to get the IIcon from my fluid. Drawing the fluids: public void drawFluidTank(IFluidTank tank, int x, int y){ FluidStack fluid = tank.getFluid(); TextureManager manager = mc.getTextureManager(); if (fluid != null){ manager.bindTexture(manager.getResourceLocation(0)); //Bind the blocks texture map float amount = fluid.amount; //The amount of fluid in the tank float capacity = tank.getCapacity(); //The max capacity of the tank float scale = amount / capacity; // The 'scale' of the fluid, ranging from 0 to 1, with 0 being empty, and 1 being full int fluidTankHeight = 60; // The max height of which the fluid can be drawed, i use 60, so the fluid is drawn max 60 pixels high int fluidAmount = (int) (scale * fluidTankHeight); // The amount of pixels the fluid has to be drawn on drawFluid(x, y + fluidTankHeight - fluidAmount, fluid.getFluid().getIcon(fluid), 16, fluidAmount); //Actually draw the fluid } } private void drawFluid(int x, int y, IIcon icon, int width, int height){ int i = 0; int j = 0; int drawHeight = 0; int drawWidth = 0; for (i = 0; i < width; i += 16){ for (j = 0; j < height; j += 16) { drawWidth = Math.min(width - i, 16); drawHeight = Math.min(height - j, 16); System.out.println(icon == null); drawTexturedModelRectFromIcon(x + i, y + j, icon, drawWidth, drawHeight); } } } Creating/Registering the fluid: Main.filteredWater = new Fluid("filteredWater"); FluidRegistry.registerFluid(Main.filteredWater); My fluid does work, as in I can place it, pick it up with a bucket, it flows, etc.
  20. Hopefully, you know how to download the file. You place the file in the following folder: minecraft/libraries/org/scala-lang/scala-compiler/2.11.1/ If any of the folders do not exist (the minecraft, libraries, org, and scala-lang should exist), just create it.
  21. Looks to me that is failing to download the scala libraries. "These libraries failed to download. Try again. org.scala-lang:scala-library:2.10.2, org.scala-lang:scala-compiler:2.10.2 Download this: https://bitbucket.org/luacs1998/forgelibrarydownloads/downloads/fmllibs16.zip and extract it to your .minecraft folder, then try running Minecraft, or redownload the installer. Otherwise, we will need console logs, and your JVM and OS versions."
  22. I am making a custom modpack launcher, I just need help with the actual launching of the game. What arguments do I need to launch minecraft forge 1.7.10? I have searched everywhere but I haven't found a complete guide to this. If you know of one, please let me know!
×
×
  • Create New...

Important Information

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