Jump to content

zerozhou

Members
  • Posts

    63
  • Joined

  • Last visited

Everything posted by zerozhou

  1. That sounds great!! Is smelting the only way(silk touch not count) to get stone? If there is one, things get harder.
  2. Actually I want to protect my ores from x-ray. So I'm thinking that when you break a netural stone, there is a chance that you can get an ore. But only netural stone have the chance. So I need to know if a stone is netural or not.
  3. So it seems I have to replace all block when they are generated with my own block which act like the original ones to do this. By the way, would this make the server very very slow?
  4. As the title said. If there is a way to do this? Maybe database or something else is needed? Hook all the event that the block is placed is an idea, but not efficiency and beauty.
  5. Hi. I've try you code and it works. I replace it in the event EntityJoinWorldEvent. May be it's before the initialization of the player's movementInput. It seems that I should go to see how MC runs. Anyway it works, thx.
  6. I've tried your code. But it seems not working. I try to replace the movement input while the player join the world. And as the log I see that I replace it successfully. But the updatePlayerMoveState() of the new class did not invoke. dont know why. I make a small change the it inhert from MovementInput, not MovementInputFromOptions. dont know if that is related.
  7. I'm going to write a potion that perform like confusion. That I want to swap the client's keybindings that when he press "w" and want to move forward and then he actually press "s" that he move backward. I'm searching for the code in the src but get confusion :'( .... Could someone point out the code I'm looking for? Or some simple idea about that?
  8. Yeah I know that as the protocol is public, it's hard to do that. But what I'm dealing with is the one who don't know how to mod but how to install mod just by copy and paste, not modder themselves, which is better than doing nothing. Stopping other mods to be loaded sounds like a good choice. I'm just doubting how to do this. Should I use ASM?
  9. What about a white list of the texture pack? I scan the texture pack and count their md5 sum. The number of mods installed is not quite useful. Maybe some normal client mod should be allow. Also, could white list mod list be done?
  10. It's a hard problem that players cheat. Usually using client mod, transparent textures or something like that to do this. Is there any idea dealing with cheating? I'm thinking about to do this with mod. That the mod checks all mods' hash number to match the ones in server side that make sure that they have all and no extra mods in the client, and also check for the texture packs they use. Which part should I learn about? Code or something about this?
  11. You can simply override public int idDropped(int par1, Random par2Random, int par3) or/and public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) according what you want to do. Like providing a random gem id in idDropped or according to the data of the block to drop item(s) when the block is destoryed. Maybe also override onBlockDestroyedByExplosion();
  12. Okay, that's replace all the DamageEntity() with my own. Thanks.
  13. I've set my own damagesource to unblockable to skip the armor calculation. But as I see the code, applyPotionDamageCalculations() is the function that calculate the effect of potion and enchanting. i = EnchantmentHelper.getEnchantmentModifierDamage(this.getLastActiveItems(), par1DamageSource); is the calculator of the enchanting. And yes I find I can set isDamageAllowedInCreativeMode in the damagesource to do this. But this require me to handle the hurt event to cancel the damage to the player in gamemode 1. Is this the idea you are talking about? As it looks a little strange. It seems to be sloved. I'll try it later.
  14. I'm handling with my own damage source with new mob and items. But when I hurt the entity, it always calculate the protection enchanting in the DamageEntity(). I don't want the protection enchanting being active with my new damage source. Is there any way to do this?
  15. Maybe you need to call DamageEntity() in EntityLivingBase, not just return true. And you could see the code of EntityLivingBase for more information.
  16. OK I got it, as the when the entity(not player)'s potioneffet disappear, there is no packet from the server to the client. But the server tracks the player's potioneffet status. So I send packet to the player around the entity I'm handling slove the problem.
  17. I'm not giving the same potion effect to the entity. The potion effect I give the entity first, let's to say, ID=44, and to perform the effect, I give another potioneffect with ID=8.
  18. Yes I change the onUpdate like what the SRC do in the code. Decrease the duration of the effect. public boolean onUpdate(EntityLivingBase par1) { if (this.duration > 0) { this.deincrementDuration(); } par1.addPotionEffect(new PotionEffect(8, 2, -8, false)); AttributeInstance atins = par1.getEntityAttribute(SharedMonsterAttributes.movementSpeed); AttributeModifier mod = new AttributeModifier(Utils.MyFreezeSpeed,"Freeze",-1.0F,2); if (atins.getModifier(Utils.MyFreezeSpeed) == null) { atins.applyModifier(mod); } if (this.duration % 140 == 0) { par1.attackEntityFrom(new MyDamageSource("FreezeDamage", null, 7, 2.0F), 2.0F); } return this.duration > 0; }
  19. I'm dealing with some custom potioneffects. As there are a lot of potioneffects I'm going to implement, I use reflect to expand the potion list which origin size is 32. Things seem to be fine but when I try to render the effects in the client side, I found that the potioneffect did not disappear in the client side, that I try to render the effect all the time after the entity get the effect. It seems the client would receive a packet about the disappearance of the potioneffect, but as you can see, I don't think it works well. Maybe there are some strange feature handling the potioneffects? Like the packet only send with ID less then 32 or something. Could someone help?
  20. Okay, I know what you mean. But do all the variable in the class will sync? I don't think so. The client only sync some "useful" information from the server like the position or something like that. But the custom information need to sync myself through datawatcher or something, am I right? And I prefer using datawatcher then packet as it's easier
  21. Dont the effects are rendered in the client side? I dont know how to create effects in the server. I'm trying to do this like: Packet Packet Player magic -----> Server ----------> Other player would see the magic | | Render himself render themselves As I said before, the client cant get the entity information from the server directly, I think it's not useful spawning entity in the server side.
  22. That seems not work as the parameters in the serverside cant be got from client side. I know datawatcher can do this. But there is no difference with using Packet.
  23. I'm trying to use particle to perform some magic effect. And as the particle is only spawn in client, that means other player would not see the particle. I'm thinking about passing all the parameters through the Packet to the players and render the particle in their own client. I know this would work, but I'm trying to find some better(easier) way to do this. Or is this the common way to render the particle effects?
  24. Thanks anyway. Maybe I should try some other idea about the rendering.
  25. I'm trying to rendering an entity which moves very fast. But as the rendering is not doing all the time, when the entity move fast enough, I can see it "jump" from one place to another. Is there any idea that could do this? Or is it impossible as the system of mc? A slow speed movement. oooooooooooooooooooooooooooooo A fast speed movement o o o o o o o o o o o o o o o o o o o What I want in fast speed movement. ooooooooooooooooooooooooooooooooooooooooooooooooo
×
×
  • Create New...

Important Information

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