Skip to content

Commit

Permalink
Refactors I
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Sep 4, 2024
1 parent 02f2770 commit a2cce5b
Show file tree
Hide file tree
Showing 30 changed files with 412 additions and 216 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ void addToBogeyEntryList(BogeyEntry entry) {
}

public static class FavoritesCategory extends CategoryEntry {

public static final CategoryEntry INSTANCE = new FavoritesCategory();

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
package com.railwayteam.railways.base.data.recipe;

import com.railwayteam.railways.Railways;
import com.railwayteam.railways.mixin.AccessorIngredient_TagValue;
import com.railwayteam.railways.registry.CRBlocks;
import com.railwayteam.railways.mixin.AccessorIngredient$TagValue;
import com.railwayteam.railways.registry.CRItems;
import com.railwayteam.railways.registry.CRTrackMaterials;
import com.railwayteam.railways.util.TextUtils;
Expand Down Expand Up @@ -117,14 +116,14 @@ protected GeneratedRecipe create(String name, Function<RailwaysSequencedAssembly
Ingredient railsIngredient = baseMaterial.railsIngredient;
if (railsIngredient.values.length == 2 && Arrays.stream(railsIngredient.values).allMatch((value) -> {
return value instanceof Ingredient.TagValue tagValue
&& (((AccessorIngredient_TagValue)tagValue).getTag().equals(AllTags.forgeItemTag("nuggets/iron"))
|| ((AccessorIngredient_TagValue)tagValue).getTag().equals(AllTags.forgeItemTag("nuggets/zinc"))
|| ((AccessorIngredient_TagValue)tagValue).getTag().equals(AllTags.forgeItemTag("iron_nuggets"))
|| ((AccessorIngredient_TagValue)tagValue).getTag().equals(AllTags.forgeItemTag("zinc_nuggets"))); // TODO wait until create fabric merge such difference between 1.18 and 1.19
&& (((AccessorIngredient$TagValue)tagValue).getTag().equals(AllTags.forgeItemTag("nuggets/iron"))
|| ((AccessorIngredient$TagValue)tagValue).getTag().equals(AllTags.forgeItemTag("nuggets/zinc"))
|| ((AccessorIngredient$TagValue)tagValue).getTag().equals(AllTags.forgeItemTag("iron_nuggets"))
|| ((AccessorIngredient$TagValue)tagValue).getTag().equals(AllTags.forgeItemTag("zinc_nuggets"))); // TODO wait until create fabric merge such difference between 1.18 and 1.19
})) {
railsIngredient = Ingredient.fromValues(Stream.of(
AccessorIngredient_TagValue.railways$create(Ingredients.ironNugget()),
AccessorIngredient_TagValue.railways$create(Ingredients.zincNugget())));
AccessorIngredient$TagValue.railways$create(Ingredients.ironNugget()),
AccessorIngredient$TagValue.railways$create(Ingredients.zincNugget())));
}

Ingredient finalRailsIngredient = railsIngredient;
Expand All @@ -146,14 +145,14 @@ protected GeneratedRecipe create(String name, Function<RailwaysSequencedAssembly
Ingredient railsIngredient = material.railsIngredient;
if (railsIngredient.values.length == 2 && Arrays.stream(railsIngredient.values).allMatch((value) -> {
return value instanceof Ingredient.TagValue tagValue
&& (((AccessorIngredient_TagValue) tagValue).getTag().equals(AllTags.forgeItemTag("nuggets/iron"))
|| ((AccessorIngredient_TagValue) tagValue).getTag().equals(AllTags.forgeItemTag("nuggets/zinc"))
|| ((AccessorIngredient_TagValue) tagValue).getTag().equals(AllTags.forgeItemTag("iron_nuggets"))
|| ((AccessorIngredient_TagValue) tagValue).getTag().equals(AllTags.forgeItemTag("zinc_nuggets"))); // TODO wait until create fabric merge such difference between 1.18 and 1.19
&& (((AccessorIngredient$TagValue) tagValue).getTag().equals(AllTags.forgeItemTag("nuggets/iron"))
|| ((AccessorIngredient$TagValue) tagValue).getTag().equals(AllTags.forgeItemTag("nuggets/zinc"))
|| ((AccessorIngredient$TagValue) tagValue).getTag().equals(AllTags.forgeItemTag("iron_nuggets"))
|| ((AccessorIngredient$TagValue) tagValue).getTag().equals(AllTags.forgeItemTag("zinc_nuggets"))); // TODO wait until create fabric merge such difference between 1.18 and 1.19
})) {
railsIngredient = Ingredient.fromValues(Stream.of(
AccessorIngredient_TagValue.railways$create(Ingredients.ironNugget()),
AccessorIngredient_TagValue.railways$create(Ingredients.zincNugget())));
AccessorIngredient$TagValue.railways$create(Ingredients.ironNugget()),
AccessorIngredient$TagValue.railways$create(Ingredients.zincNugget())));
}

Ingredient finalRailsIngredient = railsIngredient;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Steam 'n' Rails
* Copyright (c) 2024 The Railways Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.railwayteam.railways.base.datafixers;

import com.google.common.collect.ImmutableList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.railwayteam.railways.Railways;
import com.railwayteam.railways.compat.Mods;
import com.railwayteam.railways.config.CRConfigs;
import com.railwayteam.railways.mixin.AccessorIngredient_TagValue;
import com.railwayteam.railways.mixin.AccessorIngredient$TagValue;
import com.railwayteam.railways.multiloader.CommonTags;
import com.railwayteam.railways.registry.CRBlocks;
import com.railwayteam.railways.registry.CRTrackMaterials;
Expand Down Expand Up @@ -159,8 +159,8 @@ protected String getLang(String name) {

protected Ingredient getIngredientForRail() {
return Ingredient.fromValues(Stream.of(
AccessorIngredient_TagValue.railways$create(CommonTags.IRON_NUGGETS.tag),
AccessorIngredient_TagValue.railways$create(CommonTags.ZINC_NUGGETS.tag)
AccessorIngredient$TagValue.railways$create(CommonTags.IRON_NUGGETS.tag),
AccessorIngredient$TagValue.railways$create(CommonTags.ZINC_NUGGETS.tag)
));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Steam 'n' Rails
* Copyright (c) 2024 The Railways Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.railwayteam.railways.compat.tracks.mods;

import com.railwayteam.railways.Railways;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
/*
* Steam 'n' Rails
* Copyright (c) 2024 The Railways Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.railwayteam.railways.compat.tracks.mods;

import com.railwayteam.railways.Railways;
import com.railwayteam.railways.compat.Mods;
import com.railwayteam.railways.compat.tracks.GenericTrackCompat;
import com.railwayteam.railways.mixin.AccessorIngredient_TagValue;
import com.railwayteam.railways.mixin.AccessorIngredient$TagValue;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
Expand All @@ -19,8 +37,8 @@ public class TFCTrackCompat extends GenericTrackCompat {
@Override
protected Ingredient getIngredientForRail() {
return Ingredient.fromValues(Stream.of(
AccessorIngredient_TagValue.railways$create(TagKey.create(Registries.ITEM, new ResourceLocation("forge", "rods/wrought_iron"))),
AccessorIngredient_TagValue.railways$create(TagKey.create(Registries.ITEM, new ResourceLocation("forge", "rods/zinc")))
AccessorIngredient$TagValue.railways$create(TagKey.create(Registries.ITEM, new ResourceLocation("forge", "rods/wrought_iron"))),
AccessorIngredient$TagValue.railways$create(TagKey.create(Registries.ITEM, new ResourceLocation("forge", "rods/zinc")))
));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Steam 'n' Rails
* Copyright (c) 2024 The Railways Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.railwayteam.railways.mixin;

import net.minecraft.world.item.CreativeModeTab;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.spongepowered.asm.mixin.gen.Invoker;

@Mixin(Ingredient.TagValue.class)
public interface AccessorIngredient_TagValue {
public interface AccessorIngredient$TagValue {
@Invoker("<init>")
static Ingredient.TagValue railways$create(TagKey<Item> tag) {
throw new AssertionError();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Steam 'n' Rails
* Copyright (c) 2024 The Railways Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.railwayteam.railways.mixin;

import com.mojang.datafixers.DataFixer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Steam 'n' Rails
* Copyright (c) 2024 The Railways Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.railwayteam.railways.mixin.client;

import net.minecraft.world.entity.WalkAnimationState;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Steam 'n' Rails
* Copyright (c) 2024 The Railways Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.railwayteam.railways.mixin.client;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Steam 'n' Rails
* Copyright (c) 2024 The Railways Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.railwayteam.railways.mixin.client;

import com.mojang.blaze3d.platform.NativeImage;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Steam 'n' Rails
* Copyright (c) 2024 The Railways Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.railwayteam.railways.mixin_interfaces;

public interface AnimatedTextureDuck {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Steam 'n' Rails
* Copyright (c) 2024 The Railways Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.railwayteam.railways.mixin_interfaces;

public interface IPotentiallyInvisibleSpriteContents {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import static com.railwayteam.railways.registry.CRTrackMaterials.CRTrackType.WIDE_GAUGE;

public class CRBlockPartials {

public static final Map<DyeColor, PartialModel> TOOLBOX_BODIES = new EnumMap<>(DyeColor.class);
public static final Map<DyeColor, PartialModel> CONDUCTOR_WHISTLE_FLAGS = new EnumMap<>(DyeColor.class);
public static final Map<String, PartialModel> CUSTOM_CONDUCTOR_CAPS = new HashMap<>();
Expand Down Expand Up @@ -538,6 +537,5 @@ private static PartialModel block(String path) {
}

@SuppressWarnings("EmptyMethod")
public static void init() {
}
public static void init() {}
}
Loading

0 comments on commit a2cce5b

Please sign in to comment.