Skip to content

Commit

Permalink
[24w12a] Initial port
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMCLoveMan committed Mar 21, 2024
1 parent 1bd24fe commit 2ea36b5
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 36 deletions.
8 changes: 0 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@ sourceSets.main.resources { srcDir 'src/generated/resources' }
repositories {
maven { url = "https://nexus.themcbrothers.net/repository/maven-mod-dependencies" }
mavenLocal()

maven {
name 'Maven for PR #715' // https://github.com/neoforged/NeoForge/pull/715
url 'https://prmaven.neoforged.net/NeoForge/pr715'
content {
includeModule('net.neoforged', 'neoforge')
}
}
}

dependencies {
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ mod_version=10.0.0-alpha
artifact_type=release

# Minecraft
minecraft_version=24w11a
minecraft_version_range=24w11a
minecraft_version=24w12a
minecraft_version_range=24w12a

# NeoForge
neo_version=20.5.0-alpha.24w11a.20240318.171240
neo_version_range=20.5.0-alpha.24w11a.20240318.171240
neo_version=20.5.0-alpha.24w12a.20240321.204905
neo_version_range=20.5.0-alpha.24w12a.20240321.204905
loader_version_range=[2,)

# Mappings
Expand All @@ -33,7 +33,7 @@ catalogue_item_icon=uselessmod:useless_ingot

# Dependencies
lib_version=7.0.0-SNAPSHOT
lib_version_range=24w11a-7.0.0-SNAPSHOT
lib_version_range=24w12a-7.0.0-SNAPSHOT
jei_version=17.3.0.49

# Publishing
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/net/themcbrothers/uselessmod/init/ModItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ static void register() {

// Armor
public static final DeferredItem<Item> USELESS_ELYTRA = ITEMS.register("useless_elytra", () -> new UselessElytraItem(new Item.Properties().durability(540).rarity(Rarity.UNCOMMON)));
public static final DeferredItem<Item> USELESS_HELMET = ITEMS.register("useless_helmet", () -> new ArmorItem(UselessArmorMaterials.USELESS, ArmorItem.Type.HELMET, new Item.Properties().defaultDurability(ArmorItem.Type.CHESTPLATE.getDurability(20))));
public static final DeferredItem<Item> USELESS_CHESTPLATE = ITEMS.register("useless_chestplate", () -> new ArmorItem(UselessArmorMaterials.USELESS, ArmorItem.Type.CHESTPLATE, new Item.Properties().defaultDurability(ArmorItem.Type.CHESTPLATE.getDurability(20))));
public static final DeferredItem<Item> USELESS_LEGGINGS = ITEMS.register("useless_leggings", () -> new ArmorItem(UselessArmorMaterials.USELESS, ArmorItem.Type.LEGGINGS, new Item.Properties().defaultDurability(ArmorItem.Type.CHESTPLATE.getDurability(20))));
public static final DeferredItem<Item> USELESS_BOOTS = ITEMS.register("useless_boots", () -> new ArmorItem(UselessArmorMaterials.USELESS, ArmorItem.Type.BOOTS, new Item.Properties().defaultDurability(ArmorItem.Type.CHESTPLATE.getDurability(20))));
public static final DeferredItem<Item> USELESS_HELMET = ITEMS.register("useless_helmet", () -> new ArmorItem(UselessArmorMaterials.USELESS, ArmorItem.Type.HELMET, new Item.Properties().durability(ArmorItem.Type.CHESTPLATE.getDurability(20))));
public static final DeferredItem<Item> USELESS_CHESTPLATE = ITEMS.register("useless_chestplate", () -> new ArmorItem(UselessArmorMaterials.USELESS, ArmorItem.Type.CHESTPLATE, new Item.Properties().durability(ArmorItem.Type.CHESTPLATE.getDurability(20))));
public static final DeferredItem<Item> USELESS_LEGGINGS = ITEMS.register("useless_leggings", () -> new ArmorItem(UselessArmorMaterials.USELESS, ArmorItem.Type.LEGGINGS, new Item.Properties().durability(ArmorItem.Type.CHESTPLATE.getDurability(20))));
public static final DeferredItem<Item> USELESS_BOOTS = ITEMS.register("useless_boots", () -> new ArmorItem(UselessArmorMaterials.USELESS, ArmorItem.Type.BOOTS, new Item.Properties().durability(ArmorItem.Type.CHESTPLATE.getDurability(20))));
public static final DeferredItem<Item> SUPER_USELESS_ELYTRA = ITEMS.register("super_useless_elytra", () -> new UselessElytraItem(new Item.Properties().durability(864).rarity(Rarity.UNCOMMON)));
public static final DeferredItem<Item> SUPER_USELESS_HELMET = ITEMS.register("super_useless_helmet", () -> new ArmorItem(UselessArmorMaterials.SUPER_USELESS, ArmorItem.Type.HELMET, new Item.Properties().defaultDurability(ArmorItem.Type.CHESTPLATE.getDurability(22))));
public static final DeferredItem<Item> SUPER_USELESS_CHESTPLATE = ITEMS.register("super_useless_chestplate", () -> new ArmorItem(UselessArmorMaterials.SUPER_USELESS, ArmorItem.Type.CHESTPLATE, new Item.Properties().defaultDurability(ArmorItem.Type.CHESTPLATE.getDurability(22))));
public static final DeferredItem<Item> SUPER_USELESS_LEGGINGS = ITEMS.register("super_useless_leggings", () -> new ArmorItem(UselessArmorMaterials.SUPER_USELESS, ArmorItem.Type.LEGGINGS, new Item.Properties().defaultDurability(ArmorItem.Type.CHESTPLATE.getDurability(22))));
public static final DeferredItem<Item> SUPER_USELESS_BOOTS = ITEMS.register("super_useless_boots", () -> new ArmorItem(UselessArmorMaterials.SUPER_USELESS, ArmorItem.Type.BOOTS, new Item.Properties().defaultDurability(ArmorItem.Type.CHESTPLATE.getDurability(22))));
public static final DeferredItem<Item> SUPER_USELESS_HELMET = ITEMS.register("super_useless_helmet", () -> new ArmorItem(UselessArmorMaterials.SUPER_USELESS, ArmorItem.Type.HELMET, new Item.Properties().durability(ArmorItem.Type.CHESTPLATE.getDurability(22))));
public static final DeferredItem<Item> SUPER_USELESS_CHESTPLATE = ITEMS.register("super_useless_chestplate", () -> new ArmorItem(UselessArmorMaterials.SUPER_USELESS, ArmorItem.Type.CHESTPLATE, new Item.Properties().durability(ArmorItem.Type.CHESTPLATE.getDurability(22))));
public static final DeferredItem<Item> SUPER_USELESS_LEGGINGS = ITEMS.register("super_useless_leggings", () -> new ArmorItem(UselessArmorMaterials.SUPER_USELESS, ArmorItem.Type.LEGGINGS, new Item.Properties().durability(ArmorItem.Type.CHESTPLATE.getDurability(22))));
public static final DeferredItem<Item> SUPER_USELESS_BOOTS = ITEMS.register("super_useless_boots", () -> new ArmorItem(UselessArmorMaterials.SUPER_USELESS, ArmorItem.Type.BOOTS, new Item.Properties().durability(ArmorItem.Type.CHESTPLATE.getDurability(22))));

public static final DeferredItem<Item> USELESS_SKELETON_SKULL = ITEMS.register("useless_skeleton_skull", () -> new StandingAndWallBlockItem(ModBlocks.USELESS_SKELETON_SKULL.get(), ModBlocks.USELESS_SKELETON_WALL_SKULL.get(), new Item.Properties().rarity(Rarity.UNCOMMON), Direction.DOWN));

Expand Down
6 changes: 2 additions & 4 deletions src/main/java/net/themcbrothers/uselessmod/init/ModTiers.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import net.neoforged.neoforge.common.SimpleTier;

public final class ModTiers {
public static final Tier USELESS = new SimpleTier(2, 300, 7.0F, 2.5F, 15,
BlockTags.NEEDS_IRON_TOOL, () -> Ingredient.of(ModItems.USELESS_INGOT.get()));
public static final Tier SUPER_USELESS = new SimpleTier(3, 1200, 9.0F, 3.0F, 14,
BlockTags.NEEDS_IRON_TOOL, () -> Ingredient.of(ModItems.SUPER_USELESS_INGOT.get()));
public static final Tier USELESS = new SimpleTier(BlockTags.INCORRECT_FOR_IRON_TOOL, 300, 7.0F, 2.5F, 15, () -> Ingredient.of(ModItems.USELESS_INGOT.get()));
public static final Tier SUPER_USELESS = new SimpleTier(BlockTags.INCORRECT_FOR_DIAMOND_TOOL, 1200, 9.0F, 3.0F, 14, () -> Ingredient.of(ModItems.SUPER_USELESS_INGOT.get()));
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.themcbrothers.uselessmod.world.entity.animal;

import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundEvents;
Expand All @@ -13,6 +14,7 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.gameevent.GameEvent;
import net.minecraft.world.level.storage.loot.LootTable;
import net.themcbrothers.uselessmod.init.ModBlocks;
import net.themcbrothers.uselessmod.init.ModEntityTypes;
import net.themcbrothers.uselessmod.world.level.storage.loot.UselessLootTables;
Expand All @@ -28,7 +30,7 @@ public UselessSheep(EntityType<? extends Sheep> type, Level level) {
}

@Override
public ResourceLocation getDefaultLootTable() {
public ResourceKey<LootTable> getDefaultLootTable() {
if (this.isSheared()) {
return this.getType().getDefaultLootTable();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.NonNullList;
import net.minecraft.core.RegistryAccess;
import net.minecraft.network.RegistryFriendlyByteBuf;
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.util.ExtraCodecs;
Expand Down Expand Up @@ -88,7 +88,7 @@ public boolean matches(Container container, Level level) {
}

@Override
public ItemStack getResultItem(RegistryAccess registryAccess) {
public ItemStack getResultItem(HolderLookup.Provider lookupProvider) {
return this.result;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.themcbrothers.uselessmod.world.item.crafting;

import net.minecraft.core.RegistryAccess;
import net.minecraft.core.HolderLookup;
import net.minecraft.world.inventory.CraftingContainer;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.CraftingBookCategory;
Expand Down Expand Up @@ -33,7 +33,7 @@ public boolean matches(CraftingContainer container, Level level) {
}

@Override
public ItemStack assemble(CraftingContainer container, RegistryAccess registryAccess) {
public ItemStack assemble(CraftingContainer container, HolderLookup.Provider lookupProvider) {
ItemStack stack = ItemStack.EMPTY;
boolean isBlock = false;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package net.themcbrothers.uselessmod.world.item.crafting;

import com.google.common.collect.Lists;
import net.minecraft.core.RegistryAccess;
import net.minecraft.core.HolderLookup;
import net.minecraft.world.inventory.CraftingContainer;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.item.ItemStack;
Expand Down Expand Up @@ -48,7 +48,7 @@ public boolean matches(CraftingContainer container, Level level) {
}

@Override
public ItemStack assemble(CraftingContainer container, RegistryAccess registryAccess) {
public ItemStack assemble(CraftingContainer container, HolderLookup.Provider lookupProvider) {
ItemStack brushStack = ItemStack.EMPTY;
List<DyeColor> dyes = Lists.newArrayList();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ public void load(CompoundTag tag, HolderLookup.Provider lookupProvider) {

@Override
public void collectComponents(DataComponentMap.Builder builder) {
builder.set(NeoForgeMod.FLUID_STACK_COMPONENT.get(), this.colorTank.getFluid().immutable());
builder.set(NeoForgeMod.FLUID_STACK_COMPONENT.get(), this.colorTank.getFluid());
}

@Override
public void applyComponents(DataComponentMap components) {
this.colorTank.setFluid(FluidStack.of(components.getOrDefault(NeoForgeMod.FLUID_STACK_COMPONENT.get(), FluidStack.EMPTY.immutable())));
this.colorTank.setFluid(components.getOrDefault(NeoForgeMod.FLUID_STACK_COMPONENT.get(), FluidStack.EMPTY));
}

@SuppressWarnings("deprecation")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package net.themcbrothers.uselessmod.world.level.storage.loot;

import net.minecraft.resources.ResourceLocation;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.level.storage.loot.LootTable;
import net.themcbrothers.uselessmod.UselessMod;

public class UselessLootTables {
public static final ResourceLocation SHEEP_USELESS = UselessMod.rl("entities/useless_sheep/useless");
public static final ResourceKey<LootTable> SHEEP_USELESS = ResourceKey.create(Registries.LOOT_TABLE, UselessMod.rl("entities/useless_sheep/useless"));
}

0 comments on commit 2ea36b5

Please sign in to comment.