Skip to content

Commit

Permalink
1.20.6 Update III
Browse files Browse the repository at this point in the history
 - Started on Enchantment Reworks
 - Updated to 24w21b Snapshot
 - Added Boiler Plate
  • Loading branch information
chronosacaria committed May 26, 2024
1 parent 1f45dd5 commit 1abf045
Show file tree
Hide file tree
Showing 132 changed files with 1,293 additions and 563 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,6 @@ run/

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
/index.html
/styles.css
/script.js
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@ dependencies {
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.fabric_loader_version}"
// TODO REMOVE WHEN NOT NEEDED ANYMORE
modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabricKotlinVersion}"
modImplementation "net.peanuuutz.tomlkt:tomlkt:0.3.7"
//modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabricKotlinVersion}"
//modImplementation "net.peanuuutz.tomlkt:tomlkt:0.3.7"

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

// Clumps
modImplementation "com.blamejared.clumps:Clumps-fabric-${project.minecraft_version}:${project.clumps_version}"
//modImplementation "com.blamejared.clumps:Clumps-fabric-${project.minecraft_version}:${project.clumps_version}"
modImplementation "com.blamejared.clumps:Clumps-fabric-1.20.6:${project.clumps_version}"

// Ranged Weapon API
//modImplementation "maven.modrinth:ranged-weapon-api:${project.ranged_weapon_api_version}"
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop/
minecraft_version=1.20.6
yarn_mappings=1.20.6+build.1
minecraft_version=24w21b
yarn_mappings=24w21b+build.5
fabric_loader_version=0.15.11

# Mod Properties
Expand All @@ -15,9 +15,9 @@ org.gradle.parallel=true

# Dependencies
# check this on https://fabricmc.net/develop/
fabricKotlinVersion = 1.10.18+kotlin.1.9.22
fabric_version=0.98.0+1.20.6
fzzy_config=0.3.3+1.20.6
#fabricKotlinVersion = 1.10.18+kotlin.1.9.22
fabric_version=0.99.1+1.21
fzzy_config=0.3.3+24w21b

# Compatibility
clumps_version=17.0.0.1
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/timefall/mcdw/Mcdw.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Mcdw implements ModInitializer {
@SuppressWarnings("unused")
public static final Logger LOGGER = LogManager.getLogger();
public static Identifier ID(String path) {
return new Identifier(MOD_ID, path);
return Identifier.of(MOD_ID, path);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
package dev.timefall.mcdw.api.util;

import dev.timefall.mcdw.enchants.goals.GoalUtils;
import dev.timefall.mcdw.enchantment.goals.GoalUtils;
import dev.timefall.mcdw.enums.SettingsID;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffectInstance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static boolean canRepairCheck(String[] repairIngredient, ItemStack ingred
else if (repIngredient.contentEquals("minecraft:stone_crafting_materials"))
isStone.set(true);
potentialIngredients.add(
Registries.ITEM.get(new Identifier(repIngredient)));
Registries.ITEM.get(Identifier.of(repIngredient)));
}
});
}
Expand Down Expand Up @@ -361,7 +361,7 @@ public static AttributeModifiersComponent createDualWieldWithRangeAttributeModif
}

public static TagKey<Item> mcdw$getItemTagKey(String tag) {
return TagKey.of(RegistryKeys.ITEM, new Identifier(tag));
return TagKey.of(RegistryKeys.ITEM, Identifier.of(tag));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@
import org.joml.Quaternionf;
import org.joml.Vector3f;

import java.util.List;

public class ProjectileEffectHelper {

public static void mcdw$spawnExtraArrows(LivingEntity owner, LivingEntity makeArrowFromMe, int numArrowsLimit, int distance, double bonusShotDamageMultiplier) {
//List<LivingEntity> nearbyEntities = mcdw$getSecondaryTargets(makeArrowFromMe, distance);
//for (int i = 0; i < Math.min(numArrowsLimit, nearbyEntities.size()); i++) {
// PersistentProjectileEntity arrowEntity = mcdw$createProjectileEntityTowards(makeArrowFromMe, nearbyEntities.get(i));
// arrowEntity.setDamage(arrowEntity.getDamage() * bonusShotDamageMultiplier);
// arrowEntity.setOwner(owner);
// makeArrowFromMe.getWorld().spawnEntity(arrowEntity);
//}
List<LivingEntity> nearbyEntities = mcdw$getSecondaryTargets(makeArrowFromMe, distance);
for (int i = 0; i < Math.min(numArrowsLimit, nearbyEntities.size()); i++) {
PersistentProjectileEntity arrowEntity = mcdw$createProjectileEntityTowards(makeArrowFromMe, nearbyEntities.get(i));
arrowEntity.setDamage(arrowEntity.getDamage() * bonusShotDamageMultiplier);
arrowEntity.setOwner(owner);
makeArrowFromMe.getWorld().spawnEntity(arrowEntity);
}
}

public static PersistentProjectileEntity mcdw$createAbstractArrow(LivingEntity attacker) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/timefall/mcdw/bases/McdwSwordItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.google.common.collect.BiMap;
import dev.timefall.mcdw.api.util.CleanlinessHelper;
import dev.timefall.mcdw.configs.stats.IMcdwWeaponStats;
import dev.timefall.mcdw.mixin.mcdw.InsulatedAxeItemAccessor;
import dev.timefall.mcdw.mixin.old_mixins.mcdw.InsulatedAxeItemAccessor;
import dev.timefall.mcdw.registries.ItemGroupRegistry;
import dev.timefall.mcdw.registries.items.McdwSwordItemRegistry;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/dev/timefall/mcdw/client/McdwClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void onInitializeClient() {
}
public static void registerRangedWeaponPredicates(Item item) {
ModelPredicateProviderRegistry.register(item, new Identifier("pull"), (itemStack, clientWorld, livingEntity, seed) -> {
ModelPredicateProviderRegistry.register(item, Identifier.of("pull"), (itemStack, clientWorld, livingEntity, seed) -> {
if (livingEntity == null) {
return 0.0F;
} else if (item instanceof McdwBowItem bow) {
Expand All @@ -40,27 +40,27 @@ public static void registerRangedWeaponPredicates(Item item) {
});
if (item instanceof BowItem) {
ModelPredicateProviderRegistry.register(item, new Identifier("pulling"), (itemStack, clientWorld, livingEntity, seed) ->
ModelPredicateProviderRegistry.register(item, Identifier.of("pulling"), (itemStack, clientWorld, livingEntity, seed) ->
livingEntity != null && livingEntity.isUsingItem() && livingEntity.getActiveItem() == itemStack ? 1.0F : 0.0F);
}
if (item instanceof CrossbowItem) {
ModelPredicateProviderRegistry.register(item, new Identifier("pulling"), (itemStack, clientWorld, livingEntity, seed) -> {
ModelPredicateProviderRegistry.register(item, Identifier.of("pulling"), (itemStack, clientWorld, livingEntity, seed) -> {
if (livingEntity == null) {
return 0.0F;
} else {
return livingEntity.isUsingItem() && livingEntity.getActiveItem() == itemStack && !McdwCrossbowItem.isCharged(itemStack) ? 1.0F : 0.0F;
}
});
ModelPredicateProviderRegistry.register(item, new Identifier("charged"), (itemStack, clientWorld, livingEntity, seed) -> {
ModelPredicateProviderRegistry.register(item, Identifier.of("charged"), (itemStack, clientWorld, livingEntity, seed) -> {
if (livingEntity == null) {
return 0.0F;
} else {
return McdwCrossbowItem.isCharged(itemStack) ? 1.0F : 0.0F;
}
});
ModelPredicateProviderRegistry.register(item, new Identifier("firework"), (itemStack, clientWorld, livingEntity, seed) -> {
ModelPredicateProviderRegistry.register(item, Identifier.of("firework"), (itemStack, clientWorld, livingEntity, seed) -> {
if (livingEntity == null) {
return 0.0F;
} else {
Expand All @@ -71,7 +71,7 @@ public static void registerRangedWeaponPredicates(Item item) {
}
}
public static void registerShieldPredicates(McdwShieldItem shield) {
ModelPredicateProviderRegistry.register(shield, new Identifier("blocking"),
ModelPredicateProviderRegistry.register(shield, Identifier.of("blocking"),
(itemStack, clientWorld, livingEntity, seed) -> livingEntity != null && livingEntity.isUsingItem() &&
livingEntity.getActiveItem() == itemStack ? 1.0F : 0.0F
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Timefall Development License 1.2
* Copyright (c) 2024. Chronosacaria, Kluzzio, Timefall Development. All Rights Reserved.
*
* This software's content is licensed under the Timefall Development License 1.2. You can find this license information here: https://github.com/Timefall-Development/Timefall-Development-Licence/blob/main/TimefallDevelopmentLicense1.2.txt
*/

package dev.timefall.mcdw.component;

import dev.timefall.mcdw.Mcdw;
import net.minecraft.component.ComponentType;
import net.minecraft.enchantment.effect.EnchantmentEffectEntry;
import net.minecraft.enchantment.effect.EnchantmentValueEffectType;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;

import java.util.List;
import java.util.function.UnaryOperator;

public class McdwEffectComponentTypes {

public static final ComponentType<List<EnchantmentEffectEntry<EnchantmentValueEffectType>>> ACCELERATE_CHARGE_TIME = register("accelerate_charge_time", builder -> builder);


private static <T> ComponentType<T> register(String id, UnaryOperator<ComponentType.Builder<T>> builderOperator) {
return Registry.register(Registries.ENCHANTMENT_EFFECT_COMPONENT_TYPE, Mcdw.ID(id), (builderOperator.apply(ComponentType.builder())).build());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class MeleeStats implements Walkable {
public double additionalAttackRange = 0d;
@ValidatedInt.Restrict(min = 0)
public int weaponSpawnWeight = 0;
public ValidatedIngredient repairIngredient = new ValidatedIngredient(new Identifier("iron_ingot"));
public ValidatedIngredient repairIngredient = new ValidatedIngredient(Identifier.of("iron_ingot"));


}
Expand Down Expand Up @@ -123,7 +123,7 @@ class RangedStats implements Walkable {
public int range = 15;
@ValidatedInt.Restrict(min = 0)
public int weaponSpawnWeight = 0;
public ValidatedIngredient repairIngredient = new ValidatedIngredient(new Identifier("iron_ingot"));
public ValidatedIngredient repairIngredient = new ValidatedIngredient(Identifier.of("iron_ingot"));
}

static RangedStats rangedStats(
Expand Down Expand Up @@ -197,7 +197,7 @@ class ShieldStats implements Walkable {
public boolean isLootable = true;
public ToolMaterial material = ToolMaterials.IRON;
public int weaponSpawnWeight = 0;
public ValidatedIngredient repairIngredient = new ValidatedIngredient(new Identifier("iron_ingot"));
public ValidatedIngredient repairIngredient = new ValidatedIngredient(Identifier.of("iron_ingot"));
}

static ShieldStats shieldStats(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@
import me.fzzyhmstrs.fzzy_config.api.ConfigApi;
import me.fzzyhmstrs.fzzy_config.config.Config;

import java.util.function.Supplier;

@SuppressWarnings("FieldMayBeFinal")
@IgnoreVisibility
public class McdwEnchantmentStatsConfig extends Config {

public static final McdwEnchantmentStatsConfig CONFIG = ConfigApi.registerAndLoadConfig((Supplier<McdwEnchantmentStatsConfig>) McdwEnchantmentStatsConfig::new);
public static final McdwEnchantmentStatsConfig CONFIG = ConfigApi.registerAndLoadConfig(McdwEnchantmentStatsConfig::new);

public McdwEnchantmentStatsConfig() {
super(Mcdw.ID("mcdw_enchantment_stats_config"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@
import me.fzzyhmstrs.fzzy_config.api.ConfigApi;
import me.fzzyhmstrs.fzzy_config.config.Config;

import java.util.function.Supplier;

@SuppressWarnings("FieldMayBeFinal")
@IgnoreVisibility
public class McdwWeaponStatsConfig extends Config {

public static final McdwWeaponStatsConfig CONFIG = ConfigApi.registerAndLoadConfig((Supplier<McdwWeaponStatsConfig>) McdwWeaponStatsConfig::new);
public static final McdwWeaponStatsConfig CONFIG = ConfigApi.registerAndLoadConfig(McdwWeaponStatsConfig::new);

public McdwWeaponStatsConfig() {
super(Mcdw.ID("mcdw_weapon_stats_config"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
@SuppressWarnings("FieldMayBeFinal")
@IgnoreVisibility
public class McdwAxeItemStats extends ConfigSection {
private IMcdwWeaponStats.MeleeStats axeAnchor = IMcdwWeaponStats.meleeStats(true, true, ToolMaterials.IRON, 8, -3.4f, 0.0d, 10, new Identifier("minecraft:iron_ingot"));
private IMcdwWeaponStats.MeleeStats axeAxe = IMcdwWeaponStats.meleeStats(true, true, ToolMaterials.IRON, 6, -3.1f, 0.0d, 10, new Identifier("minecraft:iron_ingot"));
private IMcdwWeaponStats.MeleeStats axeEncrustedAnchor = IMcdwWeaponStats.meleeStats(true, true, ToolMaterials.DIAMOND, 8, -3.4f, 0.0d, 5, new Identifier("minecraft:diamond"));
private IMcdwWeaponStats.MeleeStats axeFirebrand = IMcdwWeaponStats.meleeStats(true, true, ToolMaterials.DIAMOND, 4, -2.9f, 0.0d, 5, new Identifier("minecraft:diamond"));
private IMcdwWeaponStats.MeleeStats axeHighland = IMcdwWeaponStats.meleeStats(true, true, ToolMaterials.IRON, 4, -2.9f, 0.0d, 5, new Identifier("minecraft:iron_ingot"));
private IMcdwWeaponStats.MeleeStats axeAnchor = IMcdwWeaponStats.meleeStats(true, true, ToolMaterials.IRON, 8, -3.4f, 0.0d, 10, Identifier.of("minecraft:iron_ingot"));
private IMcdwWeaponStats.MeleeStats axeAxe = IMcdwWeaponStats.meleeStats(true, true, ToolMaterials.IRON, 6, -3.1f, 0.0d, 10, Identifier.of("minecraft:iron_ingot"));
private IMcdwWeaponStats.MeleeStats axeEncrustedAnchor = IMcdwWeaponStats.meleeStats(true, true, ToolMaterials.DIAMOND, 8, -3.4f, 0.0d, 5, Identifier.of("minecraft:diamond"));
private IMcdwWeaponStats.MeleeStats axeFirebrand = IMcdwWeaponStats.meleeStats(true, true, ToolMaterials.DIAMOND, 4, -2.9f, 0.0d, 5, Identifier.of("minecraft:diamond"));
private IMcdwWeaponStats.MeleeStats axeHighland = IMcdwWeaponStats.meleeStats(true, true, ToolMaterials.IRON, 4, -2.9f, 0.0d, 5, Identifier.of("minecraft:iron_ingot"));

public IMcdwWeaponStats.MeleeStats getAxeAnchor() { return axeAnchor; }
public IMcdwWeaponStats.MeleeStats getAxeAxe() { return axeAxe; }
Expand Down
Loading

0 comments on commit 1abf045

Please sign in to comment.