Skip to content

Commit

Permalink
fix (karkinos_claw, armor_renderer): Removed conflicting features wit…
Browse files Browse the repository at this point in the history
…h syntra
  • Loading branch information
ionutsoran committed Dec 20, 2024
1 parent a966d53 commit 7fdf13d
Show file tree
Hide file tree
Showing 21 changed files with 542 additions and 544 deletions.
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ repositories {
name = "Geckolib"
url = "https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/"
}

maven {
name = "JamiesWhiteShirt"
url = "https://maven.jamieswhiteshirt.com/libs-release/"
}

maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven/"
Expand Down Expand Up @@ -70,7 +70,6 @@ dependencies {
modRuntimeOnly "io.github.flemmli97:debugutils:$minecraft_version-$debug_utils_version-fabric"
modRuntimeOnly "maven.modrinth:carpet:$carpet_version"

include modImplementation("com.jamieswhiteshirt:reach-entity-attributes:$reach_entity_attributes_version")
}

loom {
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ mod_menu_version=7.2.2
geckolib_version=1.20.1:4.4.4
debug_utils_version=1.0.5
carpet_version=1.4.112
reach_entity_attributes_version=2.4.0

# Meta
mod_id=hybrid-aquatic
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ private void onRender(DrawContext context, float tickDelta, CallbackInfo ci) {

if (player != null && client.options.getPerspective().isFirstPerson()) {
ItemStack helmet = player.getInventory().getArmorStack(3);
if (helmet.getItem() == HybridAquaticItems.INSTANCE.getDIVING_HELMET()) {
renderDivingHelmetOverlay(context);
}
// if (helmet.getItem() == HybridAquaticItems.INSTANCE.getDIVING_HELMET()) {
// renderDivingHelmetOverlay(context);
// }
}
if (player != null && player.hasStatusEffect(HybridAquaticStatusEffects.INSTANCE.getINKED())) {
renderInkedOverlay(context);
Expand Down
12 changes: 6 additions & 6 deletions src/client/kotlin/dev/hybridlabs/aquatic/HybridAquaticClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ object HybridAquaticClient : ClientModInitializer {
}

private fun registerGeoRenderers() {
GeoRenderProviderStorage.divingArmorRenderProvider = createBasicRenderProvider(::DivingArmorRenderer)
GeoRenderProviderStorage.seashellArmorRenderProvider = createBasicRenderProvider(::SeashellArmorRenderer)
GeoRenderProviderStorage.manglerfishArmorRenderProvider = createBasicRenderProvider(::ManglerfishArmorRenderer)
GeoRenderProviderStorage.turtleArmorRenderProvider = createBasicRenderProvider(::TurtleArmorRenderer)
GeoRenderProviderStorage.eelArmorRenderProvider = createBasicRenderProvider(::EelArmorRenderer)
GeoRenderProviderStorage.moonjellyfishArmorRenderProvider = createBasicRenderProvider(::MoonJellyfishArmorRenderer)
// GeoRenderProviderStorage.divingArmorRenderProvider = createBasicRenderProvider(::DivingArmorRenderer)
// GeoRenderProviderStorage.seashellArmorRenderProvider = createBasicRenderProvider(::SeashellArmorRenderer)
// GeoRenderProviderStorage.manglerfishArmorRenderProvider = createBasicRenderProvider(::ManglerfishArmorRenderer)
// GeoRenderProviderStorage.turtleArmorRenderProvider = createBasicRenderProvider(::TurtleArmorRenderer)
// GeoRenderProviderStorage.eelArmorRenderProvider = createBasicRenderProvider(::EelArmorRenderer)
// GeoRenderProviderStorage.moonjellyfishArmorRenderProvider = createBasicRenderProvider(::MoonJellyfishArmorRenderer)
}

private fun createBasicRenderProvider(rendererProvider: () -> GeoArmorRenderer<*>): () -> RenderProvider {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package dev.hybridlabs.aquatic.client.render.armor

import dev.hybridlabs.aquatic.HybridAquatic
import dev.hybridlabs.aquatic.item.DivingArmorItem
import net.minecraft.util.Identifier
import software.bernie.geckolib.model.DefaultedItemGeoModel
import software.bernie.geckolib.renderer.GeoArmorRenderer

class DivingArmorRenderer : GeoArmorRenderer<DivingArmorItem>(
DefaultedItemGeoModel(Identifier(HybridAquatic.MOD_ID, "armor/diving_armor"))
)
//package dev.hybridlabs.aquatic.client.render.armor
//
//import dev.hybridlabs.aquatic.HybridAquatic
//import dev.hybridlabs.aquatic.item.DivingArmorItem
//import net.minecraft.util.Identifier
//import software.bernie.geckolib.model.DefaultedItemGeoModel
//import software.bernie.geckolib.renderer.GeoArmorRenderer
//
//class DivingArmorRenderer : GeoArmorRenderer<DivingArmorItem>(
// DefaultedItemGeoModel(Identifier(HybridAquatic.MOD_ID, "armor/diving_armor"))
//)
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package dev.hybridlabs.aquatic.client.render.armor

import dev.hybridlabs.aquatic.HybridAquatic
import dev.hybridlabs.aquatic.item.DivingArmorItem
import net.minecraft.util.Identifier
import software.bernie.geckolib.model.DefaultedItemGeoModel
import software.bernie.geckolib.renderer.GeoArmorRenderer

class ManglerfishArmorRenderer : GeoArmorRenderer<DivingArmorItem>(
DefaultedItemGeoModel(Identifier(HybridAquatic.MOD_ID, "armor/manglerfish_armor"))
)
//package dev.hybridlabs.aquatic.client.render.armor
//
//import dev.hybridlabs.aquatic.HybridAquatic
//import dev.hybridlabs.aquatic.item.DivingArmorItem
//import net.minecraft.util.Identifier
//import software.bernie.geckolib.model.DefaultedItemGeoModel
//import software.bernie.geckolib.renderer.GeoArmorRenderer
//
//class ManglerfishArmorRenderer : GeoArmorRenderer<DivingArmorItem>(
// DefaultedItemGeoModel(Identifier(HybridAquatic.MOD_ID, "armor/manglerfish_armor"))
//)
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package dev.hybridlabs.aquatic.client.render.armor

import dev.hybridlabs.aquatic.HybridAquatic
import dev.hybridlabs.aquatic.item.DivingArmorItem
import net.minecraft.util.Identifier
import software.bernie.geckolib.model.DefaultedItemGeoModel
import software.bernie.geckolib.renderer.GeoArmorRenderer

class SeashellArmorRenderer : GeoArmorRenderer<DivingArmorItem>(
DefaultedItemGeoModel(Identifier(HybridAquatic.MOD_ID, "armor/seashell_armor"))
)
//package dev.hybridlabs.aquatic.client.render.armor
//
//import dev.hybridlabs.aquatic.HybridAquatic
//import dev.hybridlabs.aquatic.item.DivingArmorItem
//import net.minecraft.util.Identifier
//import software.bernie.geckolib.model.DefaultedItemGeoModel
//import software.bernie.geckolib.renderer.GeoArmorRenderer
//
//class SeashellArmorRenderer : GeoArmorRenderer<DivingArmorItem>(
// DefaultedItemGeoModel(Identifier(HybridAquatic.MOD_ID, "armor/seashell_armor"))
//)
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package dev.hybridlabs.aquatic.client.render.armor

import dev.hybridlabs.aquatic.HybridAquatic
import dev.hybridlabs.aquatic.item.DivingArmorItem
import net.minecraft.util.Identifier
import software.bernie.geckolib.model.DefaultedItemGeoModel
import software.bernie.geckolib.renderer.GeoArmorRenderer

class TurtleArmorRenderer : GeoArmorRenderer<DivingArmorItem>(
DefaultedItemGeoModel(Identifier(HybridAquatic.MOD_ID, "armor/turtle_armor"))
)
//package dev.hybridlabs.aquatic.client.render.armor
//
//import dev.hybridlabs.aquatic.HybridAquatic
//import dev.hybridlabs.aquatic.item.DivingArmorItem
//import net.minecraft.util.Identifier
//import software.bernie.geckolib.model.DefaultedItemGeoModel
//import software.bernie.geckolib.renderer.GeoArmorRenderer
//
//class TurtleArmorRenderer : GeoArmorRenderer<DivingArmorItem>(
// DefaultedItemGeoModel(Identifier(HybridAquatic.MOD_ID, "armor/turtle_armor"))
//)
62 changes: 31 additions & 31 deletions src/main/java/dev/hybridlabs/aquatic/mixin/LivingEntityMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ public abstract class LivingEntityMixin {

@Unique
private int brineEffectTick = 0;

@Inject(
method = "baseTick",
at = @At(
value = "TAIL"
)
method = "baseTick",
at = @At(
value = "TAIL"
)
)
private void applyToxicShockInBrine(CallbackInfo ci) {
LivingEntity livingEntity = (LivingEntity) (Object) this;

if (!livingEntity.getWorld().isClient && brineEffectTick >= 20) {
brineEffectTick = 0;
Box box = livingEntity.getBoundingBox().contract(0.001);
Expand All @@ -41,41 +41,41 @@ private void applyToxicShockInBrine(CallbackInfo ci) {
int entityMinZ = MathHelper.floor(box.minZ);
int entityMaxZ = MathHelper.ceil(box.maxZ);
BlockPos.Mutable mutable = new BlockPos.Mutable();

for(int entityX = entityMinX; entityX < entityMaxX; ++entityX) {
for(int entityY = entityMinY; entityY < entityMaxY; ++entityY) {
for (int entityZ = entityMinZ; entityZ < entityMaxZ; ++entityZ) {
mutable.set(entityX, entityY, entityZ);
FluidState fluidState = livingEntity.getWorld().getFluidState(mutable);
if(fluidState.isIn(HybridAquaticFluidTags.INSTANCE.getBRINE())) tickBrine();

// if(fluidState.isIn(HybridAquaticFluidTags.INSTANCE.getBRINE())) tickBrine();
}
}
}

}

brineEffectTick++;
}

@Unique
private void tickBrine() {
LivingEntity livingEntity = (LivingEntity) (Object) this;

if (!isWearingDivingSet(livingEntity)) livingEntity.addStatusEffect(new StatusEffectInstance(HybridAquaticStatusEffects.INSTANCE.getTOXIC_SHOCK(), 100, 0));
livingEntity.addStatusEffect(new StatusEffectInstance(HybridAquaticStatusEffects.INSTANCE.getCORROSION(), 100, 0));
}

@Unique
private boolean isWearingDivingSet(LivingEntity entity) {
var helmet = entity.getEquippedStack(EquipmentSlot.HEAD);
var chestplate = entity.getEquippedStack(EquipmentSlot.CHEST);
var leggings = entity.getEquippedStack(EquipmentSlot.LEGS);
var boots = entity.getEquippedStack(EquipmentSlot.FEET);

return helmet.isOf(HybridAquaticItems.INSTANCE.getDIVING_HELMET()) &&
chestplate.isOf(HybridAquaticItems.INSTANCE.getDIVING_SUIT()) &&
leggings.isOf(HybridAquaticItems.INSTANCE.getDIVING_LEGGINGS()) &&
boots.isOf(HybridAquaticItems.INSTANCE.getDIVING_BOOTS());
}
// @Unique
// private void tickBrine() {
// LivingEntity livingEntity = (LivingEntity) (Object) this;
//
// if (!isWearingDivingSet(livingEntity)) livingEntity.addStatusEffect(new StatusEffectInstance(HybridAquaticStatusEffects.INSTANCE.getTOXIC_SHOCK(), 100, 0));
// livingEntity.addStatusEffect(new StatusEffectInstance(HybridAquaticStatusEffects.INSTANCE.getCORROSION(), 100, 0));
// }
//
// @Unique
// private boolean isWearingDivingSet(LivingEntity entity) {
// var helmet = entity.getEquippedStack(EquipmentSlot.HEAD);
// var chestplate = entity.getEquippedStack(EquipmentSlot.CHEST);
// var leggings = entity.getEquippedStack(EquipmentSlot.LEGS);
// var boots = entity.getEquippedStack(EquipmentSlot.FEET);
//
// return helmet.isOf(HybridAquaticItems.INSTANCE.getDIVING_HELMET()) &&
// chestplate.isOf(HybridAquaticItems.INSTANCE.getDIVING_SUIT()) &&
// leggings.isOf(HybridAquaticItems.INSTANCE.getDIVING_LEGGINGS()) &&
// boots.isOf(HybridAquaticItems.INSTANCE.getDIVING_BOOTS());
// }
}
58 changes: 29 additions & 29 deletions src/main/java/dev/hybridlabs/aquatic/mixin/PlayerEntityMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private void setCustomHurtTimeOnDamage(DamageSource source, float amount, Callba
if (foundEntity != null) hybrid_aquatic$setHurtTime(200);
}
}

@Inject(method = "tick", at = @At("TAIL"))
private void tickDownCustomHurtTime(CallbackInfo ci) {
int cHurtTime = hybrid_aquatic$getHurtTime();
Expand All @@ -110,66 +110,66 @@ private void updateDivingHelmet() {
var player = (PlayerEntity)(Object)this;
ItemStack itemStack = player.getEquippedStack(EquipmentSlot.HEAD);

if (itemStack.isOf(HybridAquaticItems.INSTANCE.getDIVING_HELMET())) {
if (!player.isSubmergedIn(FluidTags.WATER)) {
player.addStatusEffect(new StatusEffectInstance(StatusEffects.WATER_BREATHING, 600, 0, false, false, false));
} else {
player.addStatusEffect(new StatusEffectInstance(HybridAquaticStatusEffects.INSTANCE.getCLARITY(), 600, 0, false, false, false));
}
}
// if (itemStack.isOf(HybridAquaticItems.INSTANCE.getDIVING_HELMET())) {
// if (!player.isSubmergedIn(FluidTags.WATER)) {
// player.addStatusEffect(new StatusEffectInstance(StatusEffects.WATER_BREATHING, 600, 0, false, false, false));
// } else {
// player.addStatusEffect(new StatusEffectInstance(HybridAquaticStatusEffects.INSTANCE.getCLARITY(), 600, 0, false, false, false));
// }
// }
}

@Unique
private void updateDivingBoots() {
var player = (PlayerEntity)(Object)this;
ItemStack itemStack = player.getEquippedStack(EquipmentSlot.FEET);
isWearingDivingBoots = itemStack.isOf(HybridAquaticItems.INSTANCE.getDIVING_BOOTS());
if (isWearingDivingBoots && player.isSubmergedIn(FluidTags.WATER)) {
player.setStepHeight(1.0f);
} else {
player.setStepHeight(0.6f);
}
// isWearingDivingBoots = itemStack.isOf(HybridAquaticItems.INSTANCE.getDIVING_BOOTS());
// if (isWearingDivingBoots && player.isSubmergedIn(FluidTags.WATER)) {
// player.setStepHeight(1.0f);
// } else {
// player.setStepHeight(0.6f);
// }
}

@Unique
private void updateTurtleChestplate() {
var player = (PlayerEntity)(Object)this;
var itemStack = player.getEquippedStack(EquipmentSlot.CHEST);
if (itemStack.isOf(HybridAquaticItems.INSTANCE.getTURTLE_CHESTPLATE())) {
player.addStatusEffect(new StatusEffectInstance(StatusEffects.RESISTANCE, 200, 0, false, false, true));
player.addStatusEffect(new StatusEffectInstance(StatusEffects.SLOWNESS, 200, 0, false, false, true));
}
// if (itemStack.isOf(HybridAquaticItems.INSTANCE.getTURTLE_CHESTPLATE())) {
// player.addStatusEffect(new StatusEffectInstance(StatusEffects.RESISTANCE, 200, 0, false, false, true));
// player.addStatusEffect(new StatusEffectInstance(StatusEffects.SLOWNESS, 200, 0, false, false, true));
// }
}

@Unique
int coralRepairTick = 0;
@Unique
private void repairCoralTools(int tickDelay) {
var player = (PlayerEntity)(Object)this;
var inventory = player.getInventory();

if (player.isSubmergedIn(FluidTags.WATER)) {
if (coralRepairTick > tickDelay) {
List<DefaultedList<ItemStack>> combinedInventory = ImmutableList.of(inventory.main, inventory.offHand);
List<ItemStack> coralItems = new ArrayList<>();
for(List<ItemStack> list: combinedInventory) {
for (ItemStack itemStack: list) {
if (itemStack.getItem() instanceof ToolItem tool &&
tool.getMaterial() == HybridAquaticToolMaterials.CORAL &&
itemStack.isDamaged()) {
coralItems.add(itemStack);
}
}
for (ItemStack itemStack: list) {
if (itemStack.getItem() instanceof ToolItem tool &&
tool.getMaterial() == HybridAquaticToolMaterials.CORAL &&
itemStack.isDamaged()) {
coralItems.add(itemStack);
}
}
}

if(!coralItems.isEmpty()) {
ItemStack item = coralItems.get(player.getRandom().nextInt(coralItems.size()));
item.setDamage(item.getDamage() - 1);
inventory.markDirty();
}
coralRepairTick = 0;
}

coralRepairTick++;
}
}
Expand Down
Loading

0 comments on commit 7fdf13d

Please sign in to comment.