Fix #55
This commit is contained in:
parent
5d6cd45c50
commit
6a15f02160
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>tamablefoxes-parent</artifactId>
|
<artifactId>tamablefoxes-parent</artifactId>
|
||||||
<groupId>net.seanomik</groupId>
|
<groupId>net.seanomik</groupId>
|
||||||
<version>2.1.2-SNAPSHOT</version>
|
<version>2.1.3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>tamablefoxes_v1_14_R1</artifactId>
|
<artifactId>tamablefoxes_v1_14_R1</artifactId>
|
||||||
|
|
|
@ -79,34 +79,10 @@ public class FoxPathfinderGoalSleepWithOwner extends PathfinderGoal {
|
||||||
|
|
||||||
public void d() {
|
public void d() {
|
||||||
this.a.setSleeping(false);
|
this.a.setSleeping(false);
|
||||||
float f = this.a.world.j(1.0F);
|
|
||||||
if (this.b.dJ() >= 100 && (double)f > 0.77D && (double)f < 0.8D && (double)this.a.world.getRandom().nextFloat() < 0.7D) {
|
|
||||||
this.h();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.d = 0;
|
this.d = 0;
|
||||||
//this.a.v(false); < setRelaxStateOne
|
|
||||||
this.a.getNavigation().o();
|
this.a.getNavigation().o();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void h() {
|
|
||||||
Random random = this.a.getRandom();
|
|
||||||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
|
|
||||||
blockposition_mutableblockposition.a(this.a);
|
|
||||||
this.a.a((double)(blockposition_mutableblockposition.getX() + random.nextInt(11) - 5), (double)(blockposition_mutableblockposition.getY() + random.nextInt(5) - 2), (double)(blockposition_mutableblockposition.getZ() + random.nextInt(11) - 5), false);
|
|
||||||
blockposition_mutableblockposition.a(this.a);
|
|
||||||
LootTable loottable = this.a.world.getMinecraftServer().getLootTableRegistry().getLootTable(LootTables.af);
|
|
||||||
LootTableInfo.Builder loottableinfo_builder = (new LootTableInfo.Builder((WorldServer)this.a.world)).set(LootContextParameters.POSITION, blockposition_mutableblockposition).set(LootContextParameters.THIS_ENTITY, this.a).a(random);
|
|
||||||
List<ItemStack> list = loottable.populateLoot(loottableinfo_builder.build(LootContextParameterSets.GIFT));
|
|
||||||
Iterator iterator = list.iterator();
|
|
||||||
|
|
||||||
while(iterator.hasNext()) {
|
|
||||||
ItemStack itemstack = (ItemStack)iterator.next();
|
|
||||||
this.a.world.addEntity(new EntityItem(this.a.world, (double)((float)blockposition_mutableblockposition.getX() - MathHelper.sin(this.a.aK * 0.017453292F)), (double)blockposition_mutableblockposition.getY(), (double)((float)blockposition_mutableblockposition.getZ() + MathHelper.cos(this.a.aK * 0.017453292F)), itemstack));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void e() {
|
public void e() {
|
||||||
if (this.b != null && this.c != null) {
|
if (this.b != null && this.c != null) {
|
||||||
this.a.getGoalSit().setSitting(false);
|
this.a.getGoalSit().setSitting(false);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>tamablefoxes-parent</artifactId>
|
<artifactId>tamablefoxes-parent</artifactId>
|
||||||
<groupId>net.seanomik</groupId>
|
<groupId>net.seanomik</groupId>
|
||||||
<version>2.1.2-SNAPSHOT</version>
|
<version>2.1.3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>tamablefoxes_v1_15_R1</artifactId>
|
<artifactId>tamablefoxes_v1_15_R1</artifactId>
|
||||||
|
|
|
@ -80,34 +80,10 @@ public class FoxPathfinderGoalSleepWithOwner extends PathfinderGoal {
|
||||||
|
|
||||||
public void d() {
|
public void d() {
|
||||||
this.a.setSleeping(false);
|
this.a.setSleeping(false);
|
||||||
float f = this.a.world.f(1.0F);
|
|
||||||
if (this.b.ef() >= 100 && (double)f > 0.77D && (double)f < 0.8D && (double)this.a.world.getRandom().nextFloat() < 0.7D) {
|
|
||||||
this.h();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.d = 0;
|
this.d = 0;
|
||||||
//this.a.v(false); // setRelaxStateOne
|
|
||||||
this.a.getNavigation().o();
|
this.a.getNavigation().o();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void h() {
|
|
||||||
Random random = this.a.getRandom();
|
|
||||||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
|
|
||||||
blockposition_mutableblockposition.g(this.a.getChunkCoordinates());
|
|
||||||
this.a.a((double)(blockposition_mutableblockposition.getX() + random.nextInt(11) - 5), (double)(blockposition_mutableblockposition.getY() + random.nextInt(5) - 2), (double)(blockposition_mutableblockposition.getZ() + random.nextInt(11) - 5), false);
|
|
||||||
blockposition_mutableblockposition.g(this.a.getChunkCoordinates());
|
|
||||||
LootTable loottable = this.a.world.getMinecraftServer().getLootTableRegistry().getLootTable(LootTables.ak);
|
|
||||||
LootTableInfo.Builder loottableinfo_builder = (new LootTableInfo.Builder((WorldServer)this.a.world)).set(LootContextParameters.POSITION, blockposition_mutableblockposition).set(LootContextParameters.THIS_ENTITY, this.a).a(random);
|
|
||||||
List<ItemStack> list = loottable.populateLoot(loottableinfo_builder.build(LootContextParameterSets.GIFT));
|
|
||||||
Iterator iterator = list.iterator();
|
|
||||||
|
|
||||||
while(iterator.hasNext()) {
|
|
||||||
ItemStack itemstack = (ItemStack)iterator.next();
|
|
||||||
this.a.world.addEntity(new EntityItem(this.a.world, (double)blockposition_mutableblockposition.getX() - (double)MathHelper.sin(this.a.aH * 0.017453292F), (double)blockposition_mutableblockposition.getY(), (double)blockposition_mutableblockposition.getZ() + (double)MathHelper.cos(this.a.aH * 0.017453292F), itemstack));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void e() {
|
public void e() {
|
||||||
if (this.b != null && this.c != null) {
|
if (this.b != null && this.c != null) {
|
||||||
this.a.setSitting(false);
|
this.a.setSitting(false);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>tamablefoxes-parent</artifactId>
|
<artifactId>tamablefoxes-parent</artifactId>
|
||||||
<groupId>net.seanomik</groupId>
|
<groupId>net.seanomik</groupId>
|
||||||
<version>2.1.2-SNAPSHOT</version>
|
<version>2.1.3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>tamablefoxes_v1_16_R1</artifactId>
|
<artifactId>tamablefoxes_v1_16_R1</artifactId>
|
||||||
|
|
|
@ -83,34 +83,10 @@ public class FoxPathfinderGoalSleepWithOwner extends PathfinderGoal {
|
||||||
|
|
||||||
public void d() {
|
public void d() {
|
||||||
this.a.setSleeping(false);
|
this.a.setSleeping(false);
|
||||||
float f = this.a.world.f(1.0F);
|
|
||||||
if (this.b.eB() >= 100 && (double)f > 0.77D && (double)f < 0.8D && (double)this.a.world.getRandom().nextFloat() < 0.7D) {
|
|
||||||
this.h();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.d = 0;
|
this.d = 0;
|
||||||
//this.a.y(false); // setRelaxStateOne
|
|
||||||
this.a.getNavigation().o();
|
this.a.getNavigation().o();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void h() {
|
|
||||||
Random random = this.a.getRandom();
|
|
||||||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
|
|
||||||
blockposition_mutableblockposition.g(this.a.getChunkCoordinates());
|
|
||||||
this.a.a((double)(blockposition_mutableblockposition.getX() + random.nextInt(11) - 5), (double)(blockposition_mutableblockposition.getY() + random.nextInt(5) - 2), (double)(blockposition_mutableblockposition.getZ() + random.nextInt(11) - 5), false);
|
|
||||||
blockposition_mutableblockposition.g(this.a.getChunkCoordinates());
|
|
||||||
LootTable loottable = this.a.world.getMinecraftServer().getLootTableRegistry().getLootTable(LootTables.ak);
|
|
||||||
net.minecraft.server.v1_16_R1.LootTableInfo.Builder loottableinfo_builder = (new net.minecraft.server.v1_16_R1.LootTableInfo.Builder((WorldServer)this.a.world)).set(LootContextParameters.POSITION, blockposition_mutableblockposition).set(LootContextParameters.THIS_ENTITY, this.a).a(random);
|
|
||||||
List<ItemStack> list = loottable.populateLoot(loottableinfo_builder.build(LootContextParameterSets.GIFT));
|
|
||||||
Iterator iterator = list.iterator();
|
|
||||||
|
|
||||||
while(iterator.hasNext()) {
|
|
||||||
ItemStack itemstack = (ItemStack)iterator.next();
|
|
||||||
this.a.world.addEntity(new EntityItem(this.a.world, (double)blockposition_mutableblockposition.getX() - (double)MathHelper.sin(this.a.aH * 0.017453292F), (double)blockposition_mutableblockposition.getY(), (double)blockposition_mutableblockposition.getZ() + (double)MathHelper.cos(this.a.aH * 0.017453292F), itemstack));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void e() {
|
public void e() {
|
||||||
if (this.b != null && this.c != null) {
|
if (this.b != null && this.c != null) {
|
||||||
this.a.setSitting(false);
|
this.a.setSitting(false);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>tamablefoxes-parent</artifactId>
|
<artifactId>tamablefoxes-parent</artifactId>
|
||||||
<groupId>net.seanomik</groupId>
|
<groupId>net.seanomik</groupId>
|
||||||
<version>2.1.2-SNAPSHOT</version>
|
<version>2.1.3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>tamablefoxes_v1_16_R2</artifactId>
|
<artifactId>tamablefoxes_v1_16_R2</artifactId>
|
||||||
|
|
|
@ -83,33 +83,10 @@ public class FoxPathfinderGoalSleepWithOwner extends PathfinderGoal {
|
||||||
|
|
||||||
public void d() {
|
public void d() {
|
||||||
this.a.setSleeping(false);
|
this.a.setSleeping(false);
|
||||||
float f = this.a.world.f(1.0F);
|
|
||||||
if (this.b.eB() >= 100 && (double)f > 0.77D && (double)f < 0.8D && (double)this.a.world.getRandom().nextFloat() < 0.7D) {
|
|
||||||
this.h();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.d = 0;
|
this.d = 0;
|
||||||
//this.a.y(false); // setRelaxStateOne
|
|
||||||
this.a.getNavigation().o();
|
this.a.getNavigation().o();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void h() {
|
|
||||||
Random random = this.a.getRandom();
|
|
||||||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
|
|
||||||
blockposition_mutableblockposition.g(this.a.getChunkCoordinates());
|
|
||||||
this.a.a((double)(blockposition_mutableblockposition.getX() + random.nextInt(11) - 5), (double)(blockposition_mutableblockposition.getY() + random.nextInt(5) - 2), (double)(blockposition_mutableblockposition.getZ() + random.nextInt(11) - 5), false);
|
|
||||||
blockposition_mutableblockposition.g(this.a.getChunkCoordinates());
|
|
||||||
LootTable loottable = this.a.world.getMinecraftServer().getLootTableRegistry().getLootTable(LootTables.ak);
|
|
||||||
net.minecraft.server.v1_16_R2.LootTableInfo.Builder loottableinfo_builder = (new net.minecraft.server.v1_16_R2.LootTableInfo.Builder((WorldServer)this.a.world)).set(LootContextParameters.ORIGIN, this.a.getPositionVector()).set(LootContextParameters.THIS_ENTITY, this.a).a(random);
|
|
||||||
List<ItemStack> list = loottable.populateLoot(loottableinfo_builder.build(LootContextParameterSets.GIFT));
|
|
||||||
Iterator iterator = list.iterator();
|
|
||||||
|
|
||||||
while(iterator.hasNext()) {
|
|
||||||
ItemStack itemstack = (ItemStack)iterator.next();
|
|
||||||
this.a.world.addEntity(new EntityItem(this.a.world, (double)blockposition_mutableblockposition.getX() - (double)MathHelper.sin(this.a.aA * 0.017453292F), (double)blockposition_mutableblockposition.getY(), (double)blockposition_mutableblockposition.getZ() + (double)MathHelper.cos(this.a.aA * 0.017453292F), itemstack));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void e() {
|
public void e() {
|
||||||
if (this.b != null && this.c != null) {
|
if (this.b != null && this.c != null) {
|
||||||
this.a.setSitting(false);
|
this.a.setSitting(false);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>net.seanomik</groupId>
|
<groupId>net.seanomik</groupId>
|
||||||
<artifactId>tamablefoxes-parent</artifactId>
|
<artifactId>tamablefoxes-parent</artifactId>
|
||||||
<version>2.1.2-SNAPSHOT</version>
|
<version>2.1.3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>tamablefoxes_v1_16_R3</artifactId>
|
<artifactId>tamablefoxes_v1_16_R3</artifactId>
|
||||||
|
|
|
@ -82,34 +82,10 @@ public class FoxPathfinderGoalSleepWithOwner extends PathfinderGoal {
|
||||||
|
|
||||||
public void d() {
|
public void d() {
|
||||||
this.a.setSleeping(false);
|
this.a.setSleeping(false);
|
||||||
float f = this.a.world.f(1.0F);
|
|
||||||
if (this.b.eC() >= 100 && (double)f > 0.77D && (double)f < 0.8D && (double)this.a.world.getRandom().nextFloat() < 0.7D) {
|
|
||||||
this.h();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.d = 0;
|
this.d = 0;
|
||||||
//this.a.y(false);
|
|
||||||
this.a.getNavigation().o();
|
this.a.getNavigation().o();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void h() {
|
|
||||||
Random random = this.a.getRandom();
|
|
||||||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
|
|
||||||
blockposition_mutableblockposition.g(this.a.getChunkCoordinates());
|
|
||||||
this.a.a((double)(blockposition_mutableblockposition.getX() + random.nextInt(11) - 5), (double)(blockposition_mutableblockposition.getY() + random.nextInt(5) - 2), (double)(blockposition_mutableblockposition.getZ() + random.nextInt(11) - 5), false);
|
|
||||||
blockposition_mutableblockposition.g(this.a.getChunkCoordinates());
|
|
||||||
LootTable loottable = this.a.world.getMinecraftServer().getLootTableRegistry().getLootTable(LootTables.ak);
|
|
||||||
net.minecraft.server.v1_16_R3.LootTableInfo.Builder loottableinfo_builder = (new net.minecraft.server.v1_16_R3.LootTableInfo.Builder((WorldServer)this.a.world)).set(LootContextParameters.ORIGIN, this.a.getPositionVector()).set(LootContextParameters.THIS_ENTITY, this.a).a(random);
|
|
||||||
List<ItemStack> list = loottable.populateLoot(loottableinfo_builder.build(LootContextParameterSets.GIFT));
|
|
||||||
Iterator iterator = list.iterator();
|
|
||||||
|
|
||||||
while(iterator.hasNext()) {
|
|
||||||
ItemStack itemstack = (ItemStack)iterator.next();
|
|
||||||
this.a.world.addEntity(new EntityItem(this.a.world, (double)blockposition_mutableblockposition.getX() - (double)MathHelper.sin(this.a.aA * 0.017453292F), (double)blockposition_mutableblockposition.getY(), (double)blockposition_mutableblockposition.getZ() + (double)MathHelper.cos(this.a.aA * 0.017453292F), itemstack));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void e() {
|
public void e() {
|
||||||
if (this.b != null && this.c != null) {
|
if (this.b != null && this.c != null) {
|
||||||
this.a.setSitting(false);
|
this.a.setSitting(false);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>net.seanomik</groupId>
|
<groupId>net.seanomik</groupId>
|
||||||
<artifactId>tamablefoxes-parent</artifactId>
|
<artifactId>tamablefoxes-parent</artifactId>
|
||||||
<version>2.1.2-SNAPSHOT</version>
|
<version>2.1.3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -99,38 +99,10 @@ public class FoxPathfinderGoalSleepWithOwner extends Goal {
|
||||||
|
|
||||||
public void stop() {
|
public void stop() {
|
||||||
this.fox.setSleeping(false);
|
this.fox.setSleeping(false);
|
||||||
float f = this.fox.level.getTimeOfDay(1.0F);
|
|
||||||
if (this.ownerPlayer.getSleepTimer() >= 100 && (double)f > 0.77D && (double)f < 0.8D && (double)this.fox.level.getRandom().nextFloat() < 0.7D) {
|
|
||||||
this.giveMorningGift();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.onBedTicks = 0;
|
this.onBedTicks = 0;
|
||||||
this.fox.getNavigation().stop();
|
this.fox.getNavigation().stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void giveMorningGift() {
|
|
||||||
Random random = this.fox.getRandom();
|
|
||||||
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
|
|
||||||
blockposition_mutableblockposition.set(this.fox.blockPosition());
|
|
||||||
this.fox.randomTeleport((double)(blockposition_mutableblockposition.getX() + random.nextInt(11) - 5), (double)(blockposition_mutableblockposition.getY() + random.nextInt(5) - 2), (double)(blockposition_mutableblockposition.getZ() + random.nextInt(11) - 5), false);
|
|
||||||
blockposition_mutableblockposition.set(this.fox.blockPosition());
|
|
||||||
LootTable loottable = this.fox.level.getServer().getLootTables().get(BuiltInLootTables.CAT_MORNING_GIFT);
|
|
||||||
net.minecraft.world.level.storage.loot.LootContext.Builder loottableinfo_builder = (new net.minecraft.world.level.storage.loot.LootContext.Builder((ServerLevel)this.fox.level)).withParameter(LootContextParams.ORIGIN, this.fox.position()).withParameter(LootContextParams.THIS_ENTITY, this.fox).withRandom(random);
|
|
||||||
List<ItemStack> list = loottable.getRandomItems(loottableinfo_builder.create(LootContextParamSets.GIFT));
|
|
||||||
Iterator iterator = list.iterator();
|
|
||||||
|
|
||||||
while(iterator.hasNext()) {
|
|
||||||
ItemStack itemstack = (ItemStack)iterator.next();
|
|
||||||
ItemEntity entityitem = new ItemEntity(this.fox.level, (double)blockposition_mutableblockposition.getX() - (double) Mth.sin(this.fox.yBodyRot * 0.017453292F), (double)blockposition_mutableblockposition.getY(), (double)blockposition_mutableblockposition.getZ() + (double)Mth.cos(this.fox.yBodyRot * 0.017453292F), itemstack);
|
|
||||||
EntityDropItemEvent event = new EntityDropItemEvent(this.fox.getBukkitEntity(), (org.bukkit.entity.Item)entityitem.getBukkitEntity());
|
|
||||||
entityitem.level.getCraftServer().getPluginManager().callEvent(event);
|
|
||||||
if (!event.isCancelled()) {
|
|
||||||
this.fox.level.addFreshEntity(entityitem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void tick() {
|
public void tick() {
|
||||||
if (this.ownerPlayer != null && this.goalPos != null) {
|
if (this.ownerPlayer != null && this.goalPos != null) {
|
||||||
this.fox.setSitting(false);
|
this.fox.setSitting(false);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>net.seanomik</groupId>
|
<groupId>net.seanomik</groupId>
|
||||||
<artifactId>tamablefoxes-parent</artifactId>
|
<artifactId>tamablefoxes-parent</artifactId>
|
||||||
<version>2.1.2-SNAPSHOT</version>
|
<version>2.1.3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -99,38 +99,10 @@ public class FoxPathfinderGoalSleepWithOwner extends Goal {
|
||||||
|
|
||||||
public void stop() {
|
public void stop() {
|
||||||
this.fox.setSleeping(false);
|
this.fox.setSleeping(false);
|
||||||
float f = this.fox.level.getTimeOfDay(1.0F);
|
|
||||||
if (this.ownerPlayer.getSleepTimer() >= 100 && (double)f > 0.77D && (double)f < 0.8D && (double)this.fox.level.getRandom().nextFloat() < 0.7D) {
|
|
||||||
this.giveMorningGift();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.onBedTicks = 0;
|
this.onBedTicks = 0;
|
||||||
this.fox.getNavigation().stop();
|
this.fox.getNavigation().stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void giveMorningGift() {
|
|
||||||
Random random = this.fox.getRandom();
|
|
||||||
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
|
|
||||||
blockposition_mutableblockposition.set(this.fox.blockPosition());
|
|
||||||
this.fox.randomTeleport((double)(blockposition_mutableblockposition.getX() + random.nextInt(11) - 5), (double)(blockposition_mutableblockposition.getY() + random.nextInt(5) - 2), (double)(blockposition_mutableblockposition.getZ() + random.nextInt(11) - 5), false);
|
|
||||||
blockposition_mutableblockposition.set(this.fox.blockPosition());
|
|
||||||
LootTable loottable = this.fox.level.getServer().getLootTables().get(BuiltInLootTables.CAT_MORNING_GIFT);
|
|
||||||
net.minecraft.world.level.storage.loot.LootContext.Builder loottableinfo_builder = (new net.minecraft.world.level.storage.loot.LootContext.Builder((ServerLevel)this.fox.level)).withParameter(LootContextParams.ORIGIN, this.fox.position()).withParameter(LootContextParams.THIS_ENTITY, this.fox).withRandom(random);
|
|
||||||
List<ItemStack> list = loottable.getRandomItems(loottableinfo_builder.create(LootContextParamSets.GIFT));
|
|
||||||
Iterator iterator = list.iterator();
|
|
||||||
|
|
||||||
while(iterator.hasNext()) {
|
|
||||||
ItemStack itemstack = (ItemStack)iterator.next();
|
|
||||||
ItemEntity entityitem = new ItemEntity(this.fox.level, (double)blockposition_mutableblockposition.getX() - (double) Mth.sin(this.fox.yBodyRot * 0.017453292F), (double)blockposition_mutableblockposition.getY(), (double)blockposition_mutableblockposition.getZ() + (double)Mth.cos(this.fox.yBodyRot * 0.017453292F), itemstack);
|
|
||||||
EntityDropItemEvent event = new EntityDropItemEvent(this.fox.getBukkitEntity(), (org.bukkit.entity.Item)entityitem.getBukkitEntity());
|
|
||||||
entityitem.level.getCraftServer().getPluginManager().callEvent(event);
|
|
||||||
if (!event.isCancelled()) {
|
|
||||||
this.fox.level.addFreshEntity(entityitem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void tick() {
|
public void tick() {
|
||||||
if (this.ownerPlayer != null && this.goalPos != null) {
|
if (this.ownerPlayer != null && this.goalPos != null) {
|
||||||
this.fox.setSitting(false);
|
this.fox.setSitting(false);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>net.seanomik</groupId>
|
<groupId>net.seanomik</groupId>
|
||||||
<artifactId>tamablefoxes-parent</artifactId>
|
<artifactId>tamablefoxes-parent</artifactId>
|
||||||
<version>2.1.2-SNAPSHOT</version>
|
<version>2.1.3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>tamablefoxes</artifactId>
|
<artifactId>tamablefoxes</artifactId>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>net.seanomik</groupId>
|
<groupId>net.seanomik</groupId>
|
||||||
<artifactId>tamablefoxes-parent</artifactId>
|
<artifactId>tamablefoxes-parent</artifactId>
|
||||||
<version>2.1.2-SNAPSHOT</version>
|
<version>2.1.3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>tamablefoxes-util</artifactId>
|
<artifactId>tamablefoxes-util</artifactId>
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<groupId>net.seanomik</groupId>
|
<groupId>net.seanomik</groupId>
|
||||||
<artifactId>tamablefoxes-parent</artifactId>
|
<artifactId>tamablefoxes-parent</artifactId>
|
||||||
<version>2.1.2-SNAPSHOT</version>
|
<version>2.1.3-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
|
Loading…
Reference in New Issue