further disable cart
This commit is contained in:
parent
5513704a0b
commit
0040730368
1 changed files with 5 additions and 1 deletions
|
@ -7,6 +7,8 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntity;
|
import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntity;
|
||||||
|
import com.simibubi.create.content.contraptions.components.structureMovement.Contraption;
|
||||||
|
import com.simibubi.create.content.contraptions.components.structureMovement.mounted.MountedContraption;
|
||||||
import com.teammoeg.steampowered.SPConfig;
|
import com.teammoeg.steampowered.SPConfig;
|
||||||
|
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
|
@ -14,6 +16,8 @@ import net.minecraft.nbt.CompoundNBT;
|
||||||
@Mixin(AbstractContraptionEntity.class)
|
@Mixin(AbstractContraptionEntity.class)
|
||||||
public abstract class MixinAbstractContraption {
|
public abstract class MixinAbstractContraption {
|
||||||
boolean shoulddisb=false;
|
boolean shoulddisb=false;
|
||||||
|
@Shadow(remap=false)
|
||||||
|
protected Contraption contraption;
|
||||||
/**
|
/**
|
||||||
* @author khjxiaogu
|
* @author khjxiaogu
|
||||||
* @reason force reset contraptions for mod propose
|
* @reason force reset contraptions for mod propose
|
||||||
|
@ -42,7 +46,7 @@ public abstract class MixinAbstractContraption {
|
||||||
* */
|
* */
|
||||||
@Inject(at = @At("TAIL"), method = "tick",remap=true)
|
@Inject(at = @At("TAIL"), method = "tick",remap=true)
|
||||||
protected void tick(CallbackInfo cbi) {
|
protected void tick(CallbackInfo cbi) {
|
||||||
if(shoulddisb)
|
if(shoulddisb||((!SPConfig.SERVER.allowCartAssembler.get())&&contraption instanceof MountedContraption))
|
||||||
this.disassemble();
|
this.disassemble();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue