From 2075d2947e525145aaed3753730fcb3abecbc109 Mon Sep 17 00:00:00 2001 From: baguchan Date: Sun, 24 Mar 2024 13:25:43 +0900 Subject: [PATCH] 3.0.0 --- gradle.properties | 6 +-- .../better_with_aquatic/block/ModBlocks.java | 15 +----- .../crafting/ModCraftings.java | 2 +- .../entity/EntityAnglerFish.java | 6 ++- .../entity/EntityBaseFish.java | 5 +- .../entity/EntityFrog.java | 6 ++- .../mixin/EntityMixin.java | 46 ------------------- 7 files changed, 19 insertions(+), 67 deletions(-) diff --git a/gradle.properties b/gradle.properties index f18ca37..e97bfe6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,16 +1,16 @@ org.gradle.jvmargs=-Xmx2G # BTA -bta_version=7.1-pre1a +bta_version=7.1-pre2a # Loader loader_version=0.15.6-babric.4-bta # HalpLibe -halplibe_version=3.4.14 +halplibe_version=3.4.16 dragonfly_version=1.4.4-7.1 terrain_api_version=1.4.2-7.1 # Mod -mod_version=2.4.0 +mod_version=3.0.0 mod_group=baguchan mod_name=better_with_aquatic diff --git a/src/main/java/baguchan/better_with_aquatic/block/ModBlocks.java b/src/main/java/baguchan/better_with_aquatic/block/ModBlocks.java index a476c25..e24205b 100644 --- a/src/main/java/baguchan/better_with_aquatic/block/ModBlocks.java +++ b/src/main/java/baguchan/better_with_aquatic/block/ModBlocks.java @@ -2,13 +2,10 @@ import baguchan.better_with_aquatic.BetterWithAquatic; import baguchan.better_with_aquatic.util.IDUtils; -import net.minecraft.client.sound.block.BlockSounds; import net.minecraft.core.block.Block; import net.minecraft.core.block.material.Material; import net.minecraft.core.block.tag.BlockTags; -import net.minecraft.core.item.Item; -import net.minecraft.core.item.block.ItemBlock; -import net.minecraft.core.item.tag.ItemTags; +import net.minecraft.core.sound.BlockSounds; import turniplabs.halplibe.helper.BlockBuilder; public class ModBlocks { @@ -98,15 +95,5 @@ public static void createBlocks() { } static { - Item.itemsList[sea_grass.id] = new ItemBlock(sea_grass); - Item.itemsList[sea_grass_flow.id] = new ItemBlock(sea_grass_flow); - Item.itemsList[coral_blue.id] = new ItemBlock(coral_blue); - Item.itemsList[coral_cyan.id] = new ItemBlock(coral_cyan); - Item.itemsList[coral_green.id] = new ItemBlock(coral_green); - Item.itemsList[coral_pink.id] = new ItemBlock(coral_pink); - Item.itemsList[coral_purple.id] = new ItemBlock(coral_purple); - Item.itemsList[coral_red.id] = new ItemBlock(coral_red); - Item.itemsList[coral_yellow.id] = new ItemBlock(coral_yellow); - Item.itemsList[light_blub.id] = new ItemBlock(light_blub).withTags(ItemTags.renderFullbright); } } diff --git a/src/main/java/baguchan/better_with_aquatic/crafting/ModCraftings.java b/src/main/java/baguchan/better_with_aquatic/crafting/ModCraftings.java index c0cf29e..f3f4675 100644 --- a/src/main/java/baguchan/better_with_aquatic/crafting/ModCraftings.java +++ b/src/main/java/baguchan/better_with_aquatic/crafting/ModCraftings.java @@ -18,6 +18,6 @@ public class ModCraftings implements RecipeEntrypoint { public void onRecipesReady() { AQUATIC.register("workbench", WORKBENCH); Registries.RECIPES.register("aquatic", AQUATIC); - DataLoader.loadRecipes("/assets/better_with_aquatic/recipes/workbench.json"); + DataLoader.loadRecipesFromFile("/assets/better_with_aquatic/recipes/workbench.json"); } } diff --git a/src/main/java/baguchan/better_with_aquatic/entity/EntityAnglerFish.java b/src/main/java/baguchan/better_with_aquatic/entity/EntityAnglerFish.java index c1a3995..28424b8 100644 --- a/src/main/java/baguchan/better_with_aquatic/entity/EntityAnglerFish.java +++ b/src/main/java/baguchan/better_with_aquatic/entity/EntityAnglerFish.java @@ -14,10 +14,14 @@ public EntityAnglerFish(World world) { super(world); this.setSize(0.5F, 0.45F); this.setPos(this.x, this.y, this.z); - this.health = 5; this.skinName = "angler_fish"; } + @Override + public int getMaxHealth() { + return 5; + } + @Override public String getEntityTexture() { return "/assets/better_with_aquatic/entity/angler_fish.png"; diff --git a/src/main/java/baguchan/better_with_aquatic/entity/EntityBaseFish.java b/src/main/java/baguchan/better_with_aquatic/entity/EntityBaseFish.java index 235e22f..c8ccea9 100644 --- a/src/main/java/baguchan/better_with_aquatic/entity/EntityBaseFish.java +++ b/src/main/java/baguchan/better_with_aquatic/entity/EntityBaseFish.java @@ -18,7 +18,6 @@ public abstract class EntityBaseFish extends EntityWaterAnimal implements IPathG public EntityBaseFish(World world) { super(world); this.scoreValue = 20; - this.health = 3; this.heightOffset = 0.1F; this.footSize = 0.0F; this.moveSpeed = 0.1F; @@ -28,6 +27,10 @@ public EntityBaseFish(World world) { this.setPathfindingMalus(this, BlockPath.OPEN, -1.0F); } + @Override + public int getMaxHealth() { + return 3; + } @Override public String getLivingSound() { diff --git a/src/main/java/baguchan/better_with_aquatic/entity/EntityFrog.java b/src/main/java/baguchan/better_with_aquatic/entity/EntityFrog.java index 991c5e8..0d8cc2e 100644 --- a/src/main/java/baguchan/better_with_aquatic/entity/EntityFrog.java +++ b/src/main/java/baguchan/better_with_aquatic/entity/EntityFrog.java @@ -35,13 +35,17 @@ public EntityFrog(World world) { this.frogJumpDelay = 20; this.scoreValue = 0; - this.health = 6; this.heightOffset = 0.0F; this.moveSpeed = 0.75F; this.setSize(0.45F, 0.35F); this.setPos(this.x, this.y, this.z); } + @Override + public int getMaxHealth() { + return 6; + } + @Override public String getLivingSound() { return null; diff --git a/src/main/java/baguchan/better_with_aquatic/mixin/EntityMixin.java b/src/main/java/baguchan/better_with_aquatic/mixin/EntityMixin.java index ff9edba..9ba58f8 100644 --- a/src/main/java/baguchan/better_with_aquatic/mixin/EntityMixin.java +++ b/src/main/java/baguchan/better_with_aquatic/mixin/EntityMixin.java @@ -1,19 +1,14 @@ package baguchan.better_with_aquatic.mixin; -import net.minecraft.core.block.Block; -import net.minecraft.core.block.BlockFluid; import net.minecraft.core.block.material.Material; import net.minecraft.core.entity.Entity; -import net.minecraft.core.util.helper.MathHelper; import net.minecraft.core.util.phys.AABB; -import net.minecraft.core.util.phys.Vec3d; import net.minecraft.core.world.World; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(value = Entity.class, remap = false) @@ -30,45 +25,4 @@ public void checkAndHandleWater(CallbackInfoReturnable cir) { cir.setReturnValue(true); } } - - @Inject(method = "baseTick", at = @At(value = "INVOKE", target = "Lnet/minecraft/core/entity/Entity;checkAndHandleWater()Z", shift = At.Shift.AFTER)) - public void baseTick(CallbackInfo ci) { - Entity entity = ((Entity) (Object) this); - moveWithMaterialAcceleration(this.bb, Material.water, entity); - - } - - private boolean moveWithMaterialAcceleration(AABB axisalignedbb, Material material, Entity entity) { - int j1; - int i = MathHelper.floor_double(axisalignedbb.minX); - int j = MathHelper.floor_double(axisalignedbb.maxX + 1.0); - int k = MathHelper.floor_double(axisalignedbb.minY); - int l = MathHelper.floor_double(axisalignedbb.maxY + 1.0); - int i1 = MathHelper.floor_double(axisalignedbb.minZ); - if (!this.world.areBlocksLoaded(i, k, i1, j, l, j1 = MathHelper.floor_double(axisalignedbb.maxZ + 1.0))) { - return false; - } - boolean flag = false; - Vec3d vec3d = Vec3d.createVector(0.0, 0.0, 0.0); - for (int k1 = i; k1 < j; ++k1) { - for (int l1 = k; l1 < l; ++l1) { - for (int i2 = i1; i2 < j1; ++i2) { - double d1; - Block block = Block.blocksList[this.world.getBlockId(k1, l1, i2)]; - if (block == null || block.blockMaterial != material || !((double) l >= (d1 = (double) ((float) (l1 + 1) - BlockFluid.getWaterVolume(this.world.getBlockMetadata(k1, l1, i2)))))) - continue; - flag = true; - block.handleEntityInside(this.world, k1, l1, i2, entity, vec3d); - } - } - } - if (vec3d.lengthVector() > 0.0) { - vec3d = vec3d.normalize(); - double d = 0.008; - entity.xd += vec3d.xCoord * d; - entity.yd += vec3d.yCoord * d; - entity.zd += vec3d.zCoord * d; - } - return flag; - } }