Everything posted by Major Tuvok
-
Version property isn't expanded in development enviorment (name probably too)
So, first of all why I need this to be the case (perhaps this can be solved via solving my original Problem): I wanted to test my mod with an Minecraft server, so I've tried to start MC Server and Client both in my development enviorment (IntellJ). Unfortunatly this results in an invalid session id... My solution to that was to use an ordinary MC-Forge client and add my mod as a jar to its mod folder. So far I didn't have any Proplems, but as soon as I tried to connect, I got an Mod-rejection error: My versions apperntly aren't the same... So I looked at both logs and found these strange differences: Normal Forge Client, Mod linked as jar: version is ok (and as expected) [main/WARN] [spellcraft/]: Mod spellcraft is missing the required element 'version' and a version.properties file could not be found. Falling back to metadata version 0.2.1.109 Development Forge Server: somehow using unexpanded version ${version} [Server thread/WARN] [spellcraft]: Mod spellcraft is missing the required element 'version' and a version.properties file could not be found. Falling back to metadata version ${version} Apperently Using a Development Forge Client leads to the same unexpanded version. Here's the Server side Mod-rejection... [12:57:41] [User Authenticator #1/INFO]: UUID of player Major_Tuvok is ------------I don't want to show my UUID-------------- [12:57:41] [Netty Server IO #1/INFO] [FML]: Client protocol version 2 [12:57:41] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 8 mods : [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected] [12:57:41] [Netty Server IO #1/INFO] [FML]: Rejecting connection CLIENT: [FMLMod:spellcraft{${version}}] [12:57:41] [Netty Server IO #1/ERROR] [FML]: Network Disconnect: Mod rejections [FMLMod:spellcraft{${version}}] [12:57:41] [Server thread/INFO]: Major_Tuvok lost connection: Mod rejections [FMLMod:spellcraft{${version}}] [12:57:41] [Server thread/INFO]: Major_Tuvok left the game And my Build.gradle (I already tried to force processrecources task by simply adding it right before it is declared, didn't help): buildscript { repositories { jcenter() maven { url = "http://files.minecraftforge.net/maven" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' } } apply plugin: 'net.minecraftforge.gradle.forge' apply plugin: 'java' //Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. if ( !project.hasProperty('mod_pgroup') || !project.hasProperty('mod_id') ) { throw new Exception("Missing Mod-Properties!"); } if ( !project.hasProperty('ver_forge') || !project.hasProperty('ver_mc')) { println "missing Minecraft Version!" } if ( !project.hasProperty('ver_mappings') ) { println "missing Mappings Version!" } if ( !project.hasProperty('ver_major_mod') || !project.hasProperty('ver_major_api') || !project.hasProperty('ver_minor_api') || (System.getenv('BUILD_NUMBER')==null && !project.hasProperty('ver_build'))) { println "missing Project Version!" } else if (System.getenv('BUILD_NUMBER')==null) { println "Cannot access Build Number!" } minecraft { version = "1.12.2-14.23.2.2611" if (project.hasProperty('ver_mc') && project.hasProperty('ver_forge')) { version = "${ver_mc}-${ver_forge}" } runDir = "run" // the mappings can be changed at any time, and must be in the following format. // snapshot_YYYYMMDD snapshot are built nightly. // stable_# stables are built at the discretion of the MCP team. // Use non-default mappings at your own risk. they may not always work. // simply re-run your setup task after changing the mappings to update your workspace. mappings = "snapshot_20180201" if (project.hasProperty('ver_mappings')) { mappings = "${ver_mappings}" } // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. } String getVersion() { if ( !project.hasProperty('ver_major_mod') || !project.hasProperty('ver_major_api') || !project.hasProperty('ver_minor_api') || (System.getenv('BUILD_NUMBER')==null && !project.hasProperty('ver_build'))) { return "CUSTOM_BUILD"; } String res = "${ver_major_mod}.${ver_major_api}.${ver_minor_api}." if (System.getenv('BUIlD_NUMBER')!=null) { ver_build = System.getenv('BUIlD_NUMBER') } else { ver_build = (ver_build.toInteger()+1).toString() } res+=ver_build ver_code = res; return res; } version = getVersion() group="${mod_pgroup}.${mod_id}" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "${mod_id}" sourceCompatibility = targetCompatibility = "1.8" // Need this here so eclipse task generates correctly. compileJava { sourceCompatibility = targetCompatibility = "1.8" } dependencies { // you may put jars on which you depend on in ./libs // or you may define them like so.. //compile "some.group:artifact:version:classifier" //compile "some.group:artifact:version" // real examples //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' //compile 'build/libs/Mekanism-1.11.2-9.3.4.313' // the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided, // except that these dependencies get remapped to your current MCP mappings //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev' //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev' // for more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html } processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' // replace version and mcversion expand 'version':project.version, 'mcversion':project.minecraft.version } // copy everything else except the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } jar { classifier = '' from sourceSets.main.output from sourceSets.api.output manifest.mainAttributes( "Built-By": System.getProperty('user.name'), "Created-By": "${System.getProperty('java.vm.version')} + (${System.getProperty('java.vm.vendor')})", "Implementation-Title": project.name, "Implementation-Version": project.version, "Built-On": "${ver_mc}-${ver_forge}" ) } Before anyone asks: I know that the toInteger Method doesn't increment the version saved in gradle.properties... I'm going to change that after this issue has been solved. And my gradle.properties: # Sets default memory used for gradle commands. Can be overridden by user or command line properties. # This is required to provide enough memory for the Minecraft decompilation process. org.gradle.jvmargs=-Xmx6G #version ver_java=1.8 ver_code=1.12.2-0.2.1.109 ver_major_mod=0 ver_major_api=2 ver_minor_api=1 ver_build=108 ver_forge=14.23.2.2611 ver_mc=1.12.2 ver_mappings=snapshot_20180201 #mod mod_pgroup=mt.mcmods mod_id=spellcraft Any help would be greatly appreciated...
-
Items not saved when Container is closed
you have to retrieve a reference to the iteminv you want to modify... Simply pass it from your GUI Handler down to your constructor and from there store it in your member variable...
-
Items not saved when Container is closed
you create a new inventory in your container, so that you don't modify the old one at all... see your first member variable in your Container
-
Cascading World gen error without world gen 1.12.2
(I honestly don't know much about entities and I never created one beefore, this is judt a general debugging suggestion...) Does it work if you only copy vanilla code? (If not it must have sth to do with registration...) If it does, try adding line for line until you find the problem and then try asking what's wrong with that... (I assume that you couldn't find the Problem whilst using ordinary debugging mechanisms) Another way would be to try to find the warning/error line in vanilla/forge code and then go back until you find the last call to your own code... (this way is probably more difficult...
-
GuiImageButton and custom ImageButton doesn't draw correct and Respond to a different (indepent) Buttons Hover-Event
(Code which has is used in GuiButtonImage for drawing) if (this.visible) { this.hovered = mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height; mc.getTextureManager().bindTexture(this.resourceLocation); GlStateManager.disableDepth(); int i = this.xTexStart; int j = this.yTexStart; if (this.hovered) { j += this.yDiffText; } this.drawTexturedModalRect(this.x, this.y, i, j, this.width, this.height); GlStateManager.enableDepth(); } Now with clearing away other Buttons hovered States if (this.visible) { this.hovered = mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height; mc.getTextureManager().bindTexture(this.resourceLocation); GlStateManager.disableDepth(); //This is the missing line... GlStateManager.color(1,1,1,1); //normal GuiButton does this as well... (other than the previous line nothing has to be changed) int i = this.xTexStart; int j = this.yTexStart; if (this.hovered) { j += this.yDiffText; } this.drawTexturedModalRect(this.x, this.y, i, j, this.width, this.height); GlStateManager.enableDepth(); }
-
GuiImageButton and custom ImageButton doesn't draw correct and Respond to a different (indepent) Buttons Hover-Event
Apperently the solution to the clicking was to take guiLeft and guiTop into account when checking whether a mouse was pressed. If used with an normal GuiButtonImage it works like this; mButtonInscribeSpell = new GuiButtonImage(ID_INSCRIBE, getXSize()+getGuiLeft(), Y_INSCRIBE_SPELL+getGuiTop(), BOOK_AND_QUILL.getImgXSize(),BOOK_AND_QUILL.getImgYSize(),BOOK_AND_QUILL.getImgXStart(),BOOK_AND_QUILL.getImgYStart(),0,BOOK_AND_QUILL.getResource()); //The 0 is because I don't have a second Texture below it to use as an hovered Image. But still the coloring Issue remains with standart GuiButtonImage... I'll submit that as an Issue to forge,,,
-
GuiImageButton and custom ImageButton doesn't draw correct and Respond to a different (indepent) Buttons Hover-Event
The Problem with the Image changing it's color seems to be an forge proplem, because applying GlStateManager.color(1,1,1,1); removes this strange recoloring. => Forge does not revert the recoloring of previous buttons, whilst Image Button expects it NOT to be colored (they don't recolor GLStateManager).
-
GuiImageButton and custom ImageButton doesn't draw correct and Respond to a different (indepent) Buttons Hover-Event
I tried, but as expected, that didn't change anything regarding the clicking behaviour. The reason I use different files is, that like that I do have an GUI of 256*256 (fills aup every sole pixel) and I cannot add any other Images to that. So I'm just doing that because of consistency.
-
[1.11] Tile Entity Not Loading Data
And don't use System.out... The log4j Logger is available for you and it is recommended to use that...
-
[1.11] Tile Entity Not Loading Data
One more thing, when you add tooltips, you should not rely on hardcoded Strings, but rather use localized ones... (e. g. use I18n. format(String key, Object... args), where key is a key defined in your lang files and args are arguments which are used in the resulting String like String.format does (this is generally prefered to String concatisation because it is far more flexible))
-
[1.11] Tile Entity Not Loading Data
Your problem is, that all the Data reading is performed Server side (because it is the Server providing the World data and such things). To solve this you have to send Packets when needed to the client to sync the data or provide a possibility for the client to request an data sync. it might be possible to achieve, what you want using standard tile entity update packets, I'm not sure about that... Further reference can be found in the Forge's docs under the Networking section (you should have read the Sides section before that).
-
[1.11] Tile Entity Not Loading Data
His class implicitly uses an empty constructor... (If none is specified java generates an empty public constructor...)
-
GuiImageButton and custom ImageButton doesn't draw correct and Respond to a different (indepent) Buttons Hover-Event
Ouch, ok... Thanks, I didn't know that (I was aware, that it cannot be more than 256, but never tried before with less than that in a gui). That solved the drawing issue But I still can't click it I'll look more at that tomorrow and if I find it I'll post it here...
-
GuiImageButton and custom ImageButton doesn't draw correct and Respond to a different (indepent) Buttons Hover-Event
Sry, for the spelling mistake... It should be in the title: "...ImageButton doesn't draw...".
-
GuiImageButton and custom ImageButton doesn't draw correct and Respond to a different (indepent) Buttons Hover-Event
Hello guys, I hope this isn't sth. stupid I'm overreading again, but here's my propblem: (Note: I'm really not much of an designer, so it wouldn'treally look good even if it worked) So I'm trying to add an Image Button to my own Gui but this isn't working as expected. (I once tried to show the same thing with an normal, String drawing button and it showed up at the correct Positon and so forth...) But this Button draws it's 20*20 Image scaled up to sth. of the size of about 210*210! Moreover, it only draws the 20*20 pixel of the left top, resulting in about 4 pixel being drawn quite big, but not the Image. (The reason why I noticed that it draws sth. of this incredible size is, that I tested it with drawing the (still) 20*20 image as if it had a size of 200*200 and only small parts were missing now, although much to big!) Additionally I noticed, that when i'd move the mouse over the second Button within the Gui, my Image Button would suddenly show an hover Tint! So as a result I thought, well it's scaled up, so I'll scale it down again and indeed, that worked although it should not be the way of going to scale sth. down by a factor of 0.1f only to achieve the desired result (Note that it's still not clickable and that it still get's this weird Hover tint)! Here's my code: public class GuiSpellCreator extends BaseGui { private static final int ID_EDIT = 0; private static final int ID_INSCRIBE = 1; private static final GuiResource USED_BACKGROUND = GUI_BLANK; private static final int X_EDIT_SPELL = X_INPUT + OFFSETS.getSlotXSize() + 4; //evaluates to 30 private static final int Y_INSCRIBE_SPELL = Y_OUTPUT - Math.round((BOOK_AND_QUILL.getImgYSize() - OFFSETS.getSlotYSize()) / 2); //evaluates to 34 - (20-(16/2)) = 22 private static final int Y_EDIT_SPELL = 10; private GuiButton mButtonEditSpell; private GuiButton mButtonInscribeSpell; public GuiSpellCreator(GuiContainerSpellCreator inventorySlotsIn) { super(inventorySlotsIn, USED_BACKGROUND.getImgXSize(), USED_BACKGROUND.getImgYSize()); mButtonEditSpell = null; mButtonInscribeSpell = null; } @Override public TileEntitySpellCreator getTileEntity() { return (TileEntitySpellCreator) super.getTileEntity(); } /** * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the * window resize's, the buttonList is cleared beforehand. */ @Override public void initGui() { super.initGui(); String spellName = GUI_SPELL_CREATOR_NO_SPELL.get(); mButtonEditSpell = new GuiButton(ID_EDIT, getGuiLeft() + X_EDIT_SPELL, getGuiTop() + Y_EDIT_SPELL, GUI_SPELL_CREATOR_EDIT.get(spellName)); mButtonEditSpell.width = getFontRenderer().getStringWidth(mButtonEditSpell.displayString) + 6; mButtonInscribeSpell = new ImageButton(ID_INSCRIBE, getXSize(), Y_INSCRIBE_SPELL, BOOK_AND_QUILL, getDelegate()); //does exactly the same as GuiButtonImage (I tried that too, same result) addButton(mButtonEditSpell); addButton(mButtonInscribeSpell); } /** * Called by the controls from the buttonList when activated. (Mouse pressed for buttons) * * @param button */ @Override protected void actionPerformed(GuiButton button) throws IOException { super.actionPerformed(button); switch (button.id) { case ID_EDIT: Minecraft.getMinecraft().displayGuiScreen(new GuiSpellCreation(new GuiContainerSpellCreation((GuiContainerSpellCreator) inventorySlots))); break; case ID_INSCRIBE: Log.info("Inscribing..."); break; default: { Log.warn("Unknown id of " + button.id + "!"); } } } /** * Draws the background layer of this container (behind the items). * * @param partialTicks * @param mouseX * @param mouseY */ @Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { super.drawGuiContainerBackgroundLayer(partialTicks, mouseX, mouseY); getDelegate().drawGuiBackground(USED_BACKGROUND); getDelegate().drawAllSlotsWithResource(SLOT); } } public class ImageButton extends GuiButton { private GuiDrawingDelegate mGuiDrawingDelegate; private ResourceLocation resourceLocation; private int xTexStart; private int yDiffText; private int yTexStart; public ImageButton(int buttonId, int x, int y, ResourceInfo info, GuiDrawingDelegate delegate) { this(buttonId, x, y, info.getImgXStart(), info.getImgYStart(), info.getImgXSize(), info.getImgYSize(), info.getResource(), delegate); } public ImageButton(int buttonId, int x, int y, ResourceImgMeasurements measurements, ResourceProvider location, GuiDrawingDelegate delegate) { this(buttonId, x, y, measurements.getImgXStart(), measurements.getImgYStart(), measurements.getImgXSize(), measurements.getImgYSize(), location.getResource(), delegate); } public ImageButton(int buttonId, int x, int y, int xTexStart, int yTexStart, int widthIn, int heightIn, ResourceLocation location, GuiDrawingDelegate delegate) { this(buttonId, x, y, xTexStart, yTexStart, widthIn, heightIn, 0, location, delegate); } public ImageButton(int buttonId, int x, int y, int xTexStart, int yTexStart, int widthIn, int heightIn, int yDiffText, ResourceLocation location, GuiDrawingDelegate delegate) { super(buttonId, x, y, widthIn, heightIn, ""); this.xTexStart = xTexStart; this.yTexStart = yTexStart; this.mGuiDrawingDelegate = delegate; this.resourceLocation = location; this.yDiffText = yDiffText; } public void setPosition(int p_191746_1_, int p_191746_2_) { this.x = p_191746_1_; this.y = p_191746_2_; } /** * Draws this button to the screen. */ public void drawButton(@Nonnull Minecraft mc, int mouseX, int mouseY, float partialTicks) { if (this.visible) { this.hovered = mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height; int i = this.xTexStart; int j = this.yTexStart; if (this.hovered) { j += this.yDiffText; } GlStateManager.pushMatrix(); GlStateManager.scale(0.1f,0.1f,1); GlStateManager.disableDepth(); //multiply with 5, because guiDrawing delegate already adds one more, so that in total it will result in multiplication of 6. Why 6 is what is needed here, no clue!!! //(or those other strange values, they work, but I don't know why, which is pretty irritating) mGuiDrawingDelegate.drawImage(resourceLocation, x*10+mGuiDrawingDelegate.getXSize()*5+250, y*10+mGuiDrawingDelegate.getYSize()*2, i, j, width*10+50, height*10+50); GlStateManager.popMatrix(); } } } public enum GuiResource implements ResourceInfo, ILoggable { SLOT(StringHelper.createResourceLocation(MODID, "textures", "gui", "elements", "slot.png"), 0, 0, 18, 18), SLOT_DARK(StringHelper.createResourceLocation(MODID, "textures", "gui", "elements", "slot_dark.png"), 0, 0, 18, 18), GUI_BLANK(StringHelper.createResourceLocation(MODID, "textures", "gui", "gui_blank.png"), 0, 0, 176, 166, new PlayerInventoryOffsets(8, 84, 8, 142)), GUI_BLANK_WPI(StringHelper.createResourceLocation(MODID, "textures", "gui", "gui_blank_with_player_inv.png"), 0, 0, 176, 166, new PlayerInventoryOffsets(8, 84, 8, 142)), GUI_BLANK_BIG(StringHelper.createResourceLocation(MODID, "textures", "gui", "gui_blank_big.png"), 0, 0, 176, 222), GUI_BLANK_GIANT(StringHelper.createResourceLocation(MODID, "textures", "gui", "gui_blank_giant.png"), 0, 0, 256, 222), GUI_BLANK_MAX(StringHelper.createResourceLocation(MODID, "textures", "gui", "gui_blank_max.png"), 0, 0, 256, 256, new PlayerInventoryOffsets(44, 172, 44, 230)), GUI_BLANK_BIG_WPI(StringHelper.createResourceLocation(MODID, "textures", "gui", "gui_blank_big_with_player_inv.png"), 0, 0, 176, 222), OVERLAY_SPELLPOWER_BACKGROUND(StringHelper.createResourceLocation(MODID, "textures", "gui", "overlay", "spellpower_background.png"), 0, 0, 19, 60), OVERLAY_SPELLPOWER_FOREGROUND(StringHelper.createResourceLocation(MODID, "textures", "gui", "overlay", "spellpower_foreground.png"), 0, 0, 19, 60), BOOK_AND_QUILL(StringHelper.createResourceLocation(MODID, "textures", "gui", "book_and_quill.png"), 0, 0, 21, 21); ResourceLocation location; private int imgXStart; private int imgYStart; private int imgXSize; private int imgYSize; private PlayerInventoryOffsets suggestedOffsets; GuiResource(@Nonnull ResourceLocation location, int imgXStart, int imgYStart, int imgXSize, int imgYSize, PlayerInventoryOffsets playerInventoryOffsets) { this.location = location; this.imgXStart = imgXStart; this.imgYStart = imgYStart; this.imgXSize = imgXSize; this.imgYSize = imgYSize; this.suggestedOffsets = playerInventoryOffsets; } GuiResource(ResourceLocation location, int imgXStart, int imgYStart, int imgXSize, int imgYSize) { this(location, imgXStart, imgYStart, imgXSize, imgYSize, null); } GuiResource(String location, int imgXStart, int imgYStart, int imgXSize, int imgYSize, PlayerInventoryOffsets playerInventoryOffsets) { this(new ResourceLocation(location), imgXStart, imgYStart, imgXSize, imgYSize, playerInventoryOffsets); } GuiResource(String location, int imgXStart, int imgYStart, int imgXSize, int imgYSize) { this(new ResourceLocation(location), imgXStart, imgYStart, imgXSize, imgYSize); } @Override public @Nonnull ResourceLocation getResource() { return location; } @Override public int getImgXStart() { return imgXStart; } @Override public int getImgYStart() { return imgYStart; } @Override public int getImgXSize() { return imgXSize; } @Override public int getImgYSize() { return imgYSize; } public PlayerInventoryOffsets getSuggestedOffsets() { assert suggestedOffsets != null : "attempted to retrieve null Inventory Offsets!"; return suggestedOffsets; } @Override public String toString() { return "GuiResource{" + "location=" + location + ", imgXStart=" + imgXStart + ", imgYStart=" + imgYStart + ", imgXSize=" + imgXSize + ", imgYSize=" + imgYSize + '}'; } } (This ImageButton is not yet fitted properly with my Framework so it currently has some unessecary conversions in it... I'll rework it tomorrow...) And here's my github repo.
-
Minecraft hangs (doesn't crash) when saving
ouch... thx I overread it probalby a dozen of times... grr...
-
[1.12.2] [SOLVED] getPickBlock and FluidHandler
Although is it possible, that this getFluidHandler Methods accessed TileEntities? Because it might be that the TileEntity you're trying to access doesn't exist and it is therefore returning null...
-
[1.12.2] [SOLVED] getPickBlock and FluidHandler
Changing your FluidUtil call, so that it uses your local stack variable instead of new ItemStack(this) might help, although I don't really understand, why this code works with an integrated server at all.
-
[1.12.2] [SOLVED] getPickBlock and FluidHandler
I've never used getPickBlock before but you seem to fill the wrong container... You are creating a variable called stack, but you fill a completly different instance...
-
Minecraft hangs (doesn't crash) when saving
Hi guys, I started getting this hang when adding this code in this class: @Nonnull @Override public NBTTagCompound writeToNBT(NBTTagCompound compound) { NBTTagList wands = new NBTTagList(); NBTTagList compounds = new NBTTagList(); for (Map.Entry<ItemWand,NBTTagCompound> entry: mWandNBTTagMap.entrySet()) { wands.appendTag(NBTHelper.serializeResourceLocation(entry.getKey().getRegistryName())); compounds.appendTag(entry.getValue()); } compound.setTag(KEY_WANDS,wands); compound.setTag(KEY_COMPOUNDS,compound); return super.writeToNBT(compound); } @Override public void readFromNBT(NBTTagCompound compound) { if (compound.hasKey(KEY_WANDS) && compound.hasKey(KEY_COMPOUNDS)) { Iterator<NBTBase> wands = ((NBTTagList) compound.getTag(KEY_WANDS)).iterator(); Iterator<NBTBase> compounds = ((NBTTagList) compound.getTag(KEY_COMPOUNDS)).iterator(); while (wands.hasNext() && compounds.hasNext()) { ResourceLocation registryName = NBTHelper.deserializeResourceLocation((NBTTagString) wands.next()); NBTTagCompound compoundTag = (NBTTagCompound) compounds.next(); if (registryName!=null && compoundTag!=null &&CommonProxy.ITEM_REGISTRY.containsKey(registryName)) { Item wand = CommonProxy.ITEM_REGISTRY.getValue(registryName); if (wand instanceof ItemWand) { ItemWand itemWand = (ItemWand) wand; mWandNBTTagMap.put(itemWand,compoundTag); } else { Log.warn("Could not deserialize TileEntityWandCraftingTable wand-compound map entry. Retrieved Item but item for "+registryName+" was not an ItemWand! Some Mod overrode this with an incompatible Item!"); } } else { Log.debug("Could not deserialize TileEntityWandCraftingTable wand-compound map entry. This is probably due to updating Mods."); } } if (wands.hasNext()) { Log.warn("TileEntityWandCraftingTable:Noticed corrupted NBT-Data! There are too many Wand-Entries for the given Compounds! This may lead to errors further down the line!"); } else if (compounds.hasNext()) { Log.warn("TileEntityWandCraftingTable:Noticed corrupted NBT-Data! There are too many Compound-Entries for the given Compounds! This may lead to errors further down the line!"); } }else { Log.debug("Could not deserialize TileEntityWandCraftingTable wand-compound map. This is probably due to updating Spellcraft."); } super.readFromNBT(compound); } I can see nothing obviously wrong with this code and especially nothing justifying getting an StackOverflowError on the FileIO Thread sometime after the world was opened: [10:59:04] [File IO Thread/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: java.lang.StackOverflowError [10:59:04] [File IO Thread/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: at java.io.DataOutputStream.write(DataOutputStream.java:107) [10:59:04] [File IO Thread/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: at java.io.DataOutputStream.writeUTF(DataOutputStream.java:401) [10:59:04] [File IO Thread/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: at java.io.DataOutputStream.writeUTF(DataOutputStream.java:323) [10:59:04] [File IO Thread/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: at net.minecraft.nbt.NBTTagString.write(NBTTagString.java:29) [10:59:04] [File IO Thread/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: at net.minecraft.nbt.NBTTagList.write(NBTTagList.java:39) [10:59:04] [File IO Thread/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: at net.minecraft.nbt.NBTTagCompound.writeEntry(NBTTagCompound.java:581) [10:59:04] [File IO Thread/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: at net.minecraft.nbt.NBTTagCompound.write(NBTTagCompound.java:39) [10:59:04] [File IO Thread/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: at net.minecraft.nbt.NBTTagCompound.writeEntry(NBTTagCompound.java:581) [10:59:04] [File IO Thread/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: at net.minecraft.nbt.NBTTagCompound.write(NBTTagCompound.java:39) [10:59:04] [File IO Thread/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: at net.minecraft.nbt.NBTTagCompound.writeEntry(NBTTagCompound.java:581) [10:59:04] [File IO Thread/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: at net.minecraft.nbt.NBTTagCompound.write(NBTTagCompound.java:39) ... omitted rest of the stacktrace, because it was an StackOverflowError The fact, that it comes through an NBTTagString propably suggests, that it has something to do with saving the Wand Registry Names, because these are the only ones generating NBTTagStrings in my NBTHelper utility class. Does anyone have an idea what could have caused this? The reason why I'm doing this saving is, because I want the user not to be able to recraft a specific Item with new properties everytime he removes a single component... (Before someone asks, I know, that the calls to getSubStack are currently unsafe (mutability))
-
Help with launcher plesssssss
Doesn't this belong rathe to the support forum, than the modder support forum?
-
Quick Questions regarding custom mod
You could (instead of attempting to hack max health) try to reduce damage taken by this entity, so that it simulates having more health than it actually has... Simplest (but definitly not a good way to do that (I think theres probably a callback for that, because I haven't worked with any LivingEntity yet I have no clue how the callback is called) way would be to intercept LivingAttackEvents and reduce any damage done to your Entity. You would have to evaluate that depending on how much you want to scale it up...
-
[1.12.2] Logger not showing name
Does it change anything, if you use Strings as Parameters? log4j supports if I recall correctly (it has been a while since I took a look at log4j) some special messages which are represented by those Objects. And using explicit Strings works fine with me... (e.g. LOGGER.info("Hello World!"))
-
Can anyone pls explain me this error? :D
I am referring to my own Code. Because Minecraft Mods aren't marked, I don't program with that much care like I normally do, so that when I'm looking at my Minecraft code I always spot such small things which could be made better
-
Can anyone pls explain me this error? :D
Apperetnly I can't recall typing the GameOverlayListener things, I seem to have used auto-completion at that time. => This can server as an example how NOT to write a Log. Because it makes your Logs undescriptive and therefore hard to read. I'll quickly change this to simply register... More specifically it should be the Method name... (like registerRenderer)
IPS spam blocked by CleanTalk.