Jump to content

Bektor

Forge Modder
  • Posts

    852
  • Joined

  • Last visited

Everything posted by Bektor

  1. That was the output after I tested it in eclipse within an Singleplayer world. Tested while using the scan tool and scanned an area with about 300 blocks each side. Height around 10-20 blocks. Also 7GB of RAM was allocated by Minecraft, since eclipse just default gives my Minecraft 7GB RAM. (tested the version provided from the github link)
  2. Hi, I'm currently trying to implement a energy system and I'm now wondering how I can transport energy from a point A to a point B. That's my current code: When now putting one of my solar panels (from a thread before) on the top of those cables and one under those cables (cause who needs a battery ) there is no energy transferred between them, or atleast no energy gets into the solar panel under those cables. Only in the moment I connect the solar panel with the cables about 16 energy units go into the solar panel at the bottom, but after this first connection... nothing. It would also be nice to know how to transfer energy between two blocks which aren't direclty connected. Thx in advance. Bektor
  3. It does not effect getCapability(). But think about it, you use ForgeEnergy and give it the name EU. I don't think your machines will now be compatible with machines using real EU from ic2, while the user thinks, both is using EU, so it is compatible.
  4. I haven't seen one mod yet with such a config option. Thought I've got only energysynergy and enderio and teslacoils installed. But besides that, the problem would still be, if you for example give it the name Tesla or EU or RF while using Forge Energy, I don't think you would be able to connect it to those devices from those mods which use Tesla, EU or RF and power those devices or let your devices powered by them.
  5. Hi, I'm wondering how to display in the GUI of my solar panel that it currently generates energy using the Forge Energy system, since my mod will support multiply energy APIs. I'm basically asking this because I don't want to confuse the user with different names from different mods. Like all machines which generate RF (redstone flux) display RF/t or something like that in the Gui, so that everyone knows that this machine is compatible with the machine from this mod cause it generates both the same energy. Thx in advance. Bektor
  6. Hi, I'm currently working on my mod and ran now into this problem: The FML Log says this: [16:14:46] [main/INFO] [FML/]: Forge Mod Loader version 13.20.0.2201 for Minecraft 1.11.2 loading My code in Constants.java: public static final String FORGE_VERSION = "required-after:Forge@[13.20.0.2201,);"; My code in the main class: @Mod(modid = Constants.MOD_ID, version = Constants.VERSION, dependencies = Constants.FORGE_VERSION, acceptedMinecraftVersions = Constants.MC_VERSION, useMetadata = false, canBeDeactivated = false, guiFactory = Constants.GUI_FACTORY_LOCATION, updateJSON = Constants.UPDATE) Cause I can't remember something has changed there in 1.11 I'm posting this here. In 1.10.2 it worked quite fine for me. Tested with: Minecraft 1.11.2 Forge Mod Loader version 13.20.0.2201 Java 8 JRE & JDK Update 112 64bit Eclipse Neon IDE I also executed these commands gradlew cleanCache setupDecompWorkspace --refresh-dependencies eclipse just in case that my Forge MDK Installation for eclipse was broken, but this didn't resolve the problem. Would be nice to have this working again. Thx in advance. Bektor
  7. Well, it's not actually the implementation you are looking for, but it's using capabilities. It's basically a Solar Panel with a GUI for which I looked a bit into the Vanilla furnace code. Hopes this helps. http://www.minecraftforge.net/forum/index.php?topic=44428 http://www.minecraftforge.net/forum/index.php?topic=44438
  8. A second way would be like your thread title suggests to convert the obj model into a json. I haven't done such things myself, but it's quite simple. You just need to have advanced knowledge about both file formats. Both formats just store informations about the location of for example points and how they are connected to each other. You have to read the information in and then have to convert it into the Minecraft JSON format and done. Some information about both formats, though obj is the more complex one: http://minecraft.gamepedia.com/Model https://en.wikipedia.org/wiki/Wavefront_.obj_file Other ways would be to write the jsons yourself, download free software which does the same as the paid software you talked about or directly use obj models in Minecraft.
  9. Well, I would guess updateProgressBar, but this would be a new method, because it does not exists in the default Container class and is also not overriden in Furnace (there it is created). But this method seems also to be just there, but not used... atleast in TileEntityFurnace and in the GUI and in the Container itself, eclipse couldn't find any place where it's called. It does override updateProgressBar and it does exist in Container. ContainerFurnace just doesn't have the @Override over it. Yeah, just noticed now. ^^ That's why I always use @Override ! But what to put in there? I don't have a method setField and getField, cause I've got only one variable there EDIT: Ok, found it out. Works now. Just one last question: How to change the size of text for a Gui? Because currently the complete text has the same size, but I want it to have different sizes. And in drawGuiContainerForegroundLayer these two lines seem to get different results then in drawGuiContainerBackgroundLayer which causes that the text is placed correct, but when you resize the window, the text is drawn on the wrong location while everything in drawGuiContainerBackgroundLayer works fine. int guiStartX = (this.width - this.getXSize()) / 2; int guiStartY = (this.height - this.getYSize()) / 2; EDIT 2: Ok, seems like drawGuiContainerBackgroundLayer uses other coordinates as drawGuiContainerForegroundLayer and fixed the other stuff now also with looking more indeph into setField and getField from the Vanilla Furnace.
  10. Well, I would guess updateProgressBar, but what to put in there? I don't have a method setfield and getField, cause I've got only one variable there.
  11. It's actually a number from a class which is somehow connected to some capability. (Energy stuff) So I implemented now this method here, but it does still not work... @Override public void detectAndSendChanges() { super.detectAndSendChanges(); for(int i = 0; i < this.listeners.size(); i++) { IContainerListener listener = (IContainerListener) this.listeners.get(i); if(this.energyStored != this.panel.container.getEnergyStored()) listener.sendProgressBarUpdate(this, this.energyStored, this.panel.container.getEnergyStored()); } this.energyStored = this.panel.container.getEnergyStored(); }
  12. Ok, thx. Now I'm only left with the problem that I've got some variables in the tile entity which are also saved to nbt data, but my GUI shows always 0. some parts of the GUI: some parts of the TileEntity: GuiHandler: Container: Any ideas how to fix this?
  13. Hi, I'm wondering if I need anything like IInventory and a container when I've got a GUI which does show the player inventory and some information. The GUI itself has no slots except for the slots from the player inventory. Thx in advance. Bektor
  14. Ok, I got it now working. Don't ask me what the cause of the problem was... I've got no clue... Just fixed some bugs and it seems that one of those bugs caused the other problems. ^^
  15. I'm not quite sure, but maybe return new ActionResult(EnumActionResult.PASS, ItemStack.EMPTY); If not then you need to set the players current hand to ItemStack.EMPTY during the process. Also for the boolean you need to save it to the stack and not store it in the Item class. Ah, ok. Thx, that works fine.
  16. Hi, I'm wondering how I can destroy an item after the second right click. So basically I've got a boolean set to false. The first right click is made, a position is saved to the item, the second right click is made, the player will be teleported to the location saved first. What I want is that direclty after the player was teleported, the item should be destroyed. So it can only be used once. So how am I able to do this, since there is no item in the onItemRightclick method: @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) Thx in advance. Bektor
  17. Ok, after setting a breakpoint in those two lines: this.container.receiveEnergy(2, false); (TileEntity) return this.canReceive() ? acceptedPower : 0; (BaseMPcontainer) So, basically, I found now out that it seems to count perfectly until the number 10 was reached. At this point it starts for an unknown reason again by 2 and then 12 and then 4 and then 14 and then 6 and then 16 ..... I think it's clear what I mean. Oh and directly before the number 10 was reached the world has been fully loaded.
  18. Yeah, overread the getCompoundTag. But even when using getCompoundTag, it gives me no errors anymore, but seems not to be able to save and load the data.... I'm also wondering from where this comes: As you can see, the energy reaches 250, goes down again, and then up again etc. ... But I'm not removing energy from the block! @Override public void update() { if(this.hasWorld() && !this.world.isRemote) { if(!this.getWorld().provider.hasNoSky() && this.getWorld().canBlockSeeSky(this.getPos().offset(EnumFacing.UP)) && this.getWorld().getSkylightSubtracted() == 0 && this.container.getEnergyStored() != this.container.getMaxEnergyStored()) this.container.receiveEnergy(2, false); final TileEntity tileEntity = this.getWorld().getTileEntity(this.getPos().offset(EnumFacing.DOWN)); if(tileEntity != null && !tileEntity.isInvalid()) { if(tileEntity.hasCapability(CapabilityEnergy.ENERGY, EnumFacing.UP)) { IEnergyStorage consumer = tileEntity.getCapability(CapabilityEnergy.ENERGY, EnumFacing.UP); if(consumer != null) this.container.extractEnergy(consumer.receiveEnergy(this.container.getEnergyStored(), false), false); } } System.out.println(this.container.getEnergyStored()); } } @Override public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); //this.container.setEnergyStored(compound.getInteger("StoredJAE")); this.container.deserializeNBT(compound.getCompoundTag("StoredJAE")); } @Override public NBTTagCompound writeToNBT(NBTTagCompound compound) { //compound.setInteger("StoredJAE", this.container.getEnergyStored()); compound.setTag("StoredJAE", this.container.serializeNBT()); return super.writeToNBT(compound); } To be sure it's not a problem with isRemote stuff, I just added a little check for this, but it's still counting the energy somehow twice.
  19. Ok, I changed it and it does still not work. @Override public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); //this.container.setEnergyStored(compound.getInteger("StoredJAE")); this.container.deserializeNBT(compound); } @Override public NBTTagCompound writeToNBT(NBTTagCompound compound) { //compound.setInteger("StoredJAE", this.container.getEnergyStored()); compound.setTag("StoredJAE", this.container.serializeNBT()); return super.writeToNBT(compound); } I also tried it with the setInteger thing, does still not work. Oh and deserializeNBT needs an NBTTAgCompound, so getTag does not work.
  20. What is this serializable? The container variable??
  21. Oh yeah, totally forgot and overlooked that. So I basically have to put the container stuff in there like that?: @Override public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); this.container.deserializeNBT(compound); } @Override public NBTTagCompound writeToNBT(NBTTagCompound compound) { this.container.serializeNBT(); return super.writeToNBT(compound); }
  22. You do not need to do anything capability related. Well, the Forge energy system stuff uses capabilities, so I want to use them, too. I'm just wondering when I'm creating my own EnergyStorage class which is actually a slightly modified version (so it's using IEnergyStorage, but offers also more methods) of EnergyStorage (but does not extend it, it implements the same interface however), if I have to create in that case a new capability and a new interface or not........... If you are using the forge capability system and that Capability is already registered you do not need to do any capability registering stuff. You can create new implementations whenever you want and use them as long as it ultimately implements IEnergyStorage. Ok, thx. This is working, but somehow it does not save the energy. When I reload the world it just starts by 0 again while it was at 250 when I saved the world. TileEntity Block BaseMPContainer Any ideas? Also open for ideas to improve the code.
  23. You do not need to do anything capability related. Well, the Forge energy system stuff uses capabilities, so I want to use them, too. I'm just wondering when I'm creating my own EnergyStorage class which is actually a slightly modified version (so it's using IEnergyStorage, but offers also more methods) of EnergyStorage (but does not extend it, it implements the same interface however), if I have to create in that case a new capability and a new interface or not...........
×
×
  • Create New...

Important Information

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