Skip to content

Commit

Permalink
Hammer Items are finished
Browse files Browse the repository at this point in the history
Enderite Pickaxe breaks bedrock
Enderite Armor gives creative flight status effect
  • Loading branch information
drkhodakarami committed Nov 13, 2023
1 parent 174c516 commit 858cd3e
Show file tree
Hide file tree
Showing 22 changed files with 407 additions and 28 deletions.
12 changes: 12 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ repositories {
name = "CottonMC"
url = "https://server.bbkr.space/artifactory/libs-release"
}

maven {
name = 'Ladysnake Mods'
url = 'https://maven.ladysnake.org/releases'
content {
includeGroup 'io.github.ladysnake'
includeGroupByRegex 'io\\.github\\.onyxstudios.*'
}
}
}

loom {
Expand Down Expand Up @@ -68,6 +77,9 @@ dependencies {

include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:${project.mixinextras_version}")))

modImplementation "io.github.ladysnake:PlayerAbilityLib:${pal_version}"
include "io.github.ladysnake:PlayerAbilityLib:${pal_version}"

modRuntimeOnly "curse.maven:reborncore-237903:4786770"
modRuntimeOnly "curse.maven:techreborn-233564:4786771"
}
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ fabric_version=0.90.4+1.20.2
rei_version=13.0.671
energy_api_version=3.0.0
libgui_version=9.0.0+1.20.2
mixinextras_version=0.2.0
mixinextras_version=0.2.0
pal_version = 1.9.0
2 changes: 2 additions & 0 deletions src/main/java/jiraiyah/allthatmatters/AllThatMatters.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import jiraiyah.allthatmatters.block.ModBlockEntities;
import jiraiyah.allthatmatters.command.ModCommands;
import jiraiyah.allthatmatters.datagen.world.ModWorldGeneration;
import jiraiyah.allthatmatters.effect.ModEffects;
import jiraiyah.allthatmatters.fluid.ModFluids;
import jiraiyah.allthatmatters.item.ModItemGroups;
import jiraiyah.allthatmatters.item.ModItems;
Expand Down Expand Up @@ -64,6 +65,7 @@ public void onInitialize()
ModMessages.registerC2SPackets();

ModFluids.register();
ModEffects.register();
}

@NotNull
Expand Down
19 changes: 19 additions & 0 deletions src/main/java/jiraiyah/allthatmatters/effect/ModEffects.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package jiraiyah.allthatmatters.effect;

import jiraiyah.allthatmatters.AllThatMatters;
import jiraiyah.allthatmatters.effect.custom.FlightEffect;
import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffectCategory;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;

public class ModEffects
{
public static StatusEffect FLIGHT_EFFECT = Registry.register(Registries.STATUS_EFFECT, AllThatMatters.identifier("flight"),
new FlightEffect(StatusEffectCategory.BENEFICIAL, 0xFFFFFF));

public static void register()
{
AllThatMatters.LOGGER.info(">>> Registering Effects");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package jiraiyah.allthatmatters.effect.custom;

import io.github.ladysnake.pal.AbilitySource;
import io.github.ladysnake.pal.Pal;
import io.github.ladysnake.pal.VanillaAbilities;
import jiraiyah.allthatmatters.AllThatMatters;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.attribute.AttributeContainer;
import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffectCategory;
import net.minecraft.server.network.ServerPlayerEntity;

public class FlightEffect extends StatusEffect
{
public static final AbilitySource FLIGHT_POTION = Pal.getAbilitySource(AllThatMatters.identifier("potion_flight"));

private ServerPlayerEntity entity;

public FlightEffect(StatusEffectCategory category, int color)
{
super(category, color);
}

@Override
public void onApplied(LivingEntity entity, int amplifier)
{
super.onApplied(entity, amplifier);
if(entity instanceof ServerPlayerEntity sp)
{
Pal.grantAbility(sp, VanillaAbilities.ALLOW_FLYING, FLIGHT_POTION);
Pal.grantAbility(sp, VanillaAbilities.FLYING, FLIGHT_POTION);
this.entity = sp;
}
}

@Override
public void onRemoved(AttributeContainer attributeContainer)
{
super.onRemoved(attributeContainer);
if(this.entity != null)
{
Pal.revokeAbility(this.entity, VanillaAbilities.ALLOW_FLYING, FLIGHT_POTION);
Pal.revokeAbility(this.entity, VanillaAbilities.FLYING, FLIGHT_POTION);
}
}
}
34 changes: 12 additions & 22 deletions src/main/java/jiraiyah/allthatmatters/item/ModItems.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package jiraiyah.allthatmatters.item;

import jiraiyah.allthatmatters.AllThatMatters;
import jiraiyah.allthatmatters.item.custom.HammerItem;
import jiraiyah.allthatmatters.item.custom.ModArmorItem;
import jiraiyah.allthatmatters.item.custom.GemBow;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
Expand All @@ -27,9 +28,8 @@ public class ModItems
//region CITRINE TOOLS
public static final Item TOOL_CITRINE_AXE = registerItem("tool_citrine_axe",
new AxeItem(ModToolMaterial.CITRINE, 3, 1, new FabricItemSettings()));
// TODO : HAMMER Item Object
public static final Item TOOL_CITRINE_HAMMER = registerItem("tool_citrine_hammer",
new Item(new FabricItemSettings().maxCount(1)));
new HammerItem(ModToolMaterial.SAPPHIRE, 3, 2));
public static final Item TOOL_CITRINE_HOE = registerItem("tool_citrine_hoe",
new HoeItem(ModToolMaterial.CITRINE, 0, 0, new FabricItemSettings()));
public static final Item TOOL_CITRINE_PICKAXE = registerItem("tool_citrine_pickaxe",
Expand All @@ -43,9 +43,8 @@ public class ModItems
//region COPPER TOOLS
public static final Item TOOL_COPPER_AXE = registerItem("tool_copper_axe",
new AxeItem(ModToolMaterial.COPPER, 3, 1, new FabricItemSettings()));
// TODO : HAMMER Item Object
public static final Item TOOL_COPPER_HAMMER = registerItem("tool_copper_hammer",
new Item(new FabricItemSettings().maxCount(1)));
new HammerItem(ModToolMaterial.COPPER, 3, 2));
public static final Item TOOL_COPPER_HOE = registerItem("tool_copper_hoe",
new HoeItem(ModToolMaterial.COPPER, 0, 0, new FabricItemSettings()));
public static final Item TOOL_COPPER_PICKAXE = registerItem("tool_copper_pickaxe",
Expand All @@ -57,32 +56,25 @@ public class ModItems
//endregion

//region VANILLA HAMMERS
// TODO : HAMMER Item Object
public static final Item TOOL_DIAMOND_HAMMER = registerItem("tool_diamond_hammer",
new Item(new FabricItemSettings().maxCount(1)));
// TODO : HAMMER Item Object
new HammerItem(ToolMaterials.DIAMOND, 5, 2));
public static final Item TOOL_GOLD_HAMMER = registerItem("tool_gold_hammer",
new Item(new FabricItemSettings().maxCount(1)));
// TODO : HAMMER Item Object
new HammerItem(ToolMaterials.GOLD, 5, 1));
public static final Item TOOL_IRON_HAMMER = registerItem("tool_iron_hammer",
new Item(new FabricItemSettings().maxCount(1)));
// TODO : HAMMER Item Object
new HammerItem(ToolMaterials.IRON, 5, 1));
public static final Item TOOL_NETHERITE_HAMMER = registerItem("tool_netherite_hammer",
new Item(new FabricItemSettings().maxCount(1)));
// TODO : HAMMER Item Object
new HammerItem(ToolMaterials.NETHERITE, 5, 3));
public static final Item TOOL_STONE_HAMMER = registerItem("tool_stone_hammer",
new Item(new FabricItemSettings().maxCount(1)));
// TODO : HAMMER Item Object
new HammerItem(ToolMaterials.STONE, 3, 1));
public static final Item TOOL_WOOD_HAMMER = registerItem("tool_wood_hammer",
new Item(new FabricItemSettings().maxCount(1)));
new HammerItem(ToolMaterials.WOOD, 3, 1));
//endregion

//region ENDERITE TOOLS
public static final Item TOOL_ENDERITE_AXE = registerItem("tool_enderite_axe",
new AxeItem(ModToolMaterial.ENDERITE, 3, 1, new FabricItemSettings()));
// TODO : HAMMER Item Object
public static final Item TOOL_ENDERITE_HAMMER = registerItem("tool_enderite_hammer",
new Item(new FabricItemSettings().maxCount(1)));
new HammerItem(ModToolMaterial.ENDERITE, 5, 5));
public static final Item TOOL_ENDERITE_HOE = registerItem("tool_enderite_hoe",
new HoeItem(ModToolMaterial.ENDERITE, 0, 0, new FabricItemSettings()));
public static final Item TOOL_ENDERITE_PICKAXE = registerItem("tool_enderite_pickaxe",
Expand All @@ -96,9 +88,8 @@ public class ModItems
//region RUBY TOOLS
public static final Item TOOL_RUBY_AXE = registerItem("tool_ruby_axe",
new AxeItem(ModToolMaterial.RUBY, 3, 1, new FabricItemSettings()));
// TODO : HAMMER Item Object
public static final Item TOOL_RUBY_HAMMER = registerItem("tool_ruby_hammer",
new Item(new FabricItemSettings().maxCount(1)));
new HammerItem(ModToolMaterial.RUBY, 3, 3));
public static final Item TOOL_RUBY_HOE = registerItem("tool_ruby_hoe",
new HoeItem(ModToolMaterial.RUBY, 0, 0, new FabricItemSettings()));
public static final Item TOOL_RUBY_PICKAXE = registerItem("tool_ruby_pickaxe",
Expand All @@ -112,9 +103,8 @@ public class ModItems
//region SAPPHIRE TOOLS
public static final Item TOOL_SAPPHIRE_AXE = registerItem("tool_sapphire_axe",
new AxeItem(ModToolMaterial.SAPPHIRE, 3, 1, new FabricItemSettings()));
// TODO : HAMMER Item Object
public static final Item TOOL_SAPPHIRE_HAMMER = registerItem("tool_sapphire_hammer",
new Item(new FabricItemSettings().maxCount(1)));
new HammerItem(ModToolMaterial.SAPPHIRE, 3, 3));
public static final Item TOOL_SAPPHIRE_HOE = registerItem("tool_sapphire_hoe",
new HoeItem(ModToolMaterial.SAPPHIRE, 0, 0, new FabricItemSettings()));
public static final Item TOOL_SAPPHIRE_PICKAXE = registerItem("tool_sapphire_pickaxe",
Expand Down
Loading

0 comments on commit 858cd3e

Please sign in to comment.