Skip to content

Commit

Permalink
Remove unused enchantment code
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Sep 4, 2024
1 parent 8271f68 commit ef62dd3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 144 deletions.
19 changes: 0 additions & 19 deletions src/main/java/com/tterrag/registrate/AbstractRegistrate.java
Original file line number Diff line number Diff line change
Expand Up @@ -1251,25 +1251,6 @@ public <T extends AbstractContainerMenu, SC extends Screen & MenuAccess<T>, P> M
return entry(name, callback -> new MenuBuilder<T, SC, P>(this, parent, name, callback, factory, screenFactory));
}

//fixme
// // Enchantment
//
// public <T extends Enchantment> EnchantmentBuilder<T, S> enchantment(Enchantment.EnchantmentDefinition definition, EnchantmentFactory<T> factory) {
// return enchantment(self(), definition, factory);
// }
//
// public <T extends Enchantment> EnchantmentBuilder<T, S> enchantment(String name, Enchantment.EnchantmentDefinition definition, EnchantmentFactory<T> factory) {
// return enchantment(self(), name, definition, factory);
// }
//
// public <T extends Enchantment, P> EnchantmentBuilder<T, P> enchantment(P parent, Enchantment.EnchantmentDefinition definition, EnchantmentFactory<T> factory) {
// return enchantment(parent, currentName(), definition, factory);
// }
//
// public <T extends Enchantment, P> EnchantmentBuilder<T, P> enchantment(P parent, String name, Enchantment.EnchantmentDefinition definition, EnchantmentFactory<T> factory) {
// return entry(name, callback -> EnchantmentBuilder.create(this, parent, name, callback, definition, factory));
// }

// Creative Tab

public NoConfigBuilder<CreativeModeTab, CreativeModeTab, S> defaultCreativeTab() {
Expand Down

This file was deleted.

31 changes: 1 addition & 30 deletions src/test/java/com/tterrag/registrate/test/mod/TestMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.tterrag.registrate.Registrate;
import com.tterrag.registrate.builders.BlockBuilder;
import com.tterrag.registrate.providers.ProviderType;
import com.tterrag.registrate.providers.RegistrateRecipeProvider;
import com.tterrag.registrate.util.DataIngredient;
import com.tterrag.registrate.util.entry.*;
import com.tterrag.registrate.util.nullness.NonnullType;
Expand All @@ -29,7 +28,6 @@
import net.minecraft.core.BlockPos;
import net.minecraft.core.Registry;
import net.minecraft.core.RegistrySetBuilder;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.recipes.RecipeCategory;
import net.minecraft.data.recipes.ShapedRecipeBuilder;
Expand All @@ -40,15 +38,12 @@
import net.minecraft.tags.EntityTypeTags;
import net.minecraft.tags.ItemTags;
import net.minecraft.util.valueproviders.UniformInt;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.MenuProvider;
import net.minecraft.world.SimpleContainer;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.MobCategory;
import net.minecraft.world.entity.SpawnPlacementTypes;
import net.minecraft.world.entity.SpawnPlacements;
import net.minecraft.world.entity.animal.Animal;
import net.minecraft.world.entity.animal.Pig;
import net.minecraft.world.entity.player.Inventory;
Expand All @@ -63,8 +58,6 @@
import net.minecraft.world.item.ItemDisplayContext;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.Rarity;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.biome.Biomes;
import net.minecraft.world.level.biome.FixedBiomeSource;
Expand Down Expand Up @@ -95,12 +88,10 @@
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
import net.neoforged.neoforge.client.extensions.common.IClientFluidTypeExtensions;
import net.neoforged.neoforge.common.crafting.IngredientType;
import net.neoforged.neoforge.common.data.DatapackBuiltinEntriesProvider;
import net.neoforged.neoforge.event.entity.RegisterSpawnPlacementsEvent;
import net.neoforged.neoforge.fluids.BaseFlowingFluid;
import net.neoforged.neoforge.fluids.FluidType;
import net.neoforged.neoforge.registries.NeoForgeRegistries;
import net.neoforged.neoforge.registries.RegistryBuilder;

@Mod("testmod")
Expand Down Expand Up @@ -180,19 +171,6 @@ public TestEntity(EntityType<? extends Pig> p_i50250_1_, Level p_i50250_2_) {
}
}

//fixme enchantments need reworking
// private static class TestEnchantment extends Enchantment {
//
// public TestEnchantment(Rarity rarityIn, EnchantmentCategory typeIn, EquipmentSlot... slots) {
// super(rarityIn, typeIn, slots);
// }
//
// @Override
// public int getMaxLevel() {
// return 5;
// }
// }

private static class TestCustomRegistryEntry {}

private final Registrate registrate = Registrate.create("testmod");
Expand Down Expand Up @@ -308,14 +286,7 @@ public ResourceLocation getFlowingTexture() {
private final MenuEntry<ChestMenu> testmenu = registrate.object("testmenu")
.menu((type, windowId, inv) -> new ChestMenu(type, windowId, inv, new SimpleContainer(9 * 9), 9), () -> ContainerScreen::new)
.register();

//fixme enchantments need reworking
// private final RegistryEntry<Enchantment, TestEnchantment> testenchantment = registrate.object("testenchantment")
// .enchantment(EnchantmentCategory.ARMOR, TestEnchantment::new)
// .rarity(Rarity.UNCOMMON)
// .addArmorSlots()
// .register();


// private final RegistryEntry<TestBiome> testbiome = registrate.object("testbiome")
// .biome(TestBiome::new)
// .properties(b -> b.category(Category.PLAINS)
Expand Down

0 comments on commit ef62dd3

Please sign in to comment.