misc cleanup

This commit is contained in:
FalsePattern committed 2024-06-07 19:56:57 +02:00
1 parent f8e024f1bb
commit 410d344b84
4 files changed
+21 -22

No files matched your search

@@ -1,14 +1,16 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.compactmachines;
import com.falsepattern.endlessids.mixin.helpers.ChunkBiomeHook;
import com.falsepattern.endlessids.mixin.stubpackage.org.dave.CompactMachines.tileentity.TileEntityMachine;
import lombok.val;
import org.dave.CompactMachines.handler.ConfigurationHandler;
import org.dave.CompactMachines.machines.tools.CubeTools;
import org.dave.CompactMachines.tileentity.TileEntityMachine;
import org.dave.CompactMachines.utility.WorldUtils;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.WorldServer;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
@@ -43,10 +45,12 @@ public abstract class CubeToolsMixin {
*/
@Overwrite
public static BiomeGenBase getMachineBiome(TileEntityMachine machine) {
short[] biomeArray = ((ChunkBiomeHook) machine.getWorldObj()
.getChunkFromBlockCoords(machine.xCoord,
machine.zCoord)).getBiomeShortArray();
int biomeId = biomeArray[(machine.zCoord & 15) << 4 | machine.xCoord & 15];
val TE = (TileEntity)machine;
val x = TE.xCoord;
val z = TE.zCoord;
short[] biomeArray = ((ChunkBiomeHook) TE.getWorldObj()
.getChunkFromBlockCoords(x, z)).getBiomeShortArray();
int biomeId = biomeArray[(z & 15) << 4 | x & 15];
return biomeId > 0 && biomeId < BiomeGenBase.getBiomeGenArray().length &&
BiomeDictionary.isBiomeRegistered(biomeId) ? BiomeGenBase.getBiome(biomeId) : WorldUtils.getBiomeByName(
ConfigurationHandler.defaultBiome);
@@ -31,7 +31,8 @@ public abstract class GenLayerEBHillsMixin {
@Redirect(method = "getInts",
at = @At(value = "INVOKE",
target = "Lorg/apache/logging/log4j/Logger;debug(Ljava/lang/String;)V"),
target = "Lorg/apache/logging/log4j/Logger;debug(Ljava/lang/String;)V",
remap = false),
remap = true,
require = 1)
private void noLog(Logger instance, String s) {
@@ -20,11 +20,17 @@ import java.util.List;
@Mixin(DataWatcher.class)
public abstract class DataWatcherMixin {
@ModifyConstant(method = {"addObject", "writeWatchedListToPacketBuffer", "func_151509_a",
"writeWatchableObjectToPacketBuffer"},
@ModifyConstant(method = {"writeWatchableObjectToPacketBuffer"},
constant = @Constant(intValue = VanillaConstants.maxWatchableID),
require = 3)
private static int extend1(int constant) {
require = 1)
private static int extend1s(int constant) {
return ExtendedConstants.maxWatchableID;
}
@ModifyConstant(method = {"addObject", "func_151509_a"},
constant = @Constant(intValue = VanillaConstants.maxWatchableID),
require = 2)
private int extend1d(int constant) {
return ExtendedConstants.maxWatchableID;
}
@@ -1,12 +0,0 @@
package com.falsepattern.endlessids.mixin.stubpackage.org.dave.CompactMachines.tileentity;
import net.minecraft.world.World;
public class TileEntityMachine {
public int xCoord;
public int zCoord;
public World getWorldObj() {
return null;
}
}