Skip to content

Commit

Permalink
Updated Glider to be more akin to BotW
Browse files Browse the repository at this point in the history
  • Loading branch information
Nieadni committed Aug 14, 2023
1 parent c20d6d8 commit 05db76b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
TODO:
- Fix Redstone Pouch bug. In jar file (we think), placing down redstone will crash the game.
- Update Master Miner to only mine blocks of a same or similar hardness (to avoid cheesing mining long to mine blocks)
- Fix Rendering of Glider in Off Hand.

== End of Change Log ==
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,17 @@
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.MoverType;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.phys.Vec3;

public class GliderItem extends Item {

/**
* Changes the level of the slow falling effect, the higher this is, the slower the player will fall
*/
private static int FALL_SPEED_MODIFIER = 6;
/**
* Changes the glider's automatic movement forward's speed, the higher this is, the slower the glider will move
*/
private static int GLIDE_SPEED_MODIFIER = 0;
private static int FALL_SPEED_MODIFIER = 8;

private static final MobEffectInstance SLOW_FALLING = new MobEffectInstance(MobEffects.SLOW_FALLING, 1, FALL_SPEED_MODIFIER, false, false);

Expand All @@ -46,8 +40,6 @@ public void inventoryTick(ItemStack pStack, Level pLevel, Entity pEntity, int pS
LivingEntity livingEntity = (LivingEntity) pEntity;

livingEntity.addEffect(SLOW_FALLING);
Vec3 direction = livingEntity.getViewVector(1.0F);
livingEntity.move(MoverType.SELF,new Vec3(direction.x / GLIDE_SPEED_MODIFIER,direction.y / (GLIDE_SPEED_MODIFIER * 2),direction.z / GLIDE_SPEED_MODIFIER));
System.out.println("Moved");

}
Expand Down

0 comments on commit 05db76b

Please sign in to comment.