mirror of
https://github.com/GTMEGA/EndlessIDs.git
synced 2026-11-26 23:13:19 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d7a4411a2 | ||
|
|
fdd9fde9c9 | ||
|
|
f0ab23044f | ||
|
|
1c70006519 | ||
|
|
93fa055660 | ||
|
|
1c035f6110 |
No files matched your search
+5
-2
@@ -65,7 +65,7 @@ dependencies {
|
|||||||
// region Our deps
|
// region Our deps
|
||||||
implementationSplit("com.falsepattern:falsepatternlib-mc1.7.10:1.9.0")
|
implementationSplit("com.falsepattern:falsepatternlib-mc1.7.10:1.9.0")
|
||||||
compileOnly("it.unimi.dsi:fastutil:8.5.16")
|
compileOnly("it.unimi.dsi:fastutil:8.5.16")
|
||||||
implementationSplit("com.falsepattern:chunkapi-mc1.7.10:0.6.4")
|
implementationSplit("com.falsepattern:chunkapi-mc1.7.10:0.8.0")
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
// region maintained mods
|
// region maintained mods
|
||||||
@@ -210,6 +210,9 @@ dependencies {
|
|||||||
//Nostalgic World Generation 1.0.0
|
//Nostalgic World Generation 1.0.0
|
||||||
compileOnly(deobfCurse("nostalgiagenerator-927053:4816167"))
|
compileOnly(deobfCurse("nostalgiagenerator-927053:4816167"))
|
||||||
|
|
||||||
|
//Personal Space 1.0.33
|
||||||
|
compileOnly(deobfCurse("PersonalSpace-819596:6536785"))
|
||||||
|
|
||||||
//RandomThings 2.2.4
|
//RandomThings 2.2.4
|
||||||
compileOnly(deobfCurse("randomthings-59816:2225310"))
|
compileOnly(deobfCurse("randomthings-59816:2225310"))
|
||||||
|
|
||||||
@@ -260,4 +263,4 @@ dependencies {
|
|||||||
//needed by: Biome Wand
|
//needed by: Biome Wand
|
||||||
//Source: http://spacechase0.com/files/mcmod/1.7.10-SpaceCore-0.7.14.jar
|
//Source: http://spacechase0.com/files/mcmod/1.7.10-SpaceCore-0.7.14.jar
|
||||||
compileOnly(deobf("mirror:1.7.10-SpaceCore:0.7.14"))
|
compileOnly(deobf("mirror:1.7.10-SpaceCore:0.7.14"))
|
||||||
}
|
}
|
||||||
@@ -42,7 +42,7 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
|||||||
version = Tags.VERSION,
|
version = Tags.VERSION,
|
||||||
name = Tags.MODNAME,
|
name = Tags.MODNAME,
|
||||||
acceptedMinecraftVersions = "[1.7.10]",
|
acceptedMinecraftVersions = "[1.7.10]",
|
||||||
dependencies = "required-after:chunkapi@[0.6.4,);" +
|
dependencies = "required-after:chunkapi@[0.8.0,);" +
|
||||||
"required-after:falsepatternlib@[1.9.0,);" +
|
"required-after:falsepatternlib@[1.9.0,);" +
|
||||||
"after:antiidconflict")
|
"after:antiidconflict")
|
||||||
public class EndlessIDs {
|
public class EndlessIDs {
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ import static com.falsepattern.endlessids.constants.ExtendedConstants.blocksPerS
|
|||||||
import static com.falsepattern.endlessids.util.DataUtil.*;
|
import static com.falsepattern.endlessids.util.DataUtil.*;
|
||||||
|
|
||||||
//NOTE: Also change the save logic in MapWriter mod if changing this
|
//NOTE: Also change the save logic in MapWriter mod if changing this
|
||||||
public class BlockIDManager implements DataManager.PacketDataManager, DataManager.SubChunkDataManager, DataManager.BlockPacketDataManager {
|
public class BlockIDManager implements DataManager.PacketDataManager, DataManager.CubicPacketDataManager, DataManager.SubChunkDataManager, DataManager.BlockPacketDataManager {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String domain() {
|
public String domain() {
|
||||||
@@ -259,4 +259,77 @@ public class BlockIDManager implements DataManager.PacketDataManager, DataManage
|
|||||||
public void readBlockPacketFromBuffer(S23PacketBlockChange packet, PacketBuffer buffer) {
|
public void readBlockPacketFromBuffer(S23PacketBlockChange packet, PacketBuffer buffer) {
|
||||||
packet.field_148883_d = Block.getBlockById(buffer.readInt());
|
packet.field_148883_d = Block.getBlockById(buffer.readInt());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int maxPacketSizeCubic() {
|
||||||
|
return 3 * 16 * 16 * 16 + 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToBuffer(Chunk chunk, ExtendedBlockStorage extendedBlockStorage, ByteBuffer data) {
|
||||||
|
val subChunk = (SubChunkBlockHook) extendedBlockStorage;
|
||||||
|
|
||||||
|
data.put((byte) subChunk.eid$getBlockMask());
|
||||||
|
|
||||||
|
val b1 = subChunk.eid$getB1();
|
||||||
|
data.put(b1);
|
||||||
|
|
||||||
|
val b2Low = subChunk.eid$getB2Low();
|
||||||
|
if (b2Low == null) return;
|
||||||
|
data.put(b2Low.data);
|
||||||
|
|
||||||
|
val b2High = subChunk.eid$getB2High();
|
||||||
|
if (b2High == null) return;
|
||||||
|
data.put(b2High.data);
|
||||||
|
|
||||||
|
val b3 = subChunk.eid$getB3();
|
||||||
|
if (b3 != null) {
|
||||||
|
data.put(b3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readFromBuffer(Chunk chunk, ExtendedBlockStorage extendedBlockStorage, ByteBuffer data) {
|
||||||
|
val subChunk = (SubChunkBlockHook) extendedBlockStorage;
|
||||||
|
val storageFlag = data.get();
|
||||||
|
|
||||||
|
val b1 = subChunk.eid$getB1();
|
||||||
|
data.get(b1);
|
||||||
|
|
||||||
|
if (storageFlag == 0b00) {
|
||||||
|
subChunk.eid$setB2Low(null);
|
||||||
|
subChunk.eid$setB2High(null);
|
||||||
|
subChunk.eid$setB3(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var b2Low = subChunk.eid$getB2Low();
|
||||||
|
if (b2Low == null) {
|
||||||
|
b2Low = subChunk.eid$createB2Low();
|
||||||
|
}
|
||||||
|
data.get(b2Low.data);
|
||||||
|
|
||||||
|
if (storageFlag == 0b01) {
|
||||||
|
subChunk.eid$setB2High(null);
|
||||||
|
subChunk.eid$setB3(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var b2High = subChunk.eid$getB2High();
|
||||||
|
if (b2High == null) {
|
||||||
|
b2High = subChunk.eid$createB2High();
|
||||||
|
}
|
||||||
|
data.get(b2High.data);
|
||||||
|
|
||||||
|
if (storageFlag == 0b10) {
|
||||||
|
subChunk.eid$setB3(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var b3 = subChunk.eid$getB3();
|
||||||
|
if (b3 == null) {
|
||||||
|
b3 = subChunk.eid$createB3();
|
||||||
|
}
|
||||||
|
data.get(b3);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -44,7 +44,7 @@ import java.nio.ByteBuffer;
|
|||||||
import static com.falsepattern.endlessids.constants.ExtendedConstants.blocksPerSubChunk;
|
import static com.falsepattern.endlessids.constants.ExtendedConstants.blocksPerSubChunk;
|
||||||
|
|
||||||
//NOTE: Also change the save logic in MapWriter mod if changing this
|
//NOTE: Also change the save logic in MapWriter mod if changing this
|
||||||
public class BlockMetaManager implements DataManager.PacketDataManager, DataManager.SubChunkDataManager, DataManager.BlockPacketDataManager {
|
public class BlockMetaManager implements DataManager.PacketDataManager, DataManager.CubicPacketDataManager, DataManager.SubChunkDataManager, DataManager.BlockPacketDataManager {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String domain() {
|
public String domain() {
|
||||||
@@ -233,4 +233,60 @@ public class BlockMetaManager implements DataManager.PacketDataManager, DataMana
|
|||||||
public void readBlockPacketFromBuffer(S23PacketBlockChange packet, PacketBuffer buffer) {
|
public void readBlockPacketFromBuffer(S23PacketBlockChange packet, PacketBuffer buffer) {
|
||||||
packet.field_148884_e = buffer.readUnsignedShort();
|
packet.field_148884_e = buffer.readUnsignedShort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int maxPacketSizeCubic() {
|
||||||
|
return 2 * 16 * 16 * 16 + 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToBuffer(Chunk chunk, ExtendedBlockStorage extendedBlockStorage, ByteBuffer data) {
|
||||||
|
val subChunk = (SubChunkBlockHook) extendedBlockStorage;
|
||||||
|
|
||||||
|
data.put((byte) subChunk.eid$getMetadataMask());
|
||||||
|
|
||||||
|
val m1Low = subChunk.eid$getM1Low();
|
||||||
|
data.put(m1Low.data);
|
||||||
|
|
||||||
|
val m1High = subChunk.eid$getM1High();
|
||||||
|
if (m1High == null) return;
|
||||||
|
data.put(m1High.data);
|
||||||
|
|
||||||
|
val m2 = subChunk.eid$getM2();
|
||||||
|
if (m2 != null) {
|
||||||
|
data.put(m2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readFromBuffer(Chunk chunk, ExtendedBlockStorage extendedBlockStorage, ByteBuffer data) {
|
||||||
|
val subChunk = (SubChunkBlockHook) extendedBlockStorage;
|
||||||
|
val storageFlag = data.get();
|
||||||
|
|
||||||
|
val m1Low = subChunk.eid$getM1Low();
|
||||||
|
data.get(m1Low.data);
|
||||||
|
|
||||||
|
if (storageFlag == 0b01) {
|
||||||
|
subChunk.eid$setM1High(null);
|
||||||
|
subChunk.eid$setM2(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var m1High = subChunk.eid$getM1High();
|
||||||
|
if (m1High == null) {
|
||||||
|
m1High = subChunk.eid$createM1High();
|
||||||
|
}
|
||||||
|
data.get(m1High.data);
|
||||||
|
|
||||||
|
if (storageFlag == 0b10) {
|
||||||
|
subChunk.eid$setM2(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var m2 = subChunk.eid$getM2();
|
||||||
|
if (m2 == null) {
|
||||||
|
m2 = subChunk.eid$createM2();
|
||||||
|
}
|
||||||
|
data.get(m2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* 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.biome.personalspace;
|
||||||
|
|
||||||
|
import com.falsepattern.endlessids.mixin.helpers.BiomePatchHelper;
|
||||||
|
import me.eigenraven.personalspace.world.PersonalChunkProvider;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
|
import net.minecraft.world.chunk.Chunk;
|
||||||
|
|
||||||
|
@Mixin(PersonalChunkProvider.class)
|
||||||
|
public class PersonalChunkProviderMixin {
|
||||||
|
|
||||||
|
@Shadow private int savedBiomeId = -1;
|
||||||
|
|
||||||
|
@Redirect(method = "provideChunk",
|
||||||
|
at = @At(value = "INVOKE",
|
||||||
|
target = "Lnet/minecraft/world/chunk/Chunk;getBiomeArray()[B"),
|
||||||
|
require = 1)
|
||||||
|
private byte[] setBiomesTweaked(Chunk instance) {
|
||||||
|
return BiomePatchHelper.getBiomeArrayTweaked(instance, i -> BiomeGenBase.getBiome(savedBiomeId));
|
||||||
|
}
|
||||||
|
}
|
||||||
-33
@@ -22,15 +22,11 @@
|
|||||||
|
|
||||||
package com.falsepattern.endlessids.mixin.mixins.common.potion.vanilla;
|
package com.falsepattern.endlessids.mixin.mixins.common.potion.vanilla;
|
||||||
|
|
||||||
import com.falsepattern.endlessids.EndlessIDs;
|
|
||||||
import com.falsepattern.endlessids.constants.ExtendedConstants;
|
|
||||||
import lombok.val;
|
import lombok.val;
|
||||||
import lombok.var;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
@@ -40,35 +36,6 @@ import net.minecraft.potion.PotionEffect;
|
|||||||
@Mixin(value = PotionEffect.class,
|
@Mixin(value = PotionEffect.class,
|
||||||
priority = 2000 ) //Hodgepodge fixPotionLimit compat (inject-head into overwrite in readCustomPotionEffectFromNBT)
|
priority = 2000 ) //Hodgepodge fixPotionLimit compat (inject-head into overwrite in readCustomPotionEffectFromNBT)
|
||||||
public abstract class PotionEffectMixin {
|
public abstract class PotionEffectMixin {
|
||||||
@Inject(method = "<init>(IIIZ)V",
|
|
||||||
at = @At("RETURN"),
|
|
||||||
require = 1)
|
|
||||||
private void fixOutOfBoundsID(int p_i1576_1_, int p_i1576_2_, int p_i1576_3_, boolean p_i1576_4_, CallbackInfo ci) {
|
|
||||||
var id = p_i1576_1_ & ExtendedConstants.potionIDMask;
|
|
||||||
recovery:
|
|
||||||
if (id != p_i1576_1_ && Potion.potionTypes[id] == null) {
|
|
||||||
//Maybe vanilla code?
|
|
||||||
val realId = id;
|
|
||||||
id = id & 0xFF;
|
|
||||||
if (Potion.potionTypes[id] == null) {
|
|
||||||
//Nope
|
|
||||||
id = realId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (Potion.potionTypes[id] == null) {
|
|
||||||
EndlessIDs.LOG.error("Encountered invalid potion ID: {}. See the following stacktrace for more info.", p_i1576_1_);
|
|
||||||
EndlessIDs.LOG.error("Stacktrace:", new Throwable());
|
|
||||||
EndlessIDs.LOG.error("Recovering to a valid potion ID (usually movement speed)");
|
|
||||||
for (int i = 0; i < Potion.potionTypes.length; i++) {
|
|
||||||
if (Potion.potionTypes[i] != null) {
|
|
||||||
id = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.potionID = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Inject(method = "readCustomPotionEffectFromNBT",
|
@Inject(method = "readCustomPotionEffectFromNBT",
|
||||||
at = @At(value = "HEAD"),
|
at = @At(value = "HEAD"),
|
||||||
cancellable = true,
|
cancellable = true,
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ import static com.falsepattern.endlessids.mixin.plugin.TargetMod.Netherlicious;
|
|||||||
import static com.falsepattern.endlessids.mixin.plugin.TargetMod.NomadicTents;
|
import static com.falsepattern.endlessids.mixin.plugin.TargetMod.NomadicTents;
|
||||||
import static com.falsepattern.endlessids.mixin.plugin.TargetMod.NuclearTech;
|
import static com.falsepattern.endlessids.mixin.plugin.TargetMod.NuclearTech;
|
||||||
import static com.falsepattern.endlessids.mixin.plugin.TargetMod.OldWorldGen;
|
import static com.falsepattern.endlessids.mixin.plugin.TargetMod.OldWorldGen;
|
||||||
|
import static com.falsepattern.endlessids.mixin.plugin.TargetMod.PersonalSpace;
|
||||||
import static com.falsepattern.endlessids.mixin.plugin.TargetMod.RandomThings;
|
import static com.falsepattern.endlessids.mixin.plugin.TargetMod.RandomThings;
|
||||||
import static com.falsepattern.endlessids.mixin.plugin.TargetMod.RealisticTerrainGeneration;
|
import static com.falsepattern.endlessids.mixin.plugin.TargetMod.RealisticTerrainGeneration;
|
||||||
import static com.falsepattern.endlessids.mixin.plugin.TargetMod.RealisticWorldGen;
|
import static com.falsepattern.endlessids.mixin.plugin.TargetMod.RealisticWorldGen;
|
||||||
@@ -342,6 +343,11 @@ public enum Mixin implements IMixins {
|
|||||||
require(OldWorldGen),
|
require(OldWorldGen),
|
||||||
common("biome.owg.ChunkGeneratorBetaMixin")),
|
common("biome.owg.ChunkGeneratorBetaMixin")),
|
||||||
|
|
||||||
|
Biome_PersonalSpace(Phase.LATE,
|
||||||
|
Ext.Biome,
|
||||||
|
require(PersonalSpace),
|
||||||
|
common("biome.personalspace.PersonalChunkProviderMixin")),
|
||||||
|
|
||||||
Biome_RandomThings(Phase.EARLY,
|
Biome_RandomThings(Phase.EARLY,
|
||||||
Ext.Biome,
|
Ext.Biome,
|
||||||
require(RandomThings),
|
require(RandomThings),
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ public enum TargetMod implements ITargetMod {
|
|||||||
NomadicTents("com.yurtmod.main.NomadicTents"),
|
NomadicTents("com.yurtmod.main.NomadicTents"),
|
||||||
NuclearTech("com.hbm.main.MainRegistry"),
|
NuclearTech("com.hbm.main.MainRegistry"),
|
||||||
OldWorldGen("owg.OWG"),
|
OldWorldGen("owg.OWG"),
|
||||||
|
PersonalSpace("me.eigenraven.personalspace.PersonalSpaceMod"),
|
||||||
Ruins("atomicstryker.ruins.common.RuinsMod"),
|
Ruins("atomicstryker.ruins.common.RuinsMod"),
|
||||||
RealisticTerrainGeneration("rtg.RTG"),
|
RealisticTerrainGeneration("rtg.RTG"),
|
||||||
RealisticWorldGen("rwg.RWG"),
|
RealisticWorldGen("rwg.RWG"),
|
||||||
|
|||||||
Reference in new issue
Block a user