Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ repositories {
url = 'https://ladysnake.jfrog.io/artifactory/mods'
}
maven { url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/' }
maven { url "https://maven.shedaniel.me/" }
maven { url "https://maven.terraformersmc.com/releases/" }
}

dependencies {
Expand All @@ -58,6 +60,11 @@ dependencies {
modCompileOnly "maven.modrinth:sodium:${sodium_version}"
modRuntimeOnly "maven.modrinth:sodium:${sodium_version}"
implementation "org.joml:joml:1.10.4"

modApi("me.shedaniel.cloth:cloth-config-fabric:8.2.88") {
exclude(group: "net.fabricmc.fabric-api")
}
modApi "com.terraformersmc:modmenu:4.2.0-beta.2"
}

processResources {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import static com.eightsidedsquare.angling.core.AnglingMod.MOD_ID;

public class AnglingClient implements ClientModInitializer {

@Override
public void onInitializeClient() {
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(),
Expand Down Expand Up @@ -84,7 +85,6 @@ public void onInitializeClient() {
ParticleFactoryRegistry.getInstance().register(AnglingParticles.WORM, WormParticle.Factory::new);

ModelPredicateProviderRegistry.register(AnglingItems.DONGFISH_BUCKET, new Identifier(MOD_ID, "has_horngus"), this::dongfishBucketItemHasHorngus);

}

private float dongfishBucketItemHasHorngus(ItemStack stack, ClientWorld clientWorld, LivingEntity livingEntity, int i) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.eightsidedsquare.angling.config;

import me.shedaniel.autoconfig.ConfigData;
import me.shedaniel.autoconfig.annotation.Config;
import me.shedaniel.autoconfig.annotation.ConfigEntry;

@Config(name = "angling")
public class AnglingConfig implements ConfigData {
@ConfigEntry.Category("client")
public boolean hideWaterBehindGlass = true;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.eightsidedsquare.angling.config;

import com.eightsidedsquare.angling.config.AnglingConfig;
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
import com.terraformersmc.modmenu.api.ModMenuApi;
import me.shedaniel.autoconfig.AutoConfig;

public class ModMenuIntegration implements ModMenuApi {
@Override
public ConfigScreenFactory<?> getModConfigScreenFactory() {
return parent -> AutoConfig.getConfigScreen(AnglingConfig.class, parent).get();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

import com.eightsidedsquare.angling.common.entity.util.*;
import com.eightsidedsquare.angling.common.world.PelicanSpawner;
import com.eightsidedsquare.angling.config.AnglingConfig;
import com.eightsidedsquare.angling.core.world.AnglingPlacedFeatures;
import me.shedaniel.autoconfig.AutoConfig;
import me.shedaniel.autoconfig.serializer.JanksonConfigSerializer;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import software.bernie.geckolib3.GeckoLib;

public class AnglingMod implements ModInitializer {
public static final String MOD_ID = "angling";
public static AnglingConfig CONFIG;

@Override
public void onInitialize() {
Expand All @@ -29,5 +33,8 @@ public void onInitialize() {

PelicanSpawner spawner = new PelicanSpawner();
ServerTickEvents.END_WORLD_TICK.register(world -> spawner.spawn(world, world.getServer().isMonsterSpawningEnabled(), world.getServer().shouldSpawnAnimals()));

AutoConfig.register(AnglingConfig.class, JanksonConfigSerializer::new);
CONFIG = AutoConfig.getConfigHolder(AnglingConfig.class).getConfig();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.eightsidedsquare.angling.mixin;

import com.eightsidedsquare.angling.core.AnglingMod;
import net.fabricmc.fabric.api.tag.convention.v1.ConventionalBlockTags;
import net.minecraft.block.BlockState;
import net.minecraft.client.render.block.FluidRenderer;
Expand All @@ -18,7 +19,7 @@ public abstract class FluidRendererMixin {

@Inject(method = "shouldRenderSide", at = @At("HEAD"), cancellable = true)
private static void shouldRenderSide(BlockRenderView world, BlockPos pos, FluidState fluidState, BlockState blockState, Direction direction, FluidState neighborFluidState, CallbackInfoReturnable<Boolean> cir) {
if(fluidState.isIn(FluidTags.WATER)) {
if(AnglingMod.CONFIG.hideWaterBehindGlass && fluidState.isIn(FluidTags.WATER)) {
if(world.getBlockState(pos.offset(direction)).isIn(ConventionalBlockTags.GLASS_BLOCKS)) {
cir.setReturnValue(false);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.eightsidedsquare.angling.mixin.integration;

import com.eightsidedsquare.angling.core.AnglingMod;
import me.jellysquid.mods.sodium.client.render.pipeline.FluidRenderer;
import net.fabricmc.fabric.api.tag.convention.v1.ConventionalBlockTags;
import net.minecraft.block.BlockState;
Expand All @@ -22,7 +23,7 @@ public abstract class SodiumFluidRendererMixin {

@Inject(method = "isFluidOccluded", at = @At("RETURN"), cancellable = true)
private void isFluidOccluded(BlockRenderView world, int x, int y, int z, Direction dir, Fluid fluid, CallbackInfoReturnable<Boolean> cir) {
if(!cir.getReturnValue()) {
if(AnglingMod.CONFIG.hideWaterBehindGlass && !cir.getReturnValue()) {
BlockState state = world.getBlockState(new BlockPos(scratchPos).offset(dir.getOpposite()));
BlockState sideState = world.getBlockState(scratchPos);
if(state.getFluidState().isIn(FluidTags.WATER) && sideState.isIn(ConventionalBlockTags.GLASS_BLOCKS)) {
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/assets/angling/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,7 @@
"advancements.husbandry.traded_with_pelican.title": "Paying the Bill",
"advancements.husbandry.traded_with_pelican.description": "Trade the Fish inside a Pelican's Beak for another Fish",
"advancements.husbandry.look_at_nautilus.title": "Cephalopod Activities",
"advancements.husbandry.look_at_nautilus.description": "Observe a Nautilus"
"advancements.husbandry.look_at_nautilus.description": "Observe a Nautilus",
"text.autoconfig.angling.title": "Angling Config",
"text.autoconfig.angling.option.hideWaterBehindGlass": "Hide Water Behind Glass"
}
7 changes: 6 additions & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
],
"preLaunch": [
"com.eightsidedsquare.angling.core.AnglingPreLaunch"
],
"modmenu": [
"com.eightsidedsquare.angling.config.ModMenuIntegration"
]
},
"mixins": [
Expand All @@ -41,13 +44,15 @@
"fabricloader": ">=0.14.6",
"fabric": "*",
"minecraft": "~1.19",
"java": ">=17"
"java": ">=17",
"cloth-config2": ">=8.0.0"
},
"custom": {
"cardinal-components": [
"angling:fish_spawning"
]
},
"suggests": {
"modmenu": ">=4.0.0"
}
}