Merge remote-tracking branch 'origin/1.19' into 1.19

This commit is contained in:
Frank 2022-11-18 19:56:35 +01:00
commit daece9a38d
3 changed files with 45 additions and 5 deletions

View file

@ -29,6 +29,17 @@ repositories {
maven { url "https://ladysnake.jfrog.io/artifactory/mods" } maven { url "https://ladysnake.jfrog.io/artifactory/mods" }
maven { url = "https://dvs1.progwml6.com/files/maven/" } maven { url = "https://dvs1.progwml6.com/files/maven/" }
maven { url = "https://modmaven.dev" } maven { url = "https://modmaven.dev" }
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
filter {
includeGroup "maven.modrinth"
}
}
flatDir { flatDir {
dirs 'libs' dirs 'libs'
} }
@ -53,7 +64,7 @@ dependencies {
if (local_bclib) { if (local_bclib) {
implementation(project(path: ":BCLib", configuration: 'dev')) implementation(project(path: ":BCLib", configuration: 'dev'))
} else { } else {
modImplementation "com.github.quiqueck:BCLib:${project.bclib_version}" modImplementation "maven.modrinth:BCLib:${project.bclib_version}"
} }
modCompileOnly "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}" modCompileOnly "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}"
modCompileOnly "me.shedaniel:RoughlyEnoughItems-api-fabric:${project.rei_version}" modCompileOnly "me.shedaniel:RoughlyEnoughItems-api-fabric:${project.rei_version}"

View file

@ -1,12 +1,17 @@
package org.betterx.betterend.entity; package org.betterx.betterend.entity;
import org.betterx.bclib.entity.DespawnableAnimal; import static org.betterx.betterend.registry.EndEntities.SILK_MOTH;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.animal.Animal;
import net.minecraft.world.item.BlockItem;
import org.betterx.bclib.util.BlocksHelper; import org.betterx.bclib.util.BlocksHelper;
import org.betterx.bclib.util.MHelper; import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.BetterEnd; import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.blocks.EndBlockProperties; import org.betterx.betterend.blocks.EndBlockProperties;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndEntities;
import org.betterx.betterend.registry.EndItems; import org.betterx.betterend.registry.EndItems;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
@ -46,7 +51,7 @@ import net.minecraft.world.phys.Vec3;
import java.util.EnumSet; import java.util.EnumSet;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
public class SilkMothEntity extends DespawnableAnimal implements FlyingAnimal { public class SilkMothEntity extends Animal implements FlyingAnimal {
private BlockPos hivePos; private BlockPos hivePos;
private BlockPos entrance; private BlockPos entrance;
private Level hiveWorld; private Level hiveWorld;
@ -76,11 +81,12 @@ public class SilkMothEntity extends DespawnableAnimal implements FlyingAnimal {
@Override @Override
public boolean canBeLeashed(Player player) { public boolean canBeLeashed(Player player) {
return false; return true;
} }
@Override @Override
public void addAdditionalSaveData(CompoundTag tag) { public void addAdditionalSaveData(CompoundTag tag) {
super.addAdditionalSaveData(tag);
if (hivePos != null) { if (hivePos != null) {
tag.put("HivePos", NbtUtils.writeBlockPos(hivePos)); tag.put("HivePos", NbtUtils.writeBlockPos(hivePos));
tag.putString("HiveWorld", hiveWorld.dimension().location().toString()); tag.putString("HiveWorld", hiveWorld.dimension().location().toString());
@ -89,6 +95,7 @@ public class SilkMothEntity extends DespawnableAnimal implements FlyingAnimal {
@Override @Override
public void readAdditionalSaveData(CompoundTag tag) { public void readAdditionalSaveData(CompoundTag tag) {
super.readAdditionalSaveData(tag);
if (tag.contains("HivePos")) { if (tag.contains("HivePos")) {
hivePos = NbtUtils.readBlockPos(tag.getCompound("HivePos")); hivePos = NbtUtils.readBlockPos(tag.getCompound("HivePos"));
ResourceLocation worldID = new ResourceLocation(tag.getString("HiveWorld")); ResourceLocation worldID = new ResourceLocation(tag.getString("HiveWorld"));
@ -322,4 +329,17 @@ public class SilkMothEntity extends DespawnableAnimal implements FlyingAnimal {
} }
} }
} }
@Override
public boolean isFood(ItemStack itemStack) {
if (!(itemStack.getItem() instanceof BlockItem)){
return false;
}
return ((BlockItem) (itemStack.getItem())).getBlock() instanceof EndPlantBlock;
}
@Override
public InteractionResult mobInteract(Player player, InteractionHand interactionHand) {
return super.mobInteract(player, interactionHand);
}
} }

View file

@ -1,5 +1,6 @@
package org.betterx.betterend.entity.model; package org.betterx.betterend.entity.model;
import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.entity.SilkMothEntity; import org.betterx.betterend.entity.SilkMothEntity;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
@ -179,9 +180,17 @@ public class SilkMothEntityModel extends EntityModel<SilkMothEntity> {
float blue, float blue,
float alpha float alpha
) { ) {
if (this.young) {
matrices.pushPose();
matrices.scale(0.6f, 0.6f, 0.6f);
matrices.translate(0f, 0.5f, 0f);
}
bb_main.render(matrices, vertices, light, overlay); bb_main.render(matrices, vertices, light, overlay);
head_pivot.render(matrices, vertices, light, overlay); head_pivot.render(matrices, vertices, light, overlay);
legsL.render(matrices, vertices, light, overlay); legsL.render(matrices, vertices, light, overlay);
legsR.render(matrices, vertices, light, overlay); legsR.render(matrices, vertices, light, overlay);
if (this.young) {
matrices.popPose();
}
} }
} }