#Illusion Maybe 2824 can u teach me this

1 messages · Page 1 of 1 (latest)

shadow stratus
verbal moth
#

Looking at the image

#

what's the only thing that changes?

#

Do you notice any patterns?

shadow stratus
#

i didnt change antythin

verbal moth
#

yes but

shadow stratus
#

i was outside and i wonder

verbal moth
#

between the 2 cases

#

what's different?

shadow stratus
#

moistrue age ?

verbal moth
#

pretty much

#

that's literally the only thing that changes

shadow stratus
#

ah yes

verbal moth
#

And now notice

#

how they relate

#

if it's 4 or 5, you just add 2 to the number

#

So we can just

shadow stratus
#
        if (e.getHand() == EquipmentSlot.HAND && meta.getCustomModelData() == 2  && block.getType() == Material.FARMLAND) {
            switch (farmland.getMoisture()) {
                case 0, 4 -> {
                    world.playSound(block.getLocation(), Sound.ENTITY_BOAT_PADDLE_WATER, SoundCategory.BLOCKS, 5, 2);
                    world.spawnParticle(Particle.FALLING_WATER, block.getLocation().add(new Vector(0.5, 1, 0.5)), 5, 0.1, 0.1, 0.1);
                    e.getPlayer().swingMainHand();
                    farmland.setMoisture(5);
                    meta.setCustomModelData(1);
                    block.setBlockData(farmland);
                    item.setItemMeta(meta);
                }
                case 6 -> {
                    world.playSound(block.getLocation(), Sound.ENTITY_BOAT_PADDLE_WATER, SoundCategory.BLOCKS, 5, 2);
                    world.spawnParticle(Particle.FALLING_WATER, block.getLocation().add(new Vector(0.5, 1, 0.5)), 5, 0.1, 0.1, 0.1);
                    e.getPlayer().swingMainHand();
                    farmland.setMoisture(7);
                    meta.setCustomModelData(1);
                    block.setBlockData(farmland);
                    item.setItemMeta(meta);
                }
            }
        }```
verbal moth
#
if(moisture != 4 && moisture != 5) {
  return; // early return
}

// do the rest
setMoisture(moisture + 2);