Skip to content

Commit

Permalink
rename a buncha stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
CammiePone committed Jan 18, 2025
1 parent e399822 commit 751405e
Show file tree
Hide file tree
Showing 17 changed files with 53 additions and 39 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def buildTime = ENV.BUILD_TIME ?: NOW.format('yy.MMdd.HHmm')

def javaVersion = 17

//TODO increment when updating the compendium
// TODO increment when updating the compendium
def book_version = 2

group = maven_group_id
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ org.gradle.configuration-cache=true
org.gradle.caching=true
mod_id=arcanuscontinuum
maven_group_id=dev.cammiescorner.arcanuscontinuum
mod_display_name=Arcanus Continuum
mod_display_name=Arcanus
mod_description=A simple magic mod with player-made spells and Wynncraft-like casting.
sources_url=https://github.com/Up-Mods/Arcanus
issues_url=https://github.com/Up-Mods/Arcanus/issues
Expand Down
5 changes: 4 additions & 1 deletion src/main/generated/assets/arcanuscontinuum/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"arcanuscontinuum.spell_component.arcanuscontinuum.bolt_shape": "Bolt Shape",
"arcanuscontinuum.spell_component.arcanuscontinuum.bouncy_effect": "Bouncy Effect",
"arcanuscontinuum.spell_component.arcanuscontinuum.build_effect": "Build Effect",
"arcanuscontinuum.spell_component.arcanuscontinuum.burst_shape": "Burst Shape",
"arcanuscontinuum.spell_component.arcanuscontinuum.copper_curse_effect": "Copper Curse Effect",
"arcanuscontinuum.spell_component.arcanuscontinuum.counter_shape": "Counter Shape",
"arcanuscontinuum.spell_component.arcanuscontinuum.damage_effect": "Damage Effect",
Expand All @@ -44,7 +45,6 @@
"arcanuscontinuum.spell_component.arcanuscontinuum.electric_effect": "Electric Effect",
"arcanuscontinuum.spell_component.arcanuscontinuum.empty": "EMPTY",
"arcanuscontinuum.spell_component.arcanuscontinuum.enlarge_effect": "Enlarge Effect",
"arcanuscontinuum.spell_component.arcanuscontinuum.explosion_shape": "Burst Shape",
"arcanuscontinuum.spell_component.arcanuscontinuum.feather_effect": "Feather Effect",
"arcanuscontinuum.spell_component.arcanuscontinuum.fire_effect": "Fire Effect",
"arcanuscontinuum.spell_component.arcanuscontinuum.float_effect": "Float Effect",
Expand Down Expand Up @@ -356,9 +356,12 @@
"tag.worldgen.biome.arcanuscontinuum.is_pocket_dimension": "Is Pocket Dimension",
"tag.worldgen.biome.c.has_structure.village": "Has Village",
"text.arcanuscontinuum.block_is_warded": "This block is warded.",
"text.arcanuscontinuum.cannot_ward_block": "Cannot ward this block!",
"text.arcanuscontinuum.cannot_ward_in_dimension": "Cannot ward blocks in this dimension!",
"text.arcanuscontinuum.disabled_component": "This spell contains one or more disabled spell components. Aborting spell.",
"text.arcanuscontinuum.too_many_orbs": "That target already has the maximum amount of Aggressorbs!",
"text.arcanuscontinuum.use_item.scroll_of_knowledge": "You feel a little smarter...",
"text.arcanuscontinuum.use_item.scroll_of_knowledge.max_level": "You have learned everything you can.",
"text.arcanuscontinuum.wizard_dialogue.no_wizard_armor": "Come back to me when you look like a wizard.",
"tooltip.arcanuscontinuum.wizard_dialogue.no_wizard_armor": "Maybe wearing Wizard Robes will help...",
"upgrade.arcanuscontinuum.battle_mage_upgrade": "Battle Mage Upgrade"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"functions": [
{
"function": "minecraft:set_nbt",
"tag": "{ComponentGroups:[{Effects:[\"arcanuscontinuum:damage_effect\",\"arcanuscontinuum:damage_effect\",\"arcanuscontinuum:damage_effect\",\"arcanuscontinuum:damage_effect\"],Positions:[{X:117,Y:46},{X:173,Y:73},{X:144,Y:128},{X:77,Y:124},{X:60,Y:65}],Shape:\"arcanuscontinuum:smite_shape\"},{Effects:[],Positions:[{X:117,Y:91}],Shape:\"arcanuscontinuum:explosion_shape\"}],Name:\"Smite\"}"
"tag": "{ComponentGroups:[{Effects:[\"arcanuscontinuum:damage_effect\",\"arcanuscontinuum:damage_effect\",\"arcanuscontinuum:damage_effect\",\"arcanuscontinuum:damage_effect\"],Positions:[{X:117,Y:46},{X:173,Y:73},{X:144,Y:128},{X:77,Y:124},{X:60,Y:65}],Shape:\"arcanuscontinuum:smite_shape\"},{Effects:[],Positions:[{X:117,Y:91}],Shape:\"arcanuscontinuum:burst_shape\"}],Name:\"Smite\"}"
}
],
"name": "arcanuscontinuum:spell_book"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public static final class BurstShapeProperties {
public static float strength = 3.5f;
}

// TODO uncomment this when we have guided shot done
// TODO uncomment this when we have guided shot done & set enabled to true
// @Category(id = "guidedShotShapeProperties", translation = "config.arcanuscontinuum.guidedShotShapeProperties")
public static final class GuidedShotShapeProperties {
@ConfigEntry(id = "enabled", type = EntryType.BOOLEAN, translation = "config.arcanuscontinuum.enabled")
Expand Down Expand Up @@ -967,7 +967,7 @@ public static final class DangerSenseEffectProperties {
public static double baseChanceToActivate = 0.035;
}

// TODO uncomment this when we get temporal dilation working
// TODO uncomment this when we get temporal dilation working & set enabled to true
// @Category(id = "temporalDilationEffectProperties", translation = "config.arcanuscontinuum.temporalDilationEffectProperties", sortOrder = 7)
public static final class TemporalDilationEffectProperties {
@ConfigEntry(id = "enabled", type = EntryType.BOOLEAN, translation = "config.arcanuscontinuum.enabled")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,19 @@ public static SpellGroup fromNbt(CompoundTag tag) {
ListTag nbtEffects = tag.getList("Effects", Tag.TAG_STRING);
ListTag nbtPoses = tag.getList("Positions", Tag.TAG_COMPOUND);

for(int i = 0; i < nbtEffects.size(); i++)
if(Arcanus.SPELL_COMPONENTS.get(new ResourceLocation(nbtEffects.getString(i))) instanceof SpellEffect effect)
for(int i = 0; i < nbtEffects.size(); i++) {
// TODO remove in 1.21.1
String nbtId = nbtEffects.getString(i);
ResourceLocation correctedId = switch(nbtId) {
case "arcanuscontinuum:explosion_shape" -> ArcanusSpellComponents.BURST.getId();
case "arcanuscontinuum:guardian_orb_shape" -> ArcanusSpellComponents.GUARDIAN_ORB.getId();
case "arcanuscontinuum:aggressorb_shape" -> ArcanusSpellComponents.AGGRESSORB.getId();
default -> new ResourceLocation(nbtId);
};

if(Arcanus.SPELL_COMPONENTS.get(correctedId) instanceof SpellEffect effect)
effects.add(effect);
}

for(int i = 0; i < nbtPoses.size(); i++) {
CompoundTag nbt = nbtPoses.getCompound(i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,18 @@ public InteractionResultHolder<ItemStack> use(Level world, Player user, Interact
if(component.getLevel() < component.getMaxLevel()) {
component.setLevel(component.getLevel() + 1);

if(!user.isCreative()) {
if(!user.isCreative())
stack.shrink(1);
}

user.displayClientMessage(Component.translatable("text.arcanuscontinuum.use_item.scroll_of_knowledge").withStyle(ChatFormatting.DARK_PURPLE, ChatFormatting.ITALIC), true);
}
}

if(component.getLevel() >= component.getMaxLevel()) {
user.displayClientMessage(Component.translatable("text.arcanuscontinuum.use_item.scroll_of_knowledge.max_level").withStyle(ChatFormatting.RED, ChatFormatting.ITALIC), true);
return InteractionResultHolder.fail(stack);
}

return InteractionResultHolder.sidedSuccess(stack, world.isClientSide());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ public void cast(@Nullable LivingEntity caster, Vec3 castFrom, @Nullable Entity
public static final RegistrySupplier<SpellShape> BOLT = SPELL_COMPONENTS.register("bolt_shape", BoltSpellShape::new);
public static final RegistrySupplier<SpellShape> BEAM = SPELL_COMPONENTS.register("beam_shape", BeamSpellShape::new);
public static final RegistrySupplier<SpellShape> RUNE = SPELL_COMPONENTS.register("rune_shape", RuneSpellShape::new);
public static final RegistrySupplier<SpellShape> BURST = SPELL_COMPONENTS.register("explosion_shape", BurstSpellShape::new);
public static final RegistrySupplier<SpellShape> BURST = SPELL_COMPONENTS.register("burst_shape", BurstSpellShape::new);
public static final RegistrySupplier<SpellShape> GUIDED_SHOT = SPELL_COMPONENTS.register("guided_shot_shape", GuidedShotSpellShape::new);
public static final RegistrySupplier<SpellShape> COUNTER = SPELL_COMPONENTS.register("counter_shape", CounterSpellShape::new);
public static final RegistrySupplier<SpellShape> AOE = SPELL_COMPONENTS.register("aoe_shape", AreaOfEffectSpellShape::new);
public static final RegistrySupplier<SpellShape> SMITE = SPELL_COMPONENTS.register("smite_shape", SmiteSpellShape::new);
public static final RegistrySupplier<SpellShape> GUARDIAN_ORB = SPELL_COMPONENTS.register("guardian_orb_shape", GuardianOrbSpellShape::new); // TODO replace name with something better
public static final RegistrySupplier<SpellShape> AGGRESSORB = SPELL_COMPONENTS.register("aggressorb_shape", AggressorbSpellShape::new); // TODO replace name with something better
public static final RegistrySupplier<SpellShape> GUARDIAN_ORB = SPELL_COMPONENTS.register("guardian_orb_shape", GuardianOrbSpellShape::new); // TODO replace name with something better. also change the texture file
public static final RegistrySupplier<SpellShape> AGGRESSORB = SPELL_COMPONENTS.register("aggressorb_shape", AggressorbSpellShape::new); // TODO replace name with something better. also change the texture file

//-----Spell Effects-----//
public static final RegistrySupplier<SpellEffect> DAMAGE = SPELL_COMPONENTS.register("damage_effect", DamageSpellEffect::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,8 @@ public void effect(@Nullable LivingEntity caster, @Nullable Entity sourceEntity,
Entity entity = entityHit.getEntity();

// TODO make growth be a potion
// if(entityHit.getEntity() instanceof LivingEntity entity) {
// if(ArcanusSpellComponents.SHRINK.is(this))
// entity.addEffect(new MobEffectInstance(ArcanusMobEffects.SHRINK.get(), (int) (ArcanusConfig.UtilityEffects.ShrinkEffectProperties.baseEffectDuration * effects.stream().filter(ArcanusSpellComponents.SHRINK::is).count() * potency), 0, false, true, true));
// else if(ArcanusSpellComponents.ENLARGE.is(this))
// entity.addEffect(new MobEffectInstance(ArcanusMobEffects.ENLARGE.get(), (int) (ArcanusConfig.UtilityEffects.GrowthEffectProperties.baseEffectDuration * effects.stream().filter(ArcanusSpellComponents.ENLARGE::is).count() * potency), 0, false, true, true));
// }
// if(entityHit.getEntity() instanceof LivingEntity entity)
// entity.addEffect(new MobEffectInstance(ArcanusMobEffects.ENLARGE.get(), (int) (ArcanusConfig.UtilityEffects.GrowthEffectProperties.baseEffectDuration * effects.stream().filter(ArcanusSpellComponents.ENLARGE::is).count() * potency), 0, false, true, true));

ArcanusComponents.setScale(entity, this, effects.stream().filter(ArcanusSpellComponents.ENLARGE::is).count() * potency);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,21 @@ public void effect(@Nullable LivingEntity caster, @Nullable Entity sourceEntity,

if(level.mayInteract(player, pos)) {
var isWarded = ArcanusComponents.isBlockWarded(level, pos);

if(isWarded || !state.getCollisionShape(level, pos).isEmpty()) {
if(isWarded) {
ArcanusComponents.removeWardedBlock(player, pos);
}
else {
var dimensionTypes = level.registryAccess().lookupOrThrow(Registries.DIMENSION_TYPE);
var dimensionHolder = dimensionTypes.getOrThrow(level.dimensionTypeId());
if(dimensionHolder.is(ArcanusDimensionTags.WARDING_NOT_ALLOWED)) {
// TODO make translatable
player.sendSystemMessage(Component.literal("Cannot ward blocks in this dimension!"));
}
else if(state.is(ArcanusBlockTags.WARDING_NOT_ALLOWED)) {
// TODO make translatable
player.sendSystemMessage(Component.literal("Cannot ward this block!"));
}
else {

if(dimensionHolder.is(ArcanusDimensionTags.WARDING_NOT_ALLOWED))
player.sendSystemMessage(Component.translatable("text.arcanuscontinuum.cannot_ward_in_dimension"));
else if(state.is(ArcanusBlockTags.WARDING_NOT_ALLOWED))
player.sendSystemMessage(Component.translatable("text.arcanuscontinuum.cannot_ward_block"));
else
ArcanusComponents.addWardedBlock(player, pos);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.cammiescorner.arcanuscontinuum.common.util;

public enum StaffType {
// TODO add animations for WAND and GAUNTLET
STAFF, BOOK, GUN, WAND, GAUNTLET
}
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,13 @@ public void generateTranslations(TranslationBuilder builder) {
tag(builder, ArcanusItemTags.WIZARD_ARMOR, "Wizard Armor");

builder.add("text.arcanuscontinuum.block_is_warded", "This block is warded.");
builder.add("text.arcanuscontinuum.cannot_ward_in_dimension", "Cannot ward blocks in this dimension!");
builder.add("text.arcanuscontinuum.cannot_ward_block", "Cannot ward this block!");
builder.add("text.arcanuscontinuum.disabled_component", "This spell contains one or more disabled spell components. Aborting spell.");
builder.add("text.arcanuscontinuum.too_many_orbs", "That target already has the maximum amount of Aggressorbs!");

builder.add("text.arcanuscontinuum.use_item.scroll_of_knowledge", "You feel a little smarter...");
builder.add("text.arcanuscontinuum.use_item.scroll_of_knowledge.max_level", "You have learned everything you can.");

builder.add("text.arcanuscontinuum.wizard_dialogue.no_wizard_armor", "Come back to me when you look like a wizard.");
builder.add("tooltip.arcanuscontinuum.wizard_dialogue.no_wizard_armor", "Maybe wearing Wizard Robes will help...");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ public void generate(BiConsumer<ResourceLocation, LootTable.Builder> output) {
.apply(SetNbtFunction.setTag(zoomiesSpell()))
.when(LootItemRandomChanceCondition.randomChance(0.25F))
))
//-----------
// TODO written books?
//-----------
.add(LootItem.lootTableItem(Items.WRITABLE_BOOK).setWeight(5))
.add(LootItem.lootTableItem(Items.BOOK).setWeight(5))
.add(LootItem.lootTableItem(Items.BOOK).setWeight(3).apply(EnchantWithLevelsFunction.enchantWithLevels(UniformGenerator.between(1, 3))))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package dev.cammiescorner.arcanuscontinuum.mixin.common;

public class AbstractArrowMixin {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package dev.cammiescorner.arcanuscontinuum.mixin.common;

public class EntityMixin {
}
Original file line number Diff line number Diff line change
Expand Up @@ -228,25 +228,22 @@ else if(speedAttr.getModifier(Arcanus.SPELL_SPEED_MODIFIER_ID) != null)
))
private Vec3 arcanuscontinuum$floatAround(LivingEntity livingEntity, Operation<Vec3> original, Vec3 movementInput, float slipperiness) {
// FIXME smooth out vertical movement, currently a bit jolting
if(hasEffect(ArcanusMobEffects.FLOAT.get())) {
if(hasEffect(ArcanusMobEffects.FLOAT.get()))
return getDeltaMovement().add(0, jumping ? getSpeed() : isShiftKeyDown() ? -getSpeed() : 0, 0);
}

return original.call(livingEntity);
}

@Inject(method = "onEffectRemoved", at = @At("HEAD"), cancellable = true)
private void arcanuscontinuum$cantRemoveCurse(MobEffectInstance effect, CallbackInfo info) {
if(effect.getEffect() == ArcanusMobEffects.COPPER_CURSE.get()) {
if(effect.getEffect() == ArcanusMobEffects.COPPER_CURSE.get())
info.cancel();
}
}

@ModifyVariable(method = "travel", at = @At("HEAD"), argsOnly = true)
public Vec3 arcanuscontinuum$invertInput(Vec3 movementInput) {
if(!(self instanceof Player) && hasEffect(ArcanusMobEffects.DISCOMBOBULATE.get())) {
if(!(self instanceof Player) && hasEffect(ArcanusMobEffects.DISCOMBOBULATE.get()))
movementInput = movementInput.multiply(-1, 1, -1);
}

return movementInput;
}
Expand Down

0 comments on commit 751405e

Please sign in to comment.