Skip to content

Commit f1ffe9b

Browse files
committed
Add interface for chassis pipes, closes #1579
1 parent de401cb commit f1ffe9b

File tree

3 files changed

+123
-8
lines changed

3 files changed

+123
-8
lines changed

.idea/libraries-with-intellij-classes.xml

+65
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/logisticspipes/pipes/PipeLogisticsChassis.java

+9-8
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,12 @@
9696
import network.rs485.logisticspipes.connection.NeighborTileEntity;
9797
import network.rs485.logisticspipes.connection.SingleAdjacent;
9898
import network.rs485.logisticspipes.module.PipeServiceProviderUtilKt;
99+
import network.rs485.logisticspipes.pipes.IChassisPipe;
99100

100101
@CCType(name = "LogisticsChassiePipe")
101-
public abstract class PipeLogisticsChassis extends CoreRoutedPipe implements ICraftItems, IBufferItems, ISimpleInventoryEventHandler, ISendRoutedItem, IProvideItems, IHeadUpDisplayRendererProvider, ISendQueueContentRecieiver {
102+
public abstract class PipeLogisticsChassis extends CoreRoutedPipe
103+
implements ICraftItems, IBufferItems, ISimpleInventoryEventHandler, ISendRoutedItem, IProvideItems,
104+
IHeadUpDisplayRendererProvider, ISendQueueContentRecieiver, IChassisPipe {
102105

103106
private final ChassisModule _module;
104107
private final ItemIdentifierInventory _moduleInventory;
@@ -155,7 +158,8 @@ protected void updateAdjacentCache() {
155158
}
156159
}
157160

158-
private void nextOrientation() {
161+
@Override
162+
public void nextOrientation() {
159163
final SingleAdjacent pointedAdjacent = getPointedAdjacent();
160164
Pair<NeighborTileEntity<TileEntity>, ConnectionType> newNeighbor;
161165
if (pointedAdjacent == null) {
@@ -175,6 +179,7 @@ private void nextOrientation() {
175179
refreshRender(true);
176180
}
177181

182+
@Override
178183
public void setPointedOrientation(@Nullable EnumFacing dir) {
179184
if (dir == null) {
180185
setPointedAdjacent(null);
@@ -183,6 +188,8 @@ public void setPointedOrientation(@Nullable EnumFacing dir) {
183188
}
184189
}
185190

191+
@Override
192+
@Nonnull
186193
public IInventory getModuleInventory() {
187194
return _moduleInventory;
188195
}
@@ -387,8 +394,6 @@ public void ignoreDisableUpdateEntity() {
387394
}
388395
}
389396

390-
public abstract int getChassisSize();
391-
392397
@Override
393398
public final LogisticsModule getLogisticsModule() {
394399
return _module;
@@ -541,10 +546,6 @@ public void handleModuleItemIdentifierList(Collection<ItemIdentifierStack> _allI
541546
_moduleInventory.handleItemIdentifierList(_allItems);
542547
}
543548

544-
public void handleContentItemIdentifierList(Collection<ItemIdentifierStack> _allItems) {
545-
_moduleInventory.handleItemIdentifierList(_allItems);
546-
}
547-
548549
@Override
549550
public int sendQueueChanged(boolean force) {
550551
if (MainProxy.isServer(getWorld())) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Copyright (c) 2021 RS485
3+
*
4+
* "LogisticsPipes" is distributed under the terms of the Minecraft Mod Public
5+
* License 1.0.1, or MMPL. Please check the contents of the license located in
6+
* https://github.com/RS485/LogisticsPipes/blob/dev/LICENSE.md
7+
*
8+
* This file can instead be distributed under the license terms of the
9+
* MIT license:
10+
*
11+
* Copyright (c) 2021 RS485
12+
*
13+
* This MIT license was reworded to only match this file. If you use the regular
14+
* MIT license in your project, replace this copyright notice (this line and any
15+
* lines below and NOT the copyright line above) with the lines from the original
16+
* MIT license located here: http://opensource.org/licenses/MIT
17+
*
18+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
19+
* this file and associated documentation files (the "Source Code"), to deal in
20+
* the Source Code without restriction, including without limitation the rights to
21+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
22+
* of the Source Code, and to permit persons to whom the Source Code is furnished
23+
* to do so, subject to the following conditions:
24+
*
25+
* The above copyright notice and this permission notice shall be included in all
26+
* copies or substantial portions of the Source Code, which also can be
27+
* distributed under the MIT.
28+
*
29+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35+
* SOFTWARE.
36+
*/
37+
38+
package network.rs485.logisticspipes.pipes
39+
40+
import net.minecraft.inventory.IInventory
41+
import net.minecraft.util.EnumFacing
42+
43+
interface IChassisPipe {
44+
fun nextOrientation()
45+
fun setPointedOrientation(dir: EnumFacing?)
46+
fun getPointedOrientation(): EnumFacing?
47+
fun getModuleInventory(): IInventory
48+
fun getChassisSize(): Int
49+
}

0 commit comments

Comments
 (0)