From 2bd52a3320816c51b9f4e7587b1a0130b5409565 Mon Sep 17 00:00:00 2001 From: OpenBagTwo Date: Sun, 30 Oct 2022 10:50:20 -0400 Subject: [PATCH 1/3] download BCLib from modrinth if not using local lib --- build.gradle | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 18579e29..3babb2d9 100644 --- a/build.gradle +++ b/build.gradle @@ -29,6 +29,17 @@ repositories { maven { url "https://ladysnake.jfrog.io/artifactory/mods" } maven { url = "https://dvs1.progwml6.com/files/maven/" } maven { url = "https://modmaven.dev" } + exclusiveContent { + forRepository { + maven { + name = "Modrinth" + url = "https://api.modrinth.com/maven" + } + } + filter { + includeGroup "maven.modrinth" + } + } flatDir { dirs 'libs' } @@ -53,7 +64,7 @@ dependencies { if (local_bclib) { implementation(project(path: ":BCLib", configuration: 'dev')) } 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-api-fabric:${project.rei_version}" From f8b3873ba1b123cba9e69c5acdb86dabb0b81b9e Mon Sep 17 00:00:00 2001 From: OpenBagTwo Date: Sun, 30 Oct 2022 13:07:46 -0400 Subject: [PATCH 2/3] Change silk moth breeding food ... from wheat! --- .../betterend/entity/SilkMothEntity.java | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/betterx/betterend/entity/SilkMothEntity.java b/src/main/java/org/betterx/betterend/entity/SilkMothEntity.java index 6e58e229..b5ead6b6 100644 --- a/src/main/java/org/betterx/betterend/entity/SilkMothEntity.java +++ b/src/main/java/org/betterx/betterend/entity/SilkMothEntity.java @@ -1,12 +1,17 @@ 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.MHelper; import org.betterx.betterend.BetterEnd; import org.betterx.betterend.blocks.EndBlockProperties; +import org.betterx.betterend.blocks.basis.EndPlantBlock; import org.betterx.betterend.registry.EndBlocks; -import org.betterx.betterend.registry.EndEntities; import org.betterx.betterend.registry.EndItems; import net.minecraft.core.BlockPos; @@ -46,7 +51,7 @@ import net.minecraft.world.phys.Vec3; import java.util.EnumSet; import org.jetbrains.annotations.Nullable; -public class SilkMothEntity extends DespawnableAnimal implements FlyingAnimal { +public class SilkMothEntity extends Animal implements FlyingAnimal { private BlockPos hivePos; private BlockPos entrance; private Level hiveWorld; @@ -76,11 +81,12 @@ public class SilkMothEntity extends DespawnableAnimal implements FlyingAnimal { @Override public boolean canBeLeashed(Player player) { - return false; + return true; } @Override public void addAdditionalSaveData(CompoundTag tag) { + super.addAdditionalSaveData(tag); if (hivePos != null) { tag.put("HivePos", NbtUtils.writeBlockPos(hivePos)); tag.putString("HiveWorld", hiveWorld.dimension().location().toString()); @@ -89,6 +95,7 @@ public class SilkMothEntity extends DespawnableAnimal implements FlyingAnimal { @Override public void readAdditionalSaveData(CompoundTag tag) { + super.readAdditionalSaveData(tag); if (tag.contains("HivePos")) { hivePos = NbtUtils.readBlockPos(tag.getCompound("HivePos")); ResourceLocation worldID = new ResourceLocation(tag.getString("HiveWorld")); @@ -155,7 +162,7 @@ public class SilkMothEntity extends DespawnableAnimal implements FlyingAnimal { @Override public AgeableMob getBreedOffspring(ServerLevel world, AgeableMob entity) { - return EndEntities.SILK_MOTH.create(world); + return SILK_MOTH.create(world); } @Override @@ -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); + } } From d82069ef228ca1798e6bdee1753c08cc032e362b Mon Sep 17 00:00:00 2001 From: OpenBagTwo Date: Sun, 30 Oct 2022 17:39:18 -0400 Subject: [PATCH 3/3] Nugget alert --- .../betterend/entity/model/SilkMothEntityModel.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/org/betterx/betterend/entity/model/SilkMothEntityModel.java b/src/main/java/org/betterx/betterend/entity/model/SilkMothEntityModel.java index af94286c..f853cb04 100644 --- a/src/main/java/org/betterx/betterend/entity/model/SilkMothEntityModel.java +++ b/src/main/java/org/betterx/betterend/entity/model/SilkMothEntityModel.java @@ -1,5 +1,6 @@ package org.betterx.betterend.entity.model; +import org.betterx.betterend.BetterEnd; import org.betterx.betterend.entity.SilkMothEntity; import com.mojang.blaze3d.vertex.PoseStack; @@ -179,9 +180,17 @@ public class SilkMothEntityModel extends EntityModel { float blue, 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); head_pivot.render(matrices, vertices, light, overlay); legsL.render(matrices, vertices, light, overlay); legsR.render(matrices, vertices, light, overlay); + if (this.young) { + matrices.popPose(); + } } }