Skip 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. 1) Why is this class abstract? 2) Why are you writing the block metadata to the description packet? (You're ignoring it when the packet arrives, too) 3) Your "connectTo" function is never called, making storedPos always null (unless its being called from another class you haven't posted) 4) Why are you getting the World and saving it to the local variable world when you have access to (and use!) worldObj? 5) Why are you using Minecraft.getMinecraft().thePlayer ?
  2. The irony here is that this Forge bug is why Keybounce was banned from the forums permanently, because it had the potential to corrupt a world irrevocably and Lex told him "that's why it creates a .bak file." But by the time the player logs in, the .bak files for the world info (containing the original mappings) have been overwritten three times.
  3. You are making beams that travel at arbitrary angles. So no. You're going to have to raycast. Raycasts are only expensive if you're doing a LOT of them (or they're going really far). Think about how expensive TNT is at the range you're interested in, then divide by 1352.
  4. Also don't just copy the class wholesale. That'll never work correctly and it will be impossible to debug unless you actually know what you're doing. That said: public static IIcon getIconSideOverlay() return MBlocks.Rgrass.field_149994_N;[ <------error. cannot be resolved or is not a field.] } Did it occur to you to do this? public static IIcon getIconSideOverlay() return this.field_149994_N; } Magic!
  5. The Entity tasks variable is public, so you can create an insert your own AI tasks when the entity spawns (EntitySpawnedInWorldEvent, if I am remembering the name correctly). EntityConstructedEvent is too early (tasks is null).
  6. While I will probably just use wrapper objects, that's pretty neat.
  7. It works because when you specify a grid arrangement smaller than 3x3 it lets it occur in any location on the grid. Enforcing a 3x3 shape by using spaces forces the recipe into the only place it fits: right where the spaces tell it it should go.
  8. Reminds me that I once had to download a mod from 9minecraft because the original, official host was long, long gone. And I wanted to examine the source code. I still feel dirty. *shudder*
  9. This is not a crafting recipe.
  10. ChunkEvent and ChunkDataEvent. You get access to the chunk's nbt data so you can store and retrieve any custom data you'd like. Note that chunks are saved and loaded on separate threads, so if you're using any data structures (e.g. HashMap) you will need to make it concurrent.
  11. Yeah, mine's a looped sound. Was easy enough to create and manage, so the extra work traking individual instances want that much of a bother.
  12. You don't need events. In your item, override: //called every tick for all items in the inventory public void onUpdate(ItemStack itemStack, World world, Entity entity, int slot, boolean held) { } //only makes sense for armor items, called every tick for equipped armors public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) { }
  13. Here's what I did, which is based on the way minecart sounds work. The client proxy is responsible for playing the actual sound (the server side does nothing) and making sure that we've only got 1 sound playing per location. The "ChunkCoordTriplet" class is a poorly named object which is effectively a Vec4. It was originally intended for storing 3D chunk coordinates + dimension, hence the name; overrides equals() and getHashCode() as to be a valid key type. You could probably just use a BlockPos. @Override public void startMillSound(TileEntityMillstone te) { ChunkCoordTriplet tepos = new ChunkCoordTriplet(te.getWorldObj().provider.dimensionId, te.xCoord, te.yCoord, te.zCoord); if(!sounds.containsKey(tepos)) { SoundWindmill snd = new SoundWindmill(new ResourceLocation("ores:grain-mill-loop"), te); //this is the important bit Minecraft.getMinecraft().getSoundHandler().playSound(snd); sounds.put(tepos, snd); } else { SoundWindmill snd = sounds.get(tepos); if(snd.isDonePlaying()) { sounds.remove(tepos); snd = new SoundWindmill(new ResourceLocation("ores:grain-mill-loop"), te); Minecraft.getMinecraft().getSoundHandler().playSound(snd); sounds.put(tepos, snd); } } } This is the class that handles the actual sound: public class SoundWindmill extends PositionedSound implements ITickableSound{ protected TileEntityMillstone millstone; protected boolean donePlaying = false; protected SoundWindmill(ResourceLocation sound, TileEntityMillstone mill) { super(sound); this.repeat = true; millstone = mill; this.xPosF = mill.xCoord; this.yPosF = mill.yCoord; this.zPosF = mill.zCoord; } public void update() { TileEntity te = millstone.getWorldObj().getTileEntity((int)xPosF,(int)yPosF,(int)zPosF); //handles checking to make sure the TE is still loaded, not replaced, and checks if the sound still needs to play //using the same function I would use in a GUI if this machine had one (its also used by WAILA). //For your use you'd probably just need to check the on/off state of the radio and make sure it's synced to the client //Metadata/Blockstate might be a good option if (!(te != null && te instanceof TileEntityMillstone) || millstone.getGrindTime() <= 0) { donePlaying = true; } } public boolean isDonePlaying() { return donePlaying; } }
  14. You need to do the sounds differently, as a streaming source. I'm away from my source code at the moment, or I'd look up how I did it. Long story short, it's routed through my common and client proxies (I'm playing a sound effect for a machine, client already knows the machine is operating due to synced TE data, so it just tells the proxy the start or stop the sound as needed, no networking required).
  15. I never looked into those, actually.
  16. What version of Minecraft? I've successfully extended the rails class in 1.7.10 just fine. http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2379886-micromod-rail-bridges
  17. It crashes, because that's not how you open a gui. https://github.com/Draco18s/Artifacts/blob/master/main/java/com/draco18s/artifacts/block/BlockPedestal.java#L140 Also, you have a huge crapton of stuff you absolutely should not need in your ContainerGrinder class. You can see caves through the block because you didn't override renderAsNormalBlock and isOpaqueCube to return false: the neighboring blocks are seeing your block as a full, solid, cube, so they're not bothering to render faces that can't be seen.
  18. Look at the Javadoc on world.setBlock(int, int, int, Block, int, int)
  19. As an aside, any reason you aren't storing references to your blocks and items where they can be easily accessed? That would eliminate the need to so FindBlock.
  20. The thing you see in your inventory is a 3D model of it in the world, seen from a diagonal, orthographic, viewpoint. You are unlikely to get this representation as a flat texture to draw on the face of a block. Which is why barrel mods draw a 3D block sticking out.
  21. Yeah, there's a boolean in the TileEntity class that controls their tick/not-tick behavior. There's a setter for it. Use it. (Or a function you override, I haven't actually messed with 1.8 yet, but the standard behavior still exists)

Important Information

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

Account

Navigation

Search

Search

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.