-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #577 from Dertiende/1.20
port last patch 1.19->1.20
- Loading branch information
Showing
18 changed files
with
518 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,45 @@ | ||
package mcjty.xnet.apiimpl; | ||
|
||
import mcjty.rftoolsbase.api.xnet.keys.SidedConsumer; | ||
import mcjty.xnet.modules.cables.blocks.ConnectorTileEntity; | ||
import net.minecraft.core.BlockPos; | ||
|
||
public record ConnectedBlock<T>(SidedConsumer sidedConsumer, T settings, BlockPos connectorPos){ | ||
import javax.annotation.Nonnull; | ||
|
||
|
||
public class ConnectedBlock<T> { | ||
@Nonnull private final SidedConsumer sidedConsumer; | ||
@Nonnull private final T settings; | ||
@Nonnull private final BlockPos connectorPos; | ||
@Nonnull private final BlockPos blockPos; | ||
@Nonnull private final ConnectorTileEntity connectorEntity; | ||
|
||
public ConnectedBlock(@Nonnull SidedConsumer sidedConsumer, @Nonnull T settings, @Nonnull BlockPos connectorPos, | ||
@Nonnull BlockPos blockPos, @Nonnull ConnectorTileEntity connectorEntity) { | ||
this.sidedConsumer = sidedConsumer; | ||
this.settings = settings; | ||
this.connectorPos = connectorPos; | ||
this.blockPos = blockPos; | ||
this.connectorEntity = connectorEntity; | ||
} | ||
|
||
@Nonnull | ||
public SidedConsumer sidedConsumer() {return sidedConsumer;} | ||
|
||
@Nonnull | ||
public T settings() {return settings;} | ||
|
||
@Nonnull | ||
public BlockPos connectorPos() {return connectorPos;} | ||
|
||
@Nonnull | ||
public BlockPos getBlockPos() { | ||
return blockPos; | ||
} | ||
|
||
@Nonnull | ||
public ConnectorTileEntity getConnectorEntity() { | ||
return connectorEntity; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package mcjty.xnet.apiimpl; | ||
|
||
import mcjty.rftoolsbase.api.xnet.keys.SidedConsumer; | ||
import mcjty.xnet.apiimpl.logic.ConnectedEntity; | ||
import mcjty.xnet.modules.cables.blocks.ConnectorTileEntity; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
public class ConnectedInventory<T, H> extends ConnectedEntity<T> { | ||
@Nonnull private final H handler; | ||
|
||
public ConnectedInventory(@Nonnull SidedConsumer sidedConsumer, @Nonnull T settings, @Nonnull BlockPos connectorPos, | ||
@Nonnull BlockPos blockPos, @Nonnull BlockEntity connectedEntity, | ||
@Nonnull ConnectorTileEntity connectorEntity, @Nonnull H handler) { | ||
super(sidedConsumer, settings, connectorPos, blockPos, connectedEntity, connectorEntity); | ||
this.handler = handler; | ||
} | ||
|
||
@Nonnull | ||
public H getHandler() { | ||
return handler; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
src/main/java/mcjty/xnet/apiimpl/energy/EnergyConnectedBlock.java
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
src/main/java/mcjty/xnet/apiimpl/energy/EnergyConnectedEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package mcjty.xnet.apiimpl.energy; | ||
|
||
import mcjty.rftoolsbase.api.xnet.keys.SidedConsumer; | ||
import mcjty.xnet.apiimpl.logic.ConnectedEntity; | ||
import mcjty.xnet.modules.cables.blocks.ConnectorTileEntity; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
public final class EnergyConnectedEntity extends ConnectedEntity<EnergyConnectorSettings> { | ||
private final int rate; | ||
|
||
public EnergyConnectedEntity(@Nonnull SidedConsumer sidedConsumer, @Nonnull EnergyConnectorSettings settings, | ||
@Nonnull BlockPos connectorPos, @Nonnull BlockPos blockPos, @Nonnull BlockEntity connectedEntity, | ||
@Nonnull ConnectorTileEntity connectorEntity, int rate) { | ||
super(sidedConsumer, settings, connectorPos, blockPos, connectedEntity, connectorEntity); | ||
this.rate = rate; | ||
} | ||
|
||
public int rate() {return rate;} | ||
} |
Oops, something went wrong.