diff --git a/README.md b/README.md index 6e800a2..968cfda 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,6 @@ LukeisStuff - He sent me the coral texture. - BTA 1.7.7.0_02 - Babric - Halplibe https://github.com/Turnip-Labs/bta-halplibe -- prismatic https://github.com/UselessBullets/BTA_Babric_PrismaticLibe +- dragon fly https://github.com/UselessBullets/DragonFly - Better AI BTA - Terrain API https://bta-modding.nouma-vallee.fr/Useless/terrainapi/ diff --git a/gradle.properties b/gradle.properties index 6093577..e11755d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,6 +11,6 @@ halplibe_version=2.7.0 prismatic_version=2.1.1 terrain_api_version=1.3.1 # Mod -mod_version=1.6.5 +mod_version=1.7.0 mod_group=baguchan mod_name=better_with_aquatic diff --git a/src/main/java/baguchan/better_with_aquatic/BetterWithAquatic.java b/src/main/java/baguchan/better_with_aquatic/BetterWithAquatic.java index cbf24c5..51362c7 100644 --- a/src/main/java/baguchan/better_with_aquatic/BetterWithAquatic.java +++ b/src/main/java/baguchan/better_with_aquatic/BetterWithAquatic.java @@ -1,5 +1,6 @@ package baguchan.better_with_aquatic; +import baguchan.better_with_aquatic.crafting.ModCraftings; import baguchan.better_with_aquatic.entity.EntityAnglerFish; import baguchan.better_with_aquatic.entity.EntityFish; import baguchan.better_with_aquatic.entity.render.AnglerFishModel; @@ -18,6 +19,7 @@ public class BetterWithAquatic implements ModInitializer { @Override public void onInitialize() { + ModCraftings.register(); EntityHelper.createEntity(EntityFish.class, new RenderFish(new FishModel(), 0.3F), 600, "Fish"); EntityHelper.createEntity(EntityAnglerFish.class, new RenderAnglerFish(new AnglerFishModel(), 0.4F), 601, "AnglerFish"); NetworkHelper.register(SwimPacket.class, true, false); diff --git a/src/main/java/baguchan/better_with_aquatic/BetterWithAquaticPreLaunch.java b/src/main/java/baguchan/better_with_aquatic/BetterWithAquaticPreLaunch.java index ed1e570..ddf0786 100644 --- a/src/main/java/baguchan/better_with_aquatic/BetterWithAquaticPreLaunch.java +++ b/src/main/java/baguchan/better_with_aquatic/BetterWithAquaticPreLaunch.java @@ -2,6 +2,7 @@ import baguchan.better_with_aquatic.block.ModBlocks; import baguchan.better_with_aquatic.compat.SpawnEggCompat; +import baguchan.better_with_aquatic.item.ModItems; import baguchan.better_with_aquatic.util.IDUtils; import net.fabricmc.loader.api.entrypoint.PreLaunchEntrypoint; import net.minecraft.core.block.Block; @@ -44,6 +45,7 @@ public void onPreLaunch() { Block.lightOpacity[Block.fluidWaterFlowing.id] = 1; Block.lightOpacity[Block.fluidWaterStill.id] = 1; ModBlocks.createBlocks(); + ModItems.onInitialize(); if (spawnEggsModPresent) { SpawnEggCompat.onInitialize(); } 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 5a41cb7..eafd28c 100644 --- a/src/main/java/baguchan/better_with_aquatic/block/ModBlocks.java +++ b/src/main/java/baguchan/better_with_aquatic/block/ModBlocks.java @@ -8,6 +8,7 @@ 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 turniplabs.halplibe.helper.BlockBuilder; import static turniplabs.halplibe.helper.BlockHelper.findOpenIds; @@ -83,6 +84,14 @@ public class ModBlocks { .setTags(BlockTags.MINEABLE_BY_SHEARS, BlockTags.SHEARS_DO_SILK_TOUCH) .setBlockSound(BlockSounds.GRASS) .build(new CoralBlock("coral_yellow", findOpenIds(IDUtils.getCurrBlockId()), Material.vegetable)); + public static final Block light_blub = new BlockBuilder(BetterWithAquatic.MOD_ID) + .setHardness(0.5f) + .setResistance(1.5F) + .setLuminance(13) + .setTextures("light_bulb.png") + .setTags(BlockTags.MINEABLE_BY_PICKAXE) + .setBlockSound(BlockSounds.METAL) + .build(new Block("light_bulb", findOpenIds(IDUtils.getCurrBlockId()), Material.metal)); @@ -99,5 +108,6 @@ public static void createBlocks() { 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 new file mode 100644 index 0000000..bb7d654 --- /dev/null +++ b/src/main/java/baguchan/better_with_aquatic/crafting/ModCraftings.java @@ -0,0 +1,15 @@ +package baguchan.better_with_aquatic.crafting; + +import baguchan.better_with_aquatic.block.ModBlocks; +import baguchan.better_with_aquatic.item.ModItems; +import turniplabs.halplibe.helper.RecipeHelper; + +public class ModCraftings { + public static void register() { + RecipeHelper.Crafting.createRecipe(ModBlocks.light_blub, 1, new Object[]{ + "TTT", + "TTT", + "TTT", + 'T', ModItems.small_bulb}); + } +} 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 f427923..bb19390 100644 --- a/src/main/java/baguchan/better_with_aquatic/entity/EntityAnglerFish.java +++ b/src/main/java/baguchan/better_with_aquatic/entity/EntityAnglerFish.java @@ -1,7 +1,9 @@ package baguchan.better_with_aquatic.entity; +import baguchan.better_with_aquatic.item.ModItems; import net.minecraft.core.entity.Entity; import net.minecraft.core.entity.player.EntityPlayer; +import net.minecraft.core.item.ItemStack; import net.minecraft.core.util.helper.DamageType; import net.minecraft.core.world.World; @@ -60,4 +62,10 @@ protected void attackEntity(Entity entity, float distance) { entity.hurt(this, 1, DamageType.COMBAT); } } + + @Override + protected void dropFewItems() { + this.spawnAtLocation(new ItemStack(ModItems.small_bulb, 1, 0), 0.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 new file mode 100644 index 0000000..6235a0f --- /dev/null +++ b/src/main/java/baguchan/better_with_aquatic/item/ModItems.java @@ -0,0 +1,15 @@ +package baguchan.better_with_aquatic.item; + +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; + +public class ModItems { + public static final Item small_bulb = ItemHelper.createItem(BetterWithAquatic.MOD_ID, new Item("small_bulb", ItemHelper.findOpenIds(IDUtils.getCurrItemId())).withTags(ItemTags.renderFullbright), "small_bulb", "small_bulb.png"); + + + public static void onInitialize() { + } +} diff --git a/src/main/java/baguchan/better_with_aquatic/mixin/EntityItemMixin.java b/src/main/java/baguchan/better_with_aquatic/mixin/EntityItemMixin.java index ad024fa..667412f 100644 --- a/src/main/java/baguchan/better_with_aquatic/mixin/EntityItemMixin.java +++ b/src/main/java/baguchan/better_with_aquatic/mixin/EntityItemMixin.java @@ -24,11 +24,15 @@ public void checkAndHandleWater(CallbackInfoReturnable cir) { } } - @Inject(method = "tick", at = @At("TAIL")) + @Inject(method = "tick", at = @At(value = "FIELD", target = "Lnet/minecraft/core/entity/EntityItem;yd:D", ordinal = 0)) public void tick(CallbackInfo ci) { if (this.wasInWater) { - this.yd += 0.1F; - this.yd *= (double) 0.85f; + this.yd += 0.045F; + if (this.yd > 0.0) { + this.xd *= (double) 0.95f; + this.yd *= (double) 0.95f; + this.zd *= (double) 0.95f; + } } } } diff --git a/src/main/resources/assets/better_with_aquatic/block/light_bulb.png b/src/main/resources/assets/better_with_aquatic/block/light_bulb.png new file mode 100644 index 0000000..8b63015 Binary files /dev/null and b/src/main/resources/assets/better_with_aquatic/block/light_bulb.png differ diff --git a/src/main/resources/assets/better_with_aquatic/item/small_bulb.png b/src/main/resources/assets/better_with_aquatic/item/small_bulb.png new file mode 100644 index 0000000..84839ce Binary files /dev/null and b/src/main/resources/assets/better_with_aquatic/item/small_bulb.png differ diff --git a/src/main/resources/lang/better_with_aquatic/en_US.lang b/src/main/resources/lang/better_with_aquatic/en_US.lang index 7846263..bdd108e 100644 --- a/src/main/resources/lang/better_with_aquatic/en_US.lang +++ b/src/main/resources/lang/better_with_aquatic/en_US.lang @@ -22,5 +22,11 @@ tile.better_with_aquatic.coral_purple.desc=A purple bioluminescent bone like blo tile.better_with_aquatic.coral_pink.name=Carnation Coral tile.better_with_aquatic.coral_pink.desc=A pink bioluminescent bone like block found in oceans. +tile.better_with_aquatic.light_bulb.name=Light Bulb +tile.better_with_aquatic.light_bulb.desc=Glow as warm... + + item.better_with_aquatic.spawnegg.fish.name=Fish item.better_with_aquatic.spawnegg.angler_fish.name=Angler Fish + +item.better_with_aquatic.small_bulb.name=Small Bulb