Skip to content

Commit

Permalink
fixed ID confict even correct id.
Browse files Browse the repository at this point in the history
  • Loading branch information
baguchi committed Nov 26, 2023
1 parent 0ce723c commit 60a5468
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 45 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ bta_version=1.7.7.0_02
loader_version=0.14.19-babric.1-bta

# HalpLibe
halplibe_version=2.7.0
prismatic_version=2.1.1
halplibe_version=2.8.0
dragonfly_version=0.4.1
terrain_api_version=1.3.1
# Mod
mod_version=1.7.1
mod_version=1.7.2
mod_group=baguchan
mod_name=better_with_aquatic
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ 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");
EntityHelper.createEntity(EntityFish.class, new RenderFish(new FishModel(), 0.3F), BetterWithAquaticPreLaunch.entityID, "Fish");
EntityHelper.createEntity(EntityAnglerFish.class, new RenderAnglerFish(new AnglerFishModel(), 0.4F), BetterWithAquaticPreLaunch.entityID + 1, "AnglerFish");
NetworkHelper.register(SwimPacket.class, true, false);

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package baguchan.better_with_aquatic;

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;
import turniplabs.halplibe.util.ConfigHandler;
import useless.prismaticlibe.helper.ModCheckHelper;

import java.util.Properties;

Expand All @@ -22,19 +20,21 @@ public class BetterWithAquaticPreLaunch implements PreLaunchEntrypoint {
}
}

public static int entityID;
private static boolean enable_swim;
public static final boolean spawnEggsModPresent = ModCheckHelper.checkForMod("spawneggs", ">=1.1.0");


private void handleConfig() {
Properties prop = new Properties();
prop.setProperty("starting_block_id", "561");
prop.setProperty("starting_item_id", "2000");
prop.setProperty("starting_block_id", "3200");
prop.setProperty("starting_item_id", "2600");
prop.setProperty("starting_entity_id", "600");
prop.setProperty("enable_swim", "true");
ConfigHandler config = new ConfigHandler(BetterWithAquatic.MOD_ID, prop);
IDUtils.initIds(
config.getInt("starting_block_id"),
config.getInt("starting_item_id"));

entityID = config.getInt("starting_entity_id");
enable_swim = config.getBoolean("enable_swim");
config.updateConfig();
}
Expand All @@ -46,9 +46,6 @@ public void onPreLaunch() {
Block.lightOpacity[Block.fluidWaterStill.id] = 1;
ModBlocks.createBlocks();
ModItems.onInitialize();
if (spawnEggsModPresent) {
SpawnEggCompat.onInitialize();
}
}


Expand Down
22 changes: 10 additions & 12 deletions src/main/java/baguchan/better_with_aquatic/block/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import net.minecraft.core.item.tag.ItemTags;
import turniplabs.halplibe.helper.BlockBuilder;

import static turniplabs.halplibe.helper.BlockHelper.findOpenIds;

public class ModBlocks {


Expand All @@ -23,7 +21,7 @@ public class ModBlocks {
.setTextures("sea_grass.png")
.setTags(BlockTags.IS_WATER, BlockTags.PLACE_OVERWRITES, BlockTags.SHEARS_DO_SILK_TOUCH)
.setBlockSound(BlockSounds.GRASS)
.build(new BlockWaterPlantStill("sea_grass", findOpenIds(IDUtils.getCurrBlockId()), Material.water));
.build(new BlockWaterPlantStill("sea_grass", IDUtils.getCurrBlockId(), Material.water));
public static final Block sea_grass_flow = new BlockBuilder(BetterWithAquatic.MOD_ID)
.setHardness(0.0f)
.setResistance(100F)
Expand All @@ -32,66 +30,66 @@ public class ModBlocks {
.setBlockDrop(sea_grass)
.setTags(BlockTags.IS_WATER, BlockTags.PLACE_OVERWRITES, BlockTags.SHEARS_DO_SILK_TOUCH, BlockTags.NOT_IN_CREATIVE_MENU)
.setBlockSound(BlockSounds.GRASS)
.build(new BlockWaterPlantFlow("sea_grass_flow", findOpenIds(IDUtils.getCurrBlockId()), Material.water));
.build(new BlockWaterPlantFlow("sea_grass_flow", IDUtils.getCurrBlockId(), Material.water));

public static final Block coral_blue = new BlockBuilder(BetterWithAquatic.MOD_ID)
.setHardness(0.6f)
.setResistance(0.65F)
.setTextures("coral_blue.png")
.setTags(BlockTags.MINEABLE_BY_SHEARS, BlockTags.SHEARS_DO_SILK_TOUCH)
.setBlockSound(BlockSounds.GRASS)
.build(new CoralBlock("coral_blue", findOpenIds(IDUtils.getCurrBlockId()), Material.vegetable));
.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")
.setTags(BlockTags.MINEABLE_BY_SHEARS, BlockTags.SHEARS_DO_SILK_TOUCH)
.setBlockSound(BlockSounds.GRASS)
.build(new CoralBlock("coral_cyan", findOpenIds(IDUtils.getCurrBlockId()), Material.vegetable));
.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")
.setTags(BlockTags.MINEABLE_BY_SHEARS, BlockTags.SHEARS_DO_SILK_TOUCH)
.setBlockSound(BlockSounds.GRASS)
.build(new CoralBlock("coral_green", findOpenIds(IDUtils.getCurrBlockId()), Material.vegetable));
.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")
.setTags(BlockTags.MINEABLE_BY_SHEARS, BlockTags.SHEARS_DO_SILK_TOUCH)
.setBlockSound(BlockSounds.GRASS)
.build(new CoralBlock("coral_pink", findOpenIds(IDUtils.getCurrBlockId()), Material.vegetable));
.build(new CoralBlock("coral_pink", IDUtils.getCurrBlockId(), Material.vegetable));

public static final Block coral_purple = new BlockBuilder(BetterWithAquatic.MOD_ID)
.setHardness(0.6f)
.setResistance(0.65F)
.setTextures("coral_purple.png")
.setTags(BlockTags.MINEABLE_BY_SHEARS, BlockTags.SHEARS_DO_SILK_TOUCH)
.setBlockSound(BlockSounds.GRASS)
.build(new CoralBlock("coral_purple", findOpenIds(IDUtils.getCurrBlockId()), Material.vegetable));
.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")
.setTags(BlockTags.MINEABLE_BY_SHEARS, BlockTags.SHEARS_DO_SILK_TOUCH)
.setBlockSound(BlockSounds.GRASS)
.build(new CoralBlock("coral_red", findOpenIds(IDUtils.getCurrBlockId()), Material.vegetable));
.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")
.setTags(BlockTags.MINEABLE_BY_SHEARS, BlockTags.SHEARS_DO_SILK_TOUCH)
.setBlockSound(BlockSounds.GRASS)
.build(new CoralBlock("coral_yellow", findOpenIds(IDUtils.getCurrBlockId()), Material.vegetable));
.build(new CoralBlock("coral_yellow", 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));
.build(new Block("light_bulb", IDUtils.getCurrBlockId(), Material.metal));



Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
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 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 void onInitialize() {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/baguchan/better_with_aquatic/util/IDUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ public static void initIds(int blockId, int itemId) {
}

public static int getCurrBlockId() {
return curr_block_id;
return curr_block_id++;
}

public static int getCurrItemId() {
return curr_item_id;
return curr_item_id++;
}
}

0 comments on commit 60a5468

Please sign in to comment.