Skip to content

Commit

Permalink
3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
baguchi committed Mar 24, 2024
1 parent d080103 commit 2075d29
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 67 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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
15 changes: 1 addition & 14 deletions src/main/java/baguchan/better_with_aquatic/block/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
46 changes: 0 additions & 46 deletions src/main/java/baguchan/better_with_aquatic/mixin/EntityMixin.java
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -30,45 +25,4 @@ public void checkAndHandleWater(CallbackInfoReturnable<Boolean> 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;
}
}

0 comments on commit 2075d29

Please sign in to comment.