Jump to content

Bregor

Members
  • Posts

    41
  • Joined

  • Last visited

Everything posted by Bregor

  1. No basically I am more concerned about automation as I want to supply various things from it. This is why I was asking for hashing I got some ideas from the comments I got here, just have to examine them.
  2. Well think of a centralized storage system where you can add items to and retrieve them again - not like a chest more like Applied Energistics. There the number of different items you have to match can easily go over a few hundred (especially with enchanted stuff and other items with an NBT tag) - if every retrieval process has to lookup the required item storage location with the trivial method it means for every available item in the storage a comparison required in the worst case.
  3. Your statements are all very valid of course. But as I want to develop something like an item storage system, and I think that there O(n) vs O(log2(n)) matters.
  4. Hi, is there a way to compare lots of items fast and correct other than probing each item with isItemEqual. As far as I know there is no override for hashCode/equals for items. I thought about using itemId and damage for this purpose (according to writeToNBT both are shorts and could combined into an int as a form of hash code), but getting the item ID doesn't seem to be very efficient with 1.7. How do you test an item against a large list of possible items, like for an item storage system?
  5. Hi, I am trying to solve why I can't get NEI loaded in minecraft in my development environment. I added NEI in my build.gradle (see below) file like I did for buildcraft (which loads just fine). As I am using IntelliJ IDEA for development I run the following commands to setup my development environment: "gradlew clean", "gradlew setupDecompWorkspace" followed by "gradlew idea". The build.gradle file I use: buildscript { repositories { mavenCentral() maven { name = "forge" url = "http://files.minecraftforge.net/maven" } maven { name = "sonatype" url = "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' } } repositories { maven { name 'CB Repo' url "http://chickenbones.net/maven/" } } apply plugin: 'forge' version = "1.7.10-1.0" group= "mymod.mymodname" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "MyModName" minecraft { version = "1.7.10-10.13.0.1180" } dependencies { compile 'com.mod-buildcraft:buildcraft:6.0.17:dev' // adds buildcraft to the dev env compile "codechicken:CodeChickenLib:1.7.10-1.1.1.95:dev" compile "codechicken:CodeChickenCore:1.7.10-1.0.2.11:dev" compile "codechicken:NotEnoughItems:1.7.10-1.0.2.26:dev" } 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, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } Update As it seems I just had to additionally drop the NEI Addon (dev Version) to /run/mods . It seems the gradle downloaded version of NEI doesn't contain a mcmod.info and is not found by the system - is that behaviour intended?
  6. It seems I finally got it working (with help from this http://www.minecraftforge.net/forum/index.php?topic=10543.0) Step by step: Edit the eclipse project file, replace MCP_LOC with the full path (using forward slashes) as in http://www.minecraftforge.net/wiki/NetBeans Import the project in netbeans In the project properties Set the Working directory to <Forge path>\mcp\jars Add to VM Options: -Djava.library.path="<Forge Path>\mcp\jars\versions\1.6.2\1.6.2-natives" In the Libraries section, in all of the Tabs "Run", "Compile Test", "Run Tests": Just move "Compiled Sources" above "Classpath for Compiling Sources"
  7. The only real difference in the output i have found so far is the following, but i have no idea what is causing it. 2013-08-20 23:07:56 [sEVERE] [ForgeModLoader] FML has detected a mod that is using a package name based on 'net.minecraft.src' : net.minecraft.src.BaseMod. This is generally a severe programming error. There should be no mod code in the minecraft namespace. MOVE YOUR MOD! If you're in eclipse, select your source code and 'refactor' it into a new package. Go on. DO IT NOW! 2013-08-20 23:07:56 [sEVERE] [ForgeModLoader] FML has detected a mod that is using a package name based on 'net.minecraft.src' : net.minecraft.src.EntityRendererProxy. This is generally a severe programming error. There should be no mod code in the minecraft namespace. MOVE YOUR MOD! If you're in eclipse, select your source code and 'refactor' it into a new package. Go on. DO IT NOW! 2013-08-20 23:07:56 [sEVERE] [ForgeModLoader] FML has detected a mod that is using a package name based on 'net.minecraft.src' : net.minecraft.src.FMLRenderAccessLibrary. This is generally a severe programming error. There should be no mod code in the minecraft namespace. MOVE YOUR MOD! If you're in eclipse, select your source code and 'refactor' it into a new package. Go on. DO IT NOW! 2013-08-20 23:07:56 [sEVERE] [ForgeModLoader] FML has detected a mod that is using a package name based on 'net.minecraft.src' : net.minecraft.src.MLProp. This is generally a severe programming error. There should be no mod code in the minecraft namespace. MOVE YOUR MOD! If you're in eclipse, select your source code and 'refactor' it into a new package. Go on. DO IT NOW! 2013-08-20 23:07:56 [sEVERE] [ForgeModLoader] FML has detected a mod that is using a package name based on 'net.minecraft.src' : net.minecraft.src.ModLoader. This is generally a severe programming error. There should be no mod code in the minecraft namespace. MOVE YOUR MOD! If you're in eclipse, select your source code and 'refactor' it into a new package. Go on. DO IT NOW! 2013-08-20 23:07:56 [sEVERE] [ForgeModLoader] FML has detected a mod that is using a package name based on 'net.minecraft.src' : net.minecraft.src.TradeEntry. This is generally a severe programming error. There should be no mod code in the minecraft namespace. MOVE YOUR MOD! If you're in eclipse, select your source code and 'refactor' it into a new package. Go on. DO IT NOW!
  8. I had to do two thing for a working Netbeans setup after importing from eclipse: Under Run->Set Project Configuration->Customize: Set the Working directory to <Forge path>\mcp\jars Add to VM Options: -Djava.library.path="<Forge Path>\mcp\jars\versions\1.6.2\1.6.2-natives" Without the working directory change, minecraft started but without any mod loading. But there seems still something missing, because it crashes at world creation and currently i have no idea why.
  9. Got it working now, thanks to both of you.
  10. I was just thinking to complicated it seems, as the animation is only client side without synchronization needs, using System.nanoTime() is perfectly fine
  11. But how did you time the animation of the texture, is there a way to get the number of elapsed ticks or some other timebase?
  12. I now went down the TileEntitySpecialRenderer road, and it works quite well. Thanks a lot for the tip with the TileEntitySpecialRenderer. Just got one related question, if i want some sort of texture particle effect in my TileEntitySpecialRenderer, should i create it myself or is it possible to use something like EntityFX for it? If drawing it myself is the way to go, which time reference is best used to get a time base for the animation in the render method? And is there an easy way to get the camera vector to orient the texture perpendicular to the looking direction of the player? For reference if someone else may need it, this is how the toggling is done: @Override public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer; ItemStack currentPlayerItemStack = player.getHeldItem(); if(currentPlayerItemStack == null || currentPlayerItemStack.itemID != requiredItemId) { return; } //Rendering code ... }
  13. If possible I would like to have a block without a corresponding tile entity, as there is no additional data required, the 4bit metadata are fine for me. So I experimented with normal blocks based on this tutorial http://www.minecraftforge.net/wiki/Multiple_Pass_Render_Blocks, but to my surprise the renderWorldBlock from the interface ISimpleBlockRenderingHandler is not called each frame but seems to be cached somehow. Is there a possibility to invalidate the state of a renderer on the client? So that the tool itself invalidates the renderer for the target block if it is equipped or unequipped by the player. The rendering code i used, it should render a bedrock block if the tool is equipped and an invisible block if not: public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { //which render pass are we doing? if(ClientProxy.renderPass == 0) { EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer; ItemStack currentPlayerItemStack = player.getHeldItem(); if(currentPlayerItemStack.itemID == targetItemId) { renderer.renderStandardBlock(Block.bedrock, x, y, z); } } return true; }
  14. Hi, can someone give me a hint on how this could be accomplished: I want a block of my mod by default to be invisible - but it should show up if a specific tool is equipped by the player (active tool in the quick-bar, another item of my mod). As this should be an multiplayer compatible mod, the visibility toggle should only be on the client side (as only a player with the tool equipped should see the blocks). Thanks.
  15. Well i tried it this way already, this just causes lots of import errors. Is there maybe a problem with the source distribution of NEI and newer versions of forge? Or is there a way to decompile it to the correct sources?
  16. I have the same issues with NEI and forge. I use forge version "minecraftforge-src-1.4.5-6.4.2.445", and it seems it doesn't generate the commons folder anymore. If I copy the source from NEI/ChickenCore into <forge>/mcp/src/common (after creating the folder) it's not recognized, if i copy it into the <forge>/mcp/src/minecraft tree all the imports inside the NEI/ChickenCore java files seem to be wrong.
×
×
  • Create New...

Important Information

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