HBM NTM radiation system compat (#188)

This commit is contained in:
FalsePattern committed 2024-07-20 16:19:38 +02:00
1 parent 724508e1b0
commit 51023c0e6c
5 files changed
+94

No files matched your search

@@ -0,0 +1,43 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2024 FalsePattern
* All Rights Reserved
*
* The above copyright notice, this permission notice and the words "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.mixins.common.blockitem.ntm;
import com.falsepattern.endlessids.mixin.helpers.SubChunkBlockHook;
import com.hbm.handler.radiation.ChunkRadiationHandlerPRISM;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
@Mixin(ChunkRadiationHandlerPRISM.class)
public abstract class ChunkRadiationHandlerPRISMMixin {
@Redirect(method = "updateSystem",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/storage/ExtendedBlockStorage;getBlockLSBArray()[B"),
require = 1)
private byte[] extendLSBArray(ExtendedBlockStorage instance) {
return ((SubChunkBlockHook)instance).getB1();
}
}
@@ -0,0 +1,43 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2024 FalsePattern
* All Rights Reserved
*
* The above copyright notice, this permission notice and the words "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.mixins.common.blockitem.ntm;
import com.falsepattern.endlessids.mixin.helpers.SubChunkBlockHook;
import com.hbm.handler.radiation.ChunkRadiationHandlerPRISM;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
@Mixin(ChunkRadiationHandlerPRISM.SubChunk.class)
public abstract class ChunkRadiationHandlerPRISM_SubChunkMixin {
@Redirect(method = "rebuild",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/storage/ExtendedBlockStorage;getBlockLSBArray()[B"),
require = 1)
private byte[] extendLSBArray(ExtendedBlockStorage instance) {
return ((SubChunkBlockHook)instance).getB1();
}
}
@@ -215,6 +215,10 @@ public enum Mixin implements IMixin {
DragonAPIBlockPropertiesMixin(Side.COMMON, condition(() -> GeneralConfig.extendBlockItem).and(require(TargetedMod.DRAGONAPI)), "blockitem.dragonapi.BlockPropertiesMixin"),
DragonAPIBlockItemIDTypeMixin(Side.COMMON, condition(() -> GeneralConfig.extendBlockItem).and(require(TargetedMod.DRAGONAPI)), "blockitem.dragonapi.IDTypeMixin"),
//endregion DragonAPI
//region HBM's Nuclear Tech Nod
NTMChunkRadiationHandlerPRISMMixin(Side.COMMON, condition(() -> GeneralConfig.extendBlockItem).and(require(TargetedMod.HBM_NTM)), "blockitem.ntm.ChunkRadiationHandlerPRISMMixin"),
NTMChunkRadiationHandlerPRISM_SubChunkMixin(Side.COMMON, condition(() -> GeneralConfig.extendBlockItem).and(require(TargetedMod.HBM_NTM)), "blockitem.ntm.ChunkRadiationHandlerPRISMMixin"),
//endregion HBM's Nuclear Tech Nod
//region Matter Overdrive
MOInventoryMixin(Side.COMMON, condition(() -> GeneralConfig.extendBlockItem).and(require(TargetedMod.MATTEROVERDRIVE).or(require(TargetedMod.MATTERMEGADRIVE))), "blockitem.matteroverdrive.InventoryMixin"),
MOItemPatternMixin(Side.COMMON, condition(() -> GeneralConfig.extendBlockItem).and(require(TargetedMod.MATTEROVERDRIVE).or(require(TargetedMod.MATTERMEGADRIVE))), "blockitem.matteroverdrive.ItemPatternMixin"),
@@ -55,6 +55,7 @@ public enum TargetedMod implements ITargetedMod {
FUTUREPACK("Futurepack", false, contains("futurepack")),
GALACTICRAFTCORE("GalactiCraftCore", false, contains("galacticraftcore")),
GALAXYSPACE("GalaxySpace", false, contains("galaxyspace-")),
HBM_NTM("Hbm's Nuclear Tech Mod", false, contains("hbm-ntm")),
HIGHLANDS("Highlands", false, contains("highlands")),
ICG("Immersive Cavegen", false, contains("immersivecavegen")),
IR3("Industrial Revolution by Redstone Rebooted", false, contains("industrialrevolutionbyredstonerebooted-")),