mirror of
https://github.com/TeamMidnightDust/Decorative.git
synced 2025-12-15 12:35:10 +01:00
We be ballin'
- Fix bath tires and beach balls
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
package eu.midnightdust.motschen.decorative.entity;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.mob.MobEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.tag.TagKey;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Identifier;
|
||||
@@ -32,4 +36,25 @@ public class BathTireEntity extends MobEntity {
|
||||
}
|
||||
return super.interactAt(player, hitPos, hand);
|
||||
}
|
||||
@Override
|
||||
public boolean shouldDismountUnderwater() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public Vec3d getPassengerRidingPos(Entity passenger) {
|
||||
return this.getPos().add(0,0.4d, 0);
|
||||
}
|
||||
@Override
|
||||
protected void swimUpward(TagKey<Fluid> fluid) {
|
||||
if (this.getNavigation().canSwim()) {
|
||||
super.swimUpward(fluid);
|
||||
} else {
|
||||
this.setVelocity(this.getVelocity().add(0.0D, 0.7D, 0.0D));
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public boolean canWalkOnFluid(FluidState fluid) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,10 @@ import eu.midnightdust.motschen.decorative.init.Pool;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.mob.MobEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.registry.tag.TagKey;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
@@ -25,4 +28,17 @@ public class BeachBallEntity extends MobEntity {
|
||||
}
|
||||
return ActionResult.FAIL;
|
||||
}
|
||||
@Override
|
||||
protected void swimUpward(TagKey<Fluid> fluid) {
|
||||
if (this.getNavigation().canSwim()) {
|
||||
super.swimUpward(fluid);
|
||||
} else {
|
||||
this.setVelocity(this.getVelocity().add(0.0D, 0.7D, 0.0D));
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public boolean canWalkOnFluid(FluidState fluid) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user