Skip to content

Commit

Permalink
Ditch migrations that are no longer needed
Browse files Browse the repository at this point in the history
Anything 1.16 is not a problem
Mid 1.18 stuff depends on when they are updating from, I think its safe to assume they installed the latest 1.18 build assuming that will work
  • Loading branch information
KnightMiner committed Mar 15, 2024
1 parent 226e3d7 commit 988da5d
Show file tree
Hide file tree
Showing 26 changed files with 0 additions and 256 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

52 changes: 0 additions & 52 deletions src/main/java/slimeknights/tconstruct/TConstruct.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
package slimeknights.tconstruct;

import net.minecraft.core.Registry;
import net.minecraft.data.DataGenerator;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.ItemLike;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.data.ExistingFileHelper;
Expand All @@ -20,10 +15,8 @@
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.MissingMappingsEvent;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import slimeknights.mantle.registration.RegistrationHelper;
import slimeknights.tconstruct.common.TinkerModule;
import slimeknights.tconstruct.common.TinkerTags;
import slimeknights.tconstruct.common.config.Config;
Expand Down Expand Up @@ -61,7 +54,6 @@
import slimeknights.tconstruct.world.TinkerStructures;
import slimeknights.tconstruct.world.TinkerWorld;

import javax.annotation.Nullable;
import java.util.Locale;
import java.util.Random;
import java.util.function.Supplier;
Expand Down Expand Up @@ -160,50 +152,6 @@ static void gatherData(final GatherDataEvent event) {
*/
}

@Nullable
private static Block missingBlock(String name) {
return switch (name) {
case "copper_block" -> Blocks.COPPER_BLOCK;
case "copper_ore" -> Blocks.COPPER_ORE;
// tinker bronze -> amethyst bronze
case "tinkers_bronze_block" -> TinkerMaterials.amethystBronze.get();
case "molten_tinkers_bronze_fluid" -> TinkerFluids.moltenAmethystBronze.getBlock();
default -> null;
};
}

@SubscribeEvent
void missingMappings(MissingMappingsEvent event) {
// TODO: remove these as not needed anymore
// items
RegistrationHelper.handleMissingMappings(event, MOD_ID, Registry.ITEM_REGISTRY, name -> {
switch(name) {
case "copper_ingot": return Items.COPPER_INGOT;
case "blank_cast": return Items.GOLD_INGOT;
case "pickaxe_head": return TinkerToolParts.pickHead.get();
case "pickaxe_head_cast": return TinkerSmeltery.pickHeadCast.get();
case "pickaxe_head_sand_cast": return TinkerSmeltery.pickHeadCast.getSand();
case "pickaxe_head_red_sand_cast": return TinkerSmeltery.pickHeadCast.getRedSand();
// tinker bronze -> amethyst bronze
case "tinkers_bronze_ingot": TinkerMaterials.amethystBronze.getIngot();
case "tinkers_bronze_nugget": TinkerMaterials.amethystBronze.getNugget();
case "molten_tinkers_bronze_bucket": return TinkerFluids.moltenAmethystBronze.asItem();
case "flint_and_bronze": TinkerTools.flintAndBrick.get();
}
ItemLike block = missingBlock(name);
return block == null ? null : block.asItem();
});
// blocks
RegistrationHelper.handleMissingMappings(event, MOD_ID, Registry.BLOCK_REGISTRY, TConstruct::missingBlock);
// fluids
RegistrationHelper.handleMissingMappings(event, MOD_ID, Registry.FLUID_REGISTRY, name -> switch (name) {
// tinker bronze -> amethyst bronze
case "molten_tinkers_bronze" -> TinkerFluids.moltenAmethystBronze.get();
case "flowing_molten_tinkers_bronze" -> TinkerFluids.moltenAmethystBronze.getFlowing();
default -> null;
});
}


/* Utils */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,23 +128,6 @@ protected void addModifiers() {
buildModifier(ModifierIds.rebalanced)
.tooltipDisplay(TooltipDisplay.TINKER_STATION).levelDisplay(ModifierLevelDisplay.NO_LEVELS)
.addModule(new SwappableSlotModule(1)).addModule(new SwappableSlotModule.BonusSlot(SlotType.ABILITY, SlotType.UPGRADE, -1));
addRedirect(id("red_extra_upgrade"), redirect(ModifierIds.writable));
addRedirect(id("green_extra_upgrade"), redirect(ModifierIds.recapitated));
addRedirect(id("blue_extra_upgrade"), redirect(ModifierIds.harmonious));
addRedirect(id("extra_ability"), redirect(ModifierIds.draconic));

// internal modifier migration
addRedirect(id("shovel_flatten"), redirect(ModifierIds.pathing));
addRedirect(id("axe_strip"), redirect(ModifierIds.stripping));
addRedirect(id("hoe_till"), redirect(ModifierIds.tilling));
addRedirect(id("firestarter_hidden"), redirect(TinkerModifiers.firestarter.getId()));

// merged some armor modifiers
addRedirect(id("haste_armor"), redirect(TinkerModifiers.haste.getId()));
addRedirect(id("knockback_armor"), redirect(TinkerModifiers.knockback.getId()));

// unarmed rework
addRedirect(id("unarmed"), redirect(TinkerModifiers.ambidextrous.getId()));

// tier upgrades
// emerald
Expand Down Expand Up @@ -294,7 +277,6 @@ protected void addModifiers() {
buildModifier(ModifierIds.killager).addModule(IncrementalModule.RECIPE_CONTROLLED).addModule(ConditionalMeleeDamageModule.builder().target(LivingEntityPredicate.OR.create(
new MobTypePredicate(MobType.ILLAGER),
new TagEntityPredicate(TinkerTags.EntityTypes.VILLAGERS))).eachLevel(2.0f));
addRedirect(id("fractured"), redirect(ModifierIds.sharpness));
buildModifier(ModifierIds.pierce)
// less than sharpness, but pierces 1 armor
.addModule(StatBoostModule.add(ToolStats.ATTACK_DAMAGE).eachLevel(0.5f))
Expand Down Expand Up @@ -336,11 +318,9 @@ protected void addModifiers() {
buildModifier(ModifierIds.strength)
.addModule(IncrementalModule.RECIPE_CONTROLLED)
.addModule(AttributeModule.builder(Attributes.ATTACK_DAMAGE, Operation.MULTIPLY_TOTAL).uniqueFrom(ModifierIds.strength).slots(armorSlots).eachLevel(0.1f));
addRedirect(id("armor_power"), redirect(ModifierIds.strength));
// leggings
addModifier(ModifierIds.pockets, new InventoryMenuModifier(18));
addModifier(ModifierIds.toolBelt, new ToolBeltModifier(new int[] {4, 5, 6, 7, 8, 9}));
addRedirect(id("pocket_chain"), redirect(TinkerModifiers.shieldStrap.getId()));
buildModifier(ModifierIds.stepUp).addModule(AttributeModule.builder(ForgeMod.STEP_HEIGHT_ADDITION.get(), Operation.ADDITION).uniqueFrom(ModifierIds.stepUp).slots(armorSlots).eachLevel(0.5f));
buildModifier(ModifierIds.speedy).addModule(AttributeModule.builder(Attributes.MOVEMENT_SPEED, Operation.MULTIPLY_TOTAL).uniqueFrom(ModifierIds.speedy).slots(armorMainHand).eachLevel(0.1f));
// boots
Expand Down Expand Up @@ -369,8 +349,6 @@ protected void addModifiers() {
buildModifier(ModifierIds.tilling)
.addModule(ShowOffhandModule.DISALLOW_BROKEN)
.addModule(ToolActionTransformModule.builder(ToolActions.HOE_TILL, SoundEvents.HOE_TILL).build());
addRedirect(id("axe_scrape"), redirect(ModifierIds.stripping));
addRedirect(id("axe_wax_off"), redirect(ModifierIds.stripping));

// internal
buildModifier(ModifierIds.overslimeFriend).addModule(new VolatileFlagModule(OverslimeModifier.KEY_OVERSLIME_FRIEND)).tooltipDisplay(TooltipDisplay.NEVER);
Expand Down Expand Up @@ -454,7 +432,6 @@ protected void addModifiers() {
// traits - tier 3
buildModifier(ModifierIds.crumbling).addModule(ConditionalMiningSpeedModule.builder().blocks(BlockPredicate.REQUIRES_TOOL.inverted()).allowIneffective().eachLevel(0.5f));
buildModifier(ModifierIds.enhanced).priority(60).addModule(UPGRADE);
addRedirect(id("maintained_2"), redirect(ModifierIds.maintained));
// traits - tier 3 nether
buildModifier(ModifierIds.lightweight)
.addModule(StatBoostModule.multiplyBase(ToolStats.ATTACK_SPEED).eachLevel(0.07f))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package slimeknights.tconstruct.tools.data.material;

import net.minecraft.data.DataGenerator;
import slimeknights.tconstruct.TConstruct;
import slimeknights.tconstruct.library.data.material.AbstractMaterialDataProvider;
import slimeknights.tconstruct.library.materials.definition.MaterialId;

public class MaterialDataProvider extends AbstractMaterialDataProvider {
public MaterialDataProvider(DataGenerator gen) {
Expand Down Expand Up @@ -112,13 +110,5 @@ protected void addMaterials() {
//addMaterial(MaterialIds.venom, 3, ORDER_REPAIR, true);
// slimesuit - repair
addMaterial(MaterialIds.phantom, 1, ORDER_REPAIR, true);

// legacy
addRedirect(new MaterialId(TConstruct.MOD_ID, "stone"), redirect(MaterialIds.rock));
addRedirect(new MaterialId(TConstruct.MOD_ID, "gunpowder"), redirect(MaterialIds.glass));
addRedirect(new MaterialId(TConstruct.MOD_ID, "spider"), redirect(MaterialIds.string));
addRedirect(new MaterialId(TConstruct.MOD_ID, "venom"), redirect(MaterialIds.darkthread));
addRedirect(new MaterialId(TConstruct.MOD_ID, "rabbit"), redirect(MaterialIds.leather));
addRedirect(new MaterialId(TConstruct.MOD_ID, "tinkers_bronze"), conditionalRedirect(MaterialIds.bronze, tagExistsCondition("ingots/bronze")), redirect(MaterialIds.copper));
}
}

0 comments on commit 988da5d

Please sign in to comment.