Skip to content

Commit b38ec27

Browse files
committed
调整实现
1 parent 73ab039 commit b38ec27

6 files changed

Lines changed: 52 additions & 2 deletions

File tree

gradle/scripts/dependencies.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ dependencies {
4545

4646
modImplementation 'curse.maven:modularui-624243:7929464'
4747
modCompileOnly 'curse.maven:electroblobs-wizardry-265642:5354477'
48-
modImplementation 'curse.maven:modularmachinery-community-edition-817377:7306619'
4948
modImplementation name: 'MMCE-ComponentModelHider', version: '1.1', classifier: 'dev'
5049
modImplementation name: 'resourceloader', version: '1.5.3', classifier: 'main'
5150
modImplementation name: 'circulation_networks-1.12.2', version: '1.0.3', classifier: 'dev'
51+
modImplementation name: 'ModularMachinery-CE', version: '2.3.3', classifier: 'dev'
5252
modImplementation 'curse.maven:extended-crafting-terminals-for-applied-1157825:6503414'
5353
modImplementation 'curse.maven:lumenized-1234162:6378222'
5454
modImplementation 'curse.maven:mantle-74924:2713386'
2.02 MB
Binary file not shown.

src/main/java/github/kasuminova/novaeng/mixin/NovaEngCoreLateMixinLoader.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public boolean shouldApplyMixin(final String targetClassName, final String mixin
4343
case "botania_r" -> Loader.isModLoaded("botania") && NovaEngCoreConfig.SERVER.bot;
4444
case "ae2" -> Loader.isModLoaded("appliedenergistics2");
4545
case "ar" -> Loader.isModLoaded("advancedrocketry");
46+
case "actuallyadditions" -> Loader.isModLoaded("actuallyadditions");
4647
case "astralsorcery" -> Loader.isModLoaded("astralsorcery");
4748
case "athenaeum" -> Loader.isModLoaded("athenaeum");
4849
case "betterp2p" -> Loader.isModLoaded("betterp2p");
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package github.kasuminova.novaeng.mixin.actuallyadditions;
2+
3+
import de.ellpeck.actuallyadditions.api.tile.IPhantomTile;
4+
import de.ellpeck.actuallyadditions.mod.tile.TileEntityInventoryBase;
5+
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomface;
6+
import net.minecraft.util.math.BlockPos;
7+
import org.spongepowered.asm.mixin.Mixin;
8+
import org.spongepowered.asm.mixin.Overwrite;
9+
import org.spongepowered.asm.mixin.Shadow;
10+
import org.spongepowered.asm.mixin.injection.At;
11+
import org.spongepowered.asm.mixin.injection.Inject;
12+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
13+
14+
@Mixin(TileEntityPhantomface.class)
15+
public abstract class MixinTileEntityPhantomface extends TileEntityInventoryBase {
16+
17+
@Shadow public BlockPos boundPosition;
18+
19+
public MixinTileEntityPhantomface(int slots, String name) {
20+
super(slots, name);
21+
}
22+
23+
@Inject(method = "updateEntity",at = @At(value = "INVOKE", target = "Lde/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface;upgradeRange(ILnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)I",shift = At.Shift.BEFORE,remap = false), cancellable = true)
24+
public void updateEntity(CallbackInfo ci) {
25+
if (boundPosition != null) {
26+
if (!world.isBlockLoaded(boundPosition)) {
27+
ci.cancel();
28+
}
29+
}
30+
}
31+
32+
/**
33+
* @author circulation
34+
* @reason 防止意外的区块加载
35+
*/
36+
@Overwrite(remap = false)
37+
public boolean hasBoundPosition() {
38+
if (this.boundPosition == null || !world.isBlockLoaded(this.boundPosition)) {
39+
return false;
40+
} else if (!(this.world.getTileEntity(this.boundPosition) instanceof IPhantomTile) && (this.getPos().getX() != this.boundPosition.getX() || this.getPos().getY() != this.boundPosition.getY() || this.getPos().getZ() != this.boundPosition.getZ())) {
41+
return true;
42+
} else {
43+
this.boundPosition = null;
44+
return false;
45+
}
46+
}
47+
48+
}

src/main/resources/mixins.novaeng_core.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"minecraft.forge.MixinForgeHooksClient"
2020
],
2121
"mixins": [
22+
"minecraft.MixinWorld",
2223
"minecraft.MixinNettyPacketDecoder",
2324
"minecraft.MixinRecipeBookServer",
2425
"minecraft.forge.MixinFMLProxyPacket",

src/main/resources/mixins.novaeng_core.mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"immersiveengineering.MixinTileEntityExcavator"
3535
],
3636
"mixins": [
37+
"actuallyadditions.MixinTileEntityPhantomface",
3738
"ae2.AccessorAbstractCellInventory",
3839
"ae2.AccessorCellRegistry",
3940
"ae2.AccessorContainerCraftConfirm",
@@ -78,7 +79,6 @@
7879
"libvulpes.MixinTileFluidHatch",
7980
"lootoverhaul.MixinConfigIdFileGenerator",
8081
"mets.MixinEntityTachyonBullet",
81-
"minecraft.MixinWorld",
8282
"mmce.AccessorAbstractMachine",
8383
"mmce.MixinBlockArrayCache",
8484
"mmce.MixinBlockArrayPreviewRenderHelper",

0 commit comments

Comments
 (0)