Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

moonlyer

Members
  • Posts

    21
  • 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.

moonlyer's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I do save data to the world and i change registry values on world startup if data differs from default state. I just undo this changes every time client disconnects. It is probably unnecessary, but I feel comfortable to know that when no world is loaded - the registries have default values.
  2. Hi, I'm trying to make a global world winter. Basically I change biome values in the registries using reflection to make it snow everywhere. I've almost made it work as intended. But there's one issue: If I quit the world during winter (when biome values are changed), and create a new world - then new world will be generated with snow everywhere (cause I never changed back the registry values). I've fixed this issue in singleplayer scenario by subscribing to onServerStopping event and restoring default registry values there, but when dealing with the dedicated server idk to what event I should subscribe. I've tried onPlayerLoggedOut event, but it never runs on the client side, and packets from server do not reach client (cause the player already logged out). I was thinking about onWorldUnload - but it seems that this event can fire during the game (when dimensions switches), and idk how to determine if the world unloads "for the last time". Is there an event for me to subscribe to?
  3. Yeah, I think I'll just wait. In 1.13 will also be Dolphis grace effect, which also solves the problem.
  4. Hi, modders. I'm making a hero class system or sort of, and I want to increase swim speed for one of my hero types. I know that there is a Depth Strider enchantment, but my goal is to make this as an innate ability (without the need of any items). I tried straight increasing movement speed (with attribute modifiers), but it seems that EntityLivingBase.travel() completely ignores any movement speed bonuses, if there is no Depth strider enchantment present. So, my questions are: Is there a way to make minecraft think that player has Depth Strider enchantment without any items equipped? if not, how could I increase player swim speed apart from depth strider enchantment (maybe somehow modify motion vector)?
  5. You do pos.getY() where should be pos.getZ()
  6. Sry, didn't want to be mean. Just meant that this type of mistakes easily handled with a little bit of patience and attention. And about isOn. You're right. I've looked at BlockRedstoneOre and it does the same thing. But I really don't see the point to have it, cause it does never change, and does absolutely nothing. Just like if (true)
  7. Well, if something's not working - then you're doing it wrong. Here's your mistake. You spawn your particles not at your block's position. Minecraft.getMinecraft().effectRenderer.addEffect(UraniumOreParticles.CreateParticle(worldIn, pos.getX(), pos.getY(), pos.getY(), 1f, 0, 0, 1)); I did not check your if statements, but without them your code runs perfectly fine. And about your isOn variable. The way you have it right now means that every block in the world would try to spawn particle if isOn is true. If you want your blocks to spawn particles independently - you probably should make isOn as boolean property.
  8. @Override public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, IBlockState state, BlockPos pos, EnumFacing face) { return BlockFaceShape.UNDEFINED; } I think this should do the trick.
  9. Of course it's undefined. ParticleRedstone has a different constructor. Carefully examine ParticleRedstone class and change things accordingly. It's constructor is ParticleRedstone(World, double, double, double, float, float, float)
  10. I recently did something similar. I believe it's pretty tricky to get the right color with default particles, if possible at all. My solution was to create custom particle that extends the particle you want to render (in my case ParticleSpell), and then change colors in CreateParticle method. This way you have almost complete control of the particle. My code: public class ParticleEndlessDust extends ParticleSpell { protected ParticleEndlessDust(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i1229_8_, double ySpeed, double p_i1229_12_) { super(worldIn,xCoordIn,yCoordIn,zCoordIn,p_i1229_8_,ySpeed,p_i1229_12_); } @Override public boolean shouldDisableDepth() { return false; } public static ParticleEndlessDust CreateParticle(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn) { ParticleEndlessDust particle = new ParticleEndlessDust(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); ((ParticleSpell)particle).setBaseSpellTextureIndex(144); float f = worldIn.rand.nextFloat() * 0.05F +0.95F; particle.setRBGColorF(1.0F * f, 0.91F * f, 0.46F * f); return particle; } } And then you can spawn it with ParticleManager.addEffect() @SideOnly(Side.CLIENT) public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand) { Minecraft.getMinecraft().effectRenderer.addEffect(ParticleEndlessDust.CreateParticle(worldIn, pos.getX()+0.5, pos.getY(), pos.getZ()+0.5, 0, 0, 0)); }
  11. It is possible to override vanilla sand and gravel in the registry and replace them with your own versions of sand and gravel. I believe thats the only way to stop them from falling with Forge.
  12. If someone interested, I managed to generate tall grass realtime without overriding vanilla blocks by accesing chunk in ChunkEvent.Load event, and generating needed blocks, like worldgen does. I haven't noticed much perfomance drops. @SubscribeEvent public void onChunkLoad (ChunkEvent.Load event) { if (!event.getWorld().isRemote) { //Get random x,z in chunk; Search for surface y; Check if possible to place; Places block Elcraft.elcraftRealtimeGenerator.GenDustInChunk(event.getChunk()); } }
  13. Thanks. I think I got it. It's really easy to get lost if you don't understand completely how minecraft classes interact with each other. P.S. My second issue (inablility to have different models for Block and it's ItemBlock) was solved by registering ItemBlock with a different registry name, and creating anoter blockstate .json. Previously I used the same registry name for block and ItemBlock.
  14. Right. But the problem is that UNREFINED_DUST is not an ItemBlock and does not have reference to a multistate block. So there's no way I could know every meta that I need to register in registerItemModels other than manually code it. Is there a way to drop UNREFINED_DUST with meta 0 regardless of WILD_DUST meta?
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.