-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ActuallyAdditions and Quark Mixins
Disable Disruption lens from ActuallyAdditions Disable Improved Sleeping from Quark
- Loading branch information
Showing
8 changed files
with
155 additions
and
3 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
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
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
48 changes: 48 additions & 0 deletions
48
...ing/sledgehammer/mixin/actuallyadditions/mod/tile/MixinTileEntityAtomicReconstructor.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,48 @@ | ||
/* | ||
* Copyright 2019 Alex Thomson | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.github.lxgaming.sledgehammer.mixin.actuallyadditions.mod.tile; | ||
|
||
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; | ||
import de.ellpeck.actuallyadditions.api.lens.ILensItem; | ||
import de.ellpeck.actuallyadditions.api.lens.Lens; | ||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor; | ||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityInventoryBase; | ||
import net.minecraft.item.Item; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Overwrite; | ||
|
||
@Mixin(value = TileEntityAtomicReconstructor.class, priority = 1337) | ||
public abstract class MixinTileEntityAtomicReconstructor extends TileEntityInventoryBase { | ||
|
||
public MixinTileEntityAtomicReconstructor(int slots, String name) { | ||
super(slots, name); | ||
} | ||
|
||
/** | ||
* @author LX_Gaming | ||
* @reason Disable Disruption Lens | ||
*/ | ||
@Overwrite(remap = false) | ||
public Lens getLens() { | ||
Item item = inv.getStackInSlot(0).getItem(); | ||
if (item instanceof ILensItem) { | ||
return ((ILensItem) item).getLens(); | ||
} | ||
|
||
return ActuallyAdditionsAPI.lensDefaultConversion; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/main/java/io/github/lxgaming/sledgehammer/mixin/quark/base/module/MixinModuleLoader.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,36 @@ | ||
/* | ||
* Copyright 2019 Alex Thomson | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.github.lxgaming.sledgehammer.mixin.quark.base.module; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
import vazkii.quark.base.module.Feature; | ||
import vazkii.quark.base.module.ModuleLoader; | ||
import vazkii.quark.tweaks.feature.ImprovedSleeping; | ||
|
||
@Mixin(value = ModuleLoader.class, priority = 1337, remap = false) | ||
public abstract class MixinModuleLoader { | ||
|
||
@Inject(method = "isFeatureEnabled", at = @At(value = "HEAD"), cancellable = true) | ||
private static void onIsFeatureEnabled(Class<? extends Feature> featureClass, CallbackInfoReturnable<Boolean> callbackInfoReturnable) { | ||
if (featureClass == ImprovedSleeping.class) { | ||
callbackInfoReturnable.setReturnValue(false); | ||
} | ||
} | ||
} |
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
15 changes: 15 additions & 0 deletions
15
src/main/resources/mixins.sledgehammer.actuallyadditions.json
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,15 @@ | ||
{ | ||
"required": true, | ||
"minVersion": "0.7.10", | ||
"package": "io.github.lxgaming.sledgehammer.mixin.actuallyadditions", | ||
"refmap": "mixins.sledgehammer.refmap.json", | ||
"plugin": "io.github.lxgaming.sledgehammer.mixin.plugin.CorePlugin", | ||
"target": "@env(DEFAULT)", | ||
"compatibilityLevel": "JAVA_8", | ||
"mixins": [ | ||
"mod.tile.MixinTileEntityAtomicReconstructor" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
} | ||
} |
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,15 @@ | ||
{ | ||
"required": true, | ||
"minVersion": "0.7.10", | ||
"package": "io.github.lxgaming.sledgehammer.mixin.quark", | ||
"refmap": "mixins.sledgehammer.refmap.json", | ||
"plugin": "io.github.lxgaming.sledgehammer.mixin.plugin.CorePlugin", | ||
"target": "@env(DEFAULT)", | ||
"compatibilityLevel": "JAVA_8", | ||
"mixins": [ | ||
"base.module.MixinModuleLoader" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
} | ||
} |