Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed May 12, 2024
1 parent ebd8b73 commit 3d23488
Show file tree
Hide file tree
Showing 26 changed files with 1,321 additions and 338 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.19.2 2024-04-14T13:29:32.961834342 Registrate Provider for railways [Recipes, Advancements, Loot tables, Tags (blocks), Tags (items), Tags (fluids), Tags (entity_types), Blockstates, Item models, Lang (en_us/en_ud)]
// 1.19.2 2024-05-12T18:10:06.973594621 Registrate Provider for railways [Recipes, Advancements, Loot tables, Tags (blocks), Tags (items), Tags (fluids), Tags (entity_types), Blockstates, Item models, Lang (en_us/en_ud)]
49895c50bb9ff7ecb89153ff98b3f0fc5097a3cf assets/railways/models/block/track/compat/blue_skies/starlit/diag.json
3d62ae4bfcb5ca63cd6568c0a4ef4989cf08ddc6 assets/railways/models/block/track/compat/biomesoplenty/umbran/cross_ortho.json
d7467241e8db763684674e0d86882686535cd3da assets/railways/models/block/track/compat/byg/holly_narrow/cross_d1_xo.json
Expand Down
1,529 changes: 1,283 additions & 246 deletions common/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.19.2 2024-04-14T13:29:32.98959521 Steam 'n' Rails EMI recipe tree defaults
// 1.19.2 2024-05-12T18:10:06.9671565 Steam 'n' Rails EMI recipe tree defaults
1dc6aa538b4bff0c8502fe157798936b096e6c6e assets/emi/recipe/defaults/railways.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.19.2 2024-04-14T13:29:32.989753419 Steam 'n' Rails EMI excluded tags
// 1.19.2 2024-05-12T18:10:06.963466866 Steam 'n' Rails EMI excluded tags
8ebd080b7100d3961fc94cc411b7bf522b0afcd6 assets/emi/tag/exclusions/railways.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public BlockState getStateForPlacement(BlockPlaceContext pContext) {
* BlockStateBase#hasAnalogOutputSignal} whenever possible.
* Implementing/overriding is fine.
*/
@SuppressWarnings("deprecation")
@Deprecated
@Override
public boolean hasAnalogOutputSignal(@NotNull BlockState state) {
return true;
Expand All @@ -63,7 +65,9 @@ public boolean hasAnalogOutputSignal(@NotNull BlockState state) {
* BlockStateBase#getAnalogOutputSignal} whenever possible.
* Implementing/overriding is fine.
*/
@Override
@SuppressWarnings("deprecation")
@Deprecated
@Override
public int getAnalogOutputSignal(@NotNull BlockState state, @NotNull Level level, @NotNull BlockPos pos) {
if (level.getBlockEntity(pos) instanceof TrackCouplerBlockEntity te)
return te.getTargetAnalogOutput();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ public void neighborChanged(BlockState state, Level level, BlockPos pos, Block b
* BlockStateBase#hasAnalogOutputSignal} whenever possible.
* Implementing/overriding is fine.
*/
@SuppressWarnings("deprecation")
@Deprecated
@Override
public boolean hasAnalogOutputSignal(@NotNull BlockState state) {
return true;
Expand All @@ -284,6 +286,8 @@ public boolean hasAnalogOutputSignal(@NotNull BlockState state) {
* BlockStateBase#getAnalogOutputSignal} whenever possible.
* Implementing/overriding is fine.
*/
@SuppressWarnings("deprecation")
@Deprecated
@Override
public int getAnalogOutputSignal(@NotNull BlockState state, @NotNull Level level, @NotNull BlockPos pos) {
if (level.getBlockEntity(pos) instanceof TrackSwitchBlockEntity te)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

@Mixin(CarriageContraption.class)
public interface AccessorCarriageContraption {
@Accessor
MountedStorageManager getStorageProxy();
@Accessor(value = "storageProxy", remap = false)
MountedStorageManager railways$getStorageProxy();
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@

@Mixin(MountedFluidStorage.class)
public interface AccessorMountedFluidStorage {
@Accessor SmartFluidTank getTank();
@Accessor(value = "tank", remap = false)
SmartFluidTank railways$getTank();
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

@Mixin(PortableStorageInterfaceBlockEntity.class)
public interface AccessorPortableStorageInterfaceBlockEntity {
@Invoker("isConnected")
@Invoker(value = "isConnected", remap = false)
boolean railways$isConnected();
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public class MixinAllBlocks {
),
slice = @Slice(
from = @At(value = "CONSTANT", args = "stringValue=sequenced_gearshift")
)
),
remap = false
)
private static <T extends Block, P> BlockBuilder<T, P> railways$addFlywheelMovementBehaviour(BlockBuilder<T, P> instance, NonNullUnaryOperator<BlockBehaviour.Properties> func, Operation<BlockBuilder<T, P>> original) {
return original.call(instance, func).onRegister(AllMovementBehaviours.movementBehaviour(new FlywheelMovementBehaviour()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

@Mixin(Contraption.class)
public abstract class MixinContraption implements IContraptionFuel {
@Shadow protected MountedStorageManager storage;
@Shadow(remap = false) protected MountedStorageManager storage;

@Shadow protected abstract BlockPos toLocalPos(BlockPos globalPos);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@Mixin(FlywheelBlockEntity.class)
public class MixinFlywheelBlockEntity implements ICarriageFlywheel {
@Shadow float angle;
@Shadow(remap = false) float angle;

@Override
public float railways$getAngle() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

@Mixin(TrackTargetingBehaviour.class)
public abstract class MixinTrackTargetingBehaviour<T extends TrackEdgePoint> extends BlockEntityBehaviour implements IPreAssembleCallback {
@Shadow private T edgePoint;
@Shadow(remap = false) private T edgePoint;

private MixinTrackTargetingBehaviour(SmartBlockEntity be) {
super(be);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@

@Mixin(value = TrainPacket.class, priority = 523) // random priority to ensure consistent order if another mod changes packets as well
public class MixinTrainPacket {
@Shadow
Train train;
@Shadow(remap = false) Train train;

@Inject(method = "write", at = @At(value = "RETURN", ordinal = 1))
private void writeHandcarStatus(FriendlyByteBuf buffer, CallbackInfo ci) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@

@Mixin(TrainStatus.class)
public class MixinTrainStatus {
@Shadow
Train train;
@Shadow(remap = false) Train train;

@WrapOperation(method = "displayInformation", at = @At(value = "INVOKE", target = "Ljava/util/List;add(Ljava/lang/Object;)Z"), remap = false)
private boolean addPositionInfo(List<?> instance, Object e, Operation<Boolean> original) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.railwayteam.railways.api.bogeymenu.v0;
package com.railwayteam.railways.api.bogeymenu.v0.fabric;

import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public PortableFuelInterfaceBlockEntity(BlockEntityType<?> type, BlockPos pos, B
public void startTransferringTo(Contraption contraption, float distance) {
CombinedTankWrapper ctw = ((IContraptionFuel) contraption).railways$getSharedFuelTanks();
if (contraption instanceof CarriageContraption carriageContraption) {
MountedStorageManager storageProxy = ((AccessorCarriageContraption) carriageContraption).getStorageProxy();
MountedStorageManager storageProxy = ((AccessorCarriageContraption) carriageContraption).railways$getStorageProxy();
ctw = ((IFuelInventory) storageProxy).railways$getFuelFluids();
}
capability.setWrapped(ctw);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.railwayteam.railways.registry.fabric;

import com.railwayteam.railways.api.bogeymenu.v0.BogeyMenuEvents;
import com.railwayteam.railways.api.bogeymenu.v0.fabric.BogeyMenuEvents;

public class CRBogeyStylesImpl {
public static void fireReadyForRegistrationEvent() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.railwayteam.railways.api.bogeymenu.v0;
package com.railwayteam.railways.api.bogeymenu.v0.forge;

import net.minecraftforge.eventbus.api.Event;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public PortableFuelInterfaceBlockEntity(BlockEntityType<?> type, BlockPos pos, B
public void startTransferringTo(Contraption contraption, float distance) {
CombinedTankWrapper ctw = ((IContraptionFuel) contraption).railways$getSharedFuelTanks();
if (contraption instanceof CarriageContraption carriageContraption) {
MountedStorageManager storageProxy = ((AccessorCarriageContraption) carriageContraption).getStorageProxy();
MountedStorageManager storageProxy = ((AccessorCarriageContraption) carriageContraption).railways$getStorageProxy();
ctw = ((IFuelInventory) storageProxy).railways$getFuelFluids();
}
CombinedTankWrapper finalCtw = ctw;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.common.util.ForgeSoundType;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
import net.minecraftforge.fluids.capability.IFluidHandler;

public class FuelTankBlock extends Block implements IWrenchable, IBE<FuelTankBlockEntity> {
Expand Down Expand Up @@ -124,7 +124,7 @@ public InteractionResult use(BlockState state, Level world, BlockPos pos, Player
if (be == null)
return InteractionResult.FAIL;

LazyOptional<IFluidHandler> tankCapability = be.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY);
LazyOptional<IFluidHandler> tankCapability = be.getCapability(ForgeCapabilities.FLUID_HANDLER);
if (!tankCapability.isPresent())
return InteractionResult.PASS;
IFluidHandler fluidTank = tankCapability.orElse(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.AABB;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidType;
import net.minecraftforge.fluids.IFluidTank;
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
import net.minecraftforge.fluids.capability.IFluidHandler;
import net.minecraftforge.fluids.capability.templates.FluidTank;

Expand Down Expand Up @@ -322,7 +322,7 @@ public boolean addToGoggleTooltip(List<Component> tooltip, boolean isPlayerSneak
if (controllerBE == null)
return false;
return containedFluidTooltip(tooltip, isPlayerSneaking,
controllerBE.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY));
controllerBE.getCapability(ForgeCapabilities.FLUID_HANDLER));
}

@Override
Expand Down Expand Up @@ -421,7 +421,7 @@ public void write(CompoundTag compound, boolean clientPacket) {
public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nullable Direction side) {
if (!fluidCapability.isPresent())
refreshCapability();
if (cap == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY)
if (cap == ForgeCapabilities.FLUID_HANDLER)
return fluidCapability.cast();
return super.getCapability(cap, side);
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void bindTanks(Map<BlockPos, BlockEntity> presentBlockEntities, CallbackI
return;
IFluidTank tankInventory = tank.getTankInventory();
if (tankInventory instanceof FluidTank)
((FluidTank) tankInventory).setFluid(((AccessorMountedFluidStorage) mfs).getTank().getFluid());
((FluidTank) tankInventory).setFluid(((AccessorMountedFluidStorage) mfs).railways$getTank().getFluid());
tank.getFluidLevel()
.startWithValue(tank.getFillState());
mfs.assignBlockEntity(tank);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.railwayteam.railways.Railways;
import com.railwayteam.railways.content.fuel.psi.PortableFuelInterfaceBlock;
import com.railwayteam.railways.content.fuel.tank.FuelTankBlock;
import com.railwayteam.railways.content.fuel.tank.FuelTankGenerator;
import com.railwayteam.railways.content.fuel.tank.FuelTankItem;
import com.railwayteam.railways.content.fuel.tank.FuelTankModel;
import com.simibubi.create.AllTags;
Expand All @@ -30,12 +29,13 @@
public class CRBlocksImpl {
private static final CreateRegistrate REGISTRATE = Railways.registrate();

@SuppressWarnings("removal")
public static final BlockEntry<FuelTankBlock> FUEL_TANK = REGISTRATE.block("fuel_tank", FuelTankBlock::new)
.initialProperties(SharedProperties::copperMetal)
.properties(BlockBehaviour.Properties::noOcclusion)
.properties(p -> p.isRedstoneConductor((p1, p2, p3) -> true))
.transform(pickaxeOnly())
.blockstate(new FuelTankGenerator()::generate)
//.blockstate(new FuelTankGenerator()::generate) Handled by fabric subproject
.onRegister(CreateRegistrate.blockModel(() -> FuelTankModel::standard))
.addLayer(() -> RenderType::cutoutMipped)
.item(FuelTankItem::new)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.railwayteam.railways.registry.forge;

import com.railwayteam.railways.api.bogeymenu.v0.BogeyMenuEvents;
import com.railwayteam.railways.api.bogeymenu.v0.forge.BogeyMenuEvents;
import net.minecraftforge.common.MinecraftForge;

public class CRBogeyStylesImpl {
Expand Down

0 comments on commit 3d23488

Please sign in to comment.