Fixes all around, Vec3d -> Vector3d

This commit is contained in:
Vincent Lee committed 2020-06-25 19:24:52 -05:00
1 parent 2db83d754f
commit 98b74dc69b
43 files changed
+135 -138

No files matched your search

@@ -18,7 +18,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vector3d;
import net.minecraft.util.registry.Registry;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -95,7 +95,7 @@ public class TileEntityGeneratingFlower extends TileEntitySpecialFlower {
float blue = (color & 0xFF) / 255F;
if (Math.random() > particleChance) {
Vec3d offset = getWorld().getBlockState(getPos()).getOffset(getWorld(), getPos());
Vector3d offset = getWorld().getBlockState(getPos()).getOffset(getWorld(), getPos());
double x = getPos().getX() + offset.x;
double y = getPos().getY() + offset.y;
double z = getPos().getZ() + offset.z;
@@ -205,7 +205,7 @@ public class FXLightning extends Particle {
private float rayTraceResistance(Vector3 start, Vector3 end, float prevresistance) {
// don't have an entity to pass, just use the render view
Entity viewer = Minecraft.getInstance().renderViewEntity;
RayTraceContext ctx = new RayTraceContext(start.toVec3D(), end.toVec3D(), RayTraceContext.BlockMode.OUTLINE, RayTraceContext.FluidMode.NONE, viewer);
RayTraceContext ctx = new RayTraceContext(start.toVector3d(), end.toVector3d(), RayTraceContext.BlockMode.OUTLINE, RayTraceContext.FluidMode.NONE, viewer);
RayTraceResult mop = world.rayTraceBlocks(ctx);
if (mop.getType() == RayTraceResult.Type.BLOCK) {
@@ -22,7 +22,7 @@ import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vector3d;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
@@ -114,7 +114,7 @@ public class FXSparkle extends SpriteTexturedParticle {
// [VanillaCopy] Entity.pushOutOfBlocks with tweaks
private void wiggleAround(double x, double y, double z) {
BlockPos blockpos = new BlockPos(x, y, z);
Vec3d vec3d = new Vec3d(x - (double) blockpos.getX(), y - (double) blockpos.getY(), z - (double) blockpos.getZ());
Vector3d Vector3d = new Vector3d(x - (double) blockpos.getX(), y - (double) blockpos.getY(), z - (double) blockpos.getZ());
BlockPos.Mutable blockpos$mutable = new BlockPos.Mutable();
Direction direction = Direction.UP;
double d0 = Double.MAX_VALUE;
@@ -122,7 +122,7 @@ public class FXSparkle extends SpriteTexturedParticle {
for (Direction direction1 : new Direction[] { Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST, Direction.UP }) {
blockpos$mutable.setPos(blockpos).move(direction1);
if (!this.world.getBlockState(blockpos$mutable).isCollisionShapeOpaque(this.world, blockpos$mutable)) {
double d1 = vec3d.getCoordinate(direction1.getAxis());
double d1 = Vector3d.getCoordinate(direction1.getAxis());
double d2 = direction1.getAxisDirection() == Direction.AxisDirection.POSITIVE ? 1.0D - d1 : d1;
if (d2 < d0) {
d0 = d2;
@@ -20,7 +20,7 @@ import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vector3d;
import net.minecraftforge.client.SkyRenderHandler;
import org.lwjgl.opengl.GL11;
@@ -53,10 +53,10 @@ public class SkyblockSkyRenderer implements SkyRenderHandler {
VertexFormat skyVertexFormat = mc.worldRenderer.skyVertexFormat;
RenderSystem.disableTexture();
Vec3d vec3d = world.getSkyColor(mc.gameRenderer.getActiveRenderInfo().getBlockPos(), partialTicks);
float f = (float) vec3d.x;
float f1 = (float) vec3d.y;
float f2 = (float) vec3d.z;
Vector3d Vector3d = world.getSkyColor(mc.gameRenderer.getActiveRenderInfo().getBlockPos(), partialTicks);
float f = (float) Vector3d.x;
float f1 = (float) Vector3d.y;
float f2 = (float) Vector3d.z;
// Botania - darken in void
float insideVoid = 0;
@@ -13,7 +13,7 @@ import net.minecraft.item.DyeColor;
import net.minecraft.potion.Effect;
import net.minecraft.potion.Effects;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vector3d;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import net.minecraft.world.server.ServerWorld;
@@ -80,7 +80,7 @@ public class BlockModFlower extends FlowerBlock implements IGrowable {
int r = (hex & 0xFF0000) >> 16;
int g = (hex & 0xFF00) >> 8;
int b = hex & 0xFF;
Vec3d offset = state.getOffset(world, pos);
Vector3d offset = state.getOffset(world, pos);
double x = pos.getX() + offset.x;
double y = pos.getY() + offset.y;
double z = pos.getZ() + offset.z;
@@ -23,7 +23,7 @@ import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vector3d;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
@@ -55,7 +55,7 @@ public class BlockSpecialFlower extends FlowerBlock implements ITileEntityProvid
@Nonnull
@Override
public VoxelShape getShape(BlockState state, @Nonnull IBlockReader world, @Nonnull BlockPos pos, ISelectionContext ctx) {
Vec3d shift = state.getOffset(world, pos);
Vector3d shift = state.getOffset(world, pos);
return SHAPE.withOffset(shift.x, shift.y, shift.z);
}
@@ -19,7 +19,7 @@ import net.minecraft.util.ActionResultType;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vector3d;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
@@ -54,7 +54,7 @@ public class BlockTerraPlate extends BlockModWaterloggable implements ITileEntit
ItemStack target = stack.split(1);
ItemEntity item = new ItemEntity(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, target);
item.setPickupDelay(40);
item.setMotion(Vec3d.ZERO);
item.setMotion(Vector3d.ZERO);
world.addEntity(item);
}
@@ -25,7 +25,7 @@ import net.minecraft.potion.Effects;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vector3d;
import net.minecraft.world.Difficulty;
import net.minecraft.world.World;
import net.minecraft.world.server.ServerWorld;
@@ -133,7 +133,7 @@ public class SubTileLoonuim extends TileEntityFunctionalFlower {
}
entity.setPositionAndRotation(x, y, z, world.rand.nextFloat() * 360F, 0);
entity.setMotion(Vec3d.ZERO);
entity.setMotion(Vector3d.ZERO);
Multimap<String, AttributeModifier> map = HashMultimap.create();
map.put(SharedMonsterAttributes.MAX_HEALTH.getName(),
@@ -23,7 +23,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vector3d;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
@@ -86,7 +86,7 @@ public class SubTileRannuncarpus extends TileEntityFunctionalFlower {
if (stackItem instanceof BlockItem || stackItem instanceof IFlowerPlaceable) {
if (!validPositions.isEmpty()) {
BlockPos coords = validPositions.get(getWorld().rand.nextInt(validPositions.size()));
BlockRayTraceResult ray = new BlockRayTraceResult(Vec3d.ZERO, Direction.UP, coords, false);
BlockRayTraceResult ray = new BlockRayTraceResult(Vector3d.ZERO, Direction.UP, coords, false);
BlockItemUseContext ctx = new RannuncarpusPlaceContext(getWorld(), stack, ray);
boolean success = false;
@@ -19,7 +19,7 @@ import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Direction;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vector3d;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.registries.ObjectHolder;
@@ -80,7 +80,7 @@ public class SubTileSpectranthemum extends TileEntityFunctionalFlower {
spawnExplosionParticles(item, 10);
item.setPosition(bindPos.getX() + 0.5, bindPos.getY() + 1.5, bindPos.getZ() + 0.5);
item.getPersistentData().putBoolean(TAG_TELEPORTED, true);
item.setMotion(Vec3d.ZERO);
item.setMotion(Vector3d.ZERO);
spawnExplosionParticles(item, 10);
addMana(-cost);
did = true;
@@ -17,7 +17,7 @@ import net.minecraft.particles.ParticleTypes;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vector3d;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.registries.ObjectHolder;
@@ -51,7 +51,7 @@ public class SubTileEndoflame extends TileEntityGeneratingFlower {
if (getWorld().isRemote) {
if (burnTime > 0 && getWorld().rand.nextInt(10) == 0) {
Vec3d offset = getWorld().getBlockState(getEffectivePos()).getOffset(getWorld(), getEffectivePos()).add(0.4, 0.7, 0.4);
Vector3d offset = getWorld().getBlockState(getEffectivePos()).getOffset(getWorld(), getEffectivePos()).add(0.4, 0.7, 0.4);
getWorld().addParticle(ParticleTypes.FLAME, getEffectivePos().getX() + offset.x + Math.random() * 0.2, getEffectivePos().getY() + offset.y, getEffectivePos().getZ() + offset.z + Math.random() * 0.2, 0.0D, 0.0D, 0.0D);
}
return;
@@ -18,7 +18,7 @@ import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvents;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vector3d;
import net.minecraft.world.server.ServerWorld;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.items.ItemHandlerHelper;
@@ -115,7 +115,7 @@ public class SubTileGourmaryllis extends TileEntityGeneratingFlower {
} else if (cooldown % munchInterval == 0) {
getWorld().playSound(null, getEffectivePos(), SoundEvents.ENTITY_GENERIC_EAT, SoundCategory.BLOCKS, 0.5f, 1);
Vec3d offset = getWorld().getBlockState(getEffectivePos()).getOffset(getWorld(), getEffectivePos()).add(0.4, 0.6, 0.4);
Vector3d offset = getWorld().getBlockState(getEffectivePos()).getOffset(getWorld(), getEffectivePos()).add(0.4, 0.6, 0.4);
((ServerWorld) getWorld()).spawnParticle(new ItemParticleData(ParticleTypes.ITEM, lastFoods.get(0)), getEffectivePos().getX() + offset.x, getEffectivePos().getY() + offset.y, getEffectivePos().getZ() + offset.z, 10, 0.1D, 0.1D, 0.1D, 0.03D);
}
@@ -19,7 +19,7 @@ import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvents;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vector3d;
import net.minecraft.world.World;
import net.minecraft.world.server.ServerWorld;
import net.minecraftforge.registries.ObjectHolder;
@@ -47,7 +47,7 @@ public class SubTileShulkMeNot extends TileEntityGeneratingFlower {
World world = getWorld();
BlockPos pos = getEffectivePos();
Vec3d posD = new Vec3d(pos.getX(), pos.getY(), pos.getZ());
Vector3d posD = new Vector3d(pos.getX(), pos.getY(), pos.getZ());
List<ShulkerEntity> shulkers = world.getEntitiesWithinAABB(ShulkerEntity.class, new AxisAlignedBB(pos).grow(RADIUS));
if (!world.isRemote) {
for (ShulkerEntity shulker : shulkers) {
@@ -16,7 +16,7 @@ import net.minecraft.tileentity.ITickableTileEntity;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Direction;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vector3d;
import net.minecraft.world.World;
import net.minecraftforge.registries.ObjectHolder;
@@ -72,7 +72,7 @@ public class TileOpenCrate extends TileSimpleInventory implements ITickableTileE
public void eject(ItemStack stack, boolean redstone) {
ItemEntity item = new ItemEntity(world, pos.getX() + 0.5, pos.getY() - 0.5, pos.getZ() + 0.5, stack);
item.setMotion(Vec3d.ZERO);
item.setMotion(Vector3d.ZERO);
if (redstone) {
item.age = -200;
}
@@ -22,7 +22,7 @@ import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Hand;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vector3d;
import net.minecraftforge.items.wrapper.RecipeWrapper;
import net.minecraftforge.registries.ObjectHolder;
@@ -83,7 +83,7 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver,
ItemStack toSpawn = player != null && player.abilities.isCreativeMode ? stack.copy().split(1) : stack.split(1);
ItemEntity item = new ItemEntity(world, getPos().getX() + 0.5, getPos().getY() + 1, getPos().getZ() + 0.5, toSpawn);
item.setPickupDelay(40);
item.setMotion(Vec3d.ZERO);
item.setMotion(Vector3d.ZERO);
world.addEntity(item);
}
@@ -28,7 +28,7 @@ public final class MathHelper {
finalVector = finalVector.normalize();
}
entity.setMotion(finalVector.multiply(modifier).toVec3D());
entity.setMotion(finalVector.multiply(modifier).toVector3d());
}
public static int multiplyColor(int c1, int c2) {
@@ -14,7 +14,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vector3d;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -40,7 +40,7 @@ public class Vector3 {
z = d2;
}
public Vector3(Vec3d vec) {
public Vector3(Vector3d vec) {
this(vec.x, vec.y, vec.z);
}
@@ -162,8 +162,8 @@ public class Vector3 {
return new Vector3(d, 0, d1);
}
public Vec3d toVec3D() {
return new Vec3d(x, y, z);
public Vector3d toVector3d() {
return new Vector3d(x, y, z);
}
public double angle(Vector3 vec) {
@@ -8,10 +8,10 @@
*/
package vazkii.botania.common.core.loot;
import net.minecraft.loot.LootEntry;
import net.minecraft.loot.LootPool;
import net.minecraft.loot.TableLootEntry;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.storage.loot.LootEntry;
import net.minecraft.world.storage.loot.LootPool;
import net.minecraft.world.storage.loot.TableLootEntry;
import net.minecraftforge.event.LootTableLoadEvent;
import vazkii.botania.common.lib.LibMisc;
@@ -102,14 +102,14 @@ public class EntityBabylonWeapon extends EntityThrowableCopy {
}
}
Vec3d mot = getMotion();
Vector3d mot = getMotion();
int liveTime = getLiveTicks();
int delay = getDelay();
charging &= liveTime == 0;
if (charging) {
setMotion(Vec3d.ZERO);
setMotion(Vector3d.ZERO);
int chargeTime = getChargeTicks();
setChargeTicks(chargeTime + 1);
@@ -119,7 +119,7 @@ public class EntityBabylonWeapon extends EntityThrowableCopy {
}
} else {
if (liveTime < delay) {
setMotion(Vec3d.ZERO);
setMotion(Vector3d.ZERO);
} else if (liveTime == delay && player != null) {
Vector3 playerLook;
BlockRayTraceResult rtr = ToolCommons.raytraceFromEntity(player, 64, true);
@@ -132,7 +132,7 @@ public class EntityBabylonWeapon extends EntityThrowableCopy {
Vector3 thisVec = Vector3.fromEntityCenter(this);
Vector3 motionVec = playerLook.subtract(thisVec).normalize().multiply(2);
mot = motionVec.toVec3D();
mot = motionVec.toVector3d();
world.playSound(null, getPosX(), getPosY(), getPosZ(), ModSounds.babylonAttack, SoundCategory.PLAYERS, 2F, 0.1F + world.rand.nextFloat() * 3F);
}
setLiveTicks(liveTime + 1);
@@ -17,6 +17,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.TickableSound;
import net.minecraft.entity.*;
import net.minecraft.entity.ai.attributes.Attributes;
import net.minecraft.entity.ai.goal.LookAtGoal;
import net.minecraft.entity.ai.goal.SwimGoal;
import net.minecraft.entity.monster.WitherSkeletonEntity;
@@ -40,14 +41,11 @@ import net.minecraft.potion.EffectType;
import net.minecraft.potion.Effects;
import net.minecraft.tags.Tag;
import net.minecraft.tileentity.BeaconTileEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvents;
import net.minecraft.util.*;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextFormatting;
@@ -158,7 +156,7 @@ public class EntityDoppleganger extends MobEntity implements IEntityAdditionalSp
//check difficulty
if (world.getDifficulty() == Difficulty.PEACEFUL) {
if (!world.isRemote) {
player.sendMessage(new TranslationTextComponent("botaniamisc.peacefulNoob").applyTextStyle(TextFormatting.RED));
player.sendMessage(new TranslationTextComponent("botaniamisc.peacefulNoob").func_240699_a_(TextFormatting.RED), Util.field_240973_b_);
}
return false;
}
@@ -184,7 +182,7 @@ public class EntityDoppleganger extends MobEntity implements IEntityAdditionalSp
PacketHandler.sendTo((ServerPlayerEntity) player,
new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.ARENA_INDICATOR, pos.getX(), pos.getY(), pos.getZ()));
player.sendMessage(new TranslationTextComponent("botaniamisc.badArena").applyTextStyle(TextFormatting.RED));
player.sendMessage(new TranslationTextComponent("botaniamisc.badArena").func_240699_a_(TextFormatting.RED), Util.field_240973_b_);
}
return false;
@@ -204,13 +202,13 @@ public class EntityDoppleganger extends MobEntity implements IEntityAdditionalSp
int playerCount = e.getPlayersAround().size();
e.playerCount = playerCount;
e.getAttributes().getAttributeInstance(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(MAX_HP * playerCount);
e.getAttribute(Attributes.field_233818_a_).setBaseValue(MAX_HP * playerCount);
if (hard) {
e.getAttributes().getAttributeInstance(SharedMonsterAttributes.ARMOR).setBaseValue(15);
e.getAttribute(Attributes.field_233826_i_).setBaseValue(15);
}
e.playSound(SoundEvents.ENTITY_ENDER_DRAGON_GROWL, 10F, 0.1F);
e.onInitialSpawn(world, world.getDifficultyForLocation(new BlockPos(e)), SpawnReason.EVENT, null, null);
e.onInitialSpawn(world, world.getDifficultyForLocation(e.func_233580_cy_()), SpawnReason.EVENT, null, null);
world.addEntity(e);
}
@@ -468,7 +466,7 @@ public class EntityDoppleganger extends MobEntity implements IEntityAdditionalSp
}
PlayerEntity saveLastAttacker = attackingPlayer;
Vec3d savePos = getPositionVec();
Vector3d savePos = getPositionVec();
attackingPlayer = player; // Fake attacking player as the killer
// Spoof pos so drops spawn at the player
@@ -733,7 +731,7 @@ public class EntityDoppleganger extends MobEntity implements IEntityAdditionalSp
if (aggro) {
boolean dying = getHealth() / getMaxHealth() < 0.2;
if (dying && mobSpawnTicks > 0) {
setMotion(Vec3d.ZERO);
setMotion(Vector3d.ZERO);
int reverseTicks = MOB_SPAWN_TICKS - mobSpawnTicks;
if (reverseTicks < MOB_SPAWN_START_TICKS) {
@@ -890,8 +888,8 @@ public class EntityDoppleganger extends MobEntity implements IEntityAdditionalSp
world.addParticle(ParticleTypes.PORTAL, px, py, pz, vx, vy, vz);
}
Vec3d oldPosVec = new Vec3d(oldX, oldY + getHeight() / 2, oldZ);
Vec3d newPosVec = new Vec3d(newX, newY + getHeight() / 2, newZ);
Vector3d oldPosVec = new Vector3d(oldX, oldY + getHeight() / 2, oldZ);
Vector3d newPosVec = new Vector3d(newX, newY + getHeight() / 2, newZ);
if (oldPosVec.squareDistanceTo(newPosVec) > 1) {
//damage players in the path of the teleport
@@ -1044,7 +1042,7 @@ public class EntityDoppleganger extends MobEntity implements IEntityAdditionalSp
@Override
public void tick() {
if (!guardian.isAlive()) {
donePlaying = true;
func_239509_o_();
}
}
}
@@ -18,7 +18,7 @@ import net.minecraft.potion.Effects;
import net.minecraft.util.DamageSource;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.world.World;
import net.minecraftforge.fml.network.NetworkHooks;
@@ -38,7 +38,7 @@ public class EntityMagicLandmine extends Entity {
@Override
public void tick() {
setMotion(Vec3d.ZERO);
setMotion(Vector3d.ZERO);
super.tick();
float range = 2.5F;
@@ -134,7 +134,7 @@ public class EntityMagicMissile extends ThrowableEntity {
Vector3 targetVec = evil ? new Vector3(lockX, lockY, lockZ) : Vector3.fromEntityCenter(target);
Vector3 diffVec = targetVec.subtract(thisVec);
Vector3 motionVec = diffVec.normalize().multiply(evil ? 0.5 : 0.6);
setMotion(motionVec.toVec3D());
setMotion(motionVec.toVector3d());
if (time < 10) {
setMotion(getMotion().getX(), Math.abs(getMotion().getY()), getMotion().getZ());
}
@@ -187,14 +187,14 @@ public class EntityManaBurst extends ThrowableEntity implements IManaBurst {
}
}
Vec3d vec3d = this.getMotion();
double d0 = this.getPosX() + vec3d.x;
double d1 = this.getPosY() + vec3d.y;
double d2 = this.getPosZ() + vec3d.z;
float f = MathHelper.sqrt(horizontalMag(vec3d));
this.rotationYaw = (float) (MathHelper.atan2(vec3d.x, vec3d.z) * (double) (180F / (float) Math.PI));
Vector3d Vector3d = this.getMotion();
double d0 = this.getPosX() + Vector3d.x;
double d1 = this.getPosY() + Vector3d.y;
double d2 = this.getPosZ() + Vector3d.z;
float f = MathHelper.sqrt(horizontalMag(Vector3d));
this.rotationYaw = (float) (MathHelper.atan2(Vector3d.x, Vector3d.z) * (double) (180F / (float) Math.PI));
for (this.rotationPitch = (float) (MathHelper.atan2(vec3d.y, (double) f) * (double) (180F / (float) Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
for (this.rotationPitch = (float) (MathHelper.atan2(Vector3d.y, (double) f) * (double) (180F / (float) Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
;
}
@@ -216,7 +216,7 @@ public class EntityManaBurst extends ThrowableEntity implements IManaBurst {
if (this.isInWater()) {
for (int i = 0; i < 4; ++i) {
float f2 = 0.25F;
this.world.addParticle(ParticleTypes.BUBBLE, d0 - vec3d.x * 0.25D, d1 - vec3d.y * 0.25D, d2 - vec3d.z * 0.25D, vec3d.x, vec3d.y, vec3d.z);
this.world.addParticle(ParticleTypes.BUBBLE, d0 - Vector3d.x * 0.25D, d1 - Vector3d.y * 0.25D, d2 - Vector3d.z * 0.25D, Vector3d.x, Vector3d.y, Vector3d.z);
}
f1 = 0.8F;
@@ -224,10 +224,10 @@ public class EntityManaBurst extends ThrowableEntity implements IManaBurst {
f1 = 0.99F;
}
// Botania - no drag this.setMotion(vec3d.scale((double)f1));
// Botania - no drag this.setMotion(Vector3d.scale((double)f1));
if (!this.hasNoGravity()) {
Vec3d vec3d1 = this.getMotion();
this.setMotion(vec3d1.x, vec3d1.y - (double) this.getGravityVelocity(), vec3d1.z);
Vector3d Vector3d1 = this.getMotion();
this.setMotion(Vector3d1.x, Vector3d1.y - (double) this.getGravityVelocity(), Vector3d1.z);
}
this.setPosition(d0, d1, d2);
@@ -32,7 +32,7 @@ import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.EntityRayTraceResult;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vector3d;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -85,7 +85,7 @@ public class EntityThornChakram extends ThrowableEntity implements IRendersAsIte
@Override
public void tick() {
// Standard motion
Vec3d old = getMotion();
Vector3d old = getMotion();
super.tick();
@@ -101,7 +101,7 @@ public class EntityThornChakram extends ThrowableEntity implements IRendersAsIte
Entity thrower = getThrower();
if (thrower != null) {
Vector3 motion = Vector3.fromEntityCenter(thrower).subtract(Vector3.fromEntityCenter(this)).normalize();
setMotion(motion.toVec3D());
setMotion(motion.toVector3d());
}
}
@@ -162,7 +162,7 @@ public class EntityThornChakram extends ThrowableEntity implements IRendersAsIte
Vector3 normalVector = new Vector3(dir.getXOffset(), dir.getYOffset(), dir.getZOffset()).normalize();
Vector3 movementVec = normalVector.multiply(-2 * currentMovementVec.dotProduct(normalVector)).add(currentMovementVec);
setMotion(movementVec.toVec3D());
setMotion(movementVec.toVector3d());
bounced = true;
if (!world.isRemote) {
@@ -77,19 +77,19 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile
float f1 = -MathHelper.sin((p_184538_2_ + p_184538_4_) * ((float) Math.PI / 180F));
float f2 = MathHelper.cos(p_184538_3_ * ((float) Math.PI / 180F)) * MathHelper.cos(p_184538_2_ * ((float) Math.PI / 180F));
this.shoot((double) f, (double) f1, (double) f2, p_184538_5_, p_184538_6_);
Vec3d vec3d = p_184538_1_.getMotion();
this.setMotion(this.getMotion().add(vec3d.x, p_184538_1_.onGround ? 0.0D : vec3d.y, vec3d.z));
Vector3d Vector3d = p_184538_1_.getMotion();
this.setMotion(this.getMotion().add(Vector3d.x, p_184538_1_.onGround ? 0.0D : Vector3d.y, Vector3d.z));
}
/**
* Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction.
*/
public void shoot(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, float p_70186_8_) {
Vec3d vec3d = (new Vec3d(p_70186_1_, p_70186_3_, p_70186_5_)).normalize().add(this.rand.nextGaussian() * (double) 0.0075F * (double) p_70186_8_, this.rand.nextGaussian() * (double) 0.0075F * (double) p_70186_8_, this.rand.nextGaussian() * (double) 0.0075F * (double) p_70186_8_).scale((double) p_70186_7_);
this.setMotion(vec3d);
float f = MathHelper.sqrt(horizontalMag(vec3d));
this.rotationYaw = (float) (MathHelper.atan2(vec3d.x, vec3d.z) * (double) (180F / (float) Math.PI));
this.rotationPitch = (float) (MathHelper.atan2(vec3d.y, (double) f) * (double) (180F / (float) Math.PI));
Vector3d Vector3d = (new Vector3d(p_70186_1_, p_70186_3_, p_70186_5_)).normalize().add(this.rand.nextGaussian() * (double) 0.0075F * (double) p_70186_8_, this.rand.nextGaussian() * (double) 0.0075F * (double) p_70186_8_, this.rand.nextGaussian() * (double) 0.0075F * (double) p_70186_8_).scale((double) p_70186_7_);
this.setMotion(Vector3d);
float f = MathHelper.sqrt(horizontalMag(Vector3d));
this.rotationYaw = (float) (MathHelper.atan2(Vector3d.x, Vector3d.z) * (double) (180F / (float) Math.PI));
this.rotationPitch = (float) (MathHelper.atan2(Vector3d.y, (double) f) * (double) (180F / (float) Math.PI));
this.prevRotationYaw = this.rotationYaw;
this.prevRotationPitch = this.rotationPitch;
}
@@ -156,14 +156,14 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile
}
}
Vec3d vec3d = this.getMotion();
double d0 = this.getPosX() + vec3d.x;
double d1 = this.getPosY() + vec3d.y;
double d2 = this.getPosZ() + vec3d.z;
float f = MathHelper.sqrt(horizontalMag(vec3d));
this.rotationYaw = (float) (MathHelper.atan2(vec3d.x, vec3d.z) * (double) (180F / (float) Math.PI));
Vector3d Vector3d = this.getMotion();
double d0 = this.getPosX() + Vector3d.x;
double d1 = this.getPosY() + Vector3d.y;
double d2 = this.getPosZ() + Vector3d.z;
float f = MathHelper.sqrt(horizontalMag(Vector3d));
this.rotationYaw = (float) (MathHelper.atan2(Vector3d.x, Vector3d.z) * (double) (180F / (float) Math.PI));
for (this.rotationPitch = (float) (MathHelper.atan2(vec3d.y, (double) f) * (double) (180F / (float) Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
for (this.rotationPitch = (float) (MathHelper.atan2(Vector3d.y, (double) f) * (double) (180F / (float) Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
;
}
@@ -185,7 +185,7 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile
if (this.isInWater()) {
for (int i = 0; i < 4; ++i) {
float f2 = 0.25F;
this.world.addParticle(ParticleTypes.BUBBLE, d0 - vec3d.x * 0.25D, d1 - vec3d.y * 0.25D, d2 - vec3d.z * 0.25D, vec3d.x, vec3d.y, vec3d.z);
this.world.addParticle(ParticleTypes.BUBBLE, d0 - Vector3d.x * 0.25D, d1 - Vector3d.y * 0.25D, d2 - Vector3d.z * 0.25D, Vector3d.x, Vector3d.y, Vector3d.z);
}
f1 = 0.8F;
@@ -193,10 +193,10 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile
f1 = 0.99F;
}
this.setMotion(vec3d.scale((double) f1));
this.setMotion(Vector3d.scale((double) f1));
if (!this.hasNoGravity()) {
Vec3d vec3d1 = this.getMotion();
this.setMotion(vec3d1.x, vec3d1.y - (double) this.getGravityVelocity(), vec3d1.z);
Vector3d Vector3d1 = this.getMotion();
this.setMotion(Vector3d1.x, Vector3d1.y - (double) this.getGravityVelocity(), Vector3d1.z);
}
this.setPosition(d0, d1, d2);
@@ -54,8 +54,8 @@ public class EntityThrownItem extends ItemEntity {
@Override
public void tick() {
super.tick();
Vec3d vec3 = getPositionVec();
Vec3d vec31 = getPositionVec().add(getMotion());
Vector3d vec3 = getPositionVec();
Vector3d vec31 = getPositionVec().add(getMotion());
RayTraceResult ray = world.rayTraceBlocks(new RayTraceContext(vec3, vec31,
RayTraceContext.BlockMode.COLLIDER, RayTraceContext.FluidMode.NONE, this));
@@ -69,7 +69,7 @@ public class EntityThrownItem extends ItemEntity {
if (entity1.canBeCollidedWith() && (!(entity1 instanceof PlayerEntity) || pickupDelay == 0)) {
float f = 1.0F;
AxisAlignedBB axisalignedbb = entity1.getBoundingBox().grow(f);
Optional<Vec3d> ray1 = axisalignedbb.rayTrace(vec3, vec31);
Optional<Vector3d> ray1 = axisalignedbb.rayTrace(vec3, vec31);
if (ray1.isPresent()) {
double d1 = vec3.distanceTo(ray1.get());
@@ -34,7 +34,7 @@ import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vector3d;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.TranslationTextComponent;
@@ -204,7 +204,7 @@ public class ItemCraftingHalo extends Item {
return;
}
Vec3d lookVec3 = player.getLookVec();
Vector3d lookVec3 = player.getLookVec();
Vector3 centerVector = Vector3.fromEntityCenter(player).add(lookVec3.x * 3, 1.3, lookVec3.z * 3);
float m = 0.1F;
for (int i = 0; i < 4; i++) {
@@ -277,9 +277,9 @@ public class ItemTwigWand extends Item implements ICoordBoundItem {
}
public static void doParticleBeamWithOffset(World world, BlockPos orig, BlockPos end) {
Vec3d origOffset = world.getBlockState(orig).getOffset(world, orig);
Vector3d origOffset = world.getBlockState(orig).getOffset(world, orig);
Vector3 vorig = new Vector3(orig.getX() + origOffset.getX() + 0.5, orig.getY() + origOffset.getY() + 0.5, orig.getZ() + origOffset.getZ() + 0.5);
Vec3d endOffset = world.getBlockState(end).getOffset(world, end);
Vector3d endOffset = world.getBlockState(end).getOffset(world, end);
Vector3 vend = new Vector3(end.getX() + endOffset.getX() + 0.5, end.getY() + endOffset.getY() + 0.5, end.getZ() + endOffset.getZ() + 0.5);
doParticleBeam(world, vorig, vend);
}
@@ -113,7 +113,7 @@ public class ItemDodgeRing extends ItemBauble {
Vector3 lookVec = new Vector3(x, 0, z);
Vector3 sideVec = lookVec.crossProduct(new Vector3(0, dir == Direction.WEST || dir == Direction.NORTH ? 1 : (dir == Direction.EAST || dir == Direction.SOUTH ? -1 : 0), 0)).multiply(1.25);
player.setMotion(sideVec.toVec3D());
player.setMotion(sideVec.toVector3d());
PacketHandler.sendToServer(new PacketDodge());
}
@@ -27,7 +27,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vector3d;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.world.World;
@@ -273,7 +273,7 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem {
ItemNBTHelper.setBoolean(stack, TAG_BOOST_PENDING, true);
} else if (cooldown > 0) {
if (ItemNBTHelper.getBoolean(stack, TAG_BOOST_PENDING, false)) {
player.moveRelative(5F, new Vec3d(0F, 0F, 1F));
player.moveRelative(5F, new Vector3d(0F, 0F, 1F));
ItemNBTHelper.removeEntry(stack, TAG_BOOST_PENDING);
}
ItemNBTHelper.setInt(stack, TAG_DASH_COOLDOWN, cooldown - 2);
@@ -19,7 +19,7 @@ import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vector3d;
import net.minecraft.world.Explosion;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -43,7 +43,7 @@ public class ItemGoddessCharm extends ItemBauble implements IManaUsingItem {
public static void onExplosion(ExplosionEvent.Detonate event) {
Explosion e = event.getExplosion();
Vec3d vec = e.getPosition();
Vector3d vec = e.getPosition();
List<PlayerEntity> players = event.getWorld().getEntitiesWithinAABB(PlayerEntity.class, new AxisAlignedBB(vec.x, vec.y, vec.z, vec.x, vec.y, vec.z).grow(8));
for (PlayerEntity player : players) {
@@ -18,7 +18,7 @@ import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vector3d;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.MinecraftForge;
@@ -78,7 +78,7 @@ public class ItemTravelBelt extends ItemBauble implements IManaUsingItem {
if (player.world.isRemote) {
if ((player.onGround || player.abilities.isFlying) && player.moveForward > 0F && !player.isInWaterOrBubbleColumn()) {
float speed = beltItem.getSpeed(belt);
player.moveRelative(player.abilities.isFlying ? speed : speed, new Vec3d(0, 0, 1));
player.moveRelative(player.abilities.isFlying ? speed : speed, new Vector3d(0, 0, 1));
beltItem.onMovedTick(belt, player);
if (player.ticksExisted % COST_INTERVAL == 0) {
@@ -50,7 +50,7 @@ public class ItemStarSword extends ItemManasteelSword {
EntityFallingStar star = new EntityFallingStar(player, world);
star.setPosition(posVec.x, posVec.y, posVec.z);
star.setMotion(motVec.toVec3D());
star.setMotion(motVec.toVector3d());
world.addEntity(star);
if (!world.isRaining()
@@ -166,9 +166,9 @@ public final class ToolCommons {
// [VanillaCopy] Exact Entity.func_213324_a but available serverside, partialTicks fixed to 1, and narrowed return type
public static BlockRayTraceResult raytraceFromEntity(Entity e, double distance, boolean fluids) {
Vec3d vec3d = e.getEyePosition(1);
Vec3d vec3d1 = e.getLook(1);
Vec3d vec3d2 = vec3d.add(vec3d1.x * distance, vec3d1.y * distance, vec3d1.z * distance);
return e.world.rayTraceBlocks(new RayTraceContext(vec3d, vec3d2, RayTraceContext.BlockMode.OUTLINE, fluids ? RayTraceContext.FluidMode.ANY : RayTraceContext.FluidMode.NONE, e));
Vector3d Vector3d = e.getEyePosition(1);
Vector3d Vector3d1 = e.getLook(1);
Vector3d Vector3d2 = Vector3d.add(Vector3d1.x * distance, Vector3d1.y * distance, Vector3d1.z * distance);
return e.world.rayTraceBlocks(new RayTraceContext(Vector3d, Vector3d2, RayTraceContext.BlockMode.OUTLINE, fluids ? RayTraceContext.FluidMode.ANY : RayTraceContext.FluidMode.NONE, e));
}
}
@@ -111,8 +111,8 @@ public class ItemLokiRing extends ItemRelicBauble implements IWireframeCoordinat
for (BlockPos cursor : cursors) {
BlockPos pos = hit.add(cursor);
if (ManaItemHandler.instance().requestManaExact(lokiRing, player, cost, false)) {
Vec3d lookHit = lookPos.getHitVec();
Vec3d newHitVec = new Vec3d(pos.getX() + MathHelper.frac(lookHit.getX()), pos.getY() + MathHelper.frac(lookHit.getY()), pos.getZ() + MathHelper.frac(lookHit.getZ()));
Vector3d lookHit = lookPos.getHitVec();
Vector3d newHitVec = new Vector3d(pos.getX() + MathHelper.frac(lookHit.getX()), pos.getY() + MathHelper.frac(lookHit.getY()), pos.getZ() + MathHelper.frac(lookHit.getZ()));
BlockRayTraceResult newHit = new BlockRayTraceResult(newHitVec, lookPos.getFace(), pos, false);
ItemUseContext ctx = new ItemUseContext(player, event.getHand(), newHit);
@@ -241,7 +241,7 @@ public class ItemGravityRod extends Item implements IManaUsingItem {
}
item.remove();
} else {
item.setMotion(moveVector.multiply(3, 1.5, 3).toVec3D());
item.setMotion(moveVector.multiply(3, 1.5, 3).toVector3d());
}
ItemNBTHelper.setInt(stack, TAG_TICKS_COOLDOWN, 10);
}
@@ -21,7 +21,7 @@ import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vector3d;
import net.minecraft.world.World;
import vazkii.botania.api.item.IAvatarTile;
@@ -181,7 +181,7 @@ public class ItemRainbowRod extends Item implements IManaUsingItem, IAvatarWield
int ex = px + i - diff;
int ez = pz + j - diff;
if (!axis.contains(new Vec3d(ex + 0.5, py + 1, ez + 0.5))) {
if (!axis.contains(new Vector3d(ex + 0.5, py + 1, ez + 0.5))) {
continue;
}
BlockPos pos = new BlockPos(ex, py, ez);
@@ -49,7 +49,7 @@ public class ItemSkyDirtRod extends ItemDirtRod {
if (entities == 0) {
ItemStack stackToPlace = new ItemStack(Blocks.DIRT);
BlockRayTraceResult hit = new BlockRayTraceResult(Vec3d.ZERO, Direction.DOWN, new BlockPos(x, y, z), false);
BlockRayTraceResult hit = new BlockRayTraceResult(Vector3d.ZERO, Direction.DOWN, new BlockPos(x, y, z), false);
PlayerHelper.substituteUse(new ItemUseContext(player, hand, hit), stackToPlace);
if (stackToPlace.isEmpty()) {
@@ -19,7 +19,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vector3d;
import net.minecraft.world.World;
import vazkii.botania.api.item.IAvatarTile;
@@ -71,8 +71,8 @@ public class ItemTornadoRod extends Item implements IManaUsingItem, IAvatarWield
if (held) {
player.fallDistance = 0F;
double my = IManaProficiencyArmor.hasProficiency(player, stack) ? 1.6 : 1.25;
Vec3d oldMot = player.getMotion();
player.setMotion(new Vec3d(oldMot.getX(), my, oldMot.getZ()));
Vector3d oldMot = player.getMotion();
player.setMotion(new Vector3d(oldMot.getX(), my, oldMot.getZ()));
player.playSound(ModSounds.airRod, 0.1F, 0.25F);
for (int i = 0; i < 5; i++) {
@@ -12,7 +12,6 @@ import com.google.common.collect.ImmutableSet;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.ChunkGeneratorType;
import net.minecraft.world.gen.GenerationStage;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.placement.IPlacementConfig;
@@ -8,9 +8,9 @@
*/
package vazkii.botania.common.world;
import com.mojang.datafixers.Dynamic;
import com.mojang.datafixers.types.DynamicOps;
import com.mojang.serialization.Dynamic;
import com.mojang.serialization.DynamicOps;
import net.minecraft.world.gen.feature.IFeatureConfig;
import vazkii.botania.common.core.handler.ConfigHandler;
@@ -8,16 +8,16 @@
*/
package vazkii.botania.common.world;
import com.mojang.datafixers.Dynamic;
import com.mojang.serialization.Dynamic;
import net.minecraft.block.BlockState;
import net.minecraft.item.DyeColor;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.IWorld;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.structure.StructureManager;
import vazkii.botania.api.item.IFlowerlessBiome;
import vazkii.botania.api.item.IFlowerlessWorld;
import vazkii.botania.common.block.ModBlocks;
@@ -33,7 +33,7 @@ public class MysticalMushroomFeature extends Feature<MysticalFlowerConfig> {
}
@Override
public boolean place(@Nonnull IWorld world, @Nonnull ChunkGenerator<? extends GenerationSettings> generator, @Nonnull Random rand, @Nonnull BlockPos pos, @Nonnull MysticalFlowerConfig config) {
public boolean func_230362_a_(ISeedReader world, StructureManager structureManager, ChunkGenerator generator, Random rand, BlockPos pos, MysticalFlowerConfig config) {
boolean spawn = true;
if (world.getDimension() instanceof IFlowerlessWorld) {
spawn = ((IFlowerlessWorld) world.getDimension()).generateFlowers(world);
@@ -24,7 +24,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.World;
import net.minecraft.world.dimension.DimensionType;
import net.minecraft.world.server.ServerWorld;
import net.minecraftforge.event.LootTableLoadEvent;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
@@ -60,13 +60,13 @@ public final class SkyblockWorldEvents {
CompoundNBT persist = data.getCompound(PlayerEntity.PERSISTED_NBT_TAG);
if (player.ticksExisted > 3 && !persist.getBoolean(TAG_MADE_ISLAND)) {
World overworld = ServerLifecycleHooks.getCurrentServer().getWorld(DimensionType.OVERWORLD);
World world = player.world;
World overworld = ServerLifecycleHooks.getCurrentServer().getWorld(World.field_234918_g_);
ServerWorld world = (ServerWorld) player.world;
if (WorldTypeSkyblock.isWorldSkyblock(world)) {
BlockPos coords = world.getSpawnPoint();
BlockPos coords = world.func_241135_u_();
if (coords.getY() <= 0) {
coords = new BlockPos(coords.getX(), 64, coords.getZ());
world.setSpawnPoint(coords);
world.func_241124_a__(coords);
}
if (world.getBlockState(coords.down(4)).getBlock() != Blocks.BEDROCK && world == overworld) {
spawnPlayer(player, coords, false);
@@ -87,7 +87,7 @@ public final class SkyblockWorldEvents {
BlockState state = event.getWorld().getBlockState(event.getPos());
Block block = state.getBlock();
if (ModTags.Blocks.PEBBLE_SOURCES.contains(block)) {
if (ModTags.Blocks.PEBBLE_SOURCES.func_230235_a_(block)) {
SoundType st = state.getSoundType(event.getWorld(), event.getPos(), player);
player.playSound(st.getBreakSound(), st.getVolume() * 0.4F, st.getPitch() + (float) (Math.random() * 0.2 - 0.1));
@@ -146,7 +146,7 @@ public final class SkyblockWorldEvents {
if (player instanceof ServerPlayerEntity) {
ServerPlayerEntity pmp = (ServerPlayerEntity) player;
pmp.setPositionAndUpdate(pos.getX() + 0.5, pos.getY() + 1.6, pos.getZ() + 0.5);
pmp.setSpawnPoint(pos, true, false, player.world.getDimension().getType());
pmp.func_241153_a_(pmp.world.func_234923_W_(), pos, true, false);
if (ConfigHandler.COMMON.gogSpawnWithLexicon.get()) {
player.inventory.addItemStackToInventory(new ItemStack(ModItems.lexicon));
}