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

[1.15] How do I change the grass/leaf/foliage colour of a biome?


Professor_Boxtrot
 Share

Recommended Posts

Look at how vanilla biomes do it.

Link to comment
Share on other sites

The "Biomes" class. In Eclipse, vanilla source is in Referenced Libraries -> forgeSrc-xx-xxx_mapped_snapshot_xxx.jar

Not sure about IntelliJ

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • I am using onlyIn to remind myself where this is executed. It doesn't create any issues, does it?
    • Do not use @OnlyIn. SSpawnObjectPacket only works for vanilla entities. You must use NetworkHooks.getEntitySpawningPacket.
    • public class MudWallBlockEntity extends Entity { private static final BlockState blockState = ModBlocks.TEMPORARY_DIRT_BLOCK.get().defaultBlockState(); private int height; private OneTimeRunnable finishJutsuOnce; private BlockPos startingBlockPos; private BlockPos endBlockPos; private BlockPos oldPos; private int ticks; public MudWallBlockEntity(EntityType<? extends MudWallBlockEntity> entityType, World level) { super(entityType, level); } @OnlyIn(Dist.CLIENT) public MudWallBlockEntity(EntityType<? extends MudWallBlockEntity> entityType, World level, BlockPos position, int height, OneTimeRunnable releaseJutsu) { super(entityType, level); this.startingBlockPos = position; this.endBlockPos = new BlockPos(startingBlockPos.getX(), height, startingBlockPos.getZ()); this.oldPos = position; this.height = height; this.finishJutsuOnce = releaseJutsu; this.setPos(position.getX(), position.getY(), position.getZ()); this.ticks = 0; } @Override protected void defineSynchedData() { } @Override protected void readAdditionalSaveData(@Nonnull CompoundNBT pCompound) { startingBlockPos = new BlockPos(pCompound.getInt("StartX"), pCompound.getInt("StartY"),pCompound.getInt("StartZ")); endBlockPos = new BlockPos(startingBlockPos.getX(), pCompound.getInt("Height"), startingBlockPos.getZ()); oldPos = new BlockPos(startingBlockPos.getX(), pCompound.getInt("CurrentHeight"), startingBlockPos.getZ()); } @Override protected void addAdditionalSaveData(@Nonnull CompoundNBT pCompound) { pCompound.putInt("StartX", startingBlockPos.getX()); pCompound.putInt("StartY", startingBlockPos.getY()); pCompound.putInt("StartZ", startingBlockPos.getZ()); pCompound.putInt("Height", height); pCompound.putInt("CurrentHeight", oldPos.getY()); } @Nonnull @Override public IPacket<?> getAddEntityPacket() { return new SSpawnObjectPacket(this, Block.getId(this.getBlockState())); } @Override public void tick() { LogManager.getLogger().info("ticks: " + ticks++ + " current " + blockPosition() + " old " + oldPos); if(blockPosition().equals(endBlockPos)){ if(finishJutsuOnce != null){ finishJutsuOnce.execute(); } remove(); return; } if(blockPosition().equals(oldPos.above())){ oldPos = blockPosition(); level.setBlockAndUpdate(blockPosition(), blockState); } setDeltaMovement(0, 0.1, 0); move(MoverType.SELF, getDeltaMovement()); } public BlockState getBlockState() { return blockState; } public BlockPos getStartingBlockPos() { return startingBlockPos; } @Override public boolean canBeCollidedWith() { return false; } @Override protected boolean canAddPassenger(Entity pPassenger) { return false; } @Override public boolean canChangeDimensions() { return false; } }  
    • Show the whole entity class.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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