diff --git a/build.gradle b/build.gradle index e3acb4e..69a532c 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,6 @@ loom { customMinecraftManifest.set("https://github.com/Turnip-Labs/bta-manifest-repo/releases/download/v${project.bta_version}/${project.bta_version}.json") } - repositories { mavenCentral() maven { url = "https://jitpack.io" } @@ -103,7 +102,7 @@ dependencies { modImplementation "com.github.Turnip-Labs:bta-halplibe:${project.halplibe_version}" modImplementation "DragonFly:dragonfly:${project.dragonfly_version}" - modImplementation "BetterAI-BTA:better_ai:2.0.1" + modImplementation "BetterAI-BTA:better_ai:3.0.0" modImplementation "ModMenu:ModMenu:2.0.5" implementation "org.slf4j:slf4j-api:1.8.0-beta4" diff --git a/gradle.properties b/gradle.properties index 920e8cc..978fb17 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,15 +1,15 @@ org.gradle.jvmargs=-Xmx2G # BTA -bta_version=7.1 +bta_version=7.2-pre1 # Loader -loader_version=0.15.6-babric.4-bta +loader_version=0.15.6-babric.6-bta # HalpLibe -halplibe_version=3.5.2 -dragonfly_version=1.4.7-7.1 -terrain_api_version=1.4.4-7.1 +halplibe_version=4.0.6 +dragonfly_version=1.5.0-7.2-pre1 +terrain_api_version=1.4.4-7.2-pre1 # Mod mod_version=3.3.0 mod_group=baguchan diff --git a/src/main/java/baguchan/better_with_aquatic/BetterWithAquatic.java b/src/main/java/baguchan/better_with_aquatic/BetterWithAquatic.java index 213e3fc..dd209a4 100644 --- a/src/main/java/baguchan/better_with_aquatic/BetterWithAquatic.java +++ b/src/main/java/baguchan/better_with_aquatic/BetterWithAquatic.java @@ -5,6 +5,7 @@ import baguchan.better_with_aquatic.entity.EntityDrowned; import baguchan.better_with_aquatic.entity.EntityFish; import baguchan.better_with_aquatic.entity.EntityFrog; +import baguchan.better_with_aquatic.entity.render.*; import baguchan.better_with_aquatic.item.ModItems; import baguchan.better_with_aquatic.packet.SwimPacket; import net.fabricmc.api.ModInitializer; @@ -54,10 +55,10 @@ public void beforeGameStart() { Block.lightBlock[Block.fluidWaterStill.id] = 1; ModBlocks.createBlocks(); ModItems.onInitialize(); - EntityHelper.Core.createEntity(EntityFish.class, entityID, "Fish"); - EntityHelper.Core.createEntity(EntityAnglerFish.class, entityID + 1, "AnglerFish"); - EntityHelper.Core.createEntity(EntityDrowned.class, entityID + 2, "Drowned"); - EntityHelper.Core.createEntity(EntityFrog.class, entityID + 3, "Frog"); + EntityHelper.createEntity(EntityFish.class, entityID, "Fish", () -> new RenderFish(new FishModel(), 0.3F)); + EntityHelper.createEntity(EntityAnglerFish.class, entityID + 1, "AnglerFish", () -> new RenderAnglerFish(new FishModel(), 0.4F)); + EntityHelper.createEntity(EntityDrowned.class, entityID + 2, "Drowned", () -> new DrownedRenderer(BetterWithAquaticClient.modelDrowned, 0.5F)); + EntityHelper.createEntity(EntityFrog.class, entityID + 3, "Frog", () -> new FrogRenderer(BetterWithAquaticClient.modelFrog, 0.3f)); MobInfoRegistry.register(EntityFish.class, "section.better_with_aquatic.fish.name", "section.better_with_aquatic.fish.desc", 3, 20, new MobInfoRegistry.MobDrop[]{new MobInfoRegistry.MobDrop(Item.foodFishRaw.getDefaultStack(), 1.0f, 1, 1)}); MobInfoRegistry.register(EntityAnglerFish.class, "section.better_with_aquatic.angler_fish.name", "section.better_with_aquatic.angler_fish.desc", 3, 20, new MobInfoRegistry.MobDrop[]{new MobInfoRegistry.MobDrop(ModItems.small_bulb.getDefaultStack(), 1.0f, 1, 1)}); diff --git a/src/main/java/baguchan/better_with_aquatic/BetterWithAquaticClient.java b/src/main/java/baguchan/better_with_aquatic/BetterWithAquaticClient.java index 716e8f9..d5bd4bd 100644 --- a/src/main/java/baguchan/better_with_aquatic/BetterWithAquaticClient.java +++ b/src/main/java/baguchan/better_with_aquatic/BetterWithAquaticClient.java @@ -1,18 +1,15 @@ package baguchan.better_with_aquatic; import baguchan.better_with_aquatic.block.ModBlocks; -import baguchan.better_with_aquatic.entity.EntityAnglerFish; -import baguchan.better_with_aquatic.entity.EntityDrowned; -import baguchan.better_with_aquatic.entity.EntityFish; -import baguchan.better_with_aquatic.entity.EntityFrog; -import baguchan.better_with_aquatic.entity.render.*; -import net.minecraft.client.render.block.model.BlockModelDispatcher; -import net.minecraft.client.render.block.model.BlockModelRenderBlocks; -import turniplabs.halplibe.helper.EntityHelper; +import baguchan.better_with_aquatic.entity.render.DrownedModel; +import baguchan.better_with_aquatic.entity.render.FrogModel; +import net.minecraft.client.render.block.color.BlockColorCustom; +import net.minecraft.client.render.block.color.BlockColorDispatcher; +import net.minecraft.client.render.colorizer.Colorizers; +import org.useless.dragonfly.helper.ModelHelper; +import org.useless.dragonfly.model.entity.BenchEntityModel; import turniplabs.halplibe.helper.SoundHelper; import turniplabs.halplibe.util.ClientStartEntrypoint; -import useless.dragonfly.helper.ModelHelper; -import useless.dragonfly.model.entity.BenchEntityModel; import static baguchan.better_with_aquatic.BetterWithAquatic.MOD_ID; @@ -26,20 +23,16 @@ public class BetterWithAquaticClient implements ClientStartEntrypoint { @Override public void beforeClientStart() { - EntityHelper.Client.assignEntityRenderer(EntityFish.class, new RenderFish(new FishModel(), 0.3F)); - EntityHelper.Client.assignEntityRenderer(EntityAnglerFish.class, new RenderAnglerFish(new AnglerFishModel(), 0.4F)); - EntityHelper.Client.assignEntityRenderer(EntityDrowned.class, new DrownedRenderer(modelDrowned, 0.5f)); - EntityHelper.Client.assignEntityRenderer(EntityFrog.class, new FrogRenderer(modelFrog, 0.3f)); - SoundHelper.Client.addSound(MOD_ID, "mob/drowned/drowned_idle.wav"); - SoundHelper.Client.addSound(MOD_ID, "mob/drowned/drowned_death.wav"); - SoundHelper.Client.addSound(MOD_ID, "mob/drowned/drowned_hurt.wav"); - SoundHelper.Client.addSound(MOD_ID, "mob/drowned/drowned_hurt_extra.wav"); + SoundHelper.addSound(MOD_ID, "mob/drowned/drowned_idle.wav"); + SoundHelper.addSound(MOD_ID, "mob/drowned/drowned_death.wav"); + SoundHelper.addSound(MOD_ID, "mob/drowned/drowned_hurt.wav"); + SoundHelper.addSound(MOD_ID, "mob/drowned/drowned_hurt_extra.wav"); + } @Override public void afterClientStart() { - BlockModelDispatcher dispatcher = BlockModelDispatcher.getInstance(); - dispatcher.addDispatch(ModBlocks.sea_grass, new BlockModelRenderBlocks(6)); - dispatcher.addDispatch(ModBlocks.sea_grass_flow, new BlockModelRenderBlocks(6)); + BlockColorDispatcher.getInstance().addDispatch(ModBlocks.sea_grass, new BlockColorCustom(Colorizers.water)); + BlockColorDispatcher.getInstance().addDispatch(ModBlocks.sea_grass_flow, new BlockColorCustom(Colorizers.water)); } } diff --git a/src/main/java/baguchan/better_with_aquatic/block/BlockWaterPlantFlow.java b/src/main/java/baguchan/better_with_aquatic/block/BlockWaterPlantFlow.java index 6339907..d239906 100644 --- a/src/main/java/baguchan/better_with_aquatic/block/BlockWaterPlantFlow.java +++ b/src/main/java/baguchan/better_with_aquatic/block/BlockWaterPlantFlow.java @@ -230,12 +230,6 @@ public boolean isCollidable() { return super.isCollidable(); } - @Override - public int getRenderBlockPass() { - return 0; - } - - @Override public ItemStack[] getBreakResult(World world, EnumDropCause dropCause, int x, int y, int z, int meta, TileEntity tileEntity) { switch (dropCause) { @@ -251,4 +245,9 @@ public ItemStack[] getBreakResult(World world, EnumDropCause dropCause, int x, i public boolean canBlockStay(World world, int x, int y, int z) { return (this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z))) && world.getBlock(x, y, z) != null && world.getBlock(x, y, z).blockMaterial == Material.water; } + + @Override + public int getRenderBlockPass() { + return 0; + } } 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 e24205b..52039f7 100644 --- a/src/main/java/baguchan/better_with_aquatic/block/ModBlocks.java +++ b/src/main/java/baguchan/better_with_aquatic/block/ModBlocks.java @@ -1,6 +1,8 @@ package baguchan.better_with_aquatic.block; import baguchan.better_with_aquatic.BetterWithAquatic; +import baguchan.better_with_aquatic.client.render.model.BlockModelSeaGrass; +import baguchan.better_with_aquatic.client.render.model.SeaGrassItemModel; import baguchan.better_with_aquatic.util.IDUtils; import net.minecraft.core.block.Block; import net.minecraft.core.block.material.Material; @@ -15,15 +17,25 @@ public class ModBlocks { .setHardness(0.0f) .setResistance(100F) .setLightOpacity(1) - .setTextures("sea_grass.png") .setTags(BlockTags.IS_WATER, BlockTags.PLACE_OVERWRITES, BlockTags.SHEARS_DO_SILK_TOUCH) .setBlockSound(BlockSounds.GRASS) + .setBlockModel(block -> { + return new BlockModelSeaGrass<>(block).withTextures("better_with_aquatic:block/sea_grass"); + }) + .setItemModel(itemBlock -> { + return new SeaGrassItemModel(itemBlock); + }) .build(new BlockWaterPlantStill("sea_grass", IDUtils.getCurrBlockId(), Material.water).withLitInteriorSurface(true)); public static final Block sea_grass_flow = new BlockBuilder(BetterWithAquatic.MOD_ID) .setHardness(0.0f) .setResistance(100F) .setLightOpacity(1) - .setTextures("sea_grass.png") + .setBlockModel(block -> { + return new BlockModelSeaGrass<>(block).withTextures("better_with_aquatic:block/sea_grass"); + }) + .setItemModel(itemBlock -> { + return new SeaGrassItemModel(itemBlock); + }) .setBlockDrop(sea_grass) .setTags(BlockTags.IS_WATER, BlockTags.PLACE_OVERWRITES, BlockTags.SHEARS_DO_SILK_TOUCH, BlockTags.NOT_IN_CREATIVE_MENU) .setBlockSound(BlockSounds.GRASS) @@ -32,28 +44,28 @@ public class ModBlocks { public static final Block coral_blue = new BlockBuilder(BetterWithAquatic.MOD_ID) .setHardness(0.6f) .setResistance(0.65F) - .setTextures("coral_blue.png") + .setTextures("better_with_aquatic:block/coral_blue") .setTags(BlockTags.MINEABLE_BY_SHEARS, BlockTags.SHEARS_DO_SILK_TOUCH) .setBlockSound(BlockSounds.GRASS) .build(new CoralBlock("coral_blue", IDUtils.getCurrBlockId(), Material.vegetable)); public static final Block coral_cyan = new BlockBuilder(BetterWithAquatic.MOD_ID) .setHardness(0.6f) .setResistance(0.65F) - .setTextures("coral_cyan.png") + .setTextures("better_with_aquatic:block/coral_cyan") .setTags(BlockTags.MINEABLE_BY_SHEARS, BlockTags.SHEARS_DO_SILK_TOUCH) .setBlockSound(BlockSounds.GRASS) .build(new CoralBlock("coral_cyan", IDUtils.getCurrBlockId(), Material.vegetable)); public static final Block coral_green = new BlockBuilder(BetterWithAquatic.MOD_ID) .setHardness(0.6f) .setResistance(0.65F) - .setTextures("coral_green.png") + .setTextures("better_with_aquatic:block/coral_green") .setTags(BlockTags.MINEABLE_BY_SHEARS, BlockTags.SHEARS_DO_SILK_TOUCH) .setBlockSound(BlockSounds.GRASS) .build(new CoralBlock("coral_green", IDUtils.getCurrBlockId(), Material.vegetable)); public static final Block coral_pink = new BlockBuilder(BetterWithAquatic.MOD_ID) .setHardness(0.6f) .setResistance(0.65F) - .setTextures("coral_pink.png") + .setTextures("better_with_aquatic:block/coral_pink") .setTags(BlockTags.MINEABLE_BY_SHEARS, BlockTags.SHEARS_DO_SILK_TOUCH) .setBlockSound(BlockSounds.GRASS) .build(new CoralBlock("coral_pink", IDUtils.getCurrBlockId(), Material.vegetable)); @@ -61,21 +73,21 @@ public class ModBlocks { public static final Block coral_purple = new BlockBuilder(BetterWithAquatic.MOD_ID) .setHardness(0.6f) .setResistance(0.65F) - .setTextures("coral_purple.png") + .setTextures("better_with_aquatic:block/coral_purple") .setTags(BlockTags.MINEABLE_BY_SHEARS, BlockTags.SHEARS_DO_SILK_TOUCH) .setBlockSound(BlockSounds.GRASS) .build(new CoralBlock("coral_purple", IDUtils.getCurrBlockId(), Material.vegetable)); public static final Block coral_red = new BlockBuilder(BetterWithAquatic.MOD_ID) .setHardness(0.6f) .setResistance(0.65F) - .setTextures("coral_red.png") + .setTextures("better_with_aquatic:block/coral_red") .setTags(BlockTags.MINEABLE_BY_SHEARS, BlockTags.SHEARS_DO_SILK_TOUCH) .setBlockSound(BlockSounds.GRASS) .build(new CoralBlock("coral_red", IDUtils.getCurrBlockId(), Material.vegetable)); public static final Block coral_yellow = new BlockBuilder(BetterWithAquatic.MOD_ID) .setHardness(0.6f) .setResistance(0.65F) - .setTextures("coral_yellow.png") + .setTextures("better_with_aquatic:block/coral_yellow") .setTags(BlockTags.MINEABLE_BY_SHEARS, BlockTags.SHEARS_DO_SILK_TOUCH) .setBlockSound(BlockSounds.GRASS) .build(new CoralBlock("coral_yellow", IDUtils.getCurrBlockId(), Material.vegetable)); @@ -83,7 +95,7 @@ public class ModBlocks { .setHardness(0.5f) .setResistance(1.5F) .setLuminance(13) - .setTextures("light_bulb.png") + .setTextures("better_with_aquatic:block/light_bulb") .setTags(BlockTags.MINEABLE_BY_PICKAXE) .setBlockSound(BlockSounds.METAL) .build(new Block("light_bulb", IDUtils.getCurrBlockId(), Material.metal)); diff --git a/src/main/java/baguchan/better_with_aquatic/client/render/model/BlockModelSeaGrass.java b/src/main/java/baguchan/better_with_aquatic/client/render/model/BlockModelSeaGrass.java new file mode 100644 index 0000000..64c059a --- /dev/null +++ b/src/main/java/baguchan/better_with_aquatic/client/render/model/BlockModelSeaGrass.java @@ -0,0 +1,89 @@ +package baguchan.better_with_aquatic.client.render.model; + +import net.minecraft.client.render.LightmapHelper; +import net.minecraft.client.render.block.model.BlockModelStandard; +import net.minecraft.client.render.stitcher.IconCoordinate; +import net.minecraft.client.render.tessellator.Tessellator; +import net.minecraft.core.block.Block; +import net.minecraft.core.util.helper.Side; +import net.minecraft.core.world.WorldSource; + +public class BlockModelSeaGrass + extends BlockModelStandard { + + public BlockModelSeaGrass(Block block) { + super(block); + } + + @Override + public boolean render(Tessellator tessellator, int x, int y, int z) { + this.block.setBlockBoundsBasedOnState(BlockModelSeaGrass.renderBlocks.blockAccess, x, y, z); + float brightness = 1.0f; + if (LightmapHelper.isLightmapEnabled()) { + tessellator.setLightmapCoord(this.block.getLightmapCoord(BlockModelSeaGrass.renderBlocks.blockAccess, x, y, z)); + } else { + brightness = this.getBlockBrightness(BlockModelSeaGrass.renderBlocks.blockAccess, x, y, z); + } + tessellator.setColorOpaque_F(brightness, brightness, brightness); + IconCoordinate texture = this.getBlockTextureFromSideAndMetadata(Side.BOTTOM, BlockModelSeaGrass.renderBlocks.blockAccess.getBlockMetadata(x, y, z)); + if (BlockModelSeaGrass.renderBlocks.overrideBlockTexture != null) { + texture = BlockModelSeaGrass.renderBlocks.overrideBlockTexture; + } + double uMin = texture.getIconUMin(); + double uMax = texture.getIconUMax(); + double vMin = texture.getIconVMin(); + double vMax = texture.getIconVMax(); + double xMin = (double) x + 0.5 - 0.25; + double xMax = (double) x + 0.5 + 0.25; + double zMin = (double) z + 0.5 - 0.5; + double zMax = (double) z + 0.5 + 0.5; + double yd = (float) y - 0.0625f; + tessellator.addVertexWithUV(xMin, yd + 1.0, zMin, uMin, vMin); + tessellator.addVertexWithUV(xMin, yd + 0.0, zMin, uMin, vMax); + tessellator.addVertexWithUV(xMin, yd + 0.0, zMax, uMax, vMax); + tessellator.addVertexWithUV(xMin, yd + 1.0, zMax, uMax, vMin); + tessellator.addVertexWithUV(xMin, yd + 1.0, zMax, uMin, vMin); + tessellator.addVertexWithUV(xMin, yd + 0.0, zMax, uMin, vMax); + tessellator.addVertexWithUV(xMin, yd + 0.0, zMin, uMax, vMax); + tessellator.addVertexWithUV(xMin, yd + 1.0, zMin, uMax, vMin); + tessellator.addVertexWithUV(xMax, yd + 1.0, zMax, uMin, vMin); + tessellator.addVertexWithUV(xMax, yd + 0.0, zMax, uMin, vMax); + tessellator.addVertexWithUV(xMax, yd + 0.0, zMin, uMax, vMax); + tessellator.addVertexWithUV(xMax, yd + 1.0, zMin, uMax, vMin); + tessellator.addVertexWithUV(xMax, yd + 1.0, zMin, uMin, vMin); + tessellator.addVertexWithUV(xMax, yd + 0.0, zMin, uMin, vMax); + tessellator.addVertexWithUV(xMax, yd + 0.0, zMax, uMax, vMax); + tessellator.addVertexWithUV(xMax, yd + 1.0, zMax, uMax, vMin); + xMin = (double) x + 0.5 - 0.5; + xMax = (double) x + 0.5 + 0.5; + zMin = (double) z + 0.5 - 0.25; + zMax = (double) z + 0.5 + 0.25; + tessellator.addVertexWithUV(xMin, yd + 1.0, zMin, uMin, vMin); + tessellator.addVertexWithUV(xMin, yd + 0.0, zMin, uMin, vMax); + tessellator.addVertexWithUV(xMax, yd + 0.0, zMin, uMax, vMax); + tessellator.addVertexWithUV(xMax, yd + 1.0, zMin, uMax, vMin); + tessellator.addVertexWithUV(xMax, yd + 1.0, zMin, uMin, vMin); + tessellator.addVertexWithUV(xMax, yd + 0.0, zMin, uMin, vMax); + tessellator.addVertexWithUV(xMin, yd + 0.0, zMin, uMax, vMax); + tessellator.addVertexWithUV(xMin, yd + 1.0, zMin, uMax, vMin); + tessellator.addVertexWithUV(xMax, yd + 1.0, zMax, uMin, vMin); + tessellator.addVertexWithUV(xMax, yd + 0.0, zMax, uMin, vMax); + tessellator.addVertexWithUV(xMin, yd + 0.0, zMax, uMax, vMax); + tessellator.addVertexWithUV(xMin, yd + 1.0, zMax, uMax, vMin); + tessellator.addVertexWithUV(xMin, yd + 1.0, zMax, uMin, vMin); + tessellator.addVertexWithUV(xMin, yd + 0.0, zMax, uMin, vMax); + tessellator.addVertexWithUV(xMax, yd + 0.0, zMax, uMax, vMax); + tessellator.addVertexWithUV(xMax, yd + 1.0, zMax, uMax, vMin); + return true; + } + + @Override + public boolean shouldItemRender3d() { + return false; + } + + @Override + public boolean shouldSideBeRendered(WorldSource blockAccess, int x, int y, int z, int side) { + return super.shouldSideBeRendered(blockAccess, x, y, z, side); + } +} diff --git a/src/main/java/baguchan/better_with_aquatic/client/render/model/SeaGrassItemModel.java b/src/main/java/baguchan/better_with_aquatic/client/render/model/SeaGrassItemModel.java new file mode 100644 index 0000000..3591cd1 --- /dev/null +++ b/src/main/java/baguchan/better_with_aquatic/client/render/model/SeaGrassItemModel.java @@ -0,0 +1,21 @@ +package baguchan.better_with_aquatic.client.render.model; + +import net.minecraft.client.render.item.model.ItemModelBlock; +import net.minecraft.client.render.stitcher.IconCoordinate; +import net.minecraft.client.render.stitcher.TextureRegistry; +import net.minecraft.core.entity.Entity; +import net.minecraft.core.item.ItemStack; +import net.minecraft.core.item.block.ItemBlock; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class SeaGrassItemModel extends ItemModelBlock { + public SeaGrassItemModel(ItemBlock itemBlock) { + super(itemBlock); + } + + @Override + public @NotNull IconCoordinate getIcon(@Nullable Entity entity, ItemStack itemStack) { + return TextureRegistry.getTexture("better_with_aquatic:block/sea_grass"); + } +} 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 ab7fd4f..01979f2 100644 --- a/src/main/java/baguchan/better_with_aquatic/crafting/ModCraftings.java +++ b/src/main/java/baguchan/better_with_aquatic/crafting/ModCraftings.java @@ -26,7 +26,6 @@ public void onRecipesReady() { @Override public void initNamespaces() { - RecipeEntrypoint.super.initNamespaces(); RecipeBuilder.initNameSpace(MOD_ID); } } 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 28424b8..6e12177 100644 --- a/src/main/java/baguchan/better_with_aquatic/entity/EntityAnglerFish.java +++ b/src/main/java/baguchan/better_with_aquatic/entity/EntityAnglerFish.java @@ -14,7 +14,6 @@ public EntityAnglerFish(World world) { super(world); this.setSize(0.5F, 0.45F); this.setPos(this.x, this.y, this.z); - this.skinName = "angler_fish"; } @Override @@ -24,12 +23,12 @@ public int getMaxHealth() { @Override public String getEntityTexture() { - return "/assets/better_with_aquatic/entity/angler_fish.png"; + return "/assets/better_with_aquatic/textures/entity/angler_fish.png"; } @Override public String getDefaultEntityTexture() { - return "/assets/better_with_aquatic/entity/angler_fish.png"; + return "/assets/better_with_aquatic/textures/entity/angler_fish.png"; } diff --git a/src/main/java/baguchan/better_with_aquatic/entity/EntityDrowned.java b/src/main/java/baguchan/better_with_aquatic/entity/EntityDrowned.java index 729e320..760cdaa 100644 --- a/src/main/java/baguchan/better_with_aquatic/entity/EntityDrowned.java +++ b/src/main/java/baguchan/better_with_aquatic/entity/EntityDrowned.java @@ -24,17 +24,16 @@ public EntityDrowned(World world) { this.setPathFinder(this, new BetterSwimWalkPathFinder(world)); this.setPathfindingMalus(this, BlockPath.WATER, 0.0F); this.footSize = 1f; - this.skinName = "drowned"; } @Override public String getEntityTexture() { - return "/assets/better_with_aquatic/entity/drowned.png"; + return "/assets/better_with_aquatic/textures/entity/drowned.png"; } @Override public String getDefaultEntityTexture() { - return "/assets/better_with_aquatic/entity/drowned.png"; + return "/assets/better_with_aquatic/textures/entity/drowned.png"; } @Override diff --git a/src/main/java/baguchan/better_with_aquatic/entity/EntityFish.java b/src/main/java/baguchan/better_with_aquatic/entity/EntityFish.java index bba8b24..55bd665 100644 --- a/src/main/java/baguchan/better_with_aquatic/entity/EntityFish.java +++ b/src/main/java/baguchan/better_with_aquatic/entity/EntityFish.java @@ -9,18 +9,16 @@ public EntityFish(World world) { super(world); this.setSize(0.45F, 0.45F); this.setPos(this.x, this.y, this.z); - - this.skinName = "fish"; } @Override public String getEntityTexture() { - return "/assets/better_with_aquatic/entity/fish.png"; + return "/assets/better_with_aquatic/textures/entity/fish.png"; } @Override public String getDefaultEntityTexture() { - return "/assets/better_with_aquatic/entity/fish.png"; + return "/assets/better_with_aquatic/textures/entity/fish.png"; } @Override 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 0d8cc2e..7af1d4b 100644 --- a/src/main/java/baguchan/better_with_aquatic/entity/EntityFrog.java +++ b/src/main/java/baguchan/better_with_aquatic/entity/EntityFrog.java @@ -12,7 +12,7 @@ import net.minecraft.core.util.helper.MathHelper; import net.minecraft.core.util.phys.Vec3d; import net.minecraft.core.world.World; -import useless.dragonfly.model.entity.AnimationState; +import org.useless.dragonfly.model.entity.AnimationState; import java.util.Comparator; import java.util.List; @@ -31,7 +31,6 @@ public EntityFrog(World world) { this.setPathFinder(this, new BetterSwimWalkPathFinder(world)); this.setPathfindingMalus(this, BlockPath.WATER, 0.0F); this.footSize = 1f; - this.skinName = "frog"; this.frogJumpDelay = 20; this.scoreValue = 0; @@ -63,12 +62,12 @@ protected String getDeathSound() { @Override public String getEntityTexture() { - return "/assets/better_with_aquatic/entity/frog.png"; + return "/assets/better_with_aquatic/textures/entity/frog.png"; } @Override public String getDefaultEntityTexture() { - return "/assets/better_with_aquatic/entity/frog.png"; + return "/assets/better_with_aquatic/textures/entity/frog.png"; } diff --git a/src/main/java/baguchan/better_with_aquatic/entity/render/DrownedModel.java b/src/main/java/baguchan/better_with_aquatic/entity/render/DrownedModel.java index 5f765ac..1eaf410 100644 --- a/src/main/java/baguchan/better_with_aquatic/entity/render/DrownedModel.java +++ b/src/main/java/baguchan/better_with_aquatic/entity/render/DrownedModel.java @@ -3,7 +3,7 @@ import baguchan.better_with_aquatic.entity.EntityDrowned; import net.minecraft.core.entity.EntityLiving; import net.minecraft.core.util.helper.MathHelper; -import useless.dragonfly.model.entity.BenchEntityModel; +import org.useless.dragonfly.model.entity.BenchEntityModel; public class DrownedModel extends BenchEntityModel { diff --git a/src/main/java/baguchan/better_with_aquatic/entity/render/DrownedRenderer.java b/src/main/java/baguchan/better_with_aquatic/entity/render/DrownedRenderer.java index 467361c..862c0ea 100644 --- a/src/main/java/baguchan/better_with_aquatic/entity/render/DrownedRenderer.java +++ b/src/main/java/baguchan/better_with_aquatic/entity/render/DrownedRenderer.java @@ -2,7 +2,7 @@ import baguchan.better_with_aquatic.entity.EntityDrowned; import net.minecraft.client.render.entity.LivingRenderer; -import useless.dragonfly.model.entity.BenchEntityModel; +import org.useless.dragonfly.model.entity.BenchEntityModel; public class DrownedRenderer extends LivingRenderer { public DrownedRenderer(BenchEntityModel orCreateEntityModel, float v) { diff --git a/src/main/java/baguchan/better_with_aquatic/entity/render/FrogModel.java b/src/main/java/baguchan/better_with_aquatic/entity/render/FrogModel.java index 668f010..daca031 100644 --- a/src/main/java/baguchan/better_with_aquatic/entity/render/FrogModel.java +++ b/src/main/java/baguchan/better_with_aquatic/entity/render/FrogModel.java @@ -3,9 +3,9 @@ import baguchan.better_with_aquatic.entity.EntityFrog; import net.minecraft.core.entity.EntityLiving; import net.minecraft.core.util.helper.MathHelper; -import useless.dragonfly.helper.AnimationHelper; -import useless.dragonfly.model.entity.BenchEntityModel; -import useless.dragonfly.model.entity.animation.Animation; +import org.useless.dragonfly.helper.AnimationHelper; +import org.useless.dragonfly.model.entity.BenchEntityModel; +import org.useless.dragonfly.model.entity.animation.Animation; import static baguchan.better_with_aquatic.BetterWithAquatic.MOD_ID; diff --git a/src/main/java/baguchan/better_with_aquatic/entity/render/FrogRenderer.java b/src/main/java/baguchan/better_with_aquatic/entity/render/FrogRenderer.java index 25e8286..e458a43 100644 --- a/src/main/java/baguchan/better_with_aquatic/entity/render/FrogRenderer.java +++ b/src/main/java/baguchan/better_with_aquatic/entity/render/FrogRenderer.java @@ -2,7 +2,7 @@ import baguchan.better_with_aquatic.entity.EntityFrog; import net.minecraft.client.render.entity.LivingRenderer; -import useless.dragonfly.model.entity.BenchEntityModel; +import org.useless.dragonfly.model.entity.BenchEntityModel; public class FrogRenderer extends LivingRenderer { public FrogRenderer(BenchEntityModel orCreateEntityModel, float v) { diff --git a/src/main/java/baguchan/better_with_aquatic/entity/render/RenderAnglerFish.java b/src/main/java/baguchan/better_with_aquatic/entity/render/RenderAnglerFish.java index 1012790..02a300f 100644 --- a/src/main/java/baguchan/better_with_aquatic/entity/render/RenderAnglerFish.java +++ b/src/main/java/baguchan/better_with_aquatic/entity/render/RenderAnglerFish.java @@ -15,7 +15,7 @@ public RenderAnglerFish(ModelBase modelbase, float shadowSize) { protected boolean setAnglerBrightness(EntityAnglerFish spider, int i, float f) { if (i == 0) { - this.loadTexture("/assets/better_with_aquatic/entity/angler_fish_overlay.png"); + this.loadTexture("/assets/better_with_aquatic/textures/entity/angler_fish_overlay.png"); float brightness = spider.getBrightness(1.0f); if (Minecraft.getMinecraft((Object) this).fullbright) { brightness = 1.0f; diff --git a/src/main/java/baguchan/better_with_aquatic/item/ModItems.java b/src/main/java/baguchan/better_with_aquatic/item/ModItems.java index 02a3844..a4124e5 100644 --- a/src/main/java/baguchan/better_with_aquatic/item/ModItems.java +++ b/src/main/java/baguchan/better_with_aquatic/item/ModItems.java @@ -3,11 +3,10 @@ import baguchan.better_with_aquatic.BetterWithAquatic; import baguchan.better_with_aquatic.util.IDUtils; import net.minecraft.core.item.Item; -import net.minecraft.core.item.tag.ItemTags; -import turniplabs.halplibe.helper.ItemHelper; +import turniplabs.halplibe.helper.ItemBuilder; public class ModItems { - public static final Item small_bulb = ItemHelper.createItem(BetterWithAquatic.MOD_ID, new Item("small_bulb", IDUtils.getCurrItemId()).withTags(ItemTags.renderFullbright), "small_bulb", "small_bulb.png"); + public static final Item small_bulb = new ItemBuilder(BetterWithAquatic.MOD_ID).build(new Item("small_bulb", IDUtils.getCurrItemId())); public static void onInitialize() { diff --git a/src/main/java/baguchan/better_with_aquatic/mixin/EntityPlayerMixin.java b/src/main/java/baguchan/better_with_aquatic/mixin/EntityPlayerMixin.java index a3d1583..a0a3a95 100644 --- a/src/main/java/baguchan/better_with_aquatic/mixin/EntityPlayerMixin.java +++ b/src/main/java/baguchan/better_with_aquatic/mixin/EntityPlayerMixin.java @@ -11,6 +11,7 @@ import net.minecraft.core.util.helper.MathHelper; import net.minecraft.core.world.World; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -18,6 +19,9 @@ @Mixin(value = EntityPlayer.class, remap = false) public abstract class EntityPlayerMixin extends EntityLiving implements ISwiming { + @Shadow + protected abstract void resetHeight(); + @Unique public boolean swimming; @Unique @@ -39,7 +43,7 @@ public void setSwimming(boolean p_20274_) { } else if (!p_20274_ && this.swimming) { this.setSize(0.6F, 1.8F); - this.heightOffset = 1.62f; + this.resetHeight(); this.setPos(this.x, this.y + 1.2F, this.z); } this.swimming = p_20274_; diff --git a/src/main/java/baguchan/better_with_aquatic/mixin/client/ChunkRendererMixin.java b/src/main/java/baguchan/better_with_aquatic/mixin/client/ChunkRendererMixin.java index 01c0790..3a5861a 100644 --- a/src/main/java/baguchan/better_with_aquatic/mixin/client/ChunkRendererMixin.java +++ b/src/main/java/baguchan/better_with_aquatic/mixin/client/ChunkRendererMixin.java @@ -5,6 +5,7 @@ import net.minecraft.client.render.RenderBlocks; import net.minecraft.client.render.block.model.BlockModel; import net.minecraft.client.render.block.model.BlockModelDispatcher; +import net.minecraft.client.render.tessellator.Tessellator; import net.minecraft.core.block.Block; import net.minecraft.core.world.chunk.ChunkCache; import org.spongepowered.asm.mixin.Mixin; @@ -27,7 +28,7 @@ private void updateRenderer(CallbackInfo ci, int minX, int minY, int minZ, int m BlockModel model = BlockModelDispatcher.getInstance().getDispatch(Block.fluidWaterStill); - this.skipRenderPass[1] = model.render(Block.fluidWaterStill, x, y, z); + this.skipRenderPass[1] = model.render(Tessellator.instance, x, y, z); } } @@ -35,7 +36,7 @@ private void updateRenderer(CallbackInfo ci, int minX, int minY, int minZ, int m if (renderPass == 1) { BlockModel model = BlockModelDispatcher.getInstance().getDispatch(Block.fluidWaterStill); - this.skipRenderPass[1] = model.render(Block.fluidWaterFlowing, x, y, z); + this.skipRenderPass[1] = model.render(Tessellator.instance, x, y, z); } } } diff --git a/src/main/java/baguchan/better_with_aquatic/mixin/client/EntityClientPlayerMPMixin.java b/src/main/java/baguchan/better_with_aquatic/mixin/client/EntityPlayerMPMixin.java similarity index 77% rename from src/main/java/baguchan/better_with_aquatic/mixin/client/EntityClientPlayerMPMixin.java rename to src/main/java/baguchan/better_with_aquatic/mixin/client/EntityPlayerMPMixin.java index 8e376e3..cbbdbbc 100644 --- a/src/main/java/baguchan/better_with_aquatic/mixin/client/EntityClientPlayerMPMixin.java +++ b/src/main/java/baguchan/better_with_aquatic/mixin/client/EntityPlayerMPMixin.java @@ -7,7 +7,6 @@ import net.minecraft.client.entity.player.EntityPlayerSP; import net.minecraft.client.net.handler.NetClientHandler; import net.minecraft.core.player.Session; -import net.minecraft.core.util.phys.AABB; import net.minecraft.core.world.World; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; @@ -16,25 +15,21 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(value = EntityClientPlayerMP.class, remap = false) -public abstract class EntityClientPlayerMPMixin extends EntityPlayerSP implements ISwiming { +public abstract class EntityPlayerMPMixin extends EntityPlayerSP implements ISwiming { @Unique public boolean swimmingOld; - @Unique - public AABB oldAABB; - public float oldOffset; - public float oldWidth; - public float oldHeight; - public EntityClientPlayerMPMixin(Minecraft minecraft, World world, Session session, NetClientHandler netclienthandler) { + public EntityPlayerMPMixin(Minecraft minecraft, World world, Session session, NetClientHandler netclienthandler) { super(minecraft, world, session, 0); } @Inject(method = "func_4056_N", at = @At("HEAD")) public void func_4056_N(CallbackInfo callbackInfo) { if (this.isSwimming() != this.swimmingOld) { - this.swimmingOld = this.isSwimming(); EntityClientPlayerMP clientPlayerMP = (EntityClientPlayerMP) (Object) this; clientPlayerMP.sendQueue.addToSendQueue(new SwimPacket(this.isSwimming())); + + this.swimmingOld = this.isSwimming(); } } diff --git a/src/main/resources/assets/better_with_aquatic/anim/animations.json b/src/main/resources/assets/better_with_aquatic/anim/animations.json new file mode 100644 index 0000000..5cac7c5 --- /dev/null +++ b/src/main/resources/assets/better_with_aquatic/anim/animations.json @@ -0,0 +1,9 @@ +{ + "animations": [ + { + "type": "terrain", + "id": "better_with_aquatic:sea_grass", + "name": "sea_grass" + } + ] +} diff --git a/src/main/resources/assets/better_with_aquatic/anim/sea_grass.json b/src/main/resources/assets/better_with_aquatic/anim/sea_grass.json new file mode 100644 index 0000000..e889644 --- /dev/null +++ b/src/main/resources/assets/better_with_aquatic/anim/sea_grass.json @@ -0,0 +1,3 @@ +{ + "frametime": 4 +} diff --git a/src/main/resources/assets/better_with_aquatic/block/sea_grass.png b/src/main/resources/assets/better_with_aquatic/anim/sea_grass.png similarity index 100% rename from src/main/resources/assets/better_with_aquatic/block/sea_grass.png rename to src/main/resources/assets/better_with_aquatic/anim/sea_grass.png diff --git a/src/main/resources/assets/better_with_aquatic/model/entity/drowned.geo.json b/src/main/resources/assets/better_with_aquatic/models/entity/drowned.geo.json similarity index 100% rename from src/main/resources/assets/better_with_aquatic/model/entity/drowned.geo.json rename to src/main/resources/assets/better_with_aquatic/models/entity/drowned.geo.json diff --git a/src/main/resources/assets/better_with_aquatic/model/entity/frog.geo.json b/src/main/resources/assets/better_with_aquatic/models/entity/frog.geo.json similarity index 100% rename from src/main/resources/assets/better_with_aquatic/model/entity/frog.geo.json rename to src/main/resources/assets/better_with_aquatic/models/entity/frog.geo.json diff --git a/src/main/resources/assets/better_with_aquatic/block/coral_blue.png b/src/main/resources/assets/better_with_aquatic/textures/block/coral_blue.png similarity index 100% rename from src/main/resources/assets/better_with_aquatic/block/coral_blue.png rename to src/main/resources/assets/better_with_aquatic/textures/block/coral_blue.png diff --git a/src/main/resources/assets/better_with_aquatic/block/coral_cyan.png b/src/main/resources/assets/better_with_aquatic/textures/block/coral_cyan.png similarity index 100% rename from src/main/resources/assets/better_with_aquatic/block/coral_cyan.png rename to src/main/resources/assets/better_with_aquatic/textures/block/coral_cyan.png diff --git a/src/main/resources/assets/better_with_aquatic/block/coral_green.png b/src/main/resources/assets/better_with_aquatic/textures/block/coral_green.png similarity index 100% rename from src/main/resources/assets/better_with_aquatic/block/coral_green.png rename to src/main/resources/assets/better_with_aquatic/textures/block/coral_green.png diff --git a/src/main/resources/assets/better_with_aquatic/block/coral_pink.png b/src/main/resources/assets/better_with_aquatic/textures/block/coral_pink.png similarity index 100% rename from src/main/resources/assets/better_with_aquatic/block/coral_pink.png rename to src/main/resources/assets/better_with_aquatic/textures/block/coral_pink.png diff --git a/src/main/resources/assets/better_with_aquatic/block/coral_purple.png b/src/main/resources/assets/better_with_aquatic/textures/block/coral_purple.png similarity index 100% rename from src/main/resources/assets/better_with_aquatic/block/coral_purple.png rename to src/main/resources/assets/better_with_aquatic/textures/block/coral_purple.png diff --git a/src/main/resources/assets/better_with_aquatic/block/coral_red.png b/src/main/resources/assets/better_with_aquatic/textures/block/coral_red.png similarity index 100% rename from src/main/resources/assets/better_with_aquatic/block/coral_red.png rename to src/main/resources/assets/better_with_aquatic/textures/block/coral_red.png diff --git a/src/main/resources/assets/better_with_aquatic/block/coral_yellow.png b/src/main/resources/assets/better_with_aquatic/textures/block/coral_yellow.png similarity index 100% rename from src/main/resources/assets/better_with_aquatic/block/coral_yellow.png rename to src/main/resources/assets/better_with_aquatic/textures/block/coral_yellow.png diff --git a/src/main/resources/assets/better_with_aquatic/block/light_bulb.png b/src/main/resources/assets/better_with_aquatic/textures/block/light_bulb.png similarity index 100% rename from src/main/resources/assets/better_with_aquatic/block/light_bulb.png rename to src/main/resources/assets/better_with_aquatic/textures/block/light_bulb.png diff --git a/src/main/resources/assets/better_with_aquatic/textures/block/sea_grass.png b/src/main/resources/assets/better_with_aquatic/textures/block/sea_grass.png new file mode 100644 index 0000000..1bf06d0 Binary files /dev/null and b/src/main/resources/assets/better_with_aquatic/textures/block/sea_grass.png differ diff --git a/src/main/resources/assets/better_with_aquatic/entity/angler_fish.png b/src/main/resources/assets/better_with_aquatic/textures/entity/angler_fish.png similarity index 100% rename from src/main/resources/assets/better_with_aquatic/entity/angler_fish.png rename to src/main/resources/assets/better_with_aquatic/textures/entity/angler_fish.png diff --git a/src/main/resources/assets/better_with_aquatic/entity/angler_fish_overlay.png b/src/main/resources/assets/better_with_aquatic/textures/entity/angler_fish_overlay.png similarity index 100% rename from src/main/resources/assets/better_with_aquatic/entity/angler_fish_overlay.png rename to src/main/resources/assets/better_with_aquatic/textures/entity/angler_fish_overlay.png diff --git a/src/main/resources/assets/better_with_aquatic/entity/drowned.png b/src/main/resources/assets/better_with_aquatic/textures/entity/drowned.png similarity index 100% rename from src/main/resources/assets/better_with_aquatic/entity/drowned.png rename to src/main/resources/assets/better_with_aquatic/textures/entity/drowned.png diff --git a/src/main/resources/assets/better_with_aquatic/entity/fish.png b/src/main/resources/assets/better_with_aquatic/textures/entity/fish.png similarity index 100% rename from src/main/resources/assets/better_with_aquatic/entity/fish.png rename to src/main/resources/assets/better_with_aquatic/textures/entity/fish.png diff --git a/src/main/resources/assets/better_with_aquatic/entity/frog.png b/src/main/resources/assets/better_with_aquatic/textures/entity/frog.png similarity index 100% rename from src/main/resources/assets/better_with_aquatic/entity/frog.png rename to src/main/resources/assets/better_with_aquatic/textures/entity/frog.png diff --git a/src/main/resources/assets/better_with_aquatic/entity/frog_green.png b/src/main/resources/assets/better_with_aquatic/textures/entity/frog_green.png similarity index 100% rename from src/main/resources/assets/better_with_aquatic/entity/frog_green.png rename to src/main/resources/assets/better_with_aquatic/textures/entity/frog_green.png diff --git a/src/main/resources/assets/better_with_aquatic/item/small_bulb.png b/src/main/resources/assets/better_with_aquatic/textures/item/small_bulb.png similarity index 100% rename from src/main/resources/assets/better_with_aquatic/item/small_bulb.png rename to src/main/resources/assets/better_with_aquatic/textures/item/small_bulb.png diff --git a/src/main/resources/assets/better_with_aquatic/item/spawnEggDefault.png b/src/main/resources/assets/better_with_aquatic/textures/item/spawnEggDefault.png similarity index 100% rename from src/main/resources/assets/better_with_aquatic/item/spawnEggDefault.png rename to src/main/resources/assets/better_with_aquatic/textures/item/spawnEggDefault.png diff --git a/src/main/resources/better_with_aquatic.mixins.json b/src/main/resources/better_with_aquatic.mixins.json index 1f0702b..d2b9b59 100644 --- a/src/main/resources/better_with_aquatic.mixins.json +++ b/src/main/resources/better_with_aquatic.mixins.json @@ -14,7 +14,7 @@ ], "client": [ "client.ChunkRendererMixin", - "client.EntityClientPlayerMPMixin", + "client.EntityPlayerMPMixin", "client.EntityPlayerSPMixin", "client.ModelPlayerMixin", "client.PlayerInputMixin", diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 793bc51..e72ef53 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -43,11 +43,11 @@ ], "depends": { - "fabricloader": ">=0.13.3", - "halplibe": ">=3.4.14", - "dragonfly": ">=1.4.5-7.1", - "better_ai": ">=2.0.1", - "terrain-api": ">=1.4.2-7.1" + "fabricloader": ">=0.15.6-babric.6-bta", + "halplibe": ">=4.0.6-beta.1", + "dragonfly": ">=1.5.0-7.2-pre1", + "better_ai": ">=3.0.0", + "terrain-api": ">=1.4.4-7.2-pre1" }, "suggests": { }