Skip to content

Commit

Permalink
Merge branch 'refs/heads/1.19/dev' into 1.20/dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	common/src/generated/resources/.cache/1cd10ece6c88656b8f50f9539c66ccb227c56fd8
#	common/src/generated/resources/.cache/751457ce789dd6b8b7567cd82d35b9752aafe975
#	common/src/generated/resources/.cache/c3c688c4efe8f57272b43a9a4840c55a7086f208
#	common/src/generated/resources/.cache/d7e494d5d0e99c7bbf8df1e22c97c22b5c6944c1
#	common/src/main/java/com/railwayteam/railways/content/palettes/boiler/BoilerBlock.java
#	gradle.properties
  • Loading branch information
IThundxr committed Jul 9, 2024
2 parents 79d95af + 45f8aa6 commit 96ccd4e
Show file tree
Hide file tree
Showing 17 changed files with 601 additions and 603 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true
cache-read-only: ${{ !endsWith(github.ref, '/dev') }}

- name: Validate Gradle Wrapper Integrity
uses: gradle/wrapper-validation-action@v2
Expand Down
30 changes: 24 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ import net.fabricmc.loom.task.RemapJarTask
import org.gradle.configurationcache.extensions.capitalized
import org.objectweb.asm.ClassReader
import org.objectweb.asm.ClassWriter
import org.objectweb.asm.Type
import org.objectweb.asm.tree.AnnotationNode
import org.objectweb.asm.tree.ClassNode
import org.objectweb.asm.tree.FieldNode
import org.objectweb.asm.tree.MethodNode
import java.io.ByteArrayOutputStream
import java.util.*
import java.util.function.Predicate
import java.util.jar.JarEntry
import java.util.jar.JarFile
import java.util.jar.JarOutputStream
Expand Down Expand Up @@ -293,21 +292,40 @@ fun transformClass(bytes: ByteArray): ByteArray {

fun removeIfDevMixin(nodeName: String, visibleAnnotations: List<AnnotationNode>?): Boolean {
// Don't remove methods if it's not a GHA build/Release build
if (buildNumber == null || !nodeName.lowercase(Locale.ROOT).matches(Regex(".*\\/mixin\\/.*Mixin")))
if (buildNumber == null && !nodeName.lowercase(Locale.ROOT).matches(Regex(".*\\/mixin\\/.*Mixin")))
return false

if (visibleAnnotations != null) {
for (annotationNode in visibleAnnotations) {
if (annotationNode.desc == "Lcom/railwayteam/railways/annotation/mixin/DevEnvMixin;") {
println("Removed Method/Field Annotated With @DevEnvMixin from: $nodeName")
if (annotationNode.desc == "Lcom/railwayteam/railways/annotation/mixin/DevEnvMixin;")
return true
}
}
}

return false
}

fun <T> getValueFromAnnotation(annotation: AnnotationNode?, key: String): T? {
var getNextValue = false

if (annotation?.values == null) {
return null
}

// Keys and value are stored in successive pairs, search for the key and if found return the following entry
for (value in annotation.values) {
if (getNextValue) {
@Suppress("UNCHECKED_CAST")
return value as T
}
if (value == key) {
getNextValue = true
}
}

return null
}

tasks.create("railwaysPublish") {
when (val platform = System.getenv("PLATFORM")) {
"both" -> {
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Fixes
- Fix hunger depletion when controlling trains
- Texture inconsistency with the white color used for the favourites button
- Bogey Menu scrollbar not having ridges like other scroll bars in Minecraft
- Fix handcars parking at stations allowing them to be disassembled

Changes
- Lower particle count for boiler blocks being broken
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static void init() {
registerCommands(CRCommands::register);
CRPackets.PACKETS.registerC2SListener();

if (Utils.isDevEnv() && !Mods.BYG.isLoaded && !Mods.SODIUM.isLoaded) // force all mixins to load in dev
if (Utils.isDevEnv() && !Mods.BYG.isLoaded && !Mods.SODIUM.isLoaded && !Utils.isEnvVarTrue("DATAGEN")) // force all mixins to load in dev
MixinEnvironment.getCurrentEnvironment().audit();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public record BogeyEntry(@NotNull BogeyStyle bogeyStyle, @Nullable ResourceLocation iconLocation, float scale) {
public static final Map<BogeyStyle, BogeyEntry> STYLE_TO_ENTRY = new HashMap<>();
public static final Map<BogeyStyle, BogeyEntry> STYLE_TO_ENTRY = new ConcurrentHashMap<>();

public static BogeyEntry getOrCreate(@NotNull CategoryEntry categoryEntry, @NotNull BogeyStyle bogeyStyle, @Nullable ResourceLocation iconLocation, float scale) {
BogeyEntry entry = getOrCreate(bogeyStyle, iconLocation, scale);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import com.railwayteam.railways.registry.CRShapes;
import com.simibubi.create.content.equipment.extendoGrip.ExtendoGripItem;
import com.simibubi.create.content.equipment.wrench.IWrenchable;
import com.simibubi.create.foundation.block.render.ReducedDestroyEffects;
import com.simibubi.create.foundation.placement.IPlacementHelper;
import com.simibubi.create.foundation.placement.PlacementHelpers;
import com.simibubi.create.foundation.placement.PlacementOffset;
Expand Down Expand Up @@ -67,7 +66,7 @@
import java.util.Locale;
import java.util.function.Predicate;

public class BoilerBlock extends Block implements IWrenchable, IHasCustomOutline, ReducedDestroyEffects {
public class BoilerBlock extends Block implements IWrenchable, IHasCustomOutline {
public static final int placementHelperId = PlacementHelpers.register(new PlacementHelper());
public static final EnumProperty<Style> STYLE = EnumProperty.create("style", Style.class);
public static final EnumProperty<Axis> HORIZONTAL_AXIS = BlockStateProperties.HORIZONTAL_AXIS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@ApiStatus.Internal
public class BogeyMenuManagerImpl implements BogeyMenuManager {
/** Internal use only, do NOT touch. */
@ApiStatus.Internal public static final List<CategoryEntry> CATEGORIES = new ArrayList<>();
/** Internal use only, do NOT touch. */
@ApiStatus.Internal public static final Map<Pair<BogeyStyle, BogeySizes.BogeySize>, Float> SIZES_TO_SCALE = new HashMap<>();
@ApiStatus.Internal public static final Map<Pair<BogeyStyle, BogeySizes.BogeySize>, Float> SIZES_TO_SCALE = new ConcurrentHashMap<>();

static {
CATEGORIES.add(CategoryEntry.FavoritesCategory.INSTANCE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.railwayteam.railways.multiloader.PlayerSelection;
import com.railwayteam.railways.registry.CRPackets;
import com.railwayteam.railways.registry.CRTags;
import com.simibubi.create.content.schematics.SchematicWorld;
import com.simibubi.create.content.trains.track.BezierConnection;
import com.simibubi.create.content.trains.track.TrackBlock;
import com.simibubi.create.content.trains.track.TrackBlockEntity;
Expand Down Expand Up @@ -81,7 +82,8 @@ public void setTrackCasing(@Nullable SlabBlock trackCasing) {
BlockState blockState = this.level.getBlockState(worldPosition);
if (blockState.hasProperty(TrackBlock.HAS_BE))
level.setBlockAndUpdate(worldPosition, blockState.setValue(TrackBlock.HAS_BE, false));
CRPackets.PACKETS.sendTo(PlayerSelection.tracking(this), new RemoveBlockEntityPacket(worldPosition));
if (!(this.level instanceof SchematicWorld))
CRPackets.PACKETS.sendTo(PlayerSelection.tracking(this), new RemoveBlockEntityPacket(worldPosition));
}
} else if (trackCasing != null && !isAlternateModel) {
CasingCollisionUtils.manageTracks((TrackBlockEntity) (Object) this, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package com.railwayteam.railways.mixin;

import com.railwayteam.railways.content.coupling.TrainUtils;
import com.railwayteam.railways.mixin_interfaces.IHandcarTrain;
import com.simibubi.create.content.trains.entity.Train;
import com.simibubi.create.content.trains.entity.TrainRelocator;
import com.simibubi.create.content.trains.track.BezierTrackPointLocation;
Expand All @@ -36,7 +37,7 @@ public class MixinTrainRelocator {
private static void tryToApproachStation(Train train, Level level, BlockPos pos, BezierTrackPointLocation bezier,
boolean bezierDirection, Vec3 lookAngle, boolean simulate,
CallbackInfoReturnable<Boolean> cir) {
if (!simulate && !level.isClientSide)
if (!simulate && !level.isClientSide && !((IHandcarTrain) train).railways$isHandcar())
TrainUtils.tryToParkNearby(train, 1.25);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@
"create.railways.switch.auto_mode.manual_only": "Manual Trains Only",
"create.railways.switch.auto_mode.auto": "Manual & Scheduled Trains",

"railways.bogeys.styles.handcar": "Handcar",

"railways.bogeys.styles.invisible": "Invisible",
"railways.bogeys.styles.invisible_monobogey": "Invisible Monobogey",
"railways.bogeys.styles.monobogey": "Monobogey",
Expand Down
Loading

0 comments on commit 96ccd4e

Please sign in to comment.