mirror of
https://github.com/GTMEGA/EndlessIDs.git
synced 2026-11-22 20:09:39 +00:00
Merge remote-tracking branches 'pr275/cc-compat' and 'pr280/personal-space-compat'
This commit is contained in:
7 files changed
+190
-5
No files matched your search
+5
-2
@@ -65,7 +65,7 @@ dependencies {
|
||||
// region Our deps
|
||||
implementationSplit("com.falsepattern:falsepatternlib-mc1.7.10:1.9.0")
|
||||
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
|
||||
|
||||
// region maintained mods
|
||||
@@ -210,6 +210,9 @@ dependencies {
|
||||
//Nostalgic World Generation 1.0.0
|
||||
compileOnly(deobfCurse("nostalgiagenerator-927053:4816167"))
|
||||
|
||||
//Personal Space 1.0.33
|
||||
compileOnly(deobfCurse("PersonalSpace-819596:6536785"))
|
||||
|
||||
//RandomThings 2.2.4
|
||||
compileOnly(deobfCurse("randomthings-59816:2225310"))
|
||||
|
||||
@@ -260,4 +263,4 @@ dependencies {
|
||||
//needed by: Biome Wand
|
||||
//Source: http://spacechase0.com/files/mcmod/1.7.10-SpaceCore-0.7.14.jar
|
||||
compileOnly(deobf("mirror:1.7.10-SpaceCore:0.7.14"))
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
version = Tags.VERSION,
|
||||
name = Tags.MODNAME,
|
||||
acceptedMinecraftVersions = "[1.7.10]",
|
||||
dependencies = "required-after:chunkapi@[0.6.4,);" +
|
||||
dependencies = "required-after:chunkapi@[0.8.0,);" +
|
||||
"required-after:falsepatternlib@[1.9.0,);" +
|
||||
"after:antiidconflict")
|
||||
public class EndlessIDs {
|
||||
|
||||
@@ -45,7 +45,7 @@ import static com.falsepattern.endlessids.constants.ExtendedConstants.blocksPerS
|
||||
import static com.falsepattern.endlessids.util.DataUtil.*;
|
||||
|
||||
//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
|
||||
public String domain() {
|
||||
@@ -259,4 +259,77 @@ public class BlockIDManager implements DataManager.PacketDataManager, DataManage
|
||||
public void readBlockPacketFromBuffer(S23PacketBlockChange packet, PacketBuffer buffer) {
|
||||
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;
|
||||
|
||||
//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
|
||||
public String domain() {
|
||||
@@ -233,4 +233,60 @@ public class BlockMetaManager implements DataManager.PacketDataManager, DataMana
|
||||
public void readBlockPacketFromBuffer(S23PacketBlockChange packet, PacketBuffer buffer) {
|
||||
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));
|
||||
}
|
||||
}
|
||||
@@ -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.NuclearTech;
|
||||
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.RealisticTerrainGeneration;
|
||||
import static com.falsepattern.endlessids.mixin.plugin.TargetMod.RealisticWorldGen;
|
||||
@@ -342,6 +343,11 @@ public enum Mixin implements IMixins {
|
||||
require(OldWorldGen),
|
||||
common("biome.owg.ChunkGeneratorBetaMixin")),
|
||||
|
||||
Biome_PersonalSpace(Phase.LATE,
|
||||
Ext.Biome,
|
||||
require(PersonalSpace),
|
||||
common("biome.personalspace.PersonalChunkProviderMixin")),
|
||||
|
||||
Biome_RandomThings(Phase.EARLY,
|
||||
Ext.Biome,
|
||||
require(RandomThings),
|
||||
|
||||
@@ -80,6 +80,7 @@ public enum TargetMod implements ITargetMod {
|
||||
NomadicTents("com.yurtmod.main.NomadicTents"),
|
||||
NuclearTech("com.hbm.main.MainRegistry"),
|
||||
OldWorldGen("owg.OWG"),
|
||||
PersonalSpace("me.eigenraven.personalspace.PersonalSpaceMod"),
|
||||
Ruins("atomicstryker.ruins.common.RuinsMod"),
|
||||
RealisticTerrainGeneration("rtg.RTG"),
|
||||
RealisticWorldGen("rwg.RWG"),
|
||||
|
||||
Reference in new issue
Block a user