Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Draco18s

Members
  • Joined

  • Last visited

Everything posted by Draco18s

  1. Yes. Delete the tile entity. You're not using a tile entity. At all. Anywhere. Get rid of it. Player inventory screen is not a tile entity.
  2. Yes. And that's why not. Oh man, that helps. I'll take another stab at it today. Yay! Man, that was obtuse; don't think I'd have ever figured that out on my own. Thanks.
  3. I want to render an item in a similar manner to the clock or compass, which uses an animated texture, but is not animated on a per-frame basis, but rather on other events (e.g. time, like the clock). The way vanilla does this is it uses a subclass of TextureAtlasSprite and inside that it manages the animation directly. However, there does not be a way to register a TextureAtlasSprite in such a way that actually WORKS. In theory, this should work: @ForgeSubscribe public void registerTextures(TextureStitchEvent.Pre event) { event.map.setTextureEntry("modid:calendar", new TextureCalendar("modid:calendar")); } But it doesn't, as you can only register sprites for objects that don't already have one registered, and by the time this event is called, there's already an entry in the Hashmap for that string (which is the same as the item's texturename*). "Wait," you say, "You're trying to load a texture entry before any entries have been registered (TextureStitchEvent.Pre) and you can't because there's already an entry!?" Yup. It happens to be blank, but it DOES exist in the hashmap. TextureAtlasSprite{name='modid:calendar', frameCount=0, rotated=false, x=0, y=0, height=0, width=0, u0=0.0, u1=0.0, v0=0.0, v1=0.0} The texture I'm using obviously doesn't have 0 frames and 0 height and width. But none the less that entry prevents me from registering my own TextureAtlasSprite. How the hell am I supposed to do this? *Using a different string doesn't work, as the item's texture string is used as a lookup in the hashmap. Changing the item's texture string later also doesn't work.
  4. Here's some working code that I use Property cw = config.get("WorldGen","dimensionWhitelistList", new int[] {0}); Property cb = config.get("WorldGen","dimensionBlacklistList", new int[] {-1,1}); int[] white = cw.getIntList(); int[] black = cb.getIntList(); Arrays.sort(white); Arrays.sort(black); String a=Arrays.toString(white); String whitestring[]=a.substring(1,a.length()-1).split(", "); String b=Arrays.toString(black); String blackstring[]=b.substring(1,b.length()-1).split(", "); cw.set(whitestring); cb.set(blackstring); It sorts two lists of dimensions so that they're in numerical order.
  5. 1) get passed a reference to it 2) DimensionManager.getWorld(id)
  6. 1) Get a reference to the player 1) player.getCurrentEquippedItem().stackTagCompound.getTagList("ench")
  7. Nope. mOXkIe.zip |__modname |__assets
  8. Or look at the source for an old version of Minecraft.
  9. Configuration config = new Configuration(some_file_reference);//you'll have to figure this out for yourself config.get(Configuration.CATEGORY_GENERAL, "Enable this mod?", true).set(false);
  10. Except that this is bad practice. IIRC, this will fail on the dedicated server side.
  11. No: TileEntity tileEntity = player.worldObj.getBlockTileEntity((int)player.posX, (int)player.posY, (int)player.posZ); Your tileEntity is null. Because there's no tile entity AT that location. This has been your problem from the beginning. There is not, will not, never has been a tile entity at the player's feet because THERE IS NO ENTITY THERE so stop trying to reference it. You get a crash on that line because null does not have an xCoord value.
  12. Start printing out values and checking them against what the values should be. I can't help you debug your code, I can only tell you what you need to use.
  13. There is a good installer. For Eclipse. You're off using InteliJ which is not actually supported by the Forge team, so you really don't have any grounds to complain.
  14. Unfortunately I am not sure at this point.
  15. The world class can do all of that. world.getEntitiesInAABB() for instance.
  16. ...Really. A new tile entity. No no no no. You have a tile entity somewhere that is involved. Generally when the player right clicks it is when you open a gui for it. That method is inside a tile entity and has reference to itself. Unfortunately with the code you have supplied I'm not sure you even HAVE a tile entity anywhere. So I don't know why you're trying to reference it at all.
  17. Packets are tiny as mouseballs. I have an addon mod for Mystcraft that sends four max-sized packets to the server (and later retrieves them) and the delay is pretty small. I mean, it's large enough to be noticed, but there's also a lot that goes on in order to retrieve the info. Basically I'm saving and retrieving screen renders from the player. The upper right corner is just a black box normally. http://s23.postimg.org/4az5t711n/2013_11_08_22_23_39.png[/img] The retrieval takes about 1 second (even with the client and server on the same machine), so I suspect it's mostly due to disk IO.
  18. Its been a while since I messed around with collission boxes. Play around with it and see what it's doing.
  19. Admittedly I haven't actually tried that, for whatever reason my PC can't handle two clients and a server simultaneously.
  20. Nope. You don't need to manually do anything. I use it for a chest-like object that displays its contents as part of the renderer. There are some that generate as part of worldgen (so nothing involved clientside) and the item is already being displayed when I come across it.
  21. public Packet getDescriptionPacket() { NBTTagCompound nbtTag = new NBTTagCompound(); this.writeToNBT(nbtTag); return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbtTag); } public void onDataPacket(INetworkManager net, Packet132TileEntityData packet) { readFromNBT(packet.data); }
  22. Well your collision boxes for cases 0 and 2 are still only 1x1x1 in size, as xMin and xMax (ditty y and z) are based on block bounds, which ranges from 0...to 1. That and I think the x/y/z location is included. Meaning you're creating a collision box off in the middle of nowhere.
  23. Don't use config files, there's better ways to do it. 1) Use the player's already existent entityData. This is an NBT tag that all entities have that you can read and write any information you want to, to it and it will be saved in the user's profile, just like their inventory. 2) Use separate NBT data files. More difficult, but certainly doable. I did this for one mod because the data was per-world based, but tended to be "massive" in size, so having it remain loaded in memory all the time was not good, so the per-world storage that's given by IExtendedProperties wasn't going to work. Basically create a file reference and then run the file through CompressedStreamTools.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.