Skip to content

Commit

Permalink
fix 1.19.2 gradle classes and librs
Browse files Browse the repository at this point in the history
  • Loading branch information
aleganza committed Feb 26, 2023
1 parent 6fbd3bd commit 5e4ecfc
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 337 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public void onInitialize() {
// This code runs as soon as Minecraft is in a mod-load-ready state.
// However, some things (like resources) may still be uninitialized.
// Proceed with mild caution.
ModItemGroup.registerItemGroup();

ModItems.registerModItems();
ModEffects.registerEffects();
}
Expand Down
27 changes: 4 additions & 23 deletions src/main/java/net/aleganza/plentyofarmors/effect/ModEffects.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,31 @@
import net.aleganza.plentyofarmors.PlentyOfArmors;
import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffectCategory;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;


public class ModEffects {
public static StatusEffect FROST_WALKER;
public static StatusEffect FIRE_WALKER;
public static StatusEffect THORNS;
/*public static StatusEffect SWIFT_SNEAK;*/
/*public static StatusEffect BOUNCING;*/
/*public static StatusEffect XP_ENHANCER;*/

public static StatusEffect registerFrostWalker(String name) {
return Registry.register(Registries.STATUS_EFFECT, new Identifier(PlentyOfArmors.MOD_ID, name),
return Registry.register(Registry.STATUS_EFFECT, new Identifier(PlentyOfArmors.MOD_ID, name),
new FrostWalkerEffect(StatusEffectCategory.NEUTRAL, 0x5fb2d9));
}
public static StatusEffect registerHeatWalker(String name) {
return Registry.register(Registries.STATUS_EFFECT, new Identifier(PlentyOfArmors.MOD_ID, name),
return Registry.register(Registry.STATUS_EFFECT, new Identifier(PlentyOfArmors.MOD_ID, name),
new FireWalkerEffect(StatusEffectCategory.NEUTRAL, 0x9e3c28));
}
public static StatusEffect registerThorns(String name) {
return Registry.register(Registries.STATUS_EFFECT, new Identifier(PlentyOfArmors.MOD_ID, name),
return Registry.register(Registry.STATUS_EFFECT, new Identifier(PlentyOfArmors.MOD_ID, name),
new ThornsEffect(StatusEffectCategory.BENEFICIAL, 0x289e33));
}
/*public static StatusEffect registerSwiftSneak(String name) {
return Registry.register(Registries.STATUS_EFFECT, new Identifier(PlentyOfArmors.MOD_ID, name),
new SwiftSneakEffect(StatusEffectCategory.NEUTRAL, 0x065769));
}*/
/*public static StatusEffect registerBouncing(String name) {
return Registry.register(Registries.STATUS_EFFECT, new Identifier(PlentyOfArmors.MOD_ID, name),
new BouncingEffect(StatusEffectCategory.BENEFICIAL, 0xf6f121));
}
public static StatusEffect registerXPEnhancer(String name) {
return Registry.register(Registries.STATUS_EFFECT, new Identifier(PlentyOfArmors.MOD_ID, name),
new XPEnhancerEffect(StatusEffectCategory.BENEFICIAL, 0xf6f121));
}*/

public static void registerEffects() {
FROST_WALKER = registerFrostWalker("frost_walker");
FIRE_WALKER = registerHeatWalker("fire_walker");
THORNS = registerThorns("thorns");
/*SWIFT_SNEAK = registerSwiftSneak("swift_sneak");*/
/*BOUNCING = registerBouncing("bouncing");
XP_ENHANCER = registerXPEnhancer("xp_enhancer");*/
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static void solidifyLava(LivingEntity entity, World world, BlockPos block
BlockState blockState3 = world.getBlockState(blockPos2);
if (blockState3.getMaterial() == Material.LAVA && (Integer)blockState3.get(FluidBlock.LEVEL) == 0 && blockState.canPlaceAt(world, blockPos2) && world.canPlace(blockState, blockPos2, ShapeContext.absent())) {
world.setBlockState(blockPos2, blockState);
world.scheduleBlockTick(blockPos2, Blocks.BLACKSTONE, MathHelper.nextInt(entity.getRandom(), 60, 120));
world.createAndScheduleBlockTick(blockPos2, Blocks.BLACKSTONE, MathHelper.nextInt(entity.getRandom(), 60, 120));
}
}
}
Expand Down
12 changes: 3 additions & 9 deletions src/main/java/net/aleganza/plentyofarmors/item/ModItemGroup.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
package net.aleganza.plentyofarmors.item;

import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;
import net.aleganza.plentyofarmors.PlentyOfArmors;
import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;

// add a new item group to the creative inventory A2%
public class ModItemGroup {

public static ItemGroup PLENTYOFARMOR;

public static void registerItemGroup() {
PLENTYOFARMOR = FabricItemGroup.builder(new Identifier(PlentyOfArmors.MOD_ID, "plentyofarmors"))
.displayName(Text.literal("Plenty Of Armors"))
.icon(() -> new ItemStack(ModItems.ADV_ICON)).build();
}
public static final ItemGroup PLENTYOFARMOR = FabricItemGroupBuilder.build(new Identifier(PlentyOfArmors.MOD_ID, "plentyofarmors"),
() -> new ItemStack(ModItems.ADV_ICON));
}
Loading

0 comments on commit 5e4ecfc

Please sign in to comment.