Jump to content

skeeter144

Members
  • Posts

    15
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

skeeter144's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. You go into Debug mode because you hit a breakpoint. In your top right window are all of your breakpoints you have set. I would imagine you set a breakpoint somewhere by accident. Right click on the breakpoint names and select "Remove"
  2. Are you hitting a breakpoint and trying to step through external code?
  3. Figured it out! For anyone who wants to know this in the future, I could NOT for the life of me find ANY way to reasonably do this with the native Minecraft path finders or move helpers. What I did is in my custom entity AI's UpdateTask method, directly calculate the proper movement vector for the ghost and directly set the entity's movementX, movementY, movementZ, etc. example: Vec3d moveVec = ghost.getAttackTarget().getPositionVector().subtract(ghost.getPositionVector()) moveVec = moveVec.normalize(); moveVec = moveVec.scale(.5); double dx = ghost.posX - ghost.getAttackTarget().posX; double dz = ghost.posZ - ghost.getAttackTarget().posZ; float angle = (float)(MathHelper.atan2(dz, dx) * (180D / Math.PI)) + 90.0F; //this limitAngle method is copied from the vanilla EntityMovementHelper ghost.rotationYaw = this.limitAngle(ghost.rotationYaw, angle, 90.0F); ghost.motionX = moveVec.x; ghost.motionY = moveVec.y; ghost.motionZ = moveVec.z; It's fairly simple for my purposes, since I just wanted to make a ghost fly up into the air and then quickly dive down at its target. Also, be on the lookout for my mod in the coming year, it's going to be the biggest Minecraft MMORPG ever
  4. If you're calling playSound from the server (which you were in your original example), you want to pass null as the player reference: player.world.playSound(null, pos, SoundHandler.record1, SoundCategory.RECORDS, 1.0f, 1.0f); Calling world.playSound (ON THE SERVER) plays the sound for everybody EXCEPT the player passed into it. If you pass null, it plays for everyone. Calling world.playSounds (ON THE CLIENT) plays the sound ONLY for the player passed in. (Which should only be the local player anyway... it is local after all) Next, You've got a few issues here with your sound registering. In your SoundHandler class, you need to register with your MODID and sound name, e.g. You also don't want .ogg in the regsistry because this ResourceLocation is not a RL to a sound file, but a .json entry describing your sound private static SoundEvent createSoundEvent2(String soundName){ final ResourceLocation sound = new ResourceLocation(MODID /* whatever your mod id is... */, soundName); System.out.println("Create Sound2"); return new SoundEvent(sound).setRegistryName(soundName); } If you don't use your mod id, it will default to looking in Minecraft's sound folder. That should get you on the right direction and getting some kinks worked out!
  5. Does anyone know of a relatively easy way to significantly increase custom mobs' movement/flying speed? I've been able to set the base movement speed of attributes, add modifiers, etc., but it seems like there's an underlying movement speed cap on mobs (it's not very fast, at all, you can still outrun them going backwards). Is this the case? Am I doing something wrong? Some examples of what I'm trying to do now... this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(10f); this.getEntityAttribute(SharedMonsterAttributes.FLYING_SPEED).setBaseValue(10f); and in the custom AI class... ghost.moveHelper.setMoveTo(ghost.getAttackTarget().posX, ghost.getAttackTarget().posY, ghost.getAttackTarget().posZ, 15); ghost.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).applyModifier(new AttributeModifier("dive_speed", 10, 0)); ghost.getEntityAttribute(SharedMonsterAttributes.FLYING_SPEED).applyModifier(new AttributeModifier("dive_speed", 10, 0)); But still no fast ghost
  6. That, I'm not sure of, I don't know enough about the implementation of WorldPainter and/or MCEdit's schematic files, butttt..... Fixed it!!! It's a SUPER ghetto fix that I have no idea why it works...Check this out...this may be very very useful for other modders. So apparently WorldPainter doesn't want to generate the LAST block that's registered in your Mod, so if you register a dummy block as the final one, it will generate just fine So here's what I did: @SubscribeEvent public void registerItemBlocks(RegistryEvent.Register<Item> event) { final IForgeRegistry<Item> registry = event.getRegistry(); final ItemBlock[] items = { //... new ItemBlock(spiderTreeLeaves), new ItemBlock(spiderTreeLog), new ItemBlock(dummy_block) }; for(ItemBlock i : items) { Block b = i.getBlock(); registry.register(i.setRegistryName(b.getRegistryName())); } } Annddd BAM. It works, it just doesn't copy over the dummy block. So strange. Thanks for your input anyway!
  7. Okay, so completely refactored, and no improvement. The first SS is a picture of what WorldPainter generates from a really simply .schematic file. The schematic is just a column of alternating custom leaf and log blocks. Only the block that is registered first shows up right for some reason. Item IDs appear to be working correctly. And my registration code... @SubscribeEvent public void registerBlocks(RegistryEvent.Register<Block> event) { final IForgeRegistry<Block> registry = event.getRegistry(); final Block[] blocks = { //... spiderTreeLeaves, spiderTreeLog //... }; for(Block b : blocks) { registry.register(b); } }
  8. Sure thing. I'm refactoring my registration system to using the new RegistryEvents, so if that doesn't clear it up, I'll show that as soon as I'm building again!
  9. So I've been developing a very large mod over the last couple months, and I'm trying to use WorldEdit schematics with WorldPainter so I can create some stuff for a server. (Specifically, large trees for a certain area, using my custom blocks) The problem is that if I'm using WorldEdit's schematics by themselves, like for transferring stuff between worlds, it works just fine, but if I load a schematic into WorldPainter and then put it in a new world, half of the blocks don't get generated. And the weird thing is, the blocks that don't get generated are the blocks that are registered second in my proxy. So if I register the logs first and the leaves second, only the logs will get put into the world, and vice versa. I'm inclined to think that there's something wrong with the registration, because I basically made the leaves and logs identical blocks with different textures, and the only thing that makes a difference is the registry order. public static void registerBlocks() { //if I register the leaves first, they'll get generated by WorldPainter, but the logs won't and vice versa register(spiderTreeLeaves); register(spiderTreeLog); //.... } where register blocks is called from: public class CommonProxy { public void preInit(FMLPreInitializationEvent event) { //... TOCItems.registerItems(); TOCBlocks.registerBlocks(); //... } //.... } Does anyone have ANY idea that they could help me with? I've been scratching my head on this one for a while
  10. Woops, nevermind...thought you were registering them in Init. Like TheGreyGhost said, you should register them in init, but that's not what is causing this error. And no problem, hope it works!
  11. Registering your items in the FMLInit stage isn't the problem. This is actually a good practice, because if you have other mods depending on your mod, or depend on other mods' items, you want them to be completely initialized before you do your recipes. The problem is you never initialized (created) your itemTinyStick. Just make this one the same way you created all your other items, and you'll be good! Hope I could help!
  12. That's a good idea! I can't believe I had never thought about that! Thanks for the tip, I'll try it out. And even if it doesn't work, that seems like a really good practice.
  13. Not sure I completely follow. I'm checking "proxy.isRemote()," is that not what you mean? Would you recommend putting the event handler in the proxy classes?
  14. I have an event handler that I use to tell whenever an entity gets attacked, and do some other stuff with that. The problem is, the event is getting called twice per attack, on the client side. I have checks that if the server is dedicated, it will only get called on the server, which works. But when the server is integrated, it only gets called on the client, and is called twice. Here's my code for the attack handler. The LivingDeathEvent works properly, it's only the LivingAttackEvent And where I register the AttackHandler class. And here is the console output: Any help would be much appreciated! Not sure if this is a bug or what.
×
×
  • Create New...

Important Information

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