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. Vec3 vec = entityPlayer.getLookVec(); //Magic
  2. Sigh. Do you know what those 1s being passed to the constructor mean? No, clearly you don't. They're the entity's starting position. EntityLightningBolt Lightning = new EntityLightningBolt(world, Coord.blockX,Coord.blockY,Coord.blockZ); Amzanig!
  3. 1) ok, wasn't arbitrary. I still don't think you need to make the class abstract, but whatever. 2,4) Mmm...copy-pasta.. 3) this method makes me cry. And it will crash a dedicated server. Good job. So add one yourself. It's got an update function, hasn't it? You can create properties yes? You can increment a counter in the update function, no? Bloody freaking magic that is.
  4. 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 ?
  5. 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.
  6. 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.
  7. 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!
  8. 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).
  9. While I will probably just use wrapper objects, that's pretty neat.
  10. 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.
  11. 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*
  12. This is not a crafting recipe.
  13. 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.
  14. 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.
  15. 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) { }
  16. 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; } }
  17. 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).
  18. I never looked into those, actually.
  19. 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

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.