This commit is contained in:
rjnasers committed 2026-01-24 01:17:44 +01:00
1 parent 1c035f6110
commit 761a5631fe
4 files changed
+78 -14

No files matched your search

+11
View File
@@ -9,6 +9,7 @@ minecraft_fp {
modid = "endlessids"
name = "EndlessIDs"
rootPkg = "$group.endlessids"
version = "1.6.14"
}
mixin {
@@ -54,6 +55,8 @@ minecraft_fp {
}
repositories {
maven("https://maven.curseforge.com")
maven("https://nexus.gtnewhorizons.com/repository/public/")
cursemavenEX()
modrinthEX()
exclusive(mavenpattern(), "com.falsepattern")
@@ -86,6 +89,14 @@ dependencies {
// region unmaintained mods
devOnlyNonPublishable("com.github.GTNewHorizons:Galaxy-Space-GTNH:1.1.126-GTNH:dev") { isTransitive = false }
devOnlyNonPublishable("com.github.GTNewHorizons:Galacticraft:3.4.15-GTNH:dev") { isTransitive = false }
devOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.8.50-GTNH:dev") { isTransitive = false}
devOnlyNonPublishable("com.github.GTNewHorizons:CodeChickenCore:1.4.7:dev") { isTransitive = false}
devOnlyNonPublishable("curse.maven:industrial-craft-242638:6833054") { isTransitive = false }
devOnlyNonPublishable("com.github.GTNewHorizons:TinkersConstruct:1.14.17-GTNH:dev") { isTransitive = false }
devOnlyNonPublishable("com.github.GTNewHorizons:Mantle:0.5.1:dev")
//AbyssalCraft 1.9.1.3-FINAL
compileOnly(deobfCurse("abyssalcraft-53686:2311135"))
@@ -0,0 +1,50 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2025 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "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, only version 3 of the License.
*
* 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 Lesser 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.thermos;
import com.falsepattern.endlessids.config.GeneralConfig;
import lombok.var;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
@Mixin(ExtendedBlockStorage.class)
public class ExtendedBlockStorageMixin
{
@Redirect(method = "removeInvalidBlocks",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/storage/ExtendedBlockStorage;getBlockByExtId(III)Lnet/minecraft/block/Block;"),
require = 1)
private Block removeInvalidBlocks(ExtendedBlockStorage instance, int x, int y, int z) {
var block = instance.getBlockByExtId(x, y, z);
if (block == null && GeneralConfig.removeInvalidBlocks) {
instance.func_150818_a(x, y, z, Blocks.air);
block = Blocks.air;
}
return block;
}
}
@@ -189,19 +189,6 @@ public abstract class ExtendedBlockStorageMixin implements SubChunkBlockHook {
setExtBlockMetadata(x, y, z, id);
}
@Redirect(method = "removeInvalidBlocks",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/storage/ExtendedBlockStorage;getBlockByExtId(III)Lnet/minecraft/block/Block;"),
require = 1)
private Block removeInvalidBlocks(ExtendedBlockStorage instance, int x, int y, int z) {
var block = instance.getBlockByExtId(x, y, z);
if (block == null && GeneralConfig.removeInvalidBlocks) {
instance.func_150818_a(x, y, z, Blocks.air);
block = Blocks.air;
}
return block;
}
private UnsupportedOperationException emergencyCrash() {
val crashMSG = "A mod that is incompatible with " + Tags.MODNAME + " has tried to access the block array of a" +
" chunk like in vanilla! Crashing in fear of potential world corruption!\n" +
@@ -418,7 +418,11 @@ public enum Mixin implements IMixins {
// endregion Biome
// region BlockItem
BlockItem_Thermos(Phase.EARLY,
() -> { return Ext.BlockItem.getAsBoolean() && !hasThermos(); },
common("blockitem.thermos.ExtendedBlockStorageMixin")),
BlockItem_Vanilla(Phase.EARLY,
Ext.BlockItem,
common("blockitem.vanilla.BlockFireMixin",
@@ -607,4 +611,16 @@ public enum Mixin implements IMixins {
public static final BooleanSupplier Potion = () -> GeneralConfig.extendPotion;
public static final BooleanSupplier Entity = () -> GeneralConfig.extendEntity;
}
static boolean hasThermos()
{
try
{
Class.forName("thermos.Thermos");
return true;
}
catch(ClassNotFoundException ignored) {
return false;
}
}
}