Jump to content

Reika

Members
  • Posts

    228
  • Joined

  • Last visited

Everything posted by Reika

  1. Given that these images are not even 32KB, that is not really an issue, especially considering I have larger textures just for the TileEntities (and of course machines running elaborate code every tick). Even if they were reloaded into the RAM every render tick (which seems like a really stupid idea), that would be 115MB/minute (at 60FPS), except for the Java garbage clearer running every ten seconds or so, negating that issue, capping the max memory wastage to <20MB, easily manageable on any modern computer. Would that let me override the path as well? (I tried looking for updateIcons for myself, but it does not exist in Item, ItemStack, Block, Render, RenderGlobal, or RenderBlocks). That is true, and since I would never have to see the resulting mess, I would be open to the idea. However, I have no idea how to do it.
  2. No from what I saw of the parser. I managed to get around the limit, though, by sending custom-designed 250s. As for the reason for the limit, no, as the limit is used only in sending the IO exception. I doubt I am allowed to post vanilla code here, but essentially it reads a packet with parameters (stream. int), and if (stream.readShort() > int), it crashes. Except that int is used nowhere else.
  3. That would require either mixing my sound files directly with my class files, and that would be very messy and hard to work with. Is there no way to get around this limit? (And why does it even exist)?
  4. Today, someone reported an error with RotaryCraft: 2013-06-09 01:11:35 [iNFO] [sTDERR] java.io.IOException: Received string length longer than maximum allowed (36 > 32) 2013-06-09 01:11:35 [iNFO] [sTDERR] at net.minecraft.network.packet.Packet.func_73282_a(Packet.java:223) 2013-06-09 01:11:35 [iNFO] [sTDERR] at net.minecraft.network.packet.Packet62LevelSound.func_73267_a(SourceFile:34) 2013-06-09 01:11:35 [iNFO] [sTDERR] at net.minecraft.network.packet.Packet.func_73272_a(Packet.java:170) 2013-06-09 01:11:35 [iNFO] [sTDERR] at net.minecraft.network.TcpConnection.func_74447_i(TcpConnection.java:327) 2013-06-09 01:11:35 [iNFO] [sTDERR] at net.minecraft.network.TcpConnection.func_74450_c(TcpConnection.java:547) 2013-06-09 01:11:35 [iNFO] [sTDERR] at net.minecraft.network.TcpReaderThread.run(SourceFile:94) Looking into the Sound Packet code, sure enough, the relevant sound name (including path) is longer than 32 characters, which appears to be a hardcoded limit with no logical reason. How can I get around this without changing my sound names to useless references like "hg.ogg"? My relevant code: ELECTRIC("elecengine"), WIND("windengine"), STEAM("steamengine"), CAR("gasengine"), HYDRO("hydroengine"), MICRO("microengine"), JET("jetengine"), KNOCKBACK("knockback"), PULSEJET("pulsejet"), PUMP("pump"), PILEDRIVER("piledriver"), SMOKE("smokealarm"), SPRINKLER("sprinkler"), FLYWHEEL("flywheel"), PROJECTOR("projector"), LOWBASS("basslo"), BASS("bass"), HIBASS("basshi"), LOWHARP("harplo"), HARP("harp"), HIHARP("harphi"), LOWPLING("plinglo"), PLING("pling"), HIPLING("plinghi"), FRICTION("friction"); private static final String SOUND_FOLDER = "Reika/RotaryCraft/Sounds/"; private static final String SOUND_PREFIX = "Reika.RotaryCraft.Sounds."; private static final String SOUND_DIR = "Sounds/"; private static final String SOUND_EXT = ".ogg"; private static final String MUSIC_FOLDER = "music/"; private static final String MUSIC_PREFIX = "music."; public static void playSound(SoundRegistry s, World world, double x, double y, double z, float vol, float pitch) { if (FMLCommonHandler.instance().getEffectiveSide() != Side.SERVER) return; Packet62LevelSound p = new Packet62LevelSound(s.getPlayableReference(), x, y, z, vol, pitch); PacketDispatcher.sendPacketToAllInDimension(p, world.provider.dimensionId); } public String getPlayableReference() { if (this.isNote()) return SOUND_PREFIX+MUSIC_PREFIX+name; return SOUND_PREFIX+name; } Worth noting is that this is only an issue in SMP - the integrated server has no issues with my extra-long sound packet names...
  5. I use a system I consider elegant - item IDs corresponding to spritesheet rows and metadata to columns. To switch to individual textures destroys that. Additionally, from what I can tell, item icons must have names identical to ingame (or perhaps unlocalized) names and be in a folder outside the mod folder (eg if code is in Reika.RotaryCraft, sprites must be mods/textures/items). These, combined with the fact I would have 200+ loose images, mean such a system would be extremely disorganized and messy. I value clean setups and organization far more than I value the potential "easier for texture makers" aspect - a claim whose veracity I have never fully trusted. (Not to mention how I doubt I will be seeing many texturepacks for RotaryCraft, and the one texturer I talked to preferred the old system).
  6. No, the images are indentical. This has to do with how the icons are rendered. I obviously have the wrong translations, but have no idea what the right ones are.
  7. I use custom code to render items when held in hand or in the world as an entity, as I use spritesheets rather than individual textures. This works almost perfectly. The only visible issue is that the in-hand items are oriented incorrectly. Here is what I mean (stick provided for comparison). My code: if (type == type.EQUIPPED || type == type.EQUIPPED_FIRST_PERSON || type == type.ENTITY) { if (type == type.EQUIPPED || type == type.EQUIPPED_FIRST_PERSON) { GL11.glTranslatef(0, 1.25F, 0.3125F); GL11.glRotatef(60, 0, 1, 0); GL11.glRotatef(65, 0, 0, 1); GL11.glTranslatef(-0.625F, 0F, 0); GL11.glScalef(1.5F, 1.5F, 1.5F); GL11.glRotatef(-90, 0, 0, 1); GL11.glTranslatef(-1, 0, 0); GL11.glTranslatef(0.5F, 0, 0.25F); GL11.glRotatef(-10, 0, 1, 0); GL11.glTranslatef(-0.125F, -0.125F, 0F); } else { GL11.glTranslatef(-0.5F, 0, 0); } float thick = 0.0625F; ItemRenderer.renderItemIn2D(v5, 0.0625F+0.0625F*col, 0.0625F*row, 0.0625F*col, 0.0625F+0.0625F*row, 256, 256, thick); } I am not going to split these up, but how do I fix this?
  8. My mod does not use separate textures for items, and instead uses the original spritesheets. This works perfectly except for only two minor issues. The relevant one here is the warning Forge spams into the console when booting: 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file mods/RotaryCraft/textures/items/items.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/screwdriver.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/rotarycrafthandbook.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/machineplacer.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/motiontracker.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/#bucket.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/handheldcraftingtool.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/engines.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/ultrasound.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/bedrockshovel.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/advgearitem.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/worldedittool.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/bedrockaxe.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/modextracts.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/nightvisionhelmet.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/angulartransducer.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/yeast.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/#windspring.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/knockbackgun.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/tntcannontargetingaid.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/bedrockpickaxe.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/shafts.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/flywheelitem.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/magicwand.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/nightvisiongoggles.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/gbxs.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/canolaseeds.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/gravelgun.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/i/ogoggles.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/#railgunammunition.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/ethanolcrystals.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/fireballlauncher.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/#projectorslides.png, but that file does not exist. Ignoring. 2013-06-08 16:34:56 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/vacuum.png, but that file does not exist. Ignoring. Is there any way to stop this? And no, I am not going to split up 200+ item textures.
  9. One last bump. I would have done this earlier, but the forum page was down for two weeks...
  10. Well, I tried Proguard, and there appear to be two errors: One, the minecraft.jar apparently contains two copies of every class, judging from lots of this: Note: duplicate definition of library class [ase] Note: duplicate definition of library class [asf] Note: duplicate definition of library class [asg] Note: duplicate definition of library class [ash] Note: duplicate definition of library class [asi] Two, some vanilla-code references appear to break, almost like mcp reobfuscated with a different naming registry: Warning: Reika.RotaryCraft.Items.ItemBedrockAxe: can't find referenced field 'apa[] c' in class Reika.RotaryCraft.Items.ItemBedrockAxe I know that apa is Block.class, and apa[] c is in fact Block[] blocksEffectiveAgainst from the tools classes. But why does that line fail to match up when most of them do?
  11. Ok, well then. I'm not sure If something like this would work, but would I be possible to have the code get the current number of input items, and find recipes accordingly? That can certainly be done (I would use three HashMaps), but you said you are fairly new to this area of modding, and a lot of it may be putting you on the hook for a lot of suffering.
  12. That is the sort of thing I was thinking of, yes, a "configurable" obfuscator. Maybe even on the level of per-method and per-variable selection. Obfuscate getEntitiesWithinAABB? No. Obfuscate recursiveBreakWithBounds? Yes.
  13. Well, I am not in need of locking the keyboard, but do the same rules apply for mouse? Also, will this method (I would rather not use ASM because it means becoming a coremod, so I will use a tickhandler) also allow me to lock out mouse movement (so that it does not move the camera angle)? At any rate, thank you SO much for helping.
  14. When others try to run my mod in 1.5.2 (which I am told should be possible for most 1.5.1 mods), they crash with this error: The opening lines imply I need a totally different Packet usage system. Has there been some fundamental change to the packet system in 1.5.2, such that old handlers are useless? (Part of) my code: @Override public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) { ep = (EntityPlayer) player; if (packet.channel.equals("RotaryCraftData")) { this.handleData(packet); } } private void handleData(Packet250CustomPayload packet) { DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(packet.data)); int control; boolean drops; int len; int[] data; long longdata = 0; int x,y,z; boolean readinglong = false; //System.out.print(packet.length); try { control = inputStream.readInt(); pack = EnumPackets.getEnum(control); len = pack.getNumberDataInts(); data = new int[len]; readinglong = pack.isLongPacket(); if (!readinglong) { for (int i = 0; i < len; i++) data[i] = inputStream.readInt(); } else longdata = inputStream.readLong(); x = inputStream.readInt(); y = inputStream.readInt(); z = inputStream.readInt(); } catch (IOException e) { e.printStackTrace(); return; } World world = ModLoader.getMinecraftInstance().theWorld; Minecraft m = Minecraft.getMinecraft(); WorldServer ws = m.getIntegratedServer().worldServerForDimension(m.thePlayer.dimension); switch (pack) { [Cases and actions] } } @Mod( modid = "RotaryCraft", name="RotaryCraft", version="beta") @NetworkMod(clientSideRequired=true, serverSideRequired=false, channels={"RotaryCraftData"}, packetHandler = PacketHandler.class)
  15. Oh...that severely complicates things. It may also be why you had trouble with the HashMap.
  16. Nope. Open up your reobf folder and look at the file names. Reobf only changes the references to vanilla classes and functions back to their obfuscated state (field_53829_b, func_23878_c, etc) so that the mod will actually work when added to the Minecraft jar. Would a third-party obfuscator work, maybe?
  17. I had been guessing that the reason my threads are usually seemingly ignored is because I usually ask much harder questions than the usual "how do I make blocks face different ways with metadata?" sorts of generic questions, and the more advanced the question gets, the fewer people know the answer. Though I would prefer replies like "no idea" and "I do not know" to nothing at all, as those would help keep the topic afloat; I really hate self-bumping.
  18. Here is the thing. Even when the machine has no GUI or container - and thus does not interact with inventories in any way - the problem still persists.
  19. Yes, but there is no way of telling with snow if its hitboxes are globally being reassigned as new blocks are interacted with, as the only use of the hitbox in snow is the collision detection. My machines use it for other things, such as determining which sides are valid power input sides. I have double-checked and I do not. Also, my code is fundamentally the same as yours.
  20. I would not be surprised if it also suffered from the bug I am experiencing, but think snow's rarity and the fact it is simply walked on leads to it not being noticed.
  21. I feel like a complete @$$ for repeatedly bumping my post just to get something...
  22. How do I sync an inventory? I know how to use 250 Custom Payload and 132 TE Data, but inventory?
  23. Unfortunately no different (in mechanics) than mine: public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { this.func_96478_d(par1IBlockAccess.getBlockMetadata(par2, par3, par4)); } protected void func_96478_d(int par1) { int j = par1 & 7; float f = (float)(2 * (1 + j)) / 16.0F; this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F); }
×
×
  • Create New...

Important Information

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