Skip to content

Instantly share code, notes, and snippets.

@clienthax
Created June 7, 2020 17:22
Show Gist options
  • Save clienthax/1354b10e667f11717b777db851971235 to your computer and use it in GitHub Desktop.
Save clienthax/1354b10e667f11717b777db851971235 to your computer and use it in GitHub Desktop.
World.java
import com.flowpowered.math.GenericMath;
import com.flowpowered.math.vector.Vector2d;
import com.flowpowered.math.vector.Vector3d;
import com.flowpowered.math.vector.Vector3i;
import com.google.common.base.Function;
import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSetMultimap;
import com.google.common.collect.Lists;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Optional;
import java.util.Random;
import java.util.Set;
import java.util.UUID;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import javax.annotation.Nullable;
import me.jellysquid.mods.phosphor.api.ILightingEngine;
import me.jellysquid.mods.phosphor.api.ILightingEngineProvider;
import me.jellysquid.mods.phosphor.mod.world.lighting.LightingEngine;
import micdoodle8.mods.galacticraft.core.TransformerHooks;
import net.minecraft.advancements.AdvancementManager;
import net.minecraft.advancements.FunctionManager;
import net.minecraft.block.Block;
import net.minecraft.block.BlockJukebox;
import net.minecraft.block.BlockLiquid;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.IBlockState;
import net.minecraft.crash.CrashReport;
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.crash.ICrashReportDetail;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.MultiPartEntityPart;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.item.EntityArmorStand;
import net.minecraft.entity.item.EntityEnderPearl;
import net.minecraft.entity.item.EntityFallingBlock;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.item.EntityPainting;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Biomes;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.SPacketBlockChange;
import net.minecraft.pathfinding.PathWorldListener;
import net.minecraft.profiler.Profiler;
import net.minecraft.scoreboard.Scoreboard;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EntitySelectors;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.ITickable;
import net.minecraft.util.IntHashMap;
import net.minecraft.util.ReportedException;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.village.VillageCollection;
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.Explosion;
import net.minecraft.world.GameRules;
import net.minecraft.world.GameType;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.IWorldEventListener;
import net.minecraft.world.MinecraftException;
import net.minecraft.world.NextTickListEntry;
import net.minecraft.world.World;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.WorldServer;
import net.minecraft.world.WorldSettings;
import net.minecraft.world.WorldType;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.BiomeProvider;
import net.minecraft.world.border.WorldBorder;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.structure.StructureBoundingBox;
import net.minecraft.world.storage.ISaveHandler;
import net.minecraft.world.storage.MapStorage;
import net.minecraft.world.storage.WorldInfo;
import net.minecraft.world.storage.WorldSavedData;
import net.minecraft.world.storage.loot.LootTableManager;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.ForgeChunkManager;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.ForgeModContainer;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityDispatcher;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.common.util.BlockSnapshot;
import net.minecraftforge.common.util.INBTSerializable;
import net.minecraftforge.common.util.WorldCapabilityData;
import net.minecraftforge.event.ForgeEventFactory;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import net.minecraftforge.event.entity.PlaySoundAtEntityEvent;
import net.minecraftforge.event.world.GetCollisionBoxesEvent;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.common.eventhandler.Event;
import net.minecraftforge.server.timings.TimeTracker;
import org.apache.commons.lang3.reflect.ConstructorUtils;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.block.BlockSnapshot;
import org.spongepowered.api.block.BlockState;
import org.spongepowered.api.block.BlockType;
import org.spongepowered.api.block.tileentity.TileEntity;
import org.spongepowered.api.data.DataContainer;
import org.spongepowered.api.data.DataHolder;
import org.spongepowered.api.data.DataTransactionResult;
import org.spongepowered.api.data.DataView;
import org.spongepowered.api.data.Property;
import org.spongepowered.api.data.key.Key;
import org.spongepowered.api.data.manipulator.DataManipulator;
import org.spongepowered.api.data.manipulator.ImmutableDataManipulator;
import org.spongepowered.api.data.merge.MergeFunction;
import org.spongepowered.api.data.persistence.InvalidDataException;
import org.spongepowered.api.data.property.PropertyHolder;
import org.spongepowered.api.data.property.PropertyStore;
import org.spongepowered.api.data.property.item.RecordProperty;
import org.spongepowered.api.data.value.BaseValue;
import org.spongepowered.api.data.value.ValueContainer;
import org.spongepowered.api.data.value.immutable.ImmutableValue;
import org.spongepowered.api.data.value.mutable.Value;
import org.spongepowered.api.effect.Viewer;
import org.spongepowered.api.effect.sound.record.RecordType;
import org.spongepowered.api.entity.Entity;
import org.spongepowered.api.entity.EntitySnapshot;
import org.spongepowered.api.entity.EntityType;
import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.entity.projectile.EnderPearl;
import org.spongepowered.api.entity.projectile.source.ProjectileSource;
import org.spongepowered.api.event.CauseStackManager;
import org.spongepowered.api.event.cause.EventContextKeys;
import org.spongepowered.api.event.sound.PlaySoundEvent;
import org.spongepowered.api.item.inventory.ItemStack;
import org.spongepowered.api.service.context.Context;
import org.spongepowered.api.text.Text;
import org.spongepowered.api.text.chat.ChatType;
import org.spongepowered.api.text.title.Title;
import org.spongepowered.api.util.AABB;
import org.spongepowered.api.util.Direction;
import org.spongepowered.api.util.Functional;
import org.spongepowered.api.util.PositionOutOfBoundsException;
import org.spongepowered.api.util.annotation.NonnullByDefault;
import org.spongepowered.api.world.BlockChangeFlag;
import org.spongepowered.api.world.BlockChangeFlags;
import org.spongepowered.api.world.Chunk;
import org.spongepowered.api.world.ChunkPreGenerate;
import org.spongepowered.api.world.ChunkRegenerateFlag;
import org.spongepowered.api.world.Dimension;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import org.spongepowered.api.world.WorldBorder;
import org.spongepowered.api.world.biome.BiomeType;
import org.spongepowered.api.world.explosion.Explosion;
import org.spongepowered.api.world.extent.EntityUniverse;
import org.spongepowered.api.world.extent.Extent;
import org.spongepowered.api.world.extent.MutableBiomeVolume;
import org.spongepowered.api.world.extent.MutableBlockVolume;
import org.spongepowered.api.world.extent.worker.BiomeVolumeWorker;
import org.spongepowered.api.world.extent.worker.BlockVolumeWorker;
import org.spongepowered.api.world.extent.worker.MutableBiomeVolumeWorker;
import org.spongepowered.api.world.extent.worker.MutableBlockVolumeWorker;
import org.spongepowered.api.world.storage.WorldProperties;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.asm.mixin.gen.Invoker;
import org.spongepowered.asm.mixin.injection.Surrogate;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.transformer.meta.MixinMerged;
import org.spongepowered.common.SpongeImpl;
import org.spongepowered.common.SpongeImplHooks;
import org.spongepowered.common.block.SpongeBlockSnapshotBuilder;
import org.spongepowered.common.bridge.data.CustomDataHolderBridge;
import org.spongepowered.common.bridge.data.VanishableBridge;
import org.spongepowered.common.bridge.entity.EntityBridge;
import org.spongepowered.common.bridge.entity.player.EntityPlayerBridge;
import org.spongepowered.common.bridge.tileentity.TileEntityBridge;
import org.spongepowered.common.bridge.util.math.BlockPosBridge;
import org.spongepowered.common.bridge.world.WorldBridge;
import org.spongepowered.common.bridge.world.WorldInfoBridge;
import org.spongepowered.common.bridge.world.WorldProviderBridge;
import org.spongepowered.common.bridge.world.chunk.ActiveChunkReferantBridge;
import org.spongepowered.common.bridge.world.chunk.ChunkBridge;
import org.spongepowered.common.bridge.world.chunk.ChunkProviderBridge;
import org.spongepowered.common.data.type.SpongeTileEntityType;
import org.spongepowered.common.event.ShouldFire;
import org.spongepowered.common.event.SpongeCommonEventFactory;
import org.spongepowered.common.event.tracking.PhaseTracker;
import org.spongepowered.common.item.inventory.util.ItemStackUtil;
import org.spongepowered.common.mixin.core.network.play.server.SPacketBlockChangeAccessor;
import org.spongepowered.common.mixin.core.world.WorldAccessor;
import org.spongepowered.common.mixin.plugin.entityactivation.EntityActivationRange;
import org.spongepowered.common.mixin.plugin.entityactivation.interfaces.ActivationCapability;
import org.spongepowered.common.registry.provider.DirectionFacingProvider;
import org.spongepowered.common.relocate.co.aikar.timings.TimingHistory;
import org.spongepowered.common.util.Constants;
import org.spongepowered.common.util.SpongeHooks;
import org.spongepowered.common.util.VecHelper;
import org.spongepowered.common.world.SpongeDimension;
import org.spongepowered.common.world.SpongeEmptyChunk;
import org.spongepowered.common.world.extent.DefaultedExtent;
import org.spongepowered.common.world.extent.ExtentViewDownsize;
import org.spongepowered.common.world.extent.worker.SpongeMutableBiomeVolumeWorker;
import org.spongepowered.common.world.extent.worker.SpongeMutableBlockVolumeWorker;
import org.spongepowered.common.world.pregen.SpongeChunkPreGenerateTask;
import org.spongepowered.common.world.storage.SpongeChunkLayout;
import org.spongepowered.mod.bridge.world.WorldBridge_Forge;
import org.spongepowered.mod.event.CapturedSnapshotWrapperList;
import pl.asie.foamfix.coremod.patches.IFoamFixWorldRemovable;
@NonnullByDefault
public abstract class World implements IBlockAccess, ICapabilityProvider, IFoamFixWorldRemovable, World, DefaultedExtent, WorldBridge_Forge, WorldAccessor, WorldBridge, ILightingEngineProvider {
public void foamfix_removeUnloadedEntities() {
this.field_72984_F.func_76320_a("entities");
this.field_72984_F.func_76320_a("remove");
if (!this.field_72997_g.isEmpty()) {
this.field_72996_f.removeAll(this.field_72997_g);
for (Entity entity : this.field_72997_g) {
int j = entity.field_70176_ah;
int k1 = entity.field_70164_aj;
if (entity.field_70175_ag && func_175680_a(j, k1, true))
func_72964_e(j, k1).func_76622_b(entity);
}
for (Entity entity : this.field_72997_g)
func_72847_b(entity);
this.field_72997_g.clear();
}
this.field_72984_F.func_76318_c("blockEntities");
if (!this.field_147483_b.isEmpty()) {
for (TileEntity tile : this.field_147483_b)
tile.onChunkUnload();
this.field_175730_i.removeAll(this.field_147483_b);
this.field_147482_g.removeAll(this.field_147483_b);
this.field_147483_b.clear();
}
this.field_72984_F.func_76319_b();
this.field_72984_F.func_76319_b();
}
public static double MAX_ENTITY_RADIUS = 2.0D;
private int field_181546_a;
public boolean field_72999_e;
@Final
public final List<Entity> field_72996_f;
@Final
protected final List<Entity> field_72997_g;
@Final
public final List<TileEntity> field_147482_g;
@Final
public final List<TileEntity> field_175730_i;
@Final
private final List<TileEntity> field_147484_a;
@Final
private final List<TileEntity> field_147483_b;
@Final
public final List<EntityPlayer> field_73010_i;
@Final
public final List<Entity> field_73007_j;
protected final IntHashMap<Entity> field_175729_l;
private final long field_73001_c = 16777215L;
public int field_73008_k;
protected int field_73005_l;
protected final int field_73006_m = 1013904223;
public float field_73003_n;
public float field_73004_o;
public float field_73018_p;
public float field_73017_q;
public int field_73016_r;
@Final
public final Random field_73012_v;
@Final
public final WorldProvider field_73011_w;
protected PathWorldListener field_184152_t;
protected List<IWorldEventListener> field_73021_x;
protected IChunkProvider field_73020_y;
@Final
protected final ISaveHandler field_73019_z;
protected WorldInfo field_72986_A;
protected boolean field_72987_B;
protected MapStorage field_72988_C;
public VillageCollection field_72982_D;
protected LootTableManager field_184151_B;
protected AdvancementManager field_191951_C;
protected FunctionManager field_193036_D;
@Final
public final Profiler field_72984_F;
private final Calendar field_83016_L;
protected Scoreboard field_96442_D;
@Final
public final boolean field_72995_K;
protected boolean field_72985_G;
protected boolean field_72992_H;
private boolean field_147481_N;
@Final
private final WorldBorder field_175728_M;
int[] field_72994_J;
public boolean restoringBlockSnapshots;
public boolean captureBlockSnapshots;
public ArrayList<BlockSnapshot> capturedBlockSnapshots;
private CapabilityDispatcher capabilities;
private WorldCapabilityData capabilityData;
protected MapStorage perWorldStorage;
@Nullable
private Context worldContext;
boolean processingExplosion;
@Nullable
private SpongeDimension api$dimension;
private WorldInfo forgeImpl$redirectWorldInfo;
private boolean impl$isDefinitelyFake;
private boolean impl$hasChecked;
@Nullable
private SpongeEmptyChunk impl$emptyChunk;
private LightingEngine lightingEngine;
protected World(ISaveHandler saveHandlerIn, WorldInfo info, WorldProvider providerIn, Profiler profilerIn, boolean client) {
this.impl$isDefinitelyFake = false;
this.impl$hasChecked = false;
this.processingExplosion = false;
this.field_181546_a = 63;
this.field_72996_f = Lists.newArrayList();
this.field_72997_g = Lists.newArrayList();
this.field_147482_g = Lists.newArrayList();
this.field_175730_i = Lists.newArrayList();
this.field_147484_a = Lists.newArrayList();
this.field_147483_b = Lists.newArrayList();
this.field_73010_i = Lists.newArrayList();
this.field_73007_j = Lists.newArrayList();
this.field_175729_l = new IntHashMap();
this.field_73001_c = 16777215L;
this.field_73005_l = (new Random()).nextInt();
this.field_73006_m = 1013904223;
this.field_73012_v = new Random();
this.field_184152_t = new PathWorldListener();
this.restoringBlockSnapshots = false;
this.captureBlockSnapshots = false;
this.capturedBlockSnapshots = new ArrayList<>();
this.field_73021_x = Lists.newArrayList((Object[])new IWorldEventListener[] { (IWorldEventListener)this.field_184152_t });
this.field_83016_L = Calendar.getInstance();
this.field_96442_D = new Scoreboard();
this.field_72985_G = true;
this.field_72992_H = true;
this.field_72994_J = new int[32768];
this.field_73019_z = saveHandlerIn;
this.field_72984_F = profilerIn;
this.field_72986_A = info;
this.field_73011_w = providerIn;
this.field_72995_K = client;
WorldProvider worldProvider = providerIn;
this.field_175728_M = redirect$zlk000$onCreateWorldBorder(worldProvider);
this.perWorldStorage = new MapStorage((ISaveHandler)null);
handler$bam000$onIniitToSetForgeList(saveHandlerIn, info, providerIn, profilerIn, client, new CallbackInfo("<init>", false));
handler$bcl001$onConstructed(new CallbackInfo("<init>", false));
}
public World func_175643_b() {
return this;
}
public Biome func_180494_b(BlockPos pos) {
return this.field_73011_w.getBiomeForCoords(pos);
}
public Biome getBiomeForCoordsBody(BlockPos pos) {
if (func_175667_e(pos)) {
Chunk chunk = func_175726_f(pos);
try {
return chunk.func_177411_a(pos, this.field_73011_w.func_177499_m());
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.func_85055_a(throwable, "Getting biome");
CrashReportCategory crashreportcategory = crashreport.func_85058_a("Coordinates of biome request");
crashreportcategory.func_189529_a("Location", (ICrashReportDetail)new Object(this, pos));
throw new ReportedException(crashreport);
}
}
return this.field_73011_w.func_177499_m().func_180300_a(pos, Biomes.field_76772_c);
}
public BiomeProvider func_72959_q() {
return this.field_73011_w.func_177499_m();
}
public void func_72963_a(WorldSettings settings) {
this.field_72986_A.func_76091_d(true);
}
@Nullable
public MinecraftServer func_73046_m() {
return null;
}
public IBlockState func_184141_c(BlockPos pos) {
BlockPos blockpos;
for (blockpos = new BlockPos(pos.func_177958_n(), func_181545_F(), pos.func_177952_p()); !func_175623_d(blockpos.func_177984_a()); blockpos = blockpos.func_177984_a());
return func_180495_p(blockpos);
}
public boolean func_175623_d(BlockPos pos) {
return func_180495_p(pos).func_177230_c().isAir(func_180495_p(pos), this, pos);
}
public boolean func_175667_e(BlockPos pos) {
return func_175668_a(pos, true);
}
public boolean func_175668_a(BlockPos pos, boolean allowEmpty) {
return func_175680_a(pos.func_177958_n() >> 4, pos.func_177952_p() >> 4, allowEmpty);
}
public boolean func_175697_a(BlockPos center, int radius) {
return func_175648_a(center, radius, true);
}
public boolean func_175648_a(BlockPos center, int radius, boolean allowEmpty) {
return func_175663_a(center.func_177958_n() - radius, center.func_177956_o() - radius, center.func_177952_p() - radius, center.func_177958_n() + radius, center.func_177956_o() + radius, center.func_177952_p() + radius, allowEmpty);
}
public boolean func_175707_a(BlockPos from, BlockPos to) {
return func_175706_a(from, to, true);
}
public boolean func_175706_a(BlockPos from, BlockPos to, boolean allowEmpty) {
return func_175663_a(from.func_177958_n(), from.func_177956_o(), from.func_177952_p(), to.func_177958_n(), to.func_177956_o(), to.func_177952_p(), allowEmpty);
}
public boolean func_175711_a(StructureBoundingBox box) {
return func_175639_b(box, true);
}
public boolean func_175639_b(StructureBoundingBox box, boolean allowEmpty) {
return func_175663_a(box.field_78897_a, box.field_78895_b, box.field_78896_c, box.field_78893_d, box.field_78894_e, box.field_78892_f, allowEmpty);
}
private boolean func_175663_a(int xStart, int yStart, int zStart, int xEnd, int yEnd, int zEnd, boolean allowEmpty) {
callbackInfo10 = new CallbackInfoReturnable("func_175663_a", true);
handler$zlk000$impl$useWorldServerMethodForAvoidingLookups(SYNTHETIC_LOCAL_VARIABLE_1, SYNTHETIC_LOCAL_VARIABLE_2, SYNTHETIC_LOCAL_VARIABLE_3, SYNTHETIC_LOCAL_VARIABLE_4, SYNTHETIC_LOCAL_VARIABLE_5, SYNTHETIC_LOCAL_VARIABLE_6, SYNTHETIC_LOCAL_VARIABLE_7, callbackInfo10);
if (callbackInfo10.isCancelled())
return callbackInfo10.getReturnValueZ();
if (SYNTHETIC_LOCAL_VARIABLE_5 >= null && SYNTHETIC_LOCAL_VARIABLE_2 < ') {
int xStart = SYNTHETIC_LOCAL_VARIABLE_1 >> 4;
int zStart = SYNTHETIC_LOCAL_VARIABLE_3 >> 4;
int xEnd = SYNTHETIC_LOCAL_VARIABLE_4 >> 4;
int zEnd = SYNTHETIC_LOCAL_VARIABLE_6 >> 4;
for (int i = xStart; i <= xEnd; i++) {
for (int j = zStart; j <= zEnd; j++) {
if (!func_175680_a(i, j, SYNTHETIC_LOCAL_VARIABLE_7))
return false;
}
}
return true;
}
return false;
}
@Nullable
public Chunk func_175726_f(BlockPos pos) {
return func_72964_e(pos.func_177958_n() >> 4, pos.func_177952_p() >> 4);
}
public Chunk func_72964_e(int chunkX, int chunkZ) {
return this.field_73020_y.func_186025_d(chunkX, chunkZ);
}
public boolean func_190526_b(int x, int z) {
return func_175680_a(x, z, false) ? true : this.field_73020_y.func_191062_e(x, z);
}
public boolean func_180501_a(BlockPos pos, IBlockState newState, int flags) {
if (func_189509_E(pos))
return false;
if (!this.field_72995_K && this.field_72986_A.func_76067_t() == WorldType.field_180272_g)
return false;
Chunk chunk = func_175726_f(pos);
pos = pos.func_185334_h();
BlockSnapshot blockSnapshot = null;
if (this.captureBlockSnapshots && !this.field_72995_K) {
blockSnapshot = BlockSnapshot.getBlockSnapshot(this, pos, flags);
this.capturedBlockSnapshots.add(blockSnapshot);
}
IBlockState oldState = func_180495_p(pos);
int oldLight = oldState.getLightValue(this, pos);
int oldOpacity = oldState.getLightOpacity(this, pos);
IBlockState iblockstate = chunk.func_177436_a(pos, newState);
if (iblockstate == null) {
if (blockSnapshot != null)
this.capturedBlockSnapshots.remove(blockSnapshot);
return false;
}
if (newState.getLightOpacity(this, pos) != oldOpacity || newState.getLightValue(this, pos) != oldLight) {
this.field_72984_F.func_76320_a("checkLight");
func_175664_x(pos);
this.field_72984_F.func_76319_b();
}
if (blockSnapshot == null)
markAndNotifyBlock(pos, chunk, iblockstate, newState, flags);
return true;
}
public void markAndNotifyBlock(BlockPos pos, @Nullable Chunk chunk, IBlockState iblockstate, IBlockState newState, int flags) {
Block block = newState.func_177230_c();
if ((flags & 0x2) != 0 && (!this.field_72995_K || (flags & 0x4) == 0) && (chunk == null || chunk.func_150802_k()))
func_184138_a(pos, iblockstate, newState, flags);
if (!this.field_72995_K && (flags & 0x1) != 0) {
func_175722_b(pos, iblockstate.func_177230_c(), true);
if (newState.func_185912_n())
func_175666_e(pos, block);
} else if (!this.field_72995_K && (flags & 0x10) == 0) {
func_190522_c(pos, block);
}
}
public boolean func_175698_g(BlockPos pos) {
return func_180501_a(pos, Blocks.field_150350_a.func_176223_P(), 3);
}
public boolean func_175655_b(BlockPos pos, boolean dropBlock) {
IBlockState iblockstate = func_180495_p(pos);
Block block = iblockstate.func_177230_c();
if (block.isAir(iblockstate, this, pos))
return false;
callbackInfo5 = new CallbackInfoReturnable("func_175655_b", true);
handler$zlk000$onDestroyBlock(pos, dropBlock, callbackInfo5);
if (callbackInfo5.isCancelled())
return callbackInfo5.getReturnValueZ();
func_175718_b(2001, pos, Block.func_176210_f(iblockstate));
if (dropBlock)
block.func_176226_b(this, pos, iblockstate, 0);
return func_180501_a(pos, Blocks.field_150350_a.func_176223_P(), 3);
}
public boolean func_175656_a(BlockPos pos, IBlockState state) {
return func_180501_a(pos, state, 3);
}
public void func_184138_a(BlockPos pos, IBlockState oldState, IBlockState newState, int flags) {
for (int i = 0; i < this.field_73021_x.size(); i++)
((IWorldEventListener)this.field_73021_x.get(i)).func_184376_a(this, pos, oldState, newState, flags);
}
public void func_175722_b(BlockPos pos, Block blockType, boolean p_175722_3_) {
if (this.field_72986_A.func_76067_t() != WorldType.field_180272_g)
func_175685_c(pos, blockType, p_175722_3_);
}
public void func_72975_g(int x, int z, int y1, int y2) {
if (y1 > y2) {
int i = y2;
y2 = y1;
y1 = i;
}
if (this.field_73011_w.func_191066_m())
for (int j = y1; j <= y2; j++)
func_180500_c(EnumSkyBlock.SKY, new BlockPos(x, j, z));
func_147458_c(x, y1, z, x, y2, z);
}
public void func_175704_b(BlockPos rangeMin, BlockPos rangeMax) {
func_147458_c(rangeMin.func_177958_n(), rangeMin.func_177956_o(), rangeMin.func_177952_p(), rangeMax.func_177958_n(), rangeMax.func_177956_o(), rangeMax.func_177952_p());
}
public void func_147458_c(int x1, int y1, int z1, int x2, int y2, int z2) {
for (int i = 0; i < this.field_73021_x.size(); i++)
((IWorldEventListener)this.field_73021_x.get(i)).func_147585_a(x1, y1, z1, x2, y2, z2);
}
public void func_190522_c(BlockPos pos, Block blockType) {
func_190529_b(pos.func_177976_e(), blockType, pos);
func_190529_b(pos.func_177974_f(), blockType, pos);
func_190529_b(pos.func_177977_b(), blockType, pos);
func_190529_b(pos.func_177984_a(), blockType, pos);
func_190529_b(pos.func_177978_c(), blockType, pos);
func_190529_b(pos.func_177968_d(), blockType, pos);
}
public void func_175685_c(BlockPos pos, Block blockType, boolean updateObservers) {
if (ForgeEventFactory.onNeighborNotify(this, pos, func_180495_p(pos), EnumSet.allOf(EnumFacing.class), updateObservers).isCanceled())
return;
func_190524_a(pos.func_177976_e(), blockType, pos);
func_190524_a(pos.func_177974_f(), blockType, pos);
func_190524_a(pos.func_177977_b(), blockType, pos);
func_190524_a(pos.func_177984_a(), blockType, pos);
func_190524_a(pos.func_177978_c(), blockType, pos);
func_190524_a(pos.func_177968_d(), blockType, pos);
if (updateObservers)
func_190522_c(pos, blockType);
}
public void func_175695_a(BlockPos pos, Block blockType, EnumFacing skipSide) {
EnumSet<EnumFacing> directions = EnumSet.allOf(EnumFacing.class);
directions.remove(skipSide);
if (ForgeEventFactory.onNeighborNotify(this, pos, func_180495_p(pos), directions, false).isCanceled())
return;
if (skipSide != EnumFacing.WEST)
func_190524_a(pos.func_177976_e(), blockType, pos);
if (skipSide != EnumFacing.EAST)
func_190524_a(pos.func_177974_f(), blockType, pos);
if (skipSide != EnumFacing.DOWN)
func_190524_a(pos.func_177977_b(), blockType, pos);
if (skipSide != EnumFacing.UP)
func_190524_a(pos.func_177984_a(), blockType, pos);
if (skipSide != EnumFacing.NORTH)
func_190524_a(pos.func_177978_c(), blockType, pos);
if (skipSide != EnumFacing.SOUTH)
func_190524_a(pos.func_177968_d(), blockType, pos);
}
public void func_190524_a(BlockPos pos, Block blockIn, BlockPos fromPos) {
if (!this.field_72995_K) {
IBlockState iblockstate = func_180495_p(pos);
try {
iblockstate.func_189546_a(this, pos, blockIn, fromPos);
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.func_85055_a(throwable, "Exception while updating neighbours");
CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block being updated");
crashreportcategory.func_189529_a("Source block type", (ICrashReportDetail)new Object(this, blockIn));
CrashReportCategory.func_175750_a(crashreportcategory, pos, iblockstate);
throw new ReportedException(crashreport);
}
}
}
public void func_190529_b(BlockPos pos, Block p_190529_2_, BlockPos p_190529_3_) {
if (!this.field_72995_K) {
IBlockState iblockstate = func_180495_p(pos);
try {
iblockstate.func_177230_c().observedNeighborChange(iblockstate, this, pos, p_190529_2_, p_190529_3_);
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.func_85055_a(throwable, "Exception while updating neighbours");
CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block being updated");
crashreportcategory.func_189529_a("Source block type", (ICrashReportDetail)new Object(this, p_190529_2_));
CrashReportCategory.func_175750_a(crashreportcategory, pos, iblockstate);
throw new ReportedException(crashreport);
}
}
}
public boolean func_175691_a(BlockPos pos, Block blockType) {
return false;
}
public boolean func_175678_i(BlockPos pos) {
return func_175726_f(pos).func_177444_d(pos);
}
public boolean func_175710_j(BlockPos pos) {
if (pos.func_177956_o() >= func_181545_F())
return func_175678_i(pos);
BlockPos blockpos = new BlockPos(pos.func_177958_n(), func_181545_F(), pos.func_177952_p());
if (!func_175678_i(blockpos))
return false;
for (BlockPos blockpos1 = blockpos.func_177977_b(); blockpos1.func_177956_o() > pos.func_177956_o(); blockpos1 = blockpos1.func_177977_b()) {
IBlockState iblockstate = func_180495_p(blockpos1);
if (iblockstate.func_177230_c().getLightOpacity(iblockstate, this, blockpos) > 0 && !iblockstate.func_185904_a().func_76224_d())
return false;
}
return true;
}
public int func_175699_k(BlockPos pos) {
if (pos.func_177956_o() < 0)
return 0;
if (pos.func_177956_o() >= 256)
pos = new BlockPos(pos.func_177958_n(), 255, pos.func_177952_p());
return func_175726_f(pos).func_177443_a(pos, 0);
}
public int func_175671_l(BlockPos pos) {
return func_175721_c(pos, true);
}
public int func_175721_c(BlockPos pos, boolean checkNeighbors) {
if (pos.func_177958_n() >= -30000000 && pos.func_177952_p() >= -30000000 && pos.func_177958_n() < 30000000 && pos.func_177952_p() < 30000000) {
if (checkNeighbors && func_180495_p(pos).func_185916_f()) {
int i1 = func_175721_c(pos.func_177984_a(), false);
int i = func_175721_c(pos.func_177974_f(), false);
int j = func_175721_c(pos.func_177976_e(), false);
int k = func_175721_c(pos.func_177968_d(), false);
int l = func_175721_c(pos.func_177978_c(), false);
if (i > i1)
i1 = i;
if (j > i1)
i1 = j;
if (k > i1)
i1 = k;
if (l > i1)
i1 = l;
return i1;
}
if (pos.func_177956_o() < 0)
return 0;
if (pos.func_177956_o() >= 256)
pos = new BlockPos(pos.func_177958_n(), 255, pos.func_177952_p());
Chunk chunk = func_175726_f(pos);
return chunk.func_177443_a(pos, this.field_73008_k);
}
return 15;
}
public BlockPos func_175645_m(BlockPos pos) {
return new BlockPos(pos.func_177958_n(), func_189649_b(pos.func_177958_n(), pos.func_177952_p()), pos.func_177952_p());
}
public int func_189649_b(int x, int z) {
int i;
if (x >= -30000000 && z >= -30000000 && x < 30000000 && z < 30000000) {
if (func_175680_a(x >> 4, z >> 4, true)) {
i = func_72964_e(x >> 4, z >> 4).func_76611_b(x & 0xF, z & 0xF);
} else {
i = 0;
}
} else {
i = func_181545_F() + 1;
}
return i;
}
@Deprecated
public int func_82734_g(int x, int z) {
if (x >= -30000000 && z >= -30000000 && x < 30000000 && z < 30000000) {
if (!func_175680_a(x >> 4, z >> 4, true))
return 0;
Chunk chunk = func_72964_e(x >> 4, z >> 4);
return chunk.func_177442_v();
}
return func_181545_F() + 1;
}
public void func_175679_n(BlockPos pos) {
for (int i = 0; i < this.field_73021_x.size(); i++)
((IWorldEventListener)this.field_73021_x.get(i)).func_174959_b(pos);
}
public float func_175724_o(BlockPos pos) {
return this.field_73011_w.func_177497_p()[func_175671_l(pos)];
}
public boolean func_72935_r() {
return this.field_73011_w.isDaytime();
}
@Nullable
public RayTraceResult func_72933_a(Vec3d start, Vec3d end) {
return func_147447_a(start, end, false, false, false);
}
@Nullable
public RayTraceResult func_72901_a(Vec3d start, Vec3d end, boolean stopOnLiquid) {
return func_147447_a(start, end, stopOnLiquid, false, false);
}
@Nullable
public RayTraceResult func_147447_a(Vec3d vec31, Vec3d vec32, boolean stopOnLiquid, boolean ignoreBlockWithoutBoundingBox, boolean returnLastUncollidableBlock) {
if (!Double.isNaN(vec31.field_72450_a) && !Double.isNaN(vec31.field_72448_b) && !Double.isNaN(vec31.field_72449_c)) {
if (!Double.isNaN(vec32.field_72450_a) && !Double.isNaN(vec32.field_72448_b) && !Double.isNaN(vec32.field_72449_c)) {
int i = MathHelper.func_76128_c(vec32.field_72450_a);
int j = MathHelper.func_76128_c(vec32.field_72448_b);
int k = MathHelper.func_76128_c(vec32.field_72449_c);
int l = MathHelper.func_76128_c(vec31.field_72450_a);
int i1 = MathHelper.func_76128_c(vec31.field_72448_b);
int j1 = MathHelper.func_76128_c(vec31.field_72449_c);
BlockPos blockpos = new BlockPos(l, i1, j1);
callbackInfo42 = new CallbackInfoReturnable("func_147447_a", true);
handler$zof000$checkChunkLoaded(vec31, vec32, stopOnLiquid, ignoreBlockWithoutBoundingBox, returnLastUncollidableBlock, callbackInfo42, i, j, k, l, i1, j1, blockpos);
if (callbackInfo42.isCancelled())
return (RayTraceResult)callbackInfo42.getReturnValue();
IBlockState iblockstate = func_180495_p(blockpos);
Block block = iblockstate.func_177230_c();
if ((!ignoreBlockWithoutBoundingBox || iblockstate.func_185890_d(this, blockpos) != Block.field_185506_k) && block.func_176209_a(iblockstate, stopOnLiquid)) {
RayTraceResult raytraceresult = iblockstate.func_185910_a(this, blockpos, vec31, vec32);
if (raytraceresult != null)
return raytraceresult;
}
RayTraceResult raytraceresult2 = null;
int k1 = 200;
while (k1-- >= 0) {
EnumFacing enumfacing;
if (Double.isNaN(vec31.field_72450_a) || Double.isNaN(vec31.field_72448_b) || Double.isNaN(vec31.field_72449_c))
return null;
if (l == i && i1 == j && j1 == k)
return returnLastUncollidableBlock ? raytraceresult2 : null;
boolean flag2 = true;
boolean flag = true;
boolean flag1 = true;
double d0 = 999.0D;
double d1 = 999.0D;
double d2 = 999.0D;
if (i > l) {
d0 = l + 1.0D;
} else if (i < l) {
d0 = l + 0.0D;
} else {
flag2 = false;
}
if (j > i1) {
d1 = i1 + 1.0D;
} else if (j < i1) {
d1 = i1 + 0.0D;
} else {
flag = false;
}
if (k > j1) {
d2 = j1 + 1.0D;
} else if (k < j1) {
d2 = j1 + 0.0D;
} else {
flag1 = false;
}
double d3 = 999.0D;
double d4 = 999.0D;
double d5 = 999.0D;
double d6 = vec32.field_72450_a - vec31.field_72450_a;
double d7 = vec32.field_72448_b - vec31.field_72448_b;
double d8 = vec32.field_72449_c - vec31.field_72449_c;
if (flag2)
d3 = (d0 - vec31.field_72450_a) / d6;
if (flag)
d4 = (d1 - vec31.field_72448_b) / d7;
if (flag1)
d5 = (d2 - vec31.field_72449_c) / d8;
if (d3 == -0.0D)
d3 = -1.0E-4D;
if (d4 == -0.0D)
d4 = -1.0E-4D;
if (d5 == -0.0D)
d5 = -1.0E-4D;
if (d3 < d4 && d3 < d5) {
enumfacing = (i > l) ? EnumFacing.WEST : EnumFacing.EAST;
vec31 = new Vec3d(d0, vec31.field_72448_b + d7 * d3, vec31.field_72449_c + d8 * d3);
} else if (d4 < d5) {
enumfacing = (j > i1) ? EnumFacing.DOWN : EnumFacing.UP;
vec31 = new Vec3d(vec31.field_72450_a + d6 * d4, d1, vec31.field_72449_c + d8 * d4);
} else {
enumfacing = (k > j1) ? EnumFacing.NORTH : EnumFacing.SOUTH;
vec31 = new Vec3d(vec31.field_72450_a + d6 * d5, vec31.field_72448_b + d7 * d5, d2);
}
l = MathHelper.func_76128_c(vec31.field_72450_a) - ((enumfacing == EnumFacing.EAST) ? 1 : 0);
i1 = MathHelper.func_76128_c(vec31.field_72448_b) - ((enumfacing == EnumFacing.UP) ? 1 : 0);
j1 = MathHelper.func_76128_c(vec31.field_72449_c) - ((enumfacing == EnumFacing.SOUTH) ? 1 : 0);
blockpos = new BlockPos(l, i1, j1);
callbackInfo43 = new CallbackInfoReturnable("func_147447_a", true);
handler$zof000$checkChunkLoaded(vec31, vec32, stopOnLiquid, ignoreBlockWithoutBoundingBox, returnLastUncollidableBlock, callbackInfo43, i, j, k, l, i1, j1, blockpos);
if (callbackInfo43.isCancelled())
return (RayTraceResult)callbackInfo43.getReturnValue();
IBlockState iblockstate1 = func_180495_p(blockpos);
Block block1 = iblockstate1.func_177230_c();
if (!ignoreBlockWithoutBoundingBox || iblockstate1.func_185904_a() == Material.field_151567_E || iblockstate1.func_185890_d(this, blockpos) != Block.field_185506_k) {
if (block1.func_176209_a(iblockstate1, stopOnLiquid)) {
RayTraceResult raytraceresult1 = iblockstate1.func_185910_a(this, blockpos, vec31, vec32);
if (raytraceresult1 != null)
return raytraceresult1;
continue;
}
raytraceresult2 = new RayTraceResult(RayTraceResult.Type.MISS, vec31, enumfacing, blockpos);
}
}
return returnLastUncollidableBlock ? raytraceresult2 : null;
}
return null;
}
return null;
}
public void func_184133_a(@Nullable EntityPlayer player, BlockPos pos, SoundEvent soundIn, SoundCategory category, float volume, float pitch) {
func_184148_a(player, pos.func_177958_n() + 0.5D, pos.func_177956_o() + 0.5D, pos.func_177952_p() + 0.5D, soundIn, category, volume, pitch);
}
public void func_184148_a(@Nullable EntityPlayer player, double x, double y, double z, SoundEvent soundIn, SoundCategory category, float volume, float pitch) {
callbackInfo14 = new CallbackInfo("func_184148_a", true);
handler$zlk000$impl$spongePlaySoundAtEntity((EntityPlayer)SYNTHETIC_LOCAL_VARIABLE_1, SYNTHETIC_LOCAL_VARIABLE_2, SYNTHETIC_LOCAL_VARIABLE_4, SYNTHETIC_LOCAL_VARIABLE_6, (SoundEvent)SYNTHETIC_LOCAL_VARIABLE_8, (SoundCategory)SYNTHETIC_LOCAL_VARIABLE_9, SYNTHETIC_LOCAL_VARIABLE_10, SYNTHETIC_LOCAL_VARIABLE_11, callbackInfo14);
if (callbackInfo14.isCancelled())
return;
PlaySoundAtEntityEvent event = ForgeEventFactory.onPlaySoundAtEntity((Entity)SYNTHETIC_LOCAL_VARIABLE_1, (SoundEvent)SYNTHETIC_LOCAL_VARIABLE_8, (SoundCategory)SYNTHETIC_LOCAL_VARIABLE_9, SYNTHETIC_LOCAL_VARIABLE_10, SYNTHETIC_LOCAL_VARIABLE_11);
if (event.isCanceled() || event.getSound() == null)
return;
SoundEvent soundIn = event.getSound();
SoundCategory category = event.getCategory();
float volume = event.getVolume();
float pitch = event.getPitch();
for (int i = 0; i < this.field_73021_x.size(); i++)
((IWorldEventListener)this.field_73021_x.get(i)).func_184375_a((EntityPlayer)SYNTHETIC_LOCAL_VARIABLE_1, soundIn, category, SYNTHETIC_LOCAL_VARIABLE_2, SYNTHETIC_LOCAL_VARIABLE_4, SYNTHETIC_LOCAL_VARIABLE_6, volume, pitch);
}
public void func_184134_a(double x, double y, double z, SoundEvent soundIn, SoundCategory category, float volume, float pitch, boolean distanceDelay) {}
public void func_184149_a(BlockPos blockPositionIn, @Nullable SoundEvent soundEventIn) {
for (int i = 0; i < this.field_73021_x.size(); i++)
((IWorldEventListener)this.field_73021_x.get(i)).func_184377_a(soundEventIn, blockPositionIn);
}
public void func_175688_a(EnumParticleTypes particleType, double xCoord, double yCoord, double zCoord, double xSpeed, double ySpeed, double zSpeed, int... parameters) {
func_175720_a(particleType.func_179348_c(), particleType.func_179344_e(), xCoord, yCoord, zCoord, xSpeed, ySpeed, zSpeed, parameters);
}
public void func_190523_a(int p_190523_1_, double p_190523_2_, double p_190523_4_, double p_190523_6_, double p_190523_8_, double p_190523_10_, double p_190523_12_, int... p_190523_14_) {
for (int i = 0; i < this.field_73021_x.size(); i++)
((IWorldEventListener)this.field_73021_x.get(i)).func_190570_a(p_190523_1_, false, true, p_190523_2_, p_190523_4_, p_190523_6_, p_190523_8_, p_190523_10_, p_190523_12_, p_190523_14_);
}
private void func_175720_a(int particleID, boolean ignoreRange, double xCood, double yCoord, double zCoord, double xSpeed, double ySpeed, double zSpeed, int... parameters) {
for (int i = 0; i < this.field_73021_x.size(); i++)
((IWorldEventListener)this.field_73021_x.get(i)).func_180442_a(particleID, ignoreRange, xCood, yCoord, zCoord, xSpeed, ySpeed, zSpeed, parameters);
}
public boolean func_72942_c(Entity entityIn) {
if (MinecraftForge.EVENT_BUS.post((Event)new EntityJoinWorldEvent(entityIn, this)))
return false;
this.field_73007_j.add(entityIn);
return true;
}
public boolean func_72838_d(Entity entityIn) {
if (!this.field_72995_K && (entityIn == null || (entityIn instanceof EntityItem && this.restoringBlockSnapshots)))
return false;
int i = MathHelper.func_76128_c(entityIn.field_70165_t / 16.0D);
int j = MathHelper.func_76128_c(entityIn.field_70161_v / 16.0D);
boolean flag = entityIn.field_98038_p;
if (entityIn instanceof EntityPlayer)
flag = true;
if (!flag && !func_175680_a(i, j, false))
return false;
if (entityIn instanceof EntityPlayer) {
EntityPlayer entityplayer = (EntityPlayer)entityIn;
this.field_73010_i.add(entityplayer);
func_72854_c();
}
if (MinecraftForge.EVENT_BUS.post((Event)new EntityJoinWorldEvent(entityIn, this)) && !flag)
return false;
func_72964_e(i, j).func_76612_a(entityIn);
this.field_72996_f.add(entityIn);
func_72923_a(entityIn);
return true;
}
public void func_72923_a(Entity entityIn) {
for (int i = 0; i < this.field_73021_x.size(); i++)
((IWorldEventListener)this.field_73021_x.get(i)).func_72703_a(entityIn);
entityIn.onAddedToWorld();
handler$zlk000$onEntityAddedToWorldMarkAsTracked(entityIn, new CallbackInfo("func_72923_a", false));
}
public void func_72847_b(Entity entityIn) {
for (int i = 0; i < this.field_73021_x.size(); i++)
((IWorldEventListener)this.field_73021_x.get(i)).func_72709_b(entityIn);
entityIn.onRemovedFromWorld();
handler$zlk000$onEntityRemovedFromWorldMarkAsUntracked(entityIn, new CallbackInfo("func_72847_b", false));
}
public void func_72900_e(Entity entityIn) {
if (entityIn.func_184207_aI())
entityIn.func_184226_ay();
if (entityIn.func_184218_aH())
entityIn.func_184210_p();
entityIn.func_70106_y();
if (entityIn instanceof EntityPlayer) {
this.field_73010_i.remove(entityIn);
func_72854_c();
func_72847_b(entityIn);
}
}
public void func_72973_f(Entity entityIn) {
entityIn.func_184174_b(false);
entityIn.func_70106_y();
if (entityIn instanceof EntityPlayer) {
this.field_73010_i.remove(entityIn);
func_72854_c();
}
int i = entityIn.field_70176_ah;
int j = entityIn.field_70164_aj;
if (entityIn.field_70175_ag && func_175680_a(i, j, true))
func_72964_e(i, j).func_76622_b(entityIn);
this.field_72996_f.remove(entityIn);
func_72847_b(entityIn);
}
public void func_72954_a(IWorldEventListener listener) {
this.field_73021_x.add(listener);
}
private boolean func_191504_a(@Nullable Entity entityIn, AxisAlignedBB aabb, boolean p_191504_3_, @Nullable List<AxisAlignedBB> outList) {
int i = MathHelper.func_76128_c(aabb.field_72340_a) - 1;
int j = MathHelper.func_76143_f(aabb.field_72336_d) + 1;
int k = MathHelper.func_76128_c(aabb.field_72338_b) - 1;
int l = MathHelper.func_76143_f(aabb.field_72337_e) + 1;
int i1 = MathHelper.func_76128_c(aabb.field_72339_c) - 1;
int j1 = MathHelper.func_76143_f(aabb.field_72334_f) + 1;
WorldBorder worldborder = func_175723_af();
boolean flag = (entityIn != null && entityIn.func_174832_aS());
boolean flag1 = (entityIn != null && func_191503_g(entityIn));
IBlockState iblockstate = Blocks.field_150348_b.func_176223_P();
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
if (p_191504_3_ && !ForgeEventFactory.gatherCollisionBoxes(this, entityIn, aabb, outList))
return true;
try {
for (int k1 = i; k1 < j; k1++) {
for (int l1 = i1; l1 < j1; l1++) {
boolean flag2 = (k1 == i || k1 == j - 1);
boolean flag3 = (l1 == i1 || l1 == j1 - 1);
if ((!flag2 || !flag3) && func_175667_e((BlockPos)blockpos$pooledmutableblockpos.func_181079_c(k1, 64, l1)))
for (int i2 = k; i2 < l; i2++) {
if ((!flag2 && !flag3) || i2 != l - 1) {
IBlockState iblockstate1;
if (p_191504_3_) {
if (k1 < -30000000 || k1 >= 30000000 || l1 < -30000000 || l1 >= 30000000) {
boolean lvt_21_2_ = true;
return lvt_21_2_;
}
} else if (entityIn != null && flag == flag1) {
entityIn.func_174821_h(!flag1);
}
blockpos$pooledmutableblockpos.func_181079_c(k1, i2, l1);
if (!p_191504_3_ && !worldborder.func_177746_a((BlockPos)blockpos$pooledmutableblockpos) && flag1) {
iblockstate1 = iblockstate;
} else {
iblockstate1 = func_180495_p((BlockPos)blockpos$pooledmutableblockpos);
}
iblockstate1.func_185908_a(this, (BlockPos)blockpos$pooledmutableblockpos, aabb, outList, entityIn, false);
if (p_191504_3_ && !ForgeEventFactory.gatherCollisionBoxes(this, entityIn, aabb, outList)) {
boolean flag5 = true;
return flag5;
}
}
}
}
}
} finally {
blockpos$pooledmutableblockpos.func_185344_t();
}
return !outList.isEmpty();
}
public List<AxisAlignedBB> func_184144_a(@Nullable Entity entityIn, AxisAlignedBB aabb) {
callbackInfo8 = new CallbackInfoReturnable("func_184144_a", true);
handler$zlk000$onGetCollisionBoxes((Entity)SYNTHETIC_LOCAL_VARIABLE_1, (AxisAlignedBB)SYNTHETIC_LOCAL_VARIABLE_2, callbackInfo8);
if (callbackInfo8.isCancelled())
return (List<AxisAlignedBB>)callbackInfo8.getReturnValue();
List<AxisAlignedBB> list = Lists.newArrayList();
func_191504_a((Entity)SYNTHETIC_LOCAL_VARIABLE_1, (AxisAlignedBB)SYNTHETIC_LOCAL_VARIABLE_2, false, list);
if (SYNTHETIC_LOCAL_VARIABLE_1 != null) {
List<Entity> list1 = func_72839_b((Entity)SYNTHETIC_LOCAL_VARIABLE_1, SYNTHETIC_LOCAL_VARIABLE_2.func_186662_g(0.25D));
for (int i = 0; i < list1.size(); i++) {
Entity entity = list1.get(i);
if (!SYNTHETIC_LOCAL_VARIABLE_1.func_184223_x(entity)) {
AxisAlignedBB axisalignedbb = entity.func_70046_E();
if (axisalignedbb != null && axisalignedbb.func_72326_a((AxisAlignedBB)SYNTHETIC_LOCAL_VARIABLE_2))
list.add(axisalignedbb);
axisalignedbb = SYNTHETIC_LOCAL_VARIABLE_1.func_70114_g(entity);
if (axisalignedbb != null && axisalignedbb.func_72326_a((AxisAlignedBB)SYNTHETIC_LOCAL_VARIABLE_2))
list.add(axisalignedbb);
}
}
}
MinecraftForge.EVENT_BUS.post((Event)new GetCollisionBoxesEvent(this, (Entity)SYNTHETIC_LOCAL_VARIABLE_1, (AxisAlignedBB)SYNTHETIC_LOCAL_VARIABLE_2, list));
return list;
}
public void func_72848_b(IWorldEventListener listener) {
this.field_73021_x.remove(listener);
}
public boolean func_191503_g(Entity p_191503_1_) {
double d0 = this.field_175728_M.func_177726_b();
double d1 = this.field_175728_M.func_177736_c();
double d2 = this.field_175728_M.func_177728_d();
double d3 = this.field_175728_M.func_177733_e();
if (p_191503_1_.func_174832_aS()) {
d0++;
d1++;
d2--;
d3--;
} else {
d0--;
d1--;
d2++;
d3++;
}
return (p_191503_1_.field_70165_t > d0 && p_191503_1_.field_70165_t < d2 && p_191503_1_.field_70161_v > d1 && p_191503_1_.field_70161_v < d3);
}
public int func_72967_a(float partialTicks) {
float f = this.field_73011_w.getSunBrightnessFactor(partialTicks);
f = 1.0F - f;
return (int)(f * 11.0F);
}
public float getSunBrightnessFactor(float partialTicks) {
float f = func_72826_c(partialTicks);
float f1 = 1.0F - MathHelper.func_76134_b(f * 6.2831855F) * 2.0F + 0.5F;
f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
f1 = 1.0F - f1;
f1 = (float)(f1 * (1.0D - (func_72867_j(partialTicks) * 5.0F) / 16.0D));
f1 = (float)(f1 * (1.0D - (func_72819_i(partialTicks) * 5.0F) / 16.0D));
return f1;
}
public float func_72826_c(float partialTicks) {
return this.field_73011_w.func_76563_a(func_72820_D(), partialTicks);
}
public float func_130001_d() {
return this.field_73011_w.getCurrentMoonPhaseFactor();
}
public float getCurrentMoonPhaseFactorBody() {
return WorldProvider.field_111203_a[this.field_73011_w.func_76559_b(func_72820_D())];
}
public float func_72929_e(float partialTicks) {
float f = func_72826_c(partialTicks);
return f * 6.2831855F;
}
public BlockPos func_175725_q(BlockPos pos) {
return func_175726_f(pos).func_177440_h(pos);
}
public BlockPos func_175672_r(BlockPos pos) {
Chunk chunk = func_175726_f(pos);
BlockPos blockpos;
for (blockpos = new BlockPos(pos.func_177958_n(), chunk.func_76625_h() + 16, pos.func_177952_p()); blockpos.func_177956_o() >= 0; blockpos = blockpos1) {
BlockPos blockpos1 = blockpos.func_177977_b();
IBlockState state = chunk.func_177435_g(blockpos1);
if (state.func_185904_a().func_76230_c() && !state.func_177230_c().isLeaves(state, this, blockpos1) && !state.func_177230_c().isFoliage(this, blockpos1))
break;
}
return blockpos;
}
public boolean func_184145_b(BlockPos pos, Block blk) {
return true;
}
public void func_175684_a(BlockPos pos, Block blockIn, int delay) {}
public void func_175654_a(BlockPos pos, Block blockIn, int delay, int priority) {}
public void func_180497_b(BlockPos pos, Block blockIn, int delay, int priority) {}
public void func_72939_s() {
this.field_72984_F.func_76320_a("entities");
this.field_72984_F.func_76320_a("global");
handler$zlk000$impl$startEntityGlobalTimings(new CallbackInfo("func_72939_s", false));
for (int i = 0; i < this.field_73007_j.size(); i++) {
Entity entity = this.field_73007_j.get(i);
try {
if (entity.updateBlocked)
continue;
entity.field_70173_aa++;
Entity entity1 = entity;
redirect$zlk000$onUpdateWeatherEffect(entity1);
} catch (Throwable throwable2) {
handler$zlk000$impl$stopTimingForWeatherEntityTickCrash(new CallbackInfo("func_72939_s", false), i, entity, throwable2);
CrashReport crashreport = CrashReport.func_85055_a(throwable2, "Ticking entity");
CrashReportCategory crashreportcategory = crashreport.func_85058_a("Entity being ticked");
if (entity == null) {
crashreportcategory.func_71507_a("Entity", "~~NULL~~");
} else {
entity.func_85029_a(crashreportcategory);
}
if (ForgeModContainer.removeErroringEntities) {
FMLLog.log.fatal("{}", crashreport.func_71502_e());
func_72900_e(entity);
} else {
throw new ReportedException(crashreport);
}
}
if (entity.field_70128_L)
this.field_73007_j.remove(i--);
continue;
}
handler$zlk000$impl$stopEntityTickTiming(new CallbackInfo("func_72939_s", false));
this.field_72984_F.func_76318_c("remove");
this.field_72996_f.removeAll(this.field_72997_g);
for (int k = 0; k < this.field_72997_g.size(); k++) {
Entity entity1 = this.field_72997_g.get(k);
int j = entity1.field_70176_ah;
int k1 = entity1.field_70164_aj;
if (redirect$zlk000$impl$ReturnFalseUseActiveChunkReferant(entity1) && func_175680_a(j, k1, true))
func_72964_e(j, k1).func_76622_b(entity1);
}
for (int l = 0; l < this.field_72997_g.size(); l++)
func_72847_b(this.field_72997_g.get(l));
this.field_72997_g.clear();
handler$zlk000$impl$stopEntityRemovalTiming(new CallbackInfo("func_72939_s", false));
func_184147_l();
this.field_72984_F.func_76318_c("regular");
handler$zlk000$impl$entityActivationCheck(new CallbackInfo("func_72939_s", false));
for (int i1 = 0; i1 < this.field_72996_f.size(); i1++) {
Entity entity2 = this.field_72996_f.get(i1);
Entity entity3 = entity2.func_184187_bx();
if (entity3 != null) {
if (!entity3.field_70128_L && entity3.func_184196_w(entity2))
continue;
entity2.func_184210_p();
}
this.field_72984_F.func_76320_a("tick");
handler$zlk000$impl$startEntityTickingForTick(new CallbackInfo("func_72939_s", false));
if (!entity2.field_70128_L && !(entity2 instanceof EntityPlayerMP))
try {
TimeTracker.ENTITY_UPDATE.trackStart(entity2);
func_72870_g(entity2);
TimeTracker.ENTITY_UPDATE.trackEnd(entity2);
} catch (Throwable throwable1) {
handler$zlk000$impl$stopEntityAndThrowInfo(new CallbackInfo("func_72939_s", false), i1, entity2, entity3, throwable1);
CrashReport crashreport1 = CrashReport.func_85055_a(throwable1, "Ticking entity");
CrashReportCategory crashreportcategory1 = crashreport1.func_85058_a("Entity being ticked");
entity2.func_85029_a(crashreportcategory1);
if (ForgeModContainer.removeErroringEntities) {
FMLLog.log.fatal("{}", crashreport1.func_71502_e());
func_72900_e(entity2);
} else {
throw new ReportedException(crashreport1);
}
}
handler$zlk000$impl$startEntityRemovalTiming(new CallbackInfo("func_72939_s", false));
this.field_72984_F.func_76319_b();
this.field_72984_F.func_76320_a("remove");
if (entity2.field_70128_L) {
int l1 = entity2.field_70176_ah;
int i2 = entity2.field_70164_aj;
if (redirect$zlk000$impl$ReturnFalseUseActiveChunkReferant(entity2) && func_175680_a(l1, i2, true))
func_72964_e(l1, i2).func_76622_b(entity2);
this.field_72996_f.remove(i1--);
func_72847_b(entity2);
}
handler$zlk000$impl$stopRemovalTimingAfterentityRemovals(new CallbackInfo("func_72939_s", false));
this.field_72984_F.func_76319_b();
continue;
}
this.field_72984_F.func_76318_c("blockEntities");
handler$zlk000$impl$tileActivationStart(new CallbackInfo("func_72939_s", false));
this.field_147481_N = true;
if (!this.field_147483_b.isEmpty()) {
for (TileEntity tile : this.field_147483_b)
((TileEntity)tile).onChunkUnload();
Set<TileEntity> remove = Collections.newSetFromMap(new IdentityHashMap<>());
remove.addAll(this.field_147483_b);
this.field_175730_i.removeAll(remove);
this.field_147482_g.removeAll(remove);
this.field_147483_b.clear();
}
Iterator<TileEntity> iterator = this.field_175730_i.iterator();
while (true) {
Iterator<TileEntity> iterator1 = iterator;
if (redirect$zlk000$impl$stopTileRemovalTimingIfHasNext(iterator1)) {
handler$zlk000$impl$startTileTickTimer(new CallbackInfo("func_72939_s", false));
TileEntity tileentity = iterator.next();
if (!tileentity.func_145837_r()) {
TileEntity tileEntity = tileentity;
if (redirect$zlk000$impl$checkIfTileHasActiveChunk(tileEntity)) {
BlockPos blockpos = tileentity.func_174877_v();
boolean bool = false;
BlockPos blockPos1 = blockpos;
World world = this;
if (redirect$bam000$forgeImpl$useTileActiveChunk(world, blockPos1, bool) && this.field_175728_M.func_177746_a(blockpos))
try {
this.field_72984_F.func_194340_a(() -> String.valueOf(TileEntity.func_190559_a(tileentity.getClass())));
TimeTracker.TILE_ENTITY_UPDATE.trackStart(tileentity);
ITickable iTickable = (ITickable)tileentity;
redirect$zlk000$onUpdateTileEntities(iTickable);
TimeTracker.TILE_ENTITY_UPDATE.trackEnd(tileentity);
this.field_72984_F.func_76319_b();
} catch (Throwable throwable) {
handler$zlk000$impl$stopTileTickCrash(new CallbackInfo("func_72939_s", false), iterator, tileentity, blockpos, throwable);
CrashReport crashreport2 = CrashReport.func_85055_a(throwable, "Ticking block entity");
CrashReportCategory crashreportcategory2 = crashreport2.func_85058_a("Block entity being ticked");
tileentity.func_145828_a(crashreportcategory2);
if (ForgeModContainer.removeErroringTileEntities) {
FMLLog.log.fatal("{}", crashreport2.func_71502_e());
tileentity.func_145843_s();
func_175713_t(tileentity.func_174877_v());
} else {
throw new ReportedException(crashreport2);
}
}
}
}
handler$zlk000$impl$stopTileTickAndStartRemoval(new CallbackInfo("func_72939_s", false));
if (tileentity.func_145837_r()) {
iterator.remove();
TileEntity tileEntity = tileentity;
List<TileEntity> list = this.field_147482_g;
redirect$zlk000$impl$removeTileFromLoadedList(list, tileEntity);
BlockPos blockPos = tileentity.func_174877_v();
World world = this;
if (redirect$zlk000$impl$ignoreisBlockLoaded(world, blockPos)) {
Chunk chunk = func_175726_f(tileentity.func_174877_v());
if (chunk.func_177424_a(tileentity.func_174877_v(), Chunk.EnumCreateEntityType.CHECK) == tileentity)
chunk.func_177425_e(tileentity.func_174877_v());
}
}
continue;
}
break;
}
this.field_147481_N = false;
handler$zlk000$impl$startPendingBlockEntities(new CallbackInfo("func_72939_s", false));
this.field_72984_F.func_76318_c("pendingBlockEntities");
if (!this.field_147484_a.isEmpty()) {
for (int j1 = 0; j1 < this.field_147484_a.size(); j1++) {
TileEntity tileentity1 = this.field_147484_a.get(j1);
if (!tileentity1.func_145837_r()) {
if (!this.field_147482_g.contains(tileentity1))
func_175700_a(tileentity1);
if (func_175667_e(tileentity1.func_174877_v())) {
Chunk chunk = func_175726_f(tileentity1.func_174877_v());
IBlockState iblockstate = chunk.func_177435_g(tileentity1.func_174877_v());
chunk.func_177426_a(tileentity1.func_174877_v(), tileentity1);
func_184138_a(tileentity1.func_174877_v(), iblockstate, iblockstate, 3);
}
}
}
this.field_147484_a.clear();
}
this.field_72984_F.func_76319_b();
this.field_72984_F.func_76319_b();
handler$zlk000$impl$endPendingTileEntities(new CallbackInfo("func_72939_s", false));
}
protected void func_184147_l() {}
public boolean func_175700_a(TileEntity tile) {
if (tile.func_145831_w() != this)
tile.func_145834_a(this);
if (this.field_147481_N)
return this.field_147484_a.add(tile);
boolean flag = this.field_147482_g.add(tile);
if (flag && tile instanceof ITickable) {
TileEntity tileEntity = tile;
List<TileEntity> list = this.field_175730_i;
redirect$zlk000$onAddTileEntity(list, tileEntity);
}
tile.onLoad();
if (this.field_72995_K) {
BlockPos blockpos1 = tile.func_174877_v();
IBlockState iblockstate1 = func_180495_p(blockpos1);
func_184138_a(blockpos1, iblockstate1, iblockstate1, 2);
}
return flag;
}
public void func_147448_a(Collection<TileEntity> tileEntityCollection) {
if (this.field_147481_N) {
for (TileEntity te : tileEntityCollection) {
if (te.func_145831_w() != this)
te.func_145834_a(this);
}
this.field_147484_a.addAll(tileEntityCollection);
} else {
for (TileEntity tileentity2 : tileEntityCollection)
func_175700_a(tileentity2);
}
}
public void func_72870_g(Entity ent) {
func_72866_a(ent, true);
}
public void func_72866_a(Entity entityIn, boolean forceUpdate) {
// Byte code:
// 0: new org/spongepowered/asm/mixin/injection/callback/CallbackInfo
// 3: dup
// 4: ldc_w 'func_72866_a'
// 7: iconst_1
// 8: invokespecial <init> : (Ljava/lang/String;Z)V
// 11: astore #8
// 13: aload_0
// 14: aload_1
// 15: iload_2
// 16: aload #8
// 18: invokespecial handler$bbd000$forgeActivationImpl$checkIfCanUpdate : (Lnet/minecraft/entity/Entity;ZLorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V
// 21: aload #8
// 23: invokevirtual isCancelled : ()Z
// 26: ifeq -> 30
// 29: return
// 30: aload_1
// 31: instanceof net/minecraft/entity/player/EntityPlayer
// 34: ifne -> 199
// 37: aload_1
// 38: getfield field_70165_t : D
// 41: invokestatic func_76128_c : (D)I
// 44: istore_3
// 45: aload_1
// 46: getfield field_70161_v : D
// 49: invokestatic func_76128_c : (D)I
// 52: istore #4
// 54: aload_0
// 55: getfield field_72995_K : Z
// 58: ifne -> 94
// 61: aload_0
// 62: astore #9
// 64: aload_0
// 65: aload #9
// 67: invokespecial redirect$bbd000$forgeActivationImpl$returnEmptyMap : (Lnet/minecraft/world/World;)Lcom/google/common/collect/ImmutableSetMultimap;
// 70: new net/minecraft/util/math/ChunkPos
// 73: dup
// 74: iload_3
// 75: iconst_4
// 76: ishr
// 77: iload #4
// 79: iconst_4
// 80: ishr
// 81: invokespecial <init> : (II)V
// 84: invokevirtual containsKey : (Ljava/lang/Object;)Z
// 87: ifeq -> 94
// 90: iconst_1
// 91: goto -> 95
// 94: iconst_0
// 95: istore #5
// 97: iload #5
// 99: ifeq -> 106
// 102: iconst_0
// 103: goto -> 108
// 106: bipush #32
// 108: istore #6
// 110: iload_2
// 111: ifeq -> 175
// 114: aload_0
// 115: iload_3
// 116: iload #6
// 118: isub
// 119: iconst_0
// 120: iload #4
// 122: iload #6
// 124: isub
// 125: iload_3
// 126: iload #6
// 128: iadd
// 129: iconst_0
// 130: iload #4
// 132: iload #6
// 134: iadd
// 135: iconst_1
// 136: istore #16
// 138: istore #15
// 140: istore #14
// 142: istore #13
// 144: istore #12
// 146: istore #11
// 148: istore #10
// 150: astore #9
// 152: aload_0
// 153: aload #9
// 155: iload #10
// 157: iload #11
// 159: iload #12
// 161: iload #13
// 163: iload #14
// 165: iload #15
// 167: iload #16
// 169: invokespecial redirect$bbd000$forgeActivationImpl$falseOutOfTheIf : (Lnet/minecraft/world/World;IIIIIIZ)Z
// 172: ifeq -> 179
// 175: iconst_1
// 176: goto -> 180
// 179: iconst_0
// 180: istore #7
// 182: iload #7
// 184: ifne -> 193
// 187: aload_1
// 188: invokestatic canEntityUpdate : (Lnet/minecraft/entity/Entity;)Z
// 191: istore #7
// 193: iload #7
// 195: ifne -> 199
// 198: return
// 199: aload_1
// 200: aload_1
// 201: getfield field_70165_t : D
// 204: putfield field_70142_S : D
// 207: aload_1
// 208: aload_1
// 209: getfield field_70163_u : D
// 212: putfield field_70137_T : D
// 215: aload_1
// 216: aload_1
// 217: getfield field_70161_v : D
// 220: putfield field_70136_U : D
// 223: aload_1
// 224: aload_1
// 225: getfield field_70177_z : F
// 228: putfield field_70126_B : F
// 231: aload_1
// 232: aload_1
// 233: getfield field_70125_A : F
// 236: putfield field_70127_C : F
// 239: iload_2
// 240: ifeq -> 312
// 243: aload_1
// 244: getfield field_70175_ag : Z
// 247: ifeq -> 312
// 250: aload_1
// 251: dup
// 252: getfield field_70173_aa : I
// 255: iconst_1
// 256: iadd
// 257: putfield field_70173_aa : I
// 260: aload_0
// 261: aload_1
// 262: iload_2
// 263: new org/spongepowered/asm/mixin/injection/callback/CallbackInfo
// 266: dup
// 267: ldc_w 'func_72866_a'
// 270: iconst_0
// 271: invokespecial <init> : (Ljava/lang/String;Z)V
// 274: invokespecial handler$zlk000$impl$increaseActivatedEntityTicks : (Lnet/minecraft/entity/Entity;ZLorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V
// 277: aload_1
// 278: invokevirtual func_184218_aH : ()Z
// 281: ifeq -> 296
// 284: aload_1
// 285: astore #9
// 287: aload_0
// 288: aload #9
// 290: invokevirtual redirect$zlk000$onCallEntityRidingUpdate : (Lnet/minecraft/entity/Entity;)V
// 293: goto -> 312
// 296: aload_1
// 297: getfield updateBlocked : Z
// 300: ifne -> 312
// 303: aload_1
// 304: astore #9
// 306: aload_0
// 307: aload #9
// 309: invokevirtual redirect$zlk000$onCallEntityUpdate : (Lnet/minecraft/entity/Entity;)V
// 312: aload_0
// 313: getfield field_72984_F : Lnet/minecraft/profiler/Profiler;
// 316: ldc_w 'chunkCheck'
// 319: invokevirtual func_76320_a : (Ljava/lang/String;)V
// 322: aload_1
// 323: getfield field_70165_t : D
// 326: invokestatic isNaN : (D)Z
// 329: ifne -> 342
// 332: aload_1
// 333: getfield field_70165_t : D
// 336: invokestatic isInfinite : (D)Z
// 339: ifeq -> 350
// 342: aload_1
// 343: aload_1
// 344: getfield field_70142_S : D
// 347: putfield field_70165_t : D
// 350: aload_1
// 351: getfield field_70163_u : D
// 354: invokestatic isNaN : (D)Z
// 357: ifne -> 370
// 360: aload_1
// 361: getfield field_70163_u : D
// 364: invokestatic isInfinite : (D)Z
// 367: ifeq -> 378
// 370: aload_1
// 371: aload_1
// 372: getfield field_70137_T : D
// 375: putfield field_70163_u : D
// 378: aload_1
// 379: getfield field_70161_v : D
// 382: invokestatic isNaN : (D)Z
// 385: ifne -> 398
// 388: aload_1
// 389: getfield field_70161_v : D
// 392: invokestatic isInfinite : (D)Z
// 395: ifeq -> 406
// 398: aload_1
// 399: aload_1
// 400: getfield field_70136_U : D
// 403: putfield field_70161_v : D
// 406: aload_1
// 407: getfield field_70125_A : F
// 410: f2d
// 411: invokestatic isNaN : (D)Z
// 414: ifne -> 428
// 417: aload_1
// 418: getfield field_70125_A : F
// 421: f2d
// 422: invokestatic isInfinite : (D)Z
// 425: ifeq -> 436
// 428: aload_1
// 429: aload_1
// 430: getfield field_70127_C : F
// 433: putfield field_70125_A : F
// 436: aload_1
// 437: getfield field_70177_z : F
// 440: f2d
// 441: invokestatic isNaN : (D)Z
// 444: ifne -> 458
// 447: aload_1
// 448: getfield field_70177_z : F
// 451: f2d
// 452: invokestatic isInfinite : (D)Z
// 455: ifeq -> 466
// 458: aload_1
// 459: aload_1
// 460: getfield field_70126_B : F
// 463: putfield field_70177_z : F
// 466: aload_1
// 467: getfield field_70165_t : D
// 470: ldc2_w 16.0
// 473: ddiv
// 474: invokestatic func_76128_c : (D)I
// 477: istore_3
// 478: aload_1
// 479: getfield field_70163_u : D
// 482: ldc2_w 16.0
// 485: ddiv
// 486: invokestatic func_76128_c : (D)I
// 489: istore #4
// 491: aload_1
// 492: getfield field_70161_v : D
// 495: ldc2_w 16.0
// 498: ddiv
// 499: invokestatic func_76128_c : (D)I
// 502: istore #5
// 504: aload_1
// 505: getfield field_70175_ag : Z
// 508: ifeq -> 537
// 511: aload_1
// 512: getfield field_70176_ah : I
// 515: iload_3
// 516: if_icmpne -> 537
// 519: aload_1
// 520: getfield field_70162_ai : I
// 523: iload #4
// 525: if_icmpne -> 537
// 528: aload_1
// 529: getfield field_70164_aj : I
// 532: iload #5
// 534: if_icmpeq -> 666
// 537: aload_1
// 538: aload_0
// 539: swap
// 540: invokespecial redirect$zlk000$impl$returnTrueToAddedToChunkForMovingEntities : (Lnet/minecraft/entity/Entity;)Z
// 543: ifeq -> 599
// 546: aload_0
// 547: aload_1
// 548: getfield field_70176_ah : I
// 551: aload_1
// 552: getfield field_70164_aj : I
// 555: iconst_1
// 556: istore #12
// 558: istore #11
// 560: istore #10
// 562: astore #9
// 564: aload_0
// 565: aload #9
// 567: iload #10
// 569: iload #11
// 571: iload #12
// 573: invokespecial redirect$zlk000$impl$returnFalseForChunkLoadedToAvoidIf : (Lnet/minecraft/world/World;IIZ)Z
// 576: ifeq -> 599
// 579: aload_0
// 580: aload_1
// 581: getfield field_70176_ah : I
// 584: aload_1
// 585: getfield field_70164_aj : I
// 588: invokevirtual func_72964_e : (II)Lnet/minecraft/world/chunk/Chunk;
// 591: aload_1
// 592: aload_1
// 593: getfield field_70162_ai : I
// 596: invokevirtual func_76608_a : (Lnet/minecraft/entity/Entity;I)V
// 599: aload_1
// 600: invokevirtual func_184189_br : ()Z
// 603: ifne -> 642
// 606: aload_0
// 607: iload_3
// 608: iload #5
// 610: iconst_1
// 611: istore #12
// 613: istore #11
// 615: istore #10
// 617: astore #9
// 619: aload_0
// 620: aload #9
// 622: iload #10
// 624: iload #11
// 626: iload #12
// 628: invokespecial redirect$zlk000$impl$returnChunkLoadedAlways : (Lnet/minecraft/world/World;IIZ)Z
// 631: ifne -> 642
// 634: aload_1
// 635: iconst_0
// 636: putfield field_70175_ag : Z
// 639: goto -> 666
// 642: aload_0
// 643: iload_3
// 644: iload #5
// 646: istore #11
// 648: istore #10
// 650: astore #9
// 652: aload_0
// 653: aload #9
// 655: iload #10
// 657: iload #11
// 659: invokespecial redirect$zlk000$impl$returnEmptyChunk : (Lnet/minecraft/world/World;II)Lnet/minecraft/world/chunk/Chunk;
// 662: aload_1
// 663: invokevirtual func_76612_a : (Lnet/minecraft/entity/Entity;)V
// 666: aload_0
// 667: getfield field_72984_F : Lnet/minecraft/profiler/Profiler;
// 670: invokevirtual func_76319_b : ()V
// 673: iload_2
// 674: ifeq -> 751
// 677: aload_1
// 678: getfield field_70175_ag : Z
// 681: ifeq -> 751
// 684: aload_1
// 685: invokevirtual func_184188_bt : ()Ljava/util/List;
// 688: invokeinterface iterator : ()Ljava/util/Iterator;
// 693: astore #6
// 695: aload #6
// 697: invokeinterface hasNext : ()Z
// 702: ifeq -> 751
// 705: aload #6
// 707: invokeinterface next : ()Ljava/lang/Object;
// 712: checkcast net/minecraft/entity/Entity
// 715: astore #7
// 717: aload #7
// 719: getfield field_70128_L : Z
// 722: ifne -> 743
// 725: aload #7
// 727: invokevirtual func_184187_bx : ()Lnet/minecraft/entity/Entity;
// 730: aload_1
// 731: if_acmpne -> 743
// 734: aload_0
// 735: aload #7
// 737: invokevirtual func_72870_g : (Lnet/minecraft/entity/Entity;)V
// 740: goto -> 748
// 743: aload #7
// 745: invokevirtual func_184210_p : ()V
// 748: goto -> 695
// 751: return
// Line number table:
// Java source line number -> byte code offset
// #1963 -> 30
// #1965 -> 37
// #1966 -> 45
// #1968 -> 54
// #1969 -> 97
// #1970 -> 110
// #1971 -> 182
// #1973 -> 193
// #1975 -> 198
// #1979 -> 199
// #1980 -> 207
// #1981 -> 215
// #1982 -> 223
// #1983 -> 231
// #1985 -> 239
// #1987 -> 250
// #1989 -> 277
// #1991 -> 284
// #1995 -> 296
// #1996 -> 303
// #2000 -> 312
// #2002 -> 322
// #2004 -> 342
// #2007 -> 350
// #2009 -> 370
// #2012 -> 378
// #2014 -> 398
// #2017 -> 406
// #2019 -> 428
// #2022 -> 436
// #2024 -> 458
// #2027 -> 466
// #2028 -> 478
// #2029 -> 491
// #2031 -> 504
// #2033 -> 537
// #2035 -> 579
// #2038 -> 599
// #2040 -> 634
// #2044 -> 642
// #2048 -> 666
// #2050 -> 673
// #2052 -> 684
// #2054 -> 717
// #2056 -> 734
// #2060 -> 743
// #2062 -> 748
// #2064 -> 751
// Local variable table:
// start length slot name descriptor
// 45 154 3 j2 I
// 54 145 4 k2 I
// 97 102 5 isForced Z
// 110 89 6 range I
// 182 17 7 canUpdate Z
// 717 31 7 entity4 Lnet/minecraft/entity/Entity;
// 30 722 0 this Lnet/minecraft/world/World;
// 30 722 1 entityIn Lnet/minecraft/entity/Entity;
// 30 722 2 forceUpdate Z
// 478 274 3 i3 I
// 491 261 4 j3 I
// 504 248 5 k3 I
// 0 752 8 callbackInfo8 Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;
}
public boolean func_72855_b(AxisAlignedBB bb) {
return func_72917_a(bb, (Entity)null);
}
public boolean func_72917_a(AxisAlignedBB bb, @Nullable Entity entityIn) {
AxisAlignedBB axisAlignedBB = bb;
Entity entity = (Entity)null;
World world = this;
List<Entity> list = redirect$zlk000$impl$filterInvisibile(world, entity, axisAlignedBB);
for (int j2 = 0; j2 < list.size(); j2++) {
Entity entity4 = list.get(j2);
if (!entity4.field_70128_L && entity4.field_70156_m && entity4 != entityIn && (entityIn == null || !entity4.func_184223_x(entityIn)))
return false;
}
return true;
}
public boolean func_72829_c(AxisAlignedBB bb) {
int j2 = MathHelper.func_76128_c(bb.field_72340_a);
int k2 = MathHelper.func_76143_f(bb.field_72336_d);
int l2 = MathHelper.func_76128_c(bb.field_72338_b);
int i3 = MathHelper.func_76143_f(bb.field_72337_e);
int j3 = MathHelper.func_76128_c(bb.field_72339_c);
int k3 = MathHelper.func_76143_f(bb.field_72334_f);
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
for (int l3 = j2; l3 < k2; l3++) {
for (int i4 = l2; i4 < i3; i4++) {
for (int j4 = j3; j4 < k3; j4++) {
IBlockState iblockstate1 = func_180495_p((BlockPos)blockpos$pooledmutableblockpos.func_181079_c(l3, i4, j4));
if (iblockstate1.func_185904_a() != Material.field_151579_a) {
blockpos$pooledmutableblockpos.func_185344_t();
return true;
}
}
}
}
blockpos$pooledmutableblockpos.func_185344_t();
return false;
}
public boolean func_72953_d(AxisAlignedBB bb) {
int j2 = MathHelper.func_76128_c(bb.field_72340_a);
int k2 = MathHelper.func_76143_f(bb.field_72336_d);
int l2 = MathHelper.func_76128_c(bb.field_72338_b);
int i3 = MathHelper.func_76143_f(bb.field_72337_e);
int j3 = MathHelper.func_76128_c(bb.field_72339_c);
int k3 = MathHelper.func_76143_f(bb.field_72334_f);
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
for (int l3 = j2; l3 < k2; l3++) {
for (int i4 = l2; i4 < i3; i4++) {
for (int j4 = j3; j4 < k3; j4++) {
IBlockState iblockstate1 = func_180495_p((BlockPos)blockpos$pooledmutableblockpos.func_181079_c(l3, i4, j4));
Boolean result = iblockstate1.func_177230_c().isAABBInsideLiquid(this, (BlockPos)blockpos$pooledmutableblockpos, bb);
if (result != null) {
if (result.booleanValue()) {
blockpos$pooledmutableblockpos.func_185344_t();
return true;
}
} else if (iblockstate1.func_185904_a().func_76224_d()) {
blockpos$pooledmutableblockpos.func_185344_t();
return true;
}
}
}
}
blockpos$pooledmutableblockpos.func_185344_t();
return false;
}
public boolean func_147470_e(AxisAlignedBB bb) {
int j2 = MathHelper.func_76128_c(bb.field_72340_a);
int k2 = MathHelper.func_76143_f(bb.field_72336_d);
int l2 = MathHelper.func_76128_c(bb.field_72338_b);
int i3 = MathHelper.func_76143_f(bb.field_72337_e);
int j3 = MathHelper.func_76128_c(bb.field_72339_c);
int k3 = MathHelper.func_76143_f(bb.field_72334_f);
if (func_175663_a(j2, l2, j3, k2, i3, k3, true)) {
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
for (int l3 = j2; l3 < k2; l3++) {
for (int i4 = l2; i4 < i3; i4++) {
for (int j4 = j3; j4 < k3; j4++) {
Block block = func_180495_p((BlockPos)blockpos$pooledmutableblockpos.func_181079_c(l3, i4, j4)).func_177230_c();
if (block == Blocks.field_150480_ab || block == Blocks.field_150356_k || block == Blocks.field_150353_l) {
blockpos$pooledmutableblockpos.func_185344_t();
return true;
}
if (block.isBurning(this, new BlockPos(l3, i4, j4))) {
blockpos$pooledmutableblockpos.func_185344_t();
return true;
}
}
}
}
blockpos$pooledmutableblockpos.func_185344_t();
}
return false;
}
public boolean func_72918_a(AxisAlignedBB bb, Material materialIn, Entity entityIn) {
int j2 = MathHelper.func_76128_c(bb.field_72340_a);
int k2 = MathHelper.func_76143_f(bb.field_72336_d);
int l2 = MathHelper.func_76128_c(bb.field_72338_b);
int i3 = MathHelper.func_76143_f(bb.field_72337_e);
int j3 = MathHelper.func_76128_c(bb.field_72339_c);
int k3 = MathHelper.func_76143_f(bb.field_72334_f);
if (!func_175663_a(j2, l2, j3, k2, i3, k3, true))
return false;
boolean flag = false;
Vec3d vec3d = Vec3d.field_186680_a;
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
for (int l3 = j2; l3 < k2; l3++) {
for (int i4 = l2; i4 < i3; i4++) {
for (int j4 = j3; j4 < k3; j4++) {
blockpos$pooledmutableblockpos.func_181079_c(l3, i4, j4);
IBlockState iblockstate1 = func_180495_p((BlockPos)blockpos$pooledmutableblockpos);
Block block = iblockstate1.func_177230_c();
Boolean result = block.isEntityInsideMaterial(this, (BlockPos)blockpos$pooledmutableblockpos, iblockstate1, entityIn, i3, materialIn, false);
if (result != null && result.booleanValue() == true) {
flag = true;
vec3d = block.func_176197_a(this, (BlockPos)blockpos$pooledmutableblockpos, entityIn, vec3d);
} else if (result == null || result.booleanValue()) {
if (iblockstate1.func_185904_a() == materialIn) {
double d0 = ((i4 + 1) - BlockLiquid.func_149801_b(((Integer)iblockstate1.func_177229_b((IProperty)BlockLiquid.field_176367_b)).intValue()));
if (i3 >= d0) {
flag = true;
vec3d = block.func_176197_a(this, (BlockPos)blockpos$pooledmutableblockpos, entityIn, vec3d);
}
}
}
}
}
}
blockpos$pooledmutableblockpos.func_185344_t();
if (vec3d.func_72433_c() > 0.0D && entityIn.func_96092_aw()) {
vec3d = vec3d.func_72432_b();
double d1 = 0.014D;
entityIn.field_70159_w += vec3d.field_72450_a * 0.014D;
entityIn.field_70181_x += vec3d.field_72448_b * 0.014D;
entityIn.field_70179_y += vec3d.field_72449_c * 0.014D;
}
return flag;
}
public boolean func_72875_a(AxisAlignedBB bb, Material materialIn) {
int j2 = MathHelper.func_76128_c(bb.field_72340_a);
int k2 = MathHelper.func_76143_f(bb.field_72336_d);
int l2 = MathHelper.func_76128_c(bb.field_72338_b);
int i3 = MathHelper.func_76143_f(bb.field_72337_e);
int j3 = MathHelper.func_76128_c(bb.field_72339_c);
int k3 = MathHelper.func_76143_f(bb.field_72334_f);
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
for (int l3 = j2; l3 < k2; l3++) {
for (int i4 = l2; i4 < i3; i4++) {
for (int j4 = j3; j4 < k3; j4++) {
IBlockState iblockstate1 = func_180495_p((BlockPos)blockpos$pooledmutableblockpos.func_181079_c(l3, i4, j4));
Boolean result = iblockstate1.func_177230_c().isAABBInsideMaterial(this, (BlockPos)blockpos$pooledmutableblockpos, bb, materialIn);
if (result != null) {
if (result.booleanValue()) {
blockpos$pooledmutableblockpos.func_185344_t();
return true;
}
} else if (iblockstate1.func_185904_a() == materialIn) {
blockpos$pooledmutableblockpos.func_185344_t();
return true;
}
}
}
}
blockpos$pooledmutableblockpos.func_185344_t();
return false;
}
public Explosion func_72876_a(@Nullable Entity entityIn, double x, double y, double z, float strength, boolean isSmoking) {
return func_72885_a(entityIn, x, y, z, strength, false, isSmoking);
}
public Explosion func_72885_a(@Nullable Entity entityIn, double x, double y, double z, float strength, boolean isFlaming, boolean isSmoking) {
Explosion explosion = new Explosion(this, entityIn, x, y, z, strength, isFlaming, isSmoking);
if (ForgeEventFactory.onExplosionStart(this, explosion))
return explosion;
explosion.func_77278_a();
explosion.func_77279_a(true);
return explosion;
}
public float func_72842_a(Vec3d vec, AxisAlignedBB bb) {
double d0 = 1.0D / ((bb.field_72336_d - bb.field_72340_a) * 2.0D + 1.0D);
double d1 = 1.0D / ((bb.field_72337_e - bb.field_72338_b) * 2.0D + 1.0D);
double d2 = 1.0D / ((bb.field_72334_f - bb.field_72339_c) * 2.0D + 1.0D);
double d3 = (1.0D - Math.floor(1.0D / d0) * d0) / 2.0D;
double d4 = (1.0D - Math.floor(1.0D / d2) * d2) / 2.0D;
if (d0 >= 0.0D && d1 >= 0.0D && d2 >= 0.0D) {
int j2 = 0;
int k2 = 0;
float f;
for (f = 0.0F; f <= 1.0F; f = (float)(f + d0)) {
float f1;
for (f1 = 0.0F; f1 <= 1.0F; f1 = (float)(f1 + d1)) {
float f2;
for (f2 = 0.0F; f2 <= 1.0F; f2 = (float)(f2 + d2)) {
double d5 = bb.field_72340_a + (bb.field_72336_d - bb.field_72340_a) * f;
double d6 = bb.field_72338_b + (bb.field_72337_e - bb.field_72338_b) * f1;
double d7 = bb.field_72339_c + (bb.field_72334_f - bb.field_72339_c) * f2;
if (func_72933_a(new Vec3d(d5 + d3, d6, d7 + d4), vec) == null)
j2++;
k2++;
}
}
}
return j2 / k2;
}
return 0.0F;
}
public boolean func_175719_a(@Nullable EntityPlayer player, BlockPos pos, EnumFacing side) {
pos = pos.func_177972_a(side);
if (func_180495_p(pos).func_177230_c() == Blocks.field_150480_ab) {
func_180498_a(player, 1009, pos, 0);
func_175698_g(pos);
return true;
}
return false;
}
@Nullable
public TileEntity func_175625_s(BlockPos pos) {
BlockPos blockPos = pos;
World world = this;
if (redirect$zlk000$impl$useInlinedMethodInsteadisoutsideBuildHeight(world, blockPos))
return null;
TileEntity tileentity2 = null;
callbackInfo6 = new CallbackInfoReturnable("func_175625_s", true);
handler$zlk000$impl$checkForAsync(pos, callbackInfo6);
if (callbackInfo6.isCancelled())
return (TileEntity)callbackInfo6.getReturnValue();
if (this.field_147481_N)
tileentity2 = func_189508_F(pos);
if (tileentity2 == null) {
Chunk.EnumCreateEntityType enumCreateEntityType = Chunk.EnumCreateEntityType.IMMEDIATE;
blockPos = pos;
Chunk chunk = func_175726_f(pos);
tileentity2 = redirect$zlk000$impl$getTileOrNullIfMarkedForRemoval(chunk, blockPos, enumCreateEntityType);
}
if (tileentity2 == null)
tileentity2 = func_189508_F(pos);
return tileentity2;
}
@Nullable
private TileEntity func_189508_F(BlockPos pos) {
for (int j2 = 0; j2 < this.field_147484_a.size(); j2++) {
TileEntity tileentity2 = this.field_147484_a.get(j2);
if (!tileentity2.func_145837_r() && tileentity2.func_174877_v().equals(pos))
return tileentity2;
}
return null;
}
public void func_175690_a(BlockPos pos, @Nullable TileEntity tileEntityIn) {
pos = pos.func_185334_h();
if (!func_189509_E(pos))
if (tileEntityIn != null) {
TileEntity tileEntity = tileEntityIn;
if (!redirect$zlk000$onSetTileEntityForCapture(tileEntity, pos, tileEntityIn))
if (this.field_147481_N) {
tileEntityIn.func_174878_a(pos);
if (tileEntityIn.func_145831_w() != this)
tileEntityIn.func_145834_a(this);
Iterator<TileEntity> iterator1 = this.field_147484_a.iterator();
List<TileEntity> toInvalidate = Lists.newArrayList();
while (iterator1.hasNext()) {
TileEntity tileentity2 = iterator1.next();
if (tileentity2.func_174877_v().equals(pos)) {
toInvalidate.add(tileentity2);
iterator1.remove();
}
}
toInvalidate.forEach(TileEntity::func_145843_s);
this.field_147484_a.add(tileEntityIn);
} else {
Chunk chunk = func_175726_f(pos);
if (chunk != null)
chunk.func_177426_a(pos, tileEntityIn);
func_175700_a(tileEntityIn);
}
}
}
public void func_175713_t(BlockPos pos) {
BlockPos blockPos = pos;
World world = this;
TileEntity tileentity2 = redirect$zlk000$getTileEntityForRemoval(world, blockPos);
callbackInfo8 = new CallbackInfo("func_175713_t", true);
handler$zlk000$onCheckTileEntityForRemoval(pos, callbackInfo8, tileentity2, world, blockPos);
if (callbackInfo8.isCancelled())
return;
if (tileentity2 != null && this.field_147481_N) {
tileentity2.func_145843_s();
this.field_147484_a.remove(tileentity2);
if (!(tileentity2 instanceof ITickable))
this.field_147482_g.remove(tileentity2);
} else {
if (tileentity2 != null) {
this.field_147484_a.remove(tileentity2);
this.field_147482_g.remove(tileentity2);
this.field_175730_i.remove(tileentity2);
}
func_175726_f(pos).func_177425_e(pos);
}
Block block = func_180495_p(pos).func_177230_c();
blockPos = pos;
world = this;
redirect$bam000$forgeImpl$UseComparatorOutputLevel(world, blockPos, block, pos);
}
public void func_147457_a(TileEntity tileEntityIn) {
this.field_147483_b.add(tileEntityIn);
}
public boolean func_175665_u(BlockPos pos) {
AxisAlignedBB axisalignedbb = func_180495_p(pos).func_185890_d(this, pos);
return (axisalignedbb != Block.field_185506_k && axisalignedbb.func_72320_b() >= 1.0D);
}
public boolean func_175677_d(BlockPos pos, boolean _default) {
if (func_189509_E(pos))
return false;
Chunk chunk1 = this.field_73020_y.func_186026_b(pos.func_177958_n() >> 4, pos.func_177952_p() >> 4);
if (chunk1 != null && !chunk1.func_76621_g()) {
IBlockState iblockstate1 = func_180495_p(pos);
return iblockstate1.func_177230_c().isNormalCube(iblockstate1, this, pos);
}
return _default;
}
public void func_72966_v() {
int j2 = func_72967_a(1.0F);
if (j2 != this.field_73008_k)
this.field_73008_k = j2;
}
public void func_72891_a(boolean hostile, boolean peaceful) {
this.field_72985_G = hostile;
this.field_72992_H = peaceful;
this.field_73011_w.setAllowedSpawnTypes(hostile, peaceful);
}
public void func_72835_b() {
func_72979_l();
}
protected void func_72947_a() {
this.field_73011_w.calculateInitialWeather();
}
public void calculateInitialWeatherBody() {
if (this.field_72986_A.func_76059_o()) {
this.field_73004_o = 1.0F;
if (this.field_72986_A.func_76061_m())
this.field_73017_q = 1.0F;
}
}
protected void func_72979_l() {
this.field_73011_w.updateWeather();
}
public void updateWeatherBody() {
if (this.field_73011_w.func_191066_m())
if (!this.field_72995_K) {
boolean flag = func_82736_K().func_82766_b("doWeatherCycle");
if (flag) {
int j2 = this.field_72986_A.func_176133_A();
if (j2 > 0) {
j2--;
this.field_72986_A.func_176142_i(j2);
boolean bool = this.field_72986_A.func_76061_m() ? true : true;
this.field_72986_A.func_76090_f(modify$bam000$vanillaImpl$updateThunderTimeStart(bool));
bool = this.field_72986_A.func_76059_o() ? true : true;
this.field_72986_A.func_76080_g(modify$bam000$vanillaImpl$updateRainTimeStart(bool));
}
int k2 = this.field_72986_A.func_76071_n();
if (k2 <= 0) {
if (this.field_72986_A.func_76061_m()) {
int i = this.field_73012_v.nextInt(12000) + 3600;
this.field_72986_A.func_76090_f(modify$bam000$vanillaImpl$updateThunderTimeStart(i));
} else {
int i = this.field_73012_v.nextInt(168000) + 12000;
this.field_72986_A.func_76090_f(modify$bam000$vanillaImpl$updateThunderTimeStart(i));
}
} else {
int i = --k2;
this.field_72986_A.func_76090_f(modify$bam000$vanillaImpl$updateThunderTimeStart(i));
if (k2 <= 0)
this.field_72986_A.func_76069_a(!this.field_72986_A.func_76061_m());
}
int l2 = this.field_72986_A.func_76083_p();
if (l2 <= 0) {
if (this.field_72986_A.func_76059_o()) {
int i = this.field_73012_v.nextInt(12000) + 12000;
this.field_72986_A.func_76080_g(modify$bam000$vanillaImpl$updateRainTimeStart(i));
} else {
int i = this.field_73012_v.nextInt(168000) + 12000;
this.field_72986_A.func_76080_g(modify$bam000$vanillaImpl$updateRainTimeStart(i));
}
} else {
int i = --l2;
this.field_72986_A.func_76080_g(modify$bam000$vanillaImpl$updateRainTimeStart(i));
if (l2 <= 0)
this.field_72986_A.func_76084_b(!this.field_72986_A.func_76059_o());
}
}
this.field_73018_p = this.field_73017_q;
if (this.field_72986_A.func_76061_m()) {
this.field_73017_q = (float)(this.field_73017_q + 0.01D);
} else {
this.field_73017_q = (float)(this.field_73017_q - 0.01D);
}
this.field_73017_q = MathHelper.func_76131_a(this.field_73017_q, 0.0F, 1.0F);
this.field_73003_n = this.field_73004_o;
if (this.field_72986_A.func_76059_o()) {
this.field_73004_o = (float)(this.field_73004_o + 0.01D);
} else {
this.field_73004_o = (float)(this.field_73004_o - 0.01D);
}
this.field_73004_o = MathHelper.func_76131_a(this.field_73004_o, 0.0F, 1.0F);
}
}
protected void func_147456_g() {}
public void func_189507_a(BlockPos pos, IBlockState state, Random random) {
this.field_72999_e = true;
state.func_177230_c().func_180650_b(this, pos, state, random);
this.field_72999_e = false;
}
public boolean func_175675_v(BlockPos pos) {
return func_175670_e(pos, false);
}
public boolean func_175662_w(BlockPos pos) {
return func_175670_e(pos, true);
}
public boolean func_175670_e(BlockPos pos, boolean noWaterAdj) {
return this.field_73011_w.canBlockFreeze(pos, noWaterAdj);
}
public boolean canBlockFreezeBody(BlockPos pos, boolean noWaterAdj) {
Biome biome = func_180494_b(pos);
float f = biome.func_180626_a(pos);
if (f >= 0.15F)
return false;
if (pos.func_177956_o() >= 0 && pos.func_177956_o() < 256 && func_175642_b(EnumSkyBlock.BLOCK, pos) < 10) {
IBlockState iblockstate1 = func_180495_p(pos);
Block block = iblockstate1.func_177230_c();
if ((block == Blocks.field_150355_j || block == Blocks.field_150358_i) && ((Integer)iblockstate1.func_177229_b((IProperty)BlockLiquid.field_176367_b)).intValue() == 0) {
if (!noWaterAdj)
return true;
boolean flag = (func_175696_F(pos.func_177976_e()) && func_175696_F(pos.func_177974_f()) && func_175696_F(pos.func_177978_c()) && func_175696_F(pos.func_177968_d()));
if (!flag)
return true;
}
}
return false;
}
private boolean func_175696_F(BlockPos pos) {
return (func_180495_p(pos).func_185904_a() == Material.field_151586_h);
}
public boolean func_175708_f(BlockPos pos, boolean checkLight) {
return this.field_73011_w.canSnowAt(pos, checkLight);
}
public boolean canSnowAtBody(BlockPos pos, boolean checkLight) {
Biome biome = func_180494_b(pos);
float f = biome.func_180626_a(pos);
if (f >= 0.15F)
return false;
if (!checkLight)
return true;
if (pos.func_177956_o() >= 0 && pos.func_177956_o() < 256 && func_175642_b(EnumSkyBlock.BLOCK, pos) < 10) {
IBlockState iblockstate1 = func_180495_p(pos);
if (iblockstate1.func_177230_c().isAir(iblockstate1, this, pos) && Blocks.field_150431_aC.func_176196_c(this, pos))
return true;
}
return false;
}
public boolean func_175664_x(BlockPos pos) {
boolean flag = false;
if (this.field_73011_w.func_191066_m())
flag |= func_180500_c(EnumSkyBlock.SKY, pos);
flag |= func_180500_c(EnumSkyBlock.BLOCK, pos);
return flag;
}
public boolean func_180500_c(EnumSkyBlock lightType, BlockPos pos) {
callbackInfo38 = new CallbackInfoReturnable("func_180500_c", true);
handler$bcl000$checkLightFor((EnumSkyBlock)SYNTHETIC_LOCAL_VARIABLE_1, (BlockPos)SYNTHETIC_LOCAL_VARIABLE_2, callbackInfo38);
if (callbackInfo38.isCancelled())
return callbackInfo38.getReturnValueZ();
boolean bool = false;
byte b = 16;
Object object = SYNTHETIC_LOCAL_VARIABLE_2;
World world = this;
if (!redirect$zlk000$spongeIsAreaLoadedForCheckingLight(world, (BlockPos)object, b, bool, (EnumSkyBlock)SYNTHETIC_LOCAL_VARIABLE_1, (BlockPos)SYNTHETIC_LOCAL_VARIABLE_2))
return false;
bool = false;
b = 18;
object = SYNTHETIC_LOCAL_VARIABLE_2;
world = this;
int updateRange = redirect$zlk000$spongeIsAreaLoadedForCheckingLight(world, (BlockPos)object, b, bool, (EnumSkyBlock)SYNTHETIC_LOCAL_VARIABLE_1, (BlockPos)SYNTHETIC_LOCAL_VARIABLE_2) ? 17 : 15;
int j2 = 0;
int k2 = 0;
this.field_72984_F.func_76320_a("getBrightness");
int l2 = func_175642_b((EnumSkyBlock)SYNTHETIC_LOCAL_VARIABLE_1, (BlockPos)SYNTHETIC_LOCAL_VARIABLE_2);
int i3 = func_175638_a((BlockPos)SYNTHETIC_LOCAL_VARIABLE_2, (EnumSkyBlock)SYNTHETIC_LOCAL_VARIABLE_1);
int j3 = SYNTHETIC_LOCAL_VARIABLE_2.func_177958_n();
int k3 = SYNTHETIC_LOCAL_VARIABLE_2.func_177956_o();
int l3 = SYNTHETIC_LOCAL_VARIABLE_2.func_177952_p();
if (i3 > l2) {
this.field_72994_J[k2++] = 133152;
} else if (i3 < l2) {
this.field_72994_J[k2++] = 0x20820 | l2 << 18;
while (j2 < k2) {
int i4 = this.field_72994_J[j2++];
int j4 = (i4 & 0x3F) - 32 + j3;
int k4 = (i4 >> 6 & 0x3F) - 32 + k3;
int l4 = (i4 >> 12 & 0x3F) - 32 + l3;
int i5 = i4 >> 18 & 0xF;
BlockPos blockpos1 = new BlockPos(j4, k4, l4);
int j5 = func_175642_b((EnumSkyBlock)SYNTHETIC_LOCAL_VARIABLE_1, blockpos1);
if (j5 == i5) {
func_175653_a((EnumSkyBlock)SYNTHETIC_LOCAL_VARIABLE_1, blockpos1, 0);
if (i5 > 0) {
int k5 = MathHelper.func_76130_a(j4 - j3);
int l5 = MathHelper.func_76130_a(k4 - k3);
int i6 = MathHelper.func_76130_a(l4 - l3);
if (k5 + l5 + i6 < updateRange) {
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
for (EnumFacing enumfacing : EnumFacing.values()) {
int j6 = j4 + enumfacing.func_82601_c();
int k6 = k4 + enumfacing.func_96559_d();
int l6 = l4 + enumfacing.func_82599_e();
blockpos$pooledmutableblockpos.func_181079_c(j6, k6, l6);
IBlockState bs = func_180495_p((BlockPos)blockpos$pooledmutableblockpos);
int i7 = Math.max(1, bs.func_177230_c().getLightOpacity(bs, this, (BlockPos)blockpos$pooledmutableblockpos));
j5 = func_175642_b((EnumSkyBlock)SYNTHETIC_LOCAL_VARIABLE_1, (BlockPos)blockpos$pooledmutableblockpos);
if (j5 == i5 - i7 && k2 < this.field_72994_J.length)
this.field_72994_J[k2++] = j6 - j3 + 32 | k6 - k3 + 32 << 6 | l6 - l3 + 32 << 12 | i5 - i7 << 18;
}
blockpos$pooledmutableblockpos.func_185344_t();
}
}
}
}
j2 = 0;
}
this.field_72984_F.func_76319_b();
this.field_72984_F.func_76320_a("checkedPosition < toCheckCount");
while (j2 < k2) {
int j7 = this.field_72994_J[j2++];
int k7 = (j7 & 0x3F) - 32 + j3;
int l7 = (j7 >> 6 & 0x3F) - 32 + k3;
int i8 = (j7 >> 12 & 0x3F) - 32 + l3;
BlockPos blockpos2 = new BlockPos(k7, l7, i8);
int j8 = func_175642_b((EnumSkyBlock)SYNTHETIC_LOCAL_VARIABLE_1, blockpos2);
int k8 = func_175638_a(blockpos2, (EnumSkyBlock)SYNTHETIC_LOCAL_VARIABLE_1);
if (k8 != j8) {
func_175653_a((EnumSkyBlock)SYNTHETIC_LOCAL_VARIABLE_1, blockpos2, k8);
if (k8 > j8) {
int l8 = Math.abs(k7 - j3);
int i9 = Math.abs(l7 - k3);
int j9 = Math.abs(i8 - l3);
boolean flag = (k2 < this.field_72994_J.length - 6);
if (l8 + i9 + j9 < updateRange && flag) {
if (func_175642_b((EnumSkyBlock)SYNTHETIC_LOCAL_VARIABLE_1, blockpos2.func_177976_e()) < k8)
this.field_72994_J[k2++] = k7 - 1 - j3 + 32 + (l7 - k3 + 32 << 6) + (i8 - l3 + 32 << 12);
if (func_175642_b((EnumSkyBlock)SYNTHETIC_LOCAL_VARIABLE_1, blockpos2.func_177974_f()) < k8)
this.field_72994_J[k2++] = k7 + 1 - j3 + 32 + (l7 - k3 + 32 << 6) + (i8 - l3 + 32 << 12);
if (func_175642_b((EnumSkyBlock)SYNTHETIC_LOCAL_VARIABLE_1, blockpos2.func_177977_b()) < k8)
this.field_72994_J[k2++] = k7 - j3 + 32 + (l7 - 1 - k3 + 32 << 6) + (i8 - l3 + 32 << 12);
if (func_175642_b((EnumSkyBlock)SYNTHETIC_LOCAL_VARIABLE_1, blockpos2.func_177984_a()) < k8)
this.field_72994_J[k2++] = k7 - j3 + 32 + (l7 + 1 - k3 + 32 << 6) + (i8 - l3 + 32 << 12);
if (func_175642_b((EnumSkyBlock)SYNTHETIC_LOCAL_VARIABLE_1, blockpos2.func_177978_c()) < k8)
this.field_72994_J[k2++] = k7 - j3 + 32 + (l7 - k3 + 32 << 6) + (i8 - 1 - l3 + 32 << 12);
if (func_175642_b((EnumSkyBlock)SYNTHETIC_LOCAL_VARIABLE_1, blockpos2.func_177968_d()) < k8)
this.field_72994_J[k2++] = k7 - j3 + 32 + (l7 - k3 + 32 << 6) + (i8 + 1 - l3 + 32 << 12);
}
}
}
}
this.field_72984_F.func_76319_b();
return true;
}
public boolean func_72955_a(boolean runAllPending) {
return false;
}
@Nullable
public List<NextTickListEntry> func_72920_a(Chunk chunkIn, boolean remove) {
return null;
}
@Nullable
public List<NextTickListEntry> func_175712_a(StructureBoundingBox structureBB, boolean remove) {
return null;
}
public List<Entity> func_72839_b(@Nullable Entity entityIn, AxisAlignedBB bb) {
return func_175674_a(entityIn, bb, EntitySelectors.field_180132_d);
}
public List<Entity> func_175674_a(@Nullable Entity entityIn, AxisAlignedBB boundingBox, @Nullable Predicate<? super Entity> predicate) {
List<Entity> list = Lists.newArrayList();
int j2 = MathHelper.func_76128_c((boundingBox.field_72340_a - MAX_ENTITY_RADIUS) / 16.0D);
int k2 = MathHelper.func_76128_c((boundingBox.field_72336_d + MAX_ENTITY_RADIUS) / 16.0D);
int l2 = MathHelper.func_76128_c((boundingBox.field_72339_c - MAX_ENTITY_RADIUS) / 16.0D);
int i3 = MathHelper.func_76128_c((boundingBox.field_72334_f + MAX_ENTITY_RADIUS) / 16.0D);
for (int j3 = j2; j3 <= k2; j3++) {
for (int k3 = l2; k3 <= i3; k3++) {
if (func_175680_a(j3, k3, true))
func_72964_e(j3, k3).func_177414_a(entityIn, boundingBox, list, predicate);
}
}
return list;
}
public <T extends Entity> List<T> func_175644_a(Class<? extends T> entityType, Predicate<? super T> filter) {
List<T> list = Lists.newArrayList();
for (Entity entity4 : this.field_72996_f) {
if (entityType.isAssignableFrom(entity4.getClass()) && filter.apply(entity4))
list.add((T)entity4);
}
return list;
}
public <T extends Entity> List<T> func_175661_b(Class<? extends T> playerType, Predicate<? super T> filter) {
List<T> list = Lists.newArrayList();
for (Entity entity4 : this.field_73010_i) {
if (playerType.isAssignableFrom(entity4.getClass()) && filter.apply(entity4))
list.add((T)entity4);
}
return list;
}
public <T extends Entity> List<T> func_72872_a(Class<? extends T> classEntity, AxisAlignedBB bb) {
return func_175647_a(classEntity, bb, EntitySelectors.field_180132_d);
}
public <T extends Entity> List<T> func_175647_a(Class<? extends T> clazz, AxisAlignedBB aabb, @Nullable Predicate<? super T> filter) {
int j2 = MathHelper.func_76128_c((aabb.field_72340_a - MAX_ENTITY_RADIUS) / 16.0D);
int k2 = MathHelper.func_76143_f((aabb.field_72336_d + MAX_ENTITY_RADIUS) / 16.0D);
int l2 = MathHelper.func_76128_c((aabb.field_72339_c - MAX_ENTITY_RADIUS) / 16.0D);
int i3 = MathHelper.func_76143_f((aabb.field_72334_f + MAX_ENTITY_RADIUS) / 16.0D);
List<T> list = Lists.newArrayList();
for (int j3 = j2; j3 < k2; j3++) {
for (int k3 = l2; k3 < i3; k3++) {
if (func_175680_a(j3, k3, true))
func_72964_e(j3, k3).func_177430_a(clazz, aabb, list, filter);
}
}
return list;
}
@Nullable
public <T extends Entity> T func_72857_a(Class<? extends T> entityType, AxisAlignedBB aabb, T closestTo) {
Entity entity;
List<T> list = func_72872_a(entityType, aabb);
T t = null;
double d0 = Double.MAX_VALUE;
for (int j2 = 0; j2 < list.size(); j2++) {
Entity entity1 = (Entity)list.get(j2);
if (entity1 != closestTo && EntitySelectors.field_180132_d.apply(entity1)) {
double d1 = closestTo.func_70068_e(entity1);
if (d1 <= d0) {
entity = entity1;
d0 = d1;
}
}
}
return (T)entity;
}
@Nullable
public Entity func_73045_a(int id) {
return (Entity)this.field_175729_l.func_76041_a(id);
}
public void func_175646_b(BlockPos pos, TileEntity unusedTileEntity) {
if (func_175667_e(pos))
func_175726_f(pos).func_76630_e();
}
public int func_72907_a(Class<?> entityType) {
int j2 = 0;
for (Entity entity4 : this.field_72996_f) {
if ((!(entity4 instanceof EntityLiving) || !((EntityLiving)entity4).func_104002_bU()) && entityType.isAssignableFrom(entity4.getClass()))
j2++;
}
return j2;
}
public void func_175650_b(Collection<Entity> entityCollection) {
for (Entity entity4 : entityCollection) {
if (!MinecraftForge.EVENT_BUS.post((Event)new EntityJoinWorldEvent(entity4, this))) {
this.field_72996_f.add(entity4);
func_72923_a(entity4);
}
}
}
public void func_175681_c(Collection<Entity> entityCollection) {
this.field_72997_g.addAll(entityCollection);
}
public boolean func_190527_a(Block blockIn, BlockPos pos, boolean skipCollisionCheck, EnumFacing sidePlacedOn, @Nullable Entity placer) {
IBlockState iblockstate1 = func_180495_p(pos);
AxisAlignedBB axisalignedbb = skipCollisionCheck ? null : blockIn.func_176223_P().func_185890_d(this, pos);
if (!(placer instanceof EntityPlayer) && ForgeEventFactory.onBlockPlace(placer, new BlockSnapshot(this, pos, blockIn.func_176223_P()), sidePlacedOn).isCanceled())
return false;
if (axisalignedbb != Block.field_185506_k && !func_72855_b(axisalignedbb.func_186670_a(pos)))
return false;
if (iblockstate1.func_185904_a() == Material.field_151594_q && blockIn == Blocks.field_150467_bQ)
return true;
return (iblockstate1.func_177230_c().func_176200_f(this, pos) && blockIn.func_176198_a(this, pos, sidePlacedOn));
}
public int func_181545_F() {
return this.field_181546_a;
}
public void func_181544_b(int seaLevelIn) {
this.field_181546_a = seaLevelIn;
}
public int func_175627_a(BlockPos pos, EnumFacing direction) {
return func_180495_p(pos).func_185893_b(this, pos, direction);
}
public WorldType func_175624_G() {
return this.field_72986_A.func_76067_t();
}
public int func_175676_y(BlockPos pos) {
int j2 = 0;
j2 = Math.max(j2, func_175627_a(pos.func_177977_b(), EnumFacing.DOWN));
if (j2 >= 15)
return j2;
j2 = Math.max(j2, func_175627_a(pos.func_177984_a(), EnumFacing.UP));
if (j2 >= 15)
return j2;
j2 = Math.max(j2, func_175627_a(pos.func_177978_c(), EnumFacing.NORTH));
if (j2 >= 15)
return j2;
j2 = Math.max(j2, func_175627_a(pos.func_177968_d(), EnumFacing.SOUTH));
if (j2 >= 15)
return j2;
j2 = Math.max(j2, func_175627_a(pos.func_177976_e(), EnumFacing.WEST));
if (j2 >= 15)
return j2;
j2 = Math.max(j2, func_175627_a(pos.func_177974_f(), EnumFacing.EAST));
return (j2 >= 15) ? j2 : j2;
}
public boolean func_175709_b(BlockPos pos, EnumFacing side) {
return (func_175651_c(pos, side) > 0);
}
public int func_175651_c(BlockPos pos, EnumFacing facing) {
IBlockState iblockstate1 = func_180495_p(pos);
return iblockstate1.func_177230_c().shouldCheckWeakPower(iblockstate1, this, pos, facing) ? func_175676_y(pos) : iblockstate1.func_185911_a(this, pos, facing);
}
public boolean func_175640_z(BlockPos pos) {
if (func_175651_c(pos.func_177977_b(), EnumFacing.DOWN) > 0)
return true;
if (func_175651_c(pos.func_177984_a(), EnumFacing.UP) > 0)
return true;
if (func_175651_c(pos.func_177978_c(), EnumFacing.NORTH) > 0)
return true;
if (func_175651_c(pos.func_177968_d(), EnumFacing.SOUTH) > 0)
return true;
if (func_175651_c(pos.func_177976_e(), EnumFacing.WEST) > 0)
return true;
return (func_175651_c(pos.func_177974_f(), EnumFacing.EAST) > 0);
}
public int func_175687_A(BlockPos pos) {
int j2 = 0;
for (EnumFacing enumfacing : EnumFacing.values()) {
int k2 = func_175651_c(pos.func_177972_a(enumfacing), enumfacing);
if (k2 >= 15)
return 15;
if (k2 > j2)
j2 = k2;
}
return j2;
}
@Nullable
public EntityPlayer func_72890_a(Entity entityIn, double distance) {
return func_184137_a(entityIn.field_70165_t, entityIn.field_70163_u, entityIn.field_70161_v, distance, false);
}
@Nullable
public EntityPlayer func_184136_b(Entity entityIn, double distance) {
return func_184137_a(entityIn.field_70165_t, entityIn.field_70163_u, entityIn.field_70161_v, distance, true);
}
@Nullable
public EntityPlayer func_184137_a(double posX, double posY, double posZ, double distance, boolean spectator) {
Predicate<Entity> predicate = spectator ? EntitySelectors.field_188444_d : EntitySelectors.field_180132_d;
return func_190525_a(posX, posY, posZ, distance, predicate);
}
@Nullable
public EntityPlayer func_190525_a(double x, double y, double z, double p_190525_7_, Predicate<Entity> p_190525_9_) {
double d0 = -1.0D;
EntityPlayer entityplayer = null;
for (int j2 = 0; j2 < this.field_73010_i.size(); j2++) {
EntityPlayer entityplayer1 = this.field_73010_i.get(j2);
EntityPlayer entityPlayer1 = entityplayer1;
Predicate<Entity> predicate = p_190525_9_;
if (redirect$zlk000$impl$checkIfPlayerIsVanished(predicate, entityPlayer1)) {
double d1 = entityplayer1.func_70092_e(x, y, z);
if ((p_190525_7_ < 0.0D || d1 < p_190525_7_ * p_190525_7_) && (d0 == -1.0D || d1 < d0)) {
d0 = d1;
entityplayer = entityplayer1;
}
}
}
return entityplayer;
}
public boolean func_175636_b(double x, double y, double z, double range) {
for (int j2 = 0; j2 < this.field_73010_i.size(); j2++) {
EntityPlayer entityplayer = this.field_73010_i.get(j2);
EntityPlayer entityPlayer1 = entityplayer;
Predicate predicate = EntitySelectors.field_180132_d;
if (redirect$zlk000$onIsAnyPlayerWithinRangePredicate(predicate, entityPlayer1)) {
double d0 = entityplayer.func_70092_e(x, y, z);
if (range < 0.0D || d0 < range * range)
return true;
}
}
return false;
}
@Nullable
public EntityPlayer func_184142_a(Entity entityIn, double maxXZDistance, double maxYDistance) {
return func_184150_a(entityIn.field_70165_t, entityIn.field_70163_u, entityIn.field_70161_v, maxXZDistance, maxYDistance, (Function<EntityPlayer, Double>)null, (Predicate<EntityPlayer>)null);
}
@Nullable
public EntityPlayer func_184139_a(BlockPos pos, double maxXZDistance, double maxYDistance) {
return func_184150_a((pos.func_177958_n() + 0.5F), (pos.func_177956_o() + 0.5F), (pos.func_177952_p() + 0.5F), maxXZDistance, maxYDistance, (Function<EntityPlayer, Double>)null, (Predicate<EntityPlayer>)null);
}
@Nullable
public EntityPlayer func_184150_a(double posX, double posY, double posZ, double maxXZDistance, double maxYDistance, @Nullable Function<EntityPlayer, Double> playerToDouble, @Nullable Predicate<EntityPlayer> p_184150_12_) {
double d0 = -1.0D;
EntityPlayer entityplayer = null;
for (int j2 = 0; j2 < this.field_73010_i.size(); j2++) {
EntityPlayer entityplayer1 = this.field_73010_i.get(j2);
if (!entityplayer1.field_71075_bZ.field_75102_a && entityplayer1.func_70089_S() && !entityplayer1.func_175149_v() && (p_184150_12_ == null || p_184150_12_.apply(entityplayer1))) {
double d1 = entityplayer1.func_70092_e(posX, entityplayer1.field_70163_u, posZ);
double d2 = maxXZDistance;
if (entityplayer1.func_70093_af())
d2 = maxXZDistance * 0.800000011920929D;
if (entityplayer1.func_82150_aj()) {
float f = entityplayer1.func_82243_bO();
if (f < 0.1F)
f = 0.1F;
d2 *= (0.7F * f);
}
if (playerToDouble != null)
d2 *= ((Double)MoreObjects.firstNonNull(playerToDouble.apply(entityplayer1), Double.valueOf(1.0D))).doubleValue();
d2 = ForgeHooks.getPlayerVisibilityDistance(entityplayer1, d2, maxYDistance);
if ((maxYDistance < 0.0D || Math.abs(entityplayer1.field_70163_u - posY) < maxYDistance * maxYDistance) && (maxXZDistance < 0.0D || d1 < d2 * d2) && (d0 == -1.0D || d1 < d0)) {
d0 = d1;
entityplayer = entityplayer1;
}
}
}
return entityplayer;
}
@Nullable
public EntityPlayer func_72924_a(String name) {
for (int j2 = 0; j2 < this.field_73010_i.size(); j2++) {
EntityPlayer entityplayer = this.field_73010_i.get(j2);
if (name.equals(entityplayer.func_70005_c_()))
return entityplayer;
}
return null;
}
@Nullable
public EntityPlayer func_152378_a(UUID uuid) {
callbackInfo4 = new CallbackInfoReturnable("func_152378_a", true);
handler$zlk000$onGetPlayerEntityByUUID((UUID)SYNTHETIC_LOCAL_VARIABLE_1, callbackInfo4);
if (callbackInfo4.isCancelled())
return (EntityPlayer)callbackInfo4.getReturnValue();
for (int j2 = 0; j2 < this.field_73010_i.size(); j2++) {
EntityPlayer entityplayer = this.field_73010_i.get(j2);
if (SYNTHETIC_LOCAL_VARIABLE_1.equals(entityplayer.func_110124_au()))
return entityplayer;
}
return null;
}
public void func_72906_B() throws MinecraftException {
this.field_73019_z.func_75762_c();
}
public long func_72905_C() {
return this.field_73011_w.getSeed();
}
public long func_82737_E() {
return this.field_72986_A.func_82573_f();
}
public long func_72820_D() {
return this.field_73011_w.getWorldTime();
}
public void func_72877_b(long time) {
this.field_73011_w.setWorldTime(time);
}
public BlockPos func_175694_M() {
BlockPos blockpos1 = this.field_73011_w.getSpawnPoint();
if (!func_175723_af().func_177746_a(blockpos1))
blockpos1 = func_175645_m(new BlockPos(func_175723_af().func_177731_f(), 0.0D, func_175723_af().func_177721_g()));
return blockpos1;
}
public void func_175652_B(BlockPos pos) {
this.field_73011_w.setSpawnPoint(pos);
}
public boolean func_175660_a(EntityPlayer player, BlockPos pos) {
return this.field_73011_w.canMineBlock(player, pos);
}
public boolean canMineBlockBody(EntityPlayer player, BlockPos pos) {
return true;
}
public void func_72960_a(Entity entityIn, byte state) {}
public IChunkProvider func_72863_F() {
return this.field_73020_y;
}
public void func_175641_c(BlockPos pos, Block blockIn, int eventID, int eventParam) {
func_180495_p(pos).func_189547_a(this, pos, eventID, eventParam);
}
public ISaveHandler func_72860_G() {
return this.field_73019_z;
}
public WorldInfo func_72912_H() {
callbackInfo1 = new CallbackInfoReturnable("func_72912_H", true);
handler$bam000$forgeImpl$getRedirectedWorldInfoIfAvailable(callbackInfo1);
return callbackInfo1.isCancelled() ? (WorldInfo)callbackInfo1.getReturnValue() : this.field_72986_A;
}
public GameRules func_82736_K() {
return this.field_72986_A.func_82574_x();
}
public void func_72854_c() {}
public float func_72819_i(float delta) {
return (this.field_73018_p + (this.field_73017_q - this.field_73018_p) * delta) * func_72867_j(delta);
}
public float func_72867_j(float delta) {
return TransformerHooks.getRainStrength(this, delta);
}
public boolean func_72911_I() {
return (func_72819_i(1.0F) > 0.9D);
}
public boolean func_72896_J() {
return (func_72867_j(1.0F) > 0.2D);
}
public boolean func_175727_C(BlockPos position) {
if (!func_72896_J())
return false;
if (!func_175678_i(position))
return false;
if (func_175725_q(position).func_177956_o() > position.func_177956_o())
return false;
Biome biome = func_180494_b(position);
if (biome.func_76746_c())
return false;
return func_175708_f(position, false) ? false : biome.func_76738_d();
}
public boolean func_180502_D(BlockPos pos) {
return this.field_73011_w.isBlockHighHumidity(pos);
}
@Nullable
public MapStorage func_175693_T() {
callbackInfo1 = new CallbackInfoReturnable("func_175693_T", true);
handler$bam000$forgeImpl$getOverworldMapStorageInsteadOfMultiDimension(callbackInfo1);
return callbackInfo1.isCancelled() ? (MapStorage)callbackInfo1.getReturnValue() : this.field_72988_C;
}
public void func_72823_a(String dataID, WorldSavedData worldSavedDataIn) {
this.field_72988_C.func_75745_a(dataID, worldSavedDataIn);
}
@Nullable
public WorldSavedData func_72943_a(Class<? extends WorldSavedData> clazz, String dataID) {
return this.field_72988_C.func_75742_a(clazz, dataID);
}
public int func_72841_b(String key) {
return this.field_72988_C.func_75743_a(key);
}
public void func_175669_a(int id, BlockPos pos, int data) {
callbackInfo5 = new CallbackInfo("func_175669_a", true);
handler$zlk000$impl$throwBroadcastSoundEvent(SYNTHETIC_LOCAL_VARIABLE_1, (BlockPos)SYNTHETIC_LOCAL_VARIABLE_2, SYNTHETIC_LOCAL_VARIABLE_3, callbackInfo5);
if (callbackInfo5.isCancelled())
return;
for (int j2 = 0; j2 < this.field_73021_x.size(); j2++)
((IWorldEventListener)this.field_73021_x.get(j2)).func_180440_a(SYNTHETIC_LOCAL_VARIABLE_1, (BlockPos)SYNTHETIC_LOCAL_VARIABLE_2, SYNTHETIC_LOCAL_VARIABLE_3);
}
public void func_175718_b(int type, BlockPos pos, int data) {
func_180498_a((EntityPlayer)null, type, pos, data);
}
public void func_180498_a(@Nullable EntityPlayer player, int type, BlockPos pos, int data) {
callbackInfo8 = new CallbackInfo("func_180498_a", true);
handler$zlk000$impl$throwRecordPlayEvent((EntityPlayer)SYNTHETIC_LOCAL_VARIABLE_1, SYNTHETIC_LOCAL_VARIABLE_2, (BlockPos)SYNTHETIC_LOCAL_VARIABLE_3, SYNTHETIC_LOCAL_VARIABLE_4, callbackInfo8);
if (callbackInfo8.isCancelled())
return;
try {
for (int j2 = 0; j2 < this.field_73021_x.size(); j2++)
((IWorldEventListener)this.field_73021_x.get(j2)).func_180439_a((EntityPlayer)SYNTHETIC_LOCAL_VARIABLE_1, SYNTHETIC_LOCAL_VARIABLE_2, (BlockPos)SYNTHETIC_LOCAL_VARIABLE_3, SYNTHETIC_LOCAL_VARIABLE_4);
} catch (Throwable throwable3) {
CrashReport crashreport3 = CrashReport.func_85055_a(throwable3, "Playing level event");
CrashReportCategory crashreportcategory3 = crashreport3.func_85058_a("Level event being played");
crashreportcategory3.func_71507_a("Block coordinates", CrashReportCategory.func_180522_a((BlockPos)SYNTHETIC_LOCAL_VARIABLE_3));
crashreportcategory3.func_71507_a("Event source", SYNTHETIC_LOCAL_VARIABLE_1);
crashreportcategory3.func_71507_a("Event type", Integer.valueOf(SYNTHETIC_LOCAL_VARIABLE_2));
crashreportcategory3.func_71507_a("Event data", Integer.valueOf(SYNTHETIC_LOCAL_VARIABLE_4));
throw new ReportedException(crashreport3);
}
}
public int func_72800_K() {
return this.field_73011_w.getHeight();
}
public int func_72940_L() {
return this.field_73011_w.getActualHeight();
}
public Random func_72843_D(int p_72843_1_, int p_72843_2_, int p_72843_3_) {
long j2 = p_72843_1_ * 341873128712L + p_72843_2_ * 132897987541L + func_72912_H().func_76063_b() + p_72843_3_;
this.field_73012_v.setSeed(j2);
return this.field_73012_v;
}
public CrashReportCategory func_72914_a(CrashReport report) {
CrashReportCategory crashreportcategory3 = report.func_85057_a("Affected level", 1);
crashreportcategory3.func_71507_a("Level name", (this.field_72986_A == null) ? "????" : this.field_72986_A.func_76065_j());
crashreportcategory3.func_189529_a("All players", (ICrashReportDetail)new Object(this));
crashreportcategory3.func_189529_a("Chunk stats", (ICrashReportDetail)new Object(this));
try {
this.field_72986_A.func_85118_a(crashreportcategory3);
} catch (Throwable throwable3) {
crashreportcategory3.func_71499_a("Level Data Unobtainable", throwable3);
}
return crashreportcategory3;
}
public void func_175715_c(int breakerId, BlockPos pos, int progress) {
for (int j2 = 0; j2 < this.field_73021_x.size(); j2++) {
IWorldEventListener iworldeventlistener = this.field_73021_x.get(j2);
iworldeventlistener.func_180441_b(breakerId, pos, progress);
}
}
public Calendar func_83015_S() {
if (func_82737_E() % 600L == 0L)
this.field_83016_L.setTimeInMillis(MinecraftServer.func_130071_aq());
return this.field_83016_L;
}
public Scoreboard func_96441_U() {
return this.field_96442_D;
}
public void func_175666_e(BlockPos pos, Block blockIn) {
for (EnumFacing enumfacing : EnumFacing.field_82609_l) {
BlockPos blockpos1 = pos.func_177972_a(enumfacing);
if (func_175667_e(blockpos1)) {
IBlockState iblockstate1 = func_180495_p(blockpos1);
iblockstate1.func_177230_c().onNeighborChange(this, blockpos1, pos);
if (iblockstate1.func_177230_c().isNormalCube(iblockstate1, this, blockpos1)) {
blockpos1 = blockpos1.func_177972_a(enumfacing);
iblockstate1 = func_180495_p(blockpos1);
if (iblockstate1.func_177230_c().getWeakChanges(this, blockpos1))
iblockstate1.func_177230_c().onNeighborChange(this, blockpos1, pos);
}
}
}
}
public DifficultyInstance func_175649_E(BlockPos pos) {
long j2 = 0L;
float f = 0.0F;
if (func_175667_e(pos)) {
f = func_130001_d();
j2 = func_175726_f(pos).func_177416_w();
}
return new DifficultyInstance(func_175659_aa(), func_72820_D(), j2, f);
}
public EnumDifficulty func_175659_aa() {
return func_72912_H().func_176130_y();
}
public int func_175657_ab() {
return this.field_73008_k;
}
public void func_175692_b(int newSkylightSubtracted) {
this.field_73008_k = newSkylightSubtracted;
}
public void func_175702_c(int lastLightningBoltIn) {
this.field_73016_r = lastLightningBoltIn;
}
public VillageCollection func_175714_ae() {
return this.field_72982_D;
}
public WorldBorder func_175723_af() {
return this.field_175728_M;
}
public boolean func_72916_c(int x, int z) {
BlockPos blockpos1 = func_175694_M();
int j2 = x * 16 + 8 - blockpos1.func_177958_n();
int k2 = z * 16 + 8 - blockpos1.func_177952_p();
int l2 = 128;
return (j2 >= -128 && j2 <= 128 && k2 >= -128 && k2 <= 128);
}
public boolean isSideSolid(BlockPos pos, EnumFacing side) {
return isSideSolid(pos, side, false);
}
public boolean isSideSolid(BlockPos pos, EnumFacing side, boolean _default) {
if (!func_175701_a(pos))
return _default;
Chunk chunk = func_175726_f(pos);
if (chunk == null || chunk.func_76621_g())
return _default;
return func_180495_p(pos).isSideSolid(this, pos, side);
}
public ImmutableSetMultimap<ChunkPos, ForgeChunkManager.Ticket> getPersistentChunks() {
return ForgeChunkManager.getPersistentChunksFor(this);
}
public Iterator<Chunk> getPersistentChunkIterable(Iterator<Chunk> chunkIterator) {
return ForgeChunkManager.getPersistentChunksIterableFor(this, chunkIterator);
}
public int getBlockLightOpacity(BlockPos pos) {
if (!func_175701_a(pos))
return 0;
return func_175726_f(pos).func_177437_b(pos);
}
public int countEntities(EnumCreatureType type, boolean forSpawnCount) {
int count = 0;
for (int x = 0; x < this.field_72996_f.size(); x++) {
if (((Entity)this.field_72996_f.get(x)).isCreatureType(type, forSpawnCount))
count++;
}
return count;
}
@Deprecated
public void markTileEntitiesInChunkForRemoval(Chunk chunk) {
for (TileEntity tileentity : chunk.func_177434_r().values())
func_147457_a(tileentity);
}
protected void initCapabilities() {
ICapabilityProvider parent = this.field_73011_w.initCapabilities();
this.capabilities = ForgeEventFactory.gatherCapabilities(this, parent);
WorldCapabilityData data = (WorldCapabilityData)this.perWorldStorage.func_75742_a(WorldCapabilityData.class, "capabilities");
if (data == null) {
this.capabilityData = new WorldCapabilityData((INBTSerializable)this.capabilities);
this.perWorldStorage.func_75745_a(this.capabilityData.field_76190_i, (WorldSavedData)this.capabilityData);
} else {
this.capabilityData = data;
this.capabilityData.setCapabilities(this.field_73011_w, (INBTSerializable)this.capabilities);
}
}
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing facing) {
return (this.capabilities == null) ? false : this.capabilities.hasCapability(capability, facing);
}
@Nullable
public <T> T getCapability(Capability<T> capability, @Nullable EnumFacing facing) {
return (this.capabilities == null) ? null : (T)this.capabilities.getCapability(capability, facing);
}
public MapStorage getPerWorldStorage() {
return this.perWorldStorage;
}
public void func_184135_a(Packet<?> packetIn) {
throw new UnsupportedOperationException("Can't send packets to server unless you're on the client.");
}
public LootTableManager func_184146_ak() {
return this.field_184151_B;
}
@Nullable
public BlockPos func_190528_a(String p_190528_1_, BlockPos p_190528_2_, boolean p_190528_3_) {
return null;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Collection getPlayers() {
return (Collection)ImmutableList.copyOf(this.field_73010_i);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public UUID getUniqueId() {
WorldProperties properties = getProperties();
UUID worldId = properties.getUniqueId();
if (worldId == null) {
WorldInfoBridge mixinWorldInfo = (WorldInfoBridge)properties;
mixinWorldInfo.bridge$setUniqueId(UUID.randomUUID());
return properties.getUniqueId();
}
return worldId;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Optional getChunk(int x, int y, int z) {
if (!SpongeChunkLayout.instance.isValidChunk(x, y, z))
return Optional.empty();
WorldServer worldserver = (WorldServer)this;
return Optional.ofNullable((Chunk)worldserver.func_72863_F().func_186026_b(x, z));
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Optional loadChunk(int x, int y, int z, boolean shouldGenerate) {
if (!SpongeChunkLayout.instance.isValidChunk(x, y, z))
return Optional.empty();
WorldServer worldserver = (WorldServer)this;
if (!shouldGenerate)
return Optional.ofNullable((Chunk)worldserver.func_72863_F().func_186028_c(x, z));
return Optional.ofNullable((Chunk)worldserver.func_72863_F().func_186025_d(x, z));
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Optional regenerateChunk(int cx, int cy, int cz, ChunkRegenerateFlag flag) {
return Optional.empty();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public int getHighestYAt(int x, int z) {
return func_189649_b(x, z);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public int getPrecipitationLevelAt(int x, int z) {
return func_175725_q(new BlockPos(x, 0, z)).func_177956_o();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public BlockState getBlock(int x, int y, int z) {
return (BlockState)func_180495_p(new BlockPos(x, y, z));
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public BlockType getBlockType(int x, int y, int z) {
return (BlockType)func_72964_e(x >> 4, z >> 4).func_177435_g(new BlockPos(x, y, z)).func_177230_c();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public boolean setBlock(int x, int y, int z, BlockState block) {
return setBlock(x, y, z, block, BlockChangeFlags.ALL);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public BiomeType getBiome(int x, int y, int z) {
return (BiomeType)func_180494_b(new BlockPos(x, y, z));
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public void setBiome(int x, int y, int z, BiomeType biome) {
checkBiomeBounds(x, y, z);
((Chunk)func_72964_e(x >> 4, z >> 4)).setBiome(x, y, z, biome);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Collection getEntities() {
return Lists.newArrayList(this.field_72996_f);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Collection getEntities(Predicate<Entity> filter) {
return func_175644_a(Entity.class,
Functional.java8ToGuava(filter));
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Entity createEntity(EntityType type, Vector3d position) throws IllegalArgumentException, IllegalStateException {
return createEntity(type, position, false);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Entity createEntityNaturally(EntityType type, Vector3d position) throws IllegalArgumentException, IllegalStateException {
return createEntity(type, position, true);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private Entity createEntity(EntityType type, Vector3d position, boolean naturally) throws IllegalArgumentException, IllegalStateException {
Preconditions.checkNotNull(type, "The entity type cannot be null!");
Preconditions.checkNotNull(position, "The position cannot be null!");
Entity entity = null;
Class<? extends Entity> entityClass = type.getEntityClass();
double x = position.getX();
double y = position.getY();
double z = position.getZ();
if (entityClass.isAssignableFrom(EntityPlayerMP.class) || entityClass.isAssignableFrom(MultiPartEntityPart.class))
throw new IllegalArgumentException("Cannot construct " + type.getId() + " please look to using entity types correctly!");
World world = this;
if (entityClass.isAssignableFrom(EntityLightningBolt.class)) {
entity = (Entity)new EntityLightningBolt(world, x, y, z, false);
} else if (entityClass.isAssignableFrom(EntityEnderPearl.class)) {
EntityArmorStand tempEntity = new EntityArmorStand(world, x, y, z);
tempEntity.field_70163_u -= tempEntity.func_70047_e();
entity = (Entity)new EntityEnderPearl(world, (EntityLivingBase)tempEntity);
((EnderPearl)entity).setShooter((ProjectileSource)ProjectileSource.UNKNOWN);
}
if (entityClass.isAssignableFrom(EntityFallingBlock.class)) {
entity = (Entity)new EntityFallingBlock(world, x, y, z, Blocks.field_150354_m.func_176223_P());
} else if (entityClass.isAssignableFrom(EntityItem.class)) {
entity = (Entity)new EntityItem(world, x, y, z, new ItemStack(Blocks.field_150348_b));
}
if (entity == null)
try {
entity = (Entity)ConstructorUtils.invokeConstructor(entityClass, new Object[] { this });
((Entity)entity).func_70107_b(x, y, z);
} catch (Exception e) {
throw new RuntimeException("There was an issue attempting to construct " + type.getId(), e);
}
if (naturally && entity instanceof EntityLiving)
((EntityLiving)entity).func_180482_a(world.func_175649_E(new BlockPos(x, y, z)), null);
if (entity instanceof EntityPainting)
((EntityPainting)entity).field_70522_e = EntityPainting.EnumArt.KEBAB;
return entity;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Optional createEntity(DataContainer entityContainer) {
return Optional.empty();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Optional createEntity(DataContainer entityContainer, Vector3d position) {
return Optional.empty();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Optional restoreSnapshot(EntitySnapshot snapshot, Vector3d position) {
EntitySnapshot entitySnapshot = (EntitySnapshot)snapshot.withLocation(new Location((Extent)this, position));
return entitySnapshot.restore();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public WorldBorder getWorldBorder() {
return (WorldBorder)func_175723_af();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public ChunkPreGenerate.Builder newChunkPreGenerate(Vector3d center, double diameter) {
return (ChunkPreGenerate.Builder)new SpongeChunkPreGenerateTask.Builder(this, center, diameter);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Dimension getDimension() {
if (this.api$dimension == null)
this.api$dimension = new SpongeDimension(this.field_73011_w);
return (Dimension)this.api$dimension;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Optional getEntity(UUID uuid) {
for (Entity entity : this.field_72996_f) {
if (entity.func_110124_au().equals(uuid))
return Optional.of((Entity)entity);
}
return Optional.empty();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Iterable getLoadedChunks() {
if (((WorldBridge)this).bridge$isFake())
return Collections.emptyList();
return Lists.newArrayList(((WorldServer)this).func_72863_F().func_189548_a());
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public boolean unloadChunk(Chunk chunk) {
Preconditions.checkArgument((chunk != null), "Chunk cannot be null!");
return chunk.unloadChunk();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public WorldProperties getProperties() {
return (WorldProperties)this.field_72986_A;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Context getContext() {
if (this.worldContext == null) {
WorldInfo worldInfo = func_72912_H();
if (worldInfo == null)
worldInfo = new WorldInfo(new WorldSettings(0L, GameType.NOT_SET, false, false, WorldType.field_77137_b), "sponge$dummy_World");
this.worldContext = new Context("world", worldInfo.func_76065_j());
}
return this.worldContext;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Optional getTileEntity(int x, int y, int z) {
TileEntity tileEntity = func_175625_s(new BlockPos(x, y, z));
if (tileEntity == null)
return Optional.empty();
return Optional.of((TileEntity)tileEntity);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Vector3i getBiomeMin() {
return Constants.World.BIOME_MIN;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Vector3i getBiomeMax() {
return Constants.World.BIOME_MAX;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Vector3i getBiomeSize() {
return Constants.World.BIOME_SIZE;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Vector3i getBlockMin() {
return Constants.World.BLOCK_MIN;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Vector3i getBlockMax() {
return Constants.World.BLOCK_MAX;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Vector3i getBlockSize() {
return Constants.World.BLOCK_SIZE;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public boolean containsBiome(int x, int y, int z) {
return VecHelper.inBounds(x, y, z, Constants.World.BIOME_MIN, Constants.World.BIOME_MAX);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public boolean containsBlock(int x, int y, int z) {
return VecHelper.inBounds(x, y, z, Constants.World.BLOCK_MIN, Constants.World.BLOCK_MAX);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private void checkBiomeBounds(int x, int y, int z) {
if (!containsBiome(x, y, z))
throw new PositionOutOfBoundsException(new Vector3i(x, y, z), Constants.World.BIOME_MIN, Constants.World.BIOME_MAX);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
protected void checkBlockBounds(int x, int y, int z) {
if (!containsBlock(x, y, z))
throw new PositionOutOfBoundsException(new Vector3i(x, y, z), Constants.World.BLOCK_MIN, Constants.World.BLOCK_MAX);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public void sendMessage(ChatType type, Text message) {
Preconditions.checkNotNull(type, "type");
Preconditions.checkNotNull(message, "message");
for (Player player : getPlayers())
player.sendMessage(type, message);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public void sendTitle(Title title) {
Preconditions.checkNotNull(title, "title");
for (Player player : getPlayers())
player.sendTitle(title);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public void resetTitle() {
getPlayers().forEach(Viewer::resetTitle);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public void clearTitle() {
getPlayers().forEach(Viewer::clearTitle);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Collection getTileEntities() {
return Lists.newArrayList(this.field_147482_g);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Collection getTileEntities(Predicate<TileEntity> filter) {
return (Collection)this.field_147482_g.stream()
.filter(filter)
.collect(Collectors.toList());
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public void triggerExplosion(Explosion explosion) {
Preconditions.checkNotNull(explosion, "explosion");
((Explosion)explosion).func_77278_a();
((Explosion)explosion).func_77279_a(true);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Extent getExtentView(Vector3i newMin, Vector3i newMax) {
return (Extent)new ExtentViewDownsize((Extent)this, newMin, newMax);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public MutableBiomeVolumeWorker getBiomeWorker() {
return (MutableBiomeVolumeWorker)new SpongeMutableBiomeVolumeWorker((MutableBiomeVolume)this);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public MutableBlockVolumeWorker getBlockWorker() {
return (MutableBlockVolumeWorker)new SpongeMutableBlockVolumeWorker((MutableBlockVolume)this);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public BlockSnapshot createSnapshot(int x, int y, int z) {
if (!containsBlock(x, y, z))
return BlockSnapshot.NONE;
World world = this;
BlockState state = world.getBlock(x, y, z);
Optional<TileEntity> te = world.getTileEntity(x, y, z);
SpongeBlockSnapshotBuilder builder = SpongeBlockSnapshotBuilder.pooled().blockState(state).worldId(world.getUniqueId()).position(new Vector3i(x, y, z));
Optional<UUID> creator = getCreator(x, y, z);
Optional<UUID> notifier = getNotifier(x, y, z);
if (creator.isPresent())
builder.creator(creator.get());
if (notifier.isPresent())
builder.notifier(notifier.get());
if (te.isPresent()) {
TileEntity tileEntity = te.get();
for (DataManipulator<?, ?> manipulator : (Iterable<DataManipulator<?, ?>>)((CustomDataHolderBridge)tileEntity).bridge$getCustomManipulators())
builder.add(manipulator);
NBTTagCompound compound = new NBTTagCompound();
((TileEntity)tileEntity).func_189515_b(compound);
builder.unsafeNbt(compound);
}
return (BlockSnapshot)builder.build();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public boolean restoreSnapshot(BlockSnapshot snapshot, boolean force, BlockChangeFlag flag) {
return snapshot.restore(force, flag);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public boolean restoreSnapshot(int x, int y, int z, BlockSnapshot snapshot, boolean force, BlockChangeFlag flag) {
snapshot = (BlockSnapshot)snapshot.withLocation(new Location((Extent)this, new Vector3i(x, y, z)));
return snapshot.restore(force, flag);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Optional getBlockSelectionBox(int x, int y, int z) {
BlockPos pos = new BlockPos(x, y, z);
IBlockState state = func_180495_p(pos);
AxisAlignedBB box = state.func_185900_c(this, pos);
try {
return Optional.of(VecHelper.toSpongeAABB(box).offset(x, y, z));
} catch (IllegalArgumentException exception) {
return Optional.empty();
}
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Set getIntersectingEntities(AABB box, Predicate<Entity> filter) {
Preconditions.checkNotNull(box, "box");
Preconditions.checkNotNull(filter, "filter");
return (Set)func_175647_a(Entity.class, VecHelper.toMinecraftAABB(box), entity -> filter.test((Entity)entity))
.stream()
.map(entity -> (Entity)entity)
.collect(Collectors.toSet());
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Set getIntersectingBlockCollisionBoxes(AABB box) {
Preconditions.checkNotNull(box, "box");
return (Set)func_184144_a(null, VecHelper.toMinecraftAABB(box)).stream()
.map(VecHelper::toSpongeAABB)
.collect(Collectors.toSet());
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Set getIntersectingCollisionBoxes(Entity owner, AABB box) {
Preconditions.checkNotNull(owner, "owner");
Preconditions.checkNotNull(box, "box");
return (Set)func_184144_a((Entity)owner, VecHelper.toMinecraftAABB(box)).stream()
.map(VecHelper::toSpongeAABB)
.collect(Collectors.toSet());
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Set getIntersectingEntities(Vector3d start, Vector3d end, Predicate<EntityUniverse.EntityHit> filter) {
Preconditions.checkNotNull(start, "start");
Preconditions.checkNotNull(end, "end");
Vector3d diff = end.sub(start);
return getIntersectingEntities(start, diff.normalize(), diff.length(), filter);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Set getIntersectingEntities(Vector3d start, Vector3d direction, double distance, Predicate<EntityUniverse.EntityHit> filter) {
Preconditions.checkNotNull(start, "start");
Preconditions.checkNotNull(direction, "direction");
Preconditions.checkNotNull(filter, "filter");
direction = direction.normalize();
if (direction.getX() == 0.0D && direction.getZ() == 0.0D)
return getIntersectingEntities(start, direction.getY(), distance, filter);
int chunkWidth = SpongeChunkLayout.CHUNK_SIZE.getX();
int xPlaneIncrement = (direction.getX() >= 0.0D) ? chunkWidth : -chunkWidth;
int zPlaneIncrement = (direction.getZ() >= 0.0D) ? chunkWidth : -chunkWidth;
double xInChunk = GenericMath.mod(start.getX(), chunkWidth);
double zInChunk = GenericMath.mod(start.getZ(), chunkWidth);
int xPlaneNext = (int)(start.getX() - xInChunk);
int zPlaneNext = (int)(start.getZ() - zInChunk);
if (xInChunk != 0.0D && direction.getX() < 0.0D)
xPlaneNext += chunkWidth;
if (zInChunk != 0.0D && direction.getZ() < 0.0D)
zPlaneNext += chunkWidth;
double xPlaneT = (xPlaneNext - start.getX()) / direction.getX();
double zPlaneT = (zPlaneNext - start.getZ()) / direction.getZ();
double currentT = 0.0D;
double xCurrent = start.getX();
double yCurrent = start.getY();
double zCurrent = start.getZ();
double remainingDistance = distance;
Set<EntityUniverse.EntityHit> intersecting = new HashSet<>();
while (true) {
double nextT, xNext, zNext;
if (xPlaneT < zPlaneT) {
nextT = xPlaneT;
xNext = xPlaneNext;
zNext = direction.getZ() * nextT + start.getZ();
xPlaneNext += xPlaneIncrement;
xPlaneT = (xPlaneNext - start.getX()) / direction.getX();
} else {
nextT = zPlaneT;
xNext = direction.getX() * nextT + start.getX();
zNext = zPlaneNext;
zPlaneNext += zPlaneIncrement;
zPlaneT = (zPlaneNext - start.getZ()) / direction.getZ();
}
double yNext = direction.getY() * Math.min(nextT, distance) + start.getY();
if (nextT >= 0.0D) {
xInChunk = GenericMath.mod(xCurrent, chunkWidth);
zInChunk = GenericMath.mod(zCurrent, chunkWidth);
int xChunk = (int)(xCurrent - ((xInChunk == 0.0D && direction.getX() < 0.0D) ? chunkWidth : xInChunk));
int zChunk = (int)(zCurrent - ((zInChunk == 0.0D && direction.getZ() < 0.0D) ? chunkWidth : zInChunk));
Optional<Chunk> chunk = getChunkAtBlock(xChunk, 0, zChunk);
if (chunk.isPresent())
((ChunkBridge)chunk.get())
.bridge$getIntersectingEntities(start, direction, distance, filter, yCurrent, yNext, intersecting);
ChunkBridge nearIntersections = getChunkNearIntersections(xChunk, zChunk, xCurrent, zCurrent, xNext, zNext);
if (nearIntersections != null)
nearIntersections
.bridge$getIntersectingEntities(start, direction, distance, filter, yCurrent, yNext, intersecting);
remainingDistance -= nextT - Math.max(0.0D, currentT);
}
currentT = nextT;
xCurrent = xNext;
yCurrent = yNext;
zCurrent = zNext;
if (remainingDistance < 0.0D)
return intersecting;
}
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private ChunkBridge getChunkNearIntersections(int xChunk, int zChunk, double xCurrent, double zCurrent, double xNext, double zNext) {
int chunkWidth = SpongeChunkLayout.CHUNK_SIZE.getX();
Vector2d c1 = new Vector2d(xChunk, zChunk);
Vector2d c2 = new Vector2d((xChunk + chunkWidth), zChunk);
Vector2d c3 = new Vector2d(xChunk, (zChunk + chunkWidth));
Vector2d c4 = new Vector2d((xChunk + chunkWidth), (zChunk + chunkWidth));
int nearDistance2 = 4;
boolean d11 = (c1.distanceSquared(xCurrent, zCurrent) <= 4.0D);
boolean d21 = (c1.distanceSquared(xNext, zNext) <= 4.0D);
if (d11 && d21)
return getChunkAtBlock(xChunk - chunkWidth, 0, zChunk - chunkWidth).orElse(null);
boolean d12 = (c2.distanceSquared(xCurrent, zCurrent) <= 4.0D);
boolean d22 = (c2.distanceSquared(xNext, zNext) <= 4.0D);
if (d12 && d22)
return getChunkAtBlock(xChunk + chunkWidth, 0, zChunk - chunkWidth).orElse(null);
boolean d13 = (c3.distanceSquared(xCurrent, zCurrent) <= 4.0D);
boolean d23 = (c3.distanceSquared(xNext, zNext) <= 4.0D);
if (d13 && d23)
return getChunkAtBlock(xChunk - chunkWidth, 0, zChunk + chunkWidth).orElse(null);
boolean d14 = (c4.distanceSquared(xCurrent, zCurrent) <= 4.0D);
boolean d24 = (c4.distanceSquared(xNext, zNext) <= 4.0D);
if (d14 && d24)
return getChunkAtBlock(xChunk + chunkWidth, 0, zChunk + chunkWidth).orElse(null);
if ((d11 && d23) || (d21 && d13))
return getChunkAtBlock(xChunk - chunkWidth, 0, zChunk).orElse(null);
if ((d11 && d22) || (d21 && d12))
return getChunkAtBlock(xChunk, 0, zChunk - chunkWidth).orElse(null);
if ((d14 && d22) || (d24 && d12))
return getChunkAtBlock(xChunk + chunkWidth, 0, zChunk).orElse(null);
if ((d14 && d23) || (d24 && d13))
return getChunkAtBlock(xChunk, 0, zChunk + chunkWidth).orElse(null);
return null;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private Set getIntersectingEntities(Vector3d start, double yDirection, double distance, Predicate<EntityUniverse.EntityHit> filter) {
Set<EntityUniverse.EntityHit> intersecting = new HashSet<>();
Vector3d direction = (yDirection < 0.0D) ? Vector3d.UNIT_Y.negate() : Vector3d.UNIT_Y;
double endY = start.getY() + yDirection * distance;
Vector3i chunkPos = SpongeChunkLayout.instance.forceToChunk(start.toInt());
((ChunkBridge)getChunk(chunkPos).get()).bridge$getIntersectingEntities(start, direction, distance, filter, start.getY(), endY, intersecting);
int nearDistance = 2;
Vector3i chunkBlockPos = SpongeChunkLayout.instance.forceToWorld(chunkPos);
if (start.getX() - chunkBlockPos.getX() <= 2.0D)
((ChunkBridge)getChunk(chunkPos.add(-1, 0, 0)).get())
.bridge$getIntersectingEntities(start, direction, distance, filter, start.getY(), endY, intersecting);
if (start.getZ() - chunkBlockPos.getZ() <= 2.0D)
((ChunkBridge)getChunk(chunkPos.add(0, 0, -1)).get())
.bridge$getIntersectingEntities(start, direction, distance, filter, start.getY(), endY, intersecting);
int chunkWidth = SpongeChunkLayout.CHUNK_SIZE.getX();
if ((chunkBlockPos.getX() + chunkWidth) - start.getX() <= 2.0D)
((ChunkBridge)getChunk(chunkPos.add(1, 0, 0)).get())
.bridge$getIntersectingEntities(start, direction, distance, filter, start.getY(), endY, intersecting);
if ((chunkBlockPos.getZ() + chunkWidth) - start.getZ() <= 2.0D)
((ChunkBridge)getChunk(chunkPos.add(0, 0, 1)).get())
.bridge$getIntersectingEntities(start, direction, distance, filter, start.getY(), endY, intersecting);
return intersecting;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public void sendBlockChange(int x, int y, int z, BlockState state) {
Preconditions.checkNotNull(state, "state");
SPacketBlockChange packet = new SPacketBlockChange();
((SPacketBlockChangeAccessor)packet).accessor$setBlockPosition(new BlockPos(x, y, z));
((SPacketBlockChangeAccessor)packet).accessor$setBlockState((IBlockState)state);
for (EntityPlayer player : this.field_73010_i) {
if (player instanceof EntityPlayerMP)
((EntityPlayerMP)player).field_71135_a.func_147359_a((Packet)packet);
}
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public void resetBlockChange(int x, int y, int z) {
SPacketBlockChange packet = new SPacketBlockChange(this, new BlockPos(x, y, z));
for (EntityPlayer player : this.field_73010_i) {
if (player instanceof EntityPlayerMP)
((EntityPlayerMP)player).field_71135_a.func_147359_a((Packet)packet);
}
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public int getSeaLevel() {
return this.field_181546_a;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Optional getProperty(int x, int y, int z, Class<T> propertyClass) {
Optional<PropertyStore<T>> optional = Sponge.getPropertyRegistry().getStore(propertyClass);
return optional.flatMap(tPropertyStore -> tPropertyStore.getFor(new Location((Extent)this, x, y, z)));
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Optional getProperty(int x, int y, int z, Direction direction, Class<T> propertyClass) {
Optional<PropertyStore<T>> optional = Sponge.getPropertyRegistry().getStore(propertyClass);
return optional.flatMap(tPropertyStore -> tPropertyStore.getFor(new Location((Extent)this, x, y, z), direction));
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Collection getProperties(int x, int y, int z) {
return SpongeImpl.getPropertyRegistry().getPropertiesFor((PropertyHolder)new Location((Extent)this, x, y, z));
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Collection getFacesWithProperty(int x, int y, int z, Class<? extends Property<?, ?>> propertyClass) {
Optional<? extends PropertyStore<? extends Property<?, ?>>> optional = Sponge.getPropertyRegistry().getStore(propertyClass);
if (!optional.isPresent())
return Collections.emptyList();
PropertyStore<? extends Property<?, ?>> store = optional.get();
Location<World> loc = new Location((Extent)this, x, y, z);
ImmutableList.Builder<Direction> faces = ImmutableList.builder();
for (EnumFacing facing : EnumFacing.values()) {
Direction direction = DirectionFacingProvider.getInstance().getKey(facing).get();
if (store.getFor(loc, direction).isPresent())
faces.add(direction);
}
return (Collection)faces.build();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Optional get(int x, int y, int z, Key<? extends BaseValue<E>> key) {
Optional<E> optional = getBlock(x, y, z).withExtendedProperties(new Location((Extent)this, x, y, z)).get(key);
if (optional.isPresent())
return optional;
Optional<TileEntity> tileEntityOptional = getTileEntity(x, y, z);
return tileEntityOptional.flatMap(tileEntity -> tileEntity.get(key));
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Optional get(int x, int y, int z, Class<T> manipulatorClass) {
Collection<DataManipulator<?, ?>> manipulators = getManipulators(x, y, z);
for (DataManipulator<?, ?> manipulator : manipulators) {
if (manipulatorClass.isInstance(manipulator))
return Optional.of(manipulator);
}
return Optional.empty();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Optional getOrCreate(int x, int y, int z, Class<T> manipulatorClass) {
Optional<T> optional = get(x, y, z, manipulatorClass);
if (optional.isPresent())
return optional;
Optional<TileEntity> tileEntity = getTileEntity(x, y, z);
return tileEntity.flatMap(tileEntity1 -> tileEntity1.getOrCreate(manipulatorClass));
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Optional getValue(int x, int y, int z, Key<V> key) {
BlockState blockState = getBlock(x, y, z).withExtendedProperties(new Location((Extent)this, x, y, z));
if (blockState.supports(key))
return blockState.getValue(key);
Optional<TileEntity> tileEntity = getTileEntity(x, y, z);
if (tileEntity.isPresent() && ((TileEntity)tileEntity.get()).supports(key))
return ((TileEntity)tileEntity.get()).getValue(key);
return Optional.empty();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public boolean supports(int x, int y, int z, Key<?> key) {
BlockState blockState = getBlock(x, y, z);
boolean blockSupports = blockState.supports(key);
Optional<TileEntity> tileEntity = getTileEntity(x, y, z);
boolean tileEntitySupports = (tileEntity.isPresent() && ((TileEntity)tileEntity.get()).supports(key));
return (blockSupports || tileEntitySupports);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public boolean supports(int x, int y, int z, Class<? extends DataManipulator<?, ?>> manipulatorClass) {
BlockState blockState = getBlock(x, y, z);
List<ImmutableDataManipulator<?, ?>> immutableDataManipulators = blockState.getManipulators();
boolean blockSupports = false;
for (ImmutableDataManipulator<?, ?> manipulator : immutableDataManipulators) {
if (manipulator.asMutable().getClass().isAssignableFrom(manipulatorClass)) {
blockSupports = true;
break;
}
}
if (!blockSupports) {
Optional<TileEntity> tileEntity = getTileEntity(x, y, z);
boolean tileEntitySupports = (tileEntity.isPresent() && ((TileEntity)tileEntity.get()).supports(manipulatorClass));
return tileEntitySupports;
}
return true;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Set getKeys(int x, int y, int z) {
ImmutableSet.Builder<Key<?>> builder = ImmutableSet.builder();
BlockState blockState = getBlock(x, y, z).withExtendedProperties(new Location((Extent)this, x, y, z));
builder.addAll(blockState.getKeys());
Optional<TileEntity> tileEntity = getTileEntity(x, y, z);
tileEntity.ifPresent(tileEntity1 -> builder.addAll(tileEntity1.getKeys()));
return (Set)builder.build();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Set getValues(int x, int y, int z) {
ImmutableSet.Builder<ImmutableValue<?>> builder = ImmutableSet.builder();
BlockState blockState = getBlock(x, y, z).withExtendedProperties(new Location((Extent)this, x, y, z));
builder.addAll(blockState.getValues());
Optional<TileEntity> tileEntity = getTileEntity(x, y, z);
tileEntity.ifPresent(tileEntity1 -> builder.addAll(tileEntity1.getValues()));
return (Set)builder.build();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public DataTransactionResult offer(int x, int y, int z, Key<? extends BaseValue<E>> key, E value) {
BlockState blockState = getBlock(x, y, z).withExtendedProperties(new Location((Extent)this, x, y, z));
if (blockState.supports(key)) {
ImmutableValue<E> old = ((Value)getValue(x, y, z, key).map(v -> (Value)v).get()).asImmutable();
setBlock(x, y, z, blockState.with(key, value).get());
ImmutableValue<E> newVal = ((Value)getValue(x, y, z, key).map(v -> (Value)v).get()).asImmutable();
return DataTransactionResult.successReplaceResult(newVal, old);
}
return getTileEntity(x, y, z)
.map(tileEntity -> tileEntity.offer(key, value))
.orElseGet(DataTransactionResult::failNoData);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public DataTransactionResult offer(int x, int y, int z, DataManipulator<?, ?> manipulator, MergeFunction function) {
BlockState blockState = getBlock(x, y, z).withExtendedProperties(new Location((Extent)this, x, y, z));
ImmutableDataManipulator<?, ?> immutableDataManipulator = manipulator.asImmutable();
if (blockState.supports(immutableDataManipulator.getClass())) {
List<ImmutableValue<?>> old = new ArrayList<>(blockState.getValues());
BlockState newState = blockState.with((ValueContainer)immutableDataManipulator).get();
old.removeAll(newState.getValues());
setBlock(x, y, z, newState);
return DataTransactionResult.successReplaceResult(old, manipulator.getValues());
}
return getTileEntity(x, y, z)
.map(tileEntity -> tileEntity.offer((ValueContainer)manipulator, function))
.orElseGet(() -> DataTransactionResult.failResult(manipulator.getValues()));
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public DataTransactionResult remove(int x, int y, int z, Class<? extends DataManipulator<?, ?>> manipulatorClass) {
Optional<TileEntity> tileEntityOptional = getTileEntity(x, y, z);
return tileEntityOptional
.<DataTransactionResult>map(tileEntity -> tileEntity.remove(manipulatorClass))
.orElseGet(DataTransactionResult::failNoData);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public DataTransactionResult remove(int x, int y, int z, Key<?> key) {
Optional<TileEntity> tileEntityOptional = getTileEntity(x, y, z);
return tileEntityOptional
.<DataTransactionResult>map(tileEntity -> tileEntity.remove(key))
.orElseGet(DataTransactionResult::failNoData);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public DataTransactionResult undo(int x, int y, int z, DataTransactionResult result) {
return DataTransactionResult.failNoData();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public DataTransactionResult copyFrom(int xTo, int yTo, int zTo, DataHolder from) {
return copyFrom(xTo, yTo, zTo, from, MergeFunction.IGNORE_ALL);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public DataTransactionResult copyFrom(int xTo, int yTo, int zTo, DataHolder from, MergeFunction function) {
DataTransactionResult.Builder builder = DataTransactionResult.builder();
Collection<DataManipulator<?, ?>> manipulators = from.getContainers();
for (DataManipulator<?, ?> manipulator : manipulators)
builder.absorbResult(offer(xTo, yTo, zTo, manipulator, function));
return builder.build();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public DataTransactionResult copyFrom(int xTo, int yTo, int zTo, int xFrom, int yFrom, int zFrom, MergeFunction function) {
return copyFrom(xTo, yTo, zTo, (DataHolder)new Location((Extent)this, xFrom, yFrom, zFrom), function);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Collection getManipulators(int x, int y, int z) {
List<DataManipulator<?, ?>> list = new ArrayList<>();
Collection<ImmutableDataManipulator<?, ?>> manipulators = getBlock(x, y, z).withExtendedProperties(new Location((Extent)this, x, y, z)).getManipulators();
for (ImmutableDataManipulator<?, ?> immutableDataManipulator : manipulators)
list.add(immutableDataManipulator.asMutable());
Optional<TileEntity> optional = getTileEntity(x, y, z);
optional
.ifPresent(tileEntity -> list.addAll(tileEntity.getContainers()));
return list;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public boolean validateRawData(int x, int y, int z, DataView container) {
throw new UnsupportedOperationException();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.api.mcp.world.WorldMixin_API", priority = 900, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public void setRawData(int x, int y, int z, DataView container) throws InvalidDataException {
throw new UnsupportedOperationException();
}
@Overwrite
@MixinMerged(mixin = "org.spongepowered.mod.mixin.core.world.WorldMixin_Forge", priority = 999, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private int func_175638_a(BlockPos pos, EnumSkyBlock lightType) {
if (lightType == EnumSkyBlock.SKY && func_175678_i(pos))
return 15;
callbackInfo13 = new CallbackInfoReturnable("func_175638_a", true);
handler$zlk000$impl$getRawLightWithoutMarkingChunkActive(pos, lightType, callbackInfo13);
if (callbackInfo13.isCancelled())
return callbackInfo13.getReturnValueI();
IBlockState blockState = func_180495_p(pos);
int blockLight = SpongeImplHooks.getChunkPosLight(blockState, this, pos);
int i = (lightType == EnumSkyBlock.SKY) ? 0 : blockLight;
int j = SpongeImplHooks.getBlockLightOpacity(blockState, this, pos);
if (j >= 15 && blockLight > 0)
j = 1;
if (j < 1)
j = 1;
if (j >= 15)
return 0;
if (i >= 14)
return i;
for (EnumFacing enumfacing : EnumFacing.values()) {
BlockPos blockpos = pos.func_177972_a(enumfacing);
int k = func_175642_b(lightType, blockpos) - j;
if (k > i)
i = k;
if (i >= 14)
return i;
}
return i;
}
@MixinMerged(mixin = "org.spongepowered.mod.mixin.core.world.WorldMixin_Forge", priority = 999, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private boolean redirect$bam000$forgeImpl$useTileActiveChunk(World world, BlockPos pos, boolean allowEmpty) {
return true;
}
@MixinMerged(mixin = "org.spongepowered.mod.mixin.core.world.WorldMixin_Forge", priority = 999, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
protected void redirect$bam000$forgeImpl$UseComparatorOutputLevel(World world, BlockPos pos, Block blockIn, BlockPos samePos) {
func_175666_e(pos, blockIn);
}
@MixinMerged(mixin = "org.spongepowered.mod.mixin.core.world.WorldMixin_Forge", priority = 999, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private void handler$bam000$forgeImpl$getRedirectedWorldInfoIfAvailable(CallbackInfoReturnable<WorldInfo> cir) {
if (this.field_73011_w.getDimension() != 0 && this.forgeImpl$redirectWorldInfo != null)
cir.setReturnValue(this.forgeImpl$redirectWorldInfo);
}
@MixinMerged(mixin = "org.spongepowered.mod.mixin.core.world.WorldMixin_Forge", priority = 999, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private void handler$bam000$forgeImpl$getOverworldMapStorageInsteadOfMultiDimension(CallbackInfoReturnable<MapStorage> cir) {
if (!this.field_72995_K && (this.field_72988_C == null || this.field_73011_w.getDimension() != 0)) {
WorldServer overworld = DimensionManager.getWorld(0);
if (overworld != null)
cir.setReturnValue(overworld.func_175693_T());
}
}
@MixinMerged(mixin = "org.spongepowered.mod.mixin.core.world.WorldMixin_Forge", priority = 999, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public void forgeBridge$setRedirectedWorldInfo(@Nullable WorldInfo info) {
this.forgeImpl$redirectWorldInfo = info;
}
@MixinMerged(mixin = "org.spongepowered.mod.mixin.core.world.WorldMixin_Forge", priority = 999, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private void handler$bam000$onIniitToSetForgeList(ISaveHandler saveHandlerIn, WorldInfo info, WorldProvider providerIn, Profiler profilerIn, boolean client, CallbackInfo ci) {
if (!((WorldBridge)this).bridge$isFake())
this.capturedBlockSnapshots = (ArrayList<BlockSnapshot>)new CapturedSnapshotWrapperList(this);
}
@MixinMerged(mixin = "org.spongepowered.mod.mixin.core.world.WorldMixin_Forge", priority = 999, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
int modify$bam000$vanillaImpl$updateRainTimeStart(int newRainTime) {
return newRainTime;
}
@MixinMerged(mixin = "org.spongepowered.mod.mixin.core.world.WorldMixin_Forge", priority = 999, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
int modify$bam000$vanillaImpl$updateThunderTimeStart(int newThunderTime) {
return newThunderTime;
}
@MixinMerged(mixin = "org.spongepowered.mod.mixin.entityactivation.WorldMixin_ForgeActivation", priority = 999, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private void handler$bbd000$forgeActivationImpl$checkIfCanUpdate(Entity ticking, boolean forceUpdate, CallbackInfo ci) {
if (EntityActivationRange.checkIfActive(ticking))
return;
if (ForgeEventFactory.canEntityUpdate(ticking))
return;
ticking.field_70173_aa++;
((ActivationCapability)ticking).activation$inactiveTick();
ci.cancel();
}
@MixinMerged(mixin = "org.spongepowered.mod.mixin.entityactivation.WorldMixin_ForgeActivation", priority = 999, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private ImmutableSetMultimap redirect$bbd000$forgeActivationImpl$returnEmptyMap(World world) {
return ImmutableSetMultimap.of();
}
@MixinMerged(mixin = "org.spongepowered.mod.mixin.entityactivation.WorldMixin_ForgeActivation", priority = 999, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private boolean redirect$bbd000$forgeActivationImpl$falseOutOfTheIf(World world, int xStart, int yStart, int zStart, int xEnd, int yEnd, int zEnd, boolean allowEmpty) {
return true;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private WorldBorder redirect$zlk000$onCreateWorldBorder(WorldProvider provider) {
if (bridge$isFake())
return provider.func_177501_r();
return ((WorldProviderBridge)provider).bridge$createServerWorldBorder();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private void handler$zlk000$onGetCollisionBoxes(Entity entity, AxisAlignedBB axis, CallbackInfoReturnable<List<AxisAlignedBB>> cir) {
if (bridge$isFake() || entity == null)
return;
if (entity.field_70170_p != null && !((WorldBridge)entity.field_70170_p).bridge$isFake() && SpongeHooks.checkBoundingBoxSize(entity, axis))
cir.setReturnValue(new ArrayList());
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private void handler$zlk000$onEntityAddedToWorldMarkAsTracked(Entity entityIn, CallbackInfo ci) {
if (!bridge$isFake())
((EntityBridge)entityIn).bridge$setWorldTracked(true);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private void handler$zlk000$onEntityRemovedFromWorldMarkAsUntracked(Entity entityIn, CallbackInfo ci) {
if (!bridge$isFake() || ((EntityBridge)entityIn).bridge$isWorldTracked())
((EntityBridge)entityIn).bridge$setWorldTracked(false);
}
@Nullable
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
protected TileEntity redirect$zlk000$getTileEntityForRemoval(World world, BlockPos pos) {
return world.func_175625_s(pos);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
protected void handler$zlk000$onCheckTileEntityForRemoval(BlockPos pos, CallbackInfo ci, TileEntity found, World thisWorld, BlockPos samePos) {}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
protected boolean redirect$zlk000$onSetTileEntityForCapture(TileEntity tileEntity, BlockPos pos, TileEntity sameEntity) {
return tileEntity.func_145837_r();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public boolean bridge$isFake() {
if (this.impl$hasChecked)
return this.impl$isDefinitelyFake;
this.impl$isDefinitelyFake = (this.field_72995_K || this.field_72986_A == null || this.field_72986_A.func_76065_j() == null || !(this instanceof org.spongepowered.common.bridge.world.WorldServerBridge));
this.impl$hasChecked = true;
return this.impl$isDefinitelyFake;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public void bridge$clearFakeCheck() {
this.impl$hasChecked = false;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private boolean redirect$zlk000$onIsAnyPlayerWithinRangePredicate(Predicate<EntityPlayer> predicate, Object object) {
EntityPlayer player = (EntityPlayer)object;
return (!player.field_70128_L && ((EntityPlayerBridge)player).bridge$affectsSpawning() && predicate.apply(player));
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private List redirect$zlk000$impl$filterInvisibile(World world, Entity entityIn, AxisAlignedBB axisAlignedBB) {
List<Entity> entities = world.func_72839_b(entityIn, axisAlignedBB);
entities.removeIf(entity -> (((VanishableBridge)entity).bridge$isVanished() && ((VanishableBridge)entity).bridge$isUncollideable()));
return entities;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private boolean redirect$zlk000$impl$checkIfPlayerIsVanished(Predicate<Entity> predicate, Object entityPlayer) {
return (predicate.apply(entityPlayer) && !((VanishableBridge)entityPlayer).bridge$isVanished());
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private void handler$zlk000$impl$spongePlaySoundAtEntity(@Nullable EntityPlayer entity, double x, double y, double z, SoundEvent name, SoundCategory category, float volume, float pitch, CallbackInfo callbackInfo) {
if (entity instanceof EntityBridge && (
(VanishableBridge)entity).bridge$isVanished()) {
callbackInfo.cancel();
return;
}
if (bridge$isFake())
return;
if (ShouldFire.PLAY_SOUND_EVENT_AT_ENTITY)
try (CauseStackManager.StackFrame frame = Sponge.getCauseStackManager().pushCauseFrame()) {
PlaySoundEvent.AtEntity event = SpongeCommonEventFactory.callPlaySoundAtEntityEvent(frame.getCurrentCause(), entity, this, x, y, z, category, name, pitch, volume);
if (event.isCancelled())
callbackInfo.cancel();
}
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private void handler$zlk000$impl$throwBroadcastSoundEvent(int effectID, BlockPos pos, int soundData, CallbackInfo callbackInfo) {
if (!bridge$isFake() && ShouldFire.PLAY_SOUND_EVENT_BROADCAST)
try (CauseStackManager.StackFrame frame = Sponge.getCauseStackManager().pushCauseFrame()) {
PlaySoundEvent.Broadcast event = SpongeCommonEventFactory.callPlaySoundBroadcastEvent(frame, this, pos, effectID);
if (event != null && event.isCancelled())
callbackInfo.cancel();
}
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private void handler$zlk000$impl$throwRecordPlayEvent(EntityPlayer player, int type, BlockPos pos, int data, CallbackInfo callbackInfo) {
if (bridge$isFake())
return;
if (type == 1010 && ShouldFire.PLAY_SOUND_EVENT_RECORD)
try (CauseStackManager.StackFrame frame = Sponge.getCauseStackManager().pushCauseFrame()) {
TileEntity tileEntity = func_175625_s(pos);
if (tileEntity instanceof BlockJukebox.TileEntityJukebox) {
BlockJukebox.TileEntityJukebox jukebox = (BlockJukebox.TileEntityJukebox)tileEntity;
ItemStack record = jukebox.func_145856_a();
frame.pushCause(jukebox);
frame.addContext(EventContextKeys.USED_ITEM, ItemStackUtil.snapshotOf(record));
if (!record.func_190926_b()) {
Optional<RecordProperty> recordProperty = ((ItemStack)record).getProperty(RecordProperty.class);
if (!recordProperty.isPresent())
return;
RecordType recordType = (RecordType)((RecordProperty)recordProperty.get()).getValue();
PlaySoundEvent.Record event = SpongeCommonEventFactory.callPlaySoundRecordEvent(frame.getCurrentCause(), jukebox, recordType, data);
if (event.isCancelled())
callbackInfo.cancel();
}
}
}
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public void handler$zlk000$onDestroyBlock(BlockPos pos, boolean dropBlock, CallbackInfoReturnable<Boolean> cir) {}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
protected void redirect$zlk000$onUpdateWeatherEffect(Entity entityIn) {
entityIn.func_70071_h_();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
protected void redirect$zlk000$onUpdateTileEntities(ITickable tile) {
tile.func_73660_a();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
protected void redirect$zlk000$onCallEntityUpdate(Entity entity) {
entity.func_70071_h_();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
protected void redirect$zlk000$onCallEntityRidingUpdate(Entity entity) {
entity.func_70098_U();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private boolean redirect$zlk000$impl$returnTrueToAddedToChunkForMovingEntities(Entity entity) {
Chunk activeChunk = (Chunk)((ActiveChunkReferantBridge)entity).bridge$getActiveChunk();
if (activeChunk != null)
activeChunk.func_76608_a(entity, entity.field_70162_ai);
int l = MathHelper.func_76128_c(entity.field_70165_t / 16.0D);
int j1 = MathHelper.func_76128_c(entity.field_70161_v / 16.0D);
ChunkBridge newChunk = (ChunkBridge)((ChunkProviderBridge)func_72863_F()).bridge$getLoadedChunkWithoutMarkingActive(l, j1);
boolean isPositionDirty = entity.func_184189_br();
if (newChunk == null || (!isPositionDirty && newChunk.bridge$isQueuedForUnload() && !newChunk.bridge$isPersistedChunk())) {
entity.field_70175_ag = false;
} else {
((Chunk)newChunk).func_76612_a(entity);
}
return false;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private boolean redirect$zlk000$impl$returnFalseForChunkLoadedToAvoidIf(World world, int x, int z, boolean allowEmpty) {
return false;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private boolean redirect$zlk000$impl$returnChunkLoadedAlways(World world, int x, int z, boolean allowEmpty) {
return true;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private Chunk redirect$zlk000$impl$returnEmptyChunk(World world, int chunkX, int chunkZ) {
if (this.impl$emptyChunk == null)
this.impl$emptyChunk = new SpongeEmptyChunk(this, 0, 0);
return (Chunk)this.impl$emptyChunk;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private void handler$zlk000$impl$increaseActivatedEntityTicks(Entity entityIn, boolean forceUpdate, CallbackInfo ci) {
TimingHistory.activatedEntityTicks++;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private boolean redirect$zlk000$onAddTileEntity(List<? super TileEntity> list, Object tile) {
if (!bridge$isFake() && !canTileUpdate((TileEntity)tile))
return false;
return list.add((TileEntity)tile);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private boolean canTileUpdate(TileEntity tile) {
TileEntity spongeTile = (TileEntity)tile;
return (spongeTile.getType() == null || ((SpongeTileEntityType)spongeTile.getType()).canTick());
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private void handler$zlk000$onGetPlayerEntityByUUID(@Nullable UUID uuid, CallbackInfoReturnable<UUID> cir) {
if (uuid == null)
cir.setReturnValue(null);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
protected void handler$zlk000$impl$getRawLightWithoutMarkingChunkActive(BlockPos pos, EnumSkyBlock enumSkyBlock, CallbackInfoReturnable<Integer> cir) {
Chunk chunk = func_175726_f(pos);
if (chunk == null || chunk.field_189550_d)
cir.setReturnValue(Integer.valueOf(0));
}
@Overwrite
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public IBlockState func_180495_p(BlockPos pos) {
if (((BlockPosBridge)pos).bridge$isInvalidYPosition())
return Blocks.field_150350_a.func_176223_P();
Chunk chunk = func_175726_f(pos);
return chunk.func_177435_g(pos);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private boolean redirect$zlk000$impl$useInlinedMethodInsteadisoutsideBuildHeight(World world, BlockPos pos) {
return ((BlockPosBridge)pos).bridge$isInvalidYPosition();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private void handler$zlk000$impl$checkForAsync(BlockPos pos, CallbackInfoReturnable<TileEntity> cir) {
if (!bridge$isFake() && !SpongeImpl.getServer().func_152345_ab()) {
cir.setReturnValue(func_175726_f(pos).func_177424_a(pos, Chunk.EnumCreateEntityType.CHECK));
return;
}
if (isTileMarkedForRemoval(pos) && !bridge$isFake()) {
if (PhaseTracker.getInstance().getCurrentState().allowsGettingQueuedRemovedTiles()) {
cir.setReturnValue(getQueuedRemovedTileFromProxy(pos));
return;
}
cir.setReturnValue(null);
}
}
@Nullable
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
TileEntity redirect$zlk000$impl$getTileOrNullIfMarkedForRemoval(Chunk chunk, BlockPos pos, Chunk.EnumCreateEntityType creationMode) {
return chunk.func_177424_a(pos, Chunk.EnumCreateEntityType.IMMEDIATE);
}
@Nullable
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
protected TileEntity getQueuedRemovedTileFromProxy(BlockPos pos) {
return null;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
protected boolean isTileMarkedAsNull(BlockPos pos, @Nullable TileEntity tileentity) {
return false;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
protected boolean isTileMarkedForRemoval(BlockPos pos) {
return false;
}
@Nullable
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
protected TileEntity getProcessingTileFromProxy(BlockPos pos) {
return null;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
protected boolean redirect$zlk000$spongeIsAreaLoadedForCheckingLight(World thisWorld, BlockPos pos, int radius, boolean allowEmtpy, EnumSkyBlock lightType, BlockPos samePosition) {
return func_175648_a(pos, radius, allowEmtpy);
}
@Overwrite
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public boolean func_175701_a(BlockPos pos) {
return ((BlockPosBridge)pos).bridge$isValidPosition();
}
@Overwrite
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public boolean func_189509_E(BlockPos pos) {
return ((BlockPosBridge)pos).bridge$isInvalidYPosition();
}
@Overwrite
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public int func_175642_b(EnumSkyBlock type, BlockPos pos) {
if (pos.func_177956_o() < 0)
pos = new BlockPos(pos.func_177958_n(), 0, pos.func_177952_p());
if (!((BlockPosBridge)pos).bridge$isValidPosition())
return type.field_77198_c;
Chunk chunk = func_175726_f(pos);
return chunk.func_177413_a(type, pos);
}
@Overwrite
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public void func_175653_a(EnumSkyBlock type, BlockPos pos, int lightValue) {
if (((BlockPosBridge)pos).bridge$isValidPosition())
if (func_175667_e(pos)) {
Chunk chunk = func_175726_f(pos);
chunk.func_177431_a(type, pos, lightValue);
func_175679_n(pos);
}
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
protected void handler$zlk000$impl$useWorldServerMethodForAvoidingLookups(int xStart, int yStart, int zStart, int xEnd, int yEnd, int zEnd, boolean allowEmpty, CallbackInfoReturnable<Boolean> cir) {}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public boolean bridge$isAreaLoaded(int xStart, int yStart, int zStart, int xEnd, int yEnd, int zEnd, boolean allowEmpty) {
return func_175663_a(xStart, yStart, zStart, xEnd, yEnd, zEnd, allowEmpty);
}
@Overwrite
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public boolean func_184143_b(AxisAlignedBB bbox) {
List<AxisAlignedBB> list = Lists.newArrayList();
int i = MathHelper.func_76128_c(bbox.field_72340_a) - 1;
int j = MathHelper.func_76143_f(bbox.field_72336_d) + 1;
int k = MathHelper.func_76128_c(bbox.field_72338_b) - 1;
int l = MathHelper.func_76143_f(bbox.field_72337_e) + 1;
int i1 = MathHelper.func_76128_c(bbox.field_72339_c) - 1;
int j1 = MathHelper.func_76143_f(bbox.field_72334_f) + 1;
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
try {
int k1;
for (k1 = i; k1 < j; k1++) {
for (int l1 = i1; l1 < j1; l1++) {
int i2 = ((k1 != i && k1 != j - 1) ? 0 : 1) + ((l1 != i1 && l1 != j1 - 1) ? 0 : 1);
if (i2 != 2 && func_175667_e((BlockPos)blockpos$pooledmutableblockpos.func_181079_c(k1, 64, l1)))
for (int j2 = k; j2 < l; j2++) {
if (i2 <= 0 || (j2 != k && j2 != l - 1)) {
blockpos$pooledmutableblockpos.func_181079_c(k1, j2, l1);
if (!((BlockPosBridge)blockpos$pooledmutableblockpos).bridge$isValidXZPosition())
return true;
IBlockState iblockstate = func_180495_p((BlockPos)blockpos$pooledmutableblockpos);
iblockstate.func_185908_a(this, (BlockPos)blockpos$pooledmutableblockpos, bbox, list, (Entity)null, false);
if (!list.isEmpty())
return true;
}
}
}
}
k1 = 0;
return k1;
} finally {
blockpos$pooledmutableblockpos.func_185344_t();
}
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
void handler$zlk000$impl$startEntityGlobalTimings(CallbackInfo ci) {}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
void handler$zlk000$impl$stopTimingForWeatherEntityTickCrash(CallbackInfo ci, int index, Entity entity, Throwable throwable) {}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
void handler$zlk000$impl$stopEntityTickTiming(CallbackInfo ci) {}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private boolean redirect$zlk000$impl$ReturnFalseUseActiveChunkReferant(Entity entity) {
int l1 = entity.field_70176_ah;
int i2 = entity.field_70164_aj;
Chunk activeChunk = (Chunk)((ActiveChunkReferantBridge)entity).bridge$getActiveChunk();
if (activeChunk == null) {
func_72964_e(l1, i2).func_76622_b(entity);
} else {
activeChunk.func_76622_b(entity);
}
return false;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
void handler$zlk000$impl$stopEntityRemovalTiming(CallbackInfo ci) {}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
protected void handler$zlk000$impl$entityActivationCheck(CallbackInfo ci) {}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
void handler$zlk000$impl$startEntityTickingForTick(CallbackInfo ci) {}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
void handler$zlk000$impl$stopEntityAndThrowInfo(CallbackInfo ci, int index, Entity ticking, @Nullable Entity riding, Throwable throwable) {}
@Surrogate
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
void handler$zlk000$impl$stopEntityAndThrowInfo(CallbackInfo ci, int index, Entity ticking, Throwable throwable) {
handler$zlk000$impl$stopEntityAndThrowInfo(ci, index, ticking, null, throwable);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
void handler$zlk000$impl$startEntityRemovalTiming(CallbackInfo callbackInfo) {}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
void handler$zlk000$impl$stopRemovalTimingAfterentityRemovals(CallbackInfo ci) {}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
protected void handler$zlk000$impl$tileActivationStart(CallbackInfo callbackInfo) {}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
void handler$zlk000$impl$startTileTickTimer(CallbackInfo ci) {}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
void handler$zlk000$impl$stopTileTickCrash(CallbackInfo ci, Iterator<TileEntity> iterator, TileEntity tickingTile, BlockPos pos, Throwable throwable) {}
@Surrogate
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
void handler$zlk000$impl$stopTileTickCrash(CallbackInfo ci, Iterator<TileEntity> iterator, TileEntity tickingTile, Throwable throwable) {}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private boolean redirect$zlk000$impl$checkIfTileHasActiveChunk(TileEntity tileEntity) {
return (tileEntity.func_145830_o() && ((TileEntityBridge)tileEntity).bridge$shouldTick());
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
void handler$zlk000$impl$stopTileTickAndStartRemoval(CallbackInfo callbackInfo) {}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private boolean redirect$zlk000$impl$removeTileFromLoadedList(List<?> loadedTileEntityList, Object tile) {
boolean remove = loadedTileEntityList.remove(tile);
TileEntity tileEntity = (TileEntity)tile;
Chunk activeChunk = (Chunk)((ActiveChunkReferantBridge)tileEntity).bridge$getActiveChunk();
if (activeChunk != null)
if (activeChunk.func_177424_a(tileEntity.func_174877_v(), Chunk.EnumCreateEntityType.CHECK) == tileEntity)
activeChunk.func_177425_e(tileEntity.func_174877_v());
return remove;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private boolean redirect$zlk000$impl$ignoreisBlockLoaded(World self, BlockPos pos) {
return false;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
boolean redirect$zlk000$impl$stopTileRemovalTimingIfHasNext(Iterator<TileEntity> iterator) {
return iterator.hasNext();
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
void handler$zlk000$impl$startPendingBlockEntities(CallbackInfo callbackInfo) {}
@MixinMerged(mixin = "org.spongepowered.common.mixin.core.world.WorldMixin", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
void handler$zlk000$impl$endPendingTileEntities(CallbackInfo ci) {}
@MixinMerged(mixin = "me.jellysquid.mods.phosphor.mixins.lighting.common.MixinWorld", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private void handler$bcl001$onConstructed(CallbackInfo ci) {
this.lightingEngine = new LightingEngine(this);
}
@MixinMerged(mixin = "me.jellysquid.mods.phosphor.mixins.lighting.common.MixinWorld", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private void handler$bcl000$checkLightFor(EnumSkyBlock type, BlockPos pos, CallbackInfoReturnable<Boolean> cir) {
this.lightingEngine.scheduleLightUpdate(type, pos);
cir.setReturnValue(Boolean.valueOf(true));
}
@MixinMerged(mixin = "me.jellysquid.mods.phosphor.mixins.lighting.common.MixinWorld", priority = 1000, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public LightingEngine getLightingEngine() {
return this.lightingEngine;
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.tracking.world.WorldMixin_TrackerAPI", priority = 1111, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Optional getCreator(int x, int y, int z) {
Chunk chunk = ((ChunkProviderBridge)func_72863_F()).bridge$getLoadedChunkWithoutMarkingActive(x >> 4, z >> 4);
if (chunk == null)
return Optional.empty();
BlockPos pos = new BlockPos(x, y, z);
return ((ChunkBridge)chunk).bridge$getBlockOwnerUUID(pos);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.tracking.world.WorldMixin_TrackerAPI", priority = 1111, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public Optional getNotifier(int x, int y, int z) {
Chunk chunk = ((ChunkProviderBridge)func_72863_F()).bridge$getLoadedChunkWithoutMarkingActive(x >> 4, z >> 4);
if (chunk == null)
return Optional.empty();
BlockPos pos = new BlockPos(x, y, z);
return ((ChunkBridge)chunk).bridge$getBlockNotifierUUID(pos);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.tracking.world.WorldMixin_TrackerAPI", priority = 1111, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public void setCreator(int x, int y, int z, @Nullable UUID uuid) {
Chunk chunk = ((ChunkProviderBridge)func_72863_F()).bridge$getLoadedChunkWithoutMarkingActive(x >> 4, z >> 4);
if (chunk == null)
return;
BlockPos pos = new BlockPos(x, y, z);
((ChunkBridge)chunk).bridge$setBlockCreator(pos, uuid);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.tracking.world.WorldMixin_TrackerAPI", priority = 1111, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
public void setNotifier(int x, int y, int z, @Nullable UUID uuid) {
Chunk chunk = ((ChunkProviderBridge)func_72863_F()).bridge$getLoadedChunkWithoutMarkingActive(x >> 4, z >> 4);
if (chunk == null)
return;
BlockPos pos = new BlockPos(x, y, z);
((ChunkBridge)chunk).bridge$setBlockNotifier(pos, uuid);
}
@MixinMerged(mixin = "org.spongepowered.common.mixin.optimization.world.WorldMixin_RayTraceChunkLoadOptimizations", priority = 1500, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private void handler$zof000$checkChunkLoaded(Vec3d vec31, Vec3d vec32, boolean arg2, boolean arg3, boolean arg4, CallbackInfoReturnable<RayTraceResult> cir, int i, int j, int k, int l, int i1, int j1, BlockPos blockpos) {
if (!func_175667_e(blockpos))
cir.setReturnValue(null);
}
@Surrogate
@MixinMerged(mixin = "org.spongepowered.common.mixin.optimization.world.WorldMixin_RayTraceChunkLoadOptimizations", priority = 1500, sessionId = "97ffd46f-35b1-45ae-b439-9cacf3616738")
private void handler$zof000$checkChunkLoaded(Vec3d vec31, Vec3d vec32, boolean stopOnLiquid, boolean ignoreBlockWithoutBoundingBox, boolean returnLastUncollidableBlock, CallbackInfoReturnable<RayTraceResult> cir, int i, int j, int k, int l, int i1, int j1, BlockPos blockpos, IBlockState iblockstate, Block block, RayTraceResult raytraceresult2, int k1, boolean flag2, boolean flag, boolean flag1, double d0, double d1, double d2, double d3, double d4, double d5, double d6, double d7, double d8, EnumFacing enumfacing) {
if (!func_175667_e(blockpos))
cir.setReturnValue(null);
}
protected abstract IChunkProvider func_72970_h();
protected abstract boolean func_175680_a(int paramInt1, int paramInt2, boolean paramBoolean);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment