Skip to content

Commit

Permalink
1.7.0 bulb add!
Browse files Browse the repository at this point in the history
  • Loading branch information
baguchi committed Nov 19, 2023
1 parent 4f49225 commit 48ff582
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/baguchan/better_with_aquatic/block/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));



Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
@@ -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});
}
}
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -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);
}

}
15 changes: 15 additions & 0 deletions src/main/java/baguchan/better_with_aquatic/item/ModItems.java
Original file line number Diff line number Diff line change
@@ -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() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@ public void checkAndHandleWater(CallbackInfoReturnable<Boolean> 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;
}
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/main/resources/lang/better_with_aquatic/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 48ff582

Please sign in to comment.