Updated some API calls
This commit is contained in:
parent
f076a91da1
commit
6713e03088
14 changed files with 58 additions and 57 deletions
|
@ -78,9 +78,11 @@ public class BetterEnd implements ModInitializer {
|
||||||
EndStructures.addBiomeStructures(biomeID, biome);
|
EndStructures.addBiomeStructures(biomeID, biome);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (RUNS_TRINKETS) {
|
|
||||||
org.betterx.betterend.integration.trinkets.Elytra.register();
|
//TODO: 1.20 Re-enable when Trinkets is back
|
||||||
}
|
// if (RUNS_TRINKETS) {
|
||||||
|
// org.betterx.betterend.integration.trinkets.Elytra.register();
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ResourceLocation makeID(String path) {
|
public static ResourceLocation makeID(String path) {
|
||||||
|
|
|
@ -3,7 +3,7 @@ package org.betterx.betterend.advancements;
|
||||||
import org.betterx.betterend.BetterEnd;
|
import org.betterx.betterend.BetterEnd;
|
||||||
|
|
||||||
import net.minecraft.advancements.CriteriaTriggers;
|
import net.minecraft.advancements.CriteriaTriggers;
|
||||||
import net.minecraft.advancements.critereon.EntityPredicate;
|
import net.minecraft.advancements.critereon.ContextAwarePredicate;
|
||||||
import net.minecraft.advancements.critereon.PlayerTrigger;
|
import net.minecraft.advancements.critereon.PlayerTrigger;
|
||||||
|
|
||||||
public class BECriteria {
|
public class BECriteria {
|
||||||
|
@ -23,15 +23,15 @@ public class BECriteria {
|
||||||
|
|
||||||
PORTAL_ON_TRIGGER = new PlayerTrigger.TriggerInstance(
|
PORTAL_ON_TRIGGER = new PlayerTrigger.TriggerInstance(
|
||||||
PORTAL_ON.getId(),
|
PORTAL_ON.getId(),
|
||||||
EntityPredicate.Composite.ANY
|
ContextAwarePredicate.ANY
|
||||||
);
|
);
|
||||||
PORTAL_TRAVEL_TRIGGER = new PlayerTrigger.TriggerInstance(
|
PORTAL_TRAVEL_TRIGGER = new PlayerTrigger.TriggerInstance(
|
||||||
PORTAL_TRAVEL.getId(),
|
PORTAL_TRAVEL.getId(),
|
||||||
EntityPredicate.Composite.ANY
|
ContextAwarePredicate.ANY
|
||||||
);
|
);
|
||||||
INFUSION_FINISHED_TRIGGER = new PlayerTrigger.TriggerInstance(
|
INFUSION_FINISHED_TRIGGER = new PlayerTrigger.TriggerInstance(
|
||||||
INFUSION_FINISHED.getId(),
|
INFUSION_FINISHED.getId(),
|
||||||
EntityPredicate.Composite.ANY
|
ContextAwarePredicate.ANY
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,12 +29,8 @@ public class BuddingSmaragdantCrystalBlock extends LitPillarBlock implements Beh
|
||||||
.strength(1F)
|
.strength(1F)
|
||||||
.noOcclusion()
|
.noOcclusion()
|
||||||
.sound(SoundType.AMETHYST)
|
.sound(SoundType.AMETHYST)
|
||||||
.randomTicks());
|
.randomTicks()
|
||||||
}
|
.pushReaction(PushReaction.DESTROY));
|
||||||
|
|
||||||
@Override
|
|
||||||
public PushReaction getPistonPushReaction(BlockState blockState) {
|
|
||||||
return PushReaction.DESTROY;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -139,7 +139,9 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
|
||||||
@Override
|
@Override
|
||||||
public void setItem(int slot, ItemStack stack) {
|
public void setItem(int slot, ItemStack stack) {
|
||||||
ItemStack itemStack = inventory.get(slot);
|
ItemStack itemStack = inventory.get(slot);
|
||||||
boolean stackValid = !stack.isEmpty() && stack.sameItem(itemStack) && ItemStack.tagMatches(stack, itemStack);
|
boolean stackValid = !stack.isEmpty()
|
||||||
|
&& ItemStack.isSameItem(stack, itemStack)
|
||||||
|
&& ItemStack.isSameItemSameTags(stack, itemStack);
|
||||||
inventory.set(slot, stack);
|
inventory.set(slot, stack);
|
||||||
if (stack.getCount() > getMaxStackSize()) {
|
if (stack.getCount() > getMaxStackSize()) {
|
||||||
stack.setCount(getMaxStackSize());
|
stack.setCount(getMaxStackSize());
|
||||||
|
@ -174,10 +176,10 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
|
||||||
level.getRecipeManager().byKey(entry.getKey()).ifPresent((recipe) -> {
|
level.getRecipeManager().byKey(entry.getKey()).ifPresent((recipe) -> {
|
||||||
list.add(recipe);
|
list.add(recipe);
|
||||||
if (recipe instanceof AlloyingRecipe alloying) {
|
if (recipe instanceof AlloyingRecipe alloying) {
|
||||||
dropExperience(player.level, player.position(), entry.getIntValue(), alloying.getExperience());
|
dropExperience(player.level(), player.position(), entry.getIntValue(), alloying.getExperience());
|
||||||
} else {
|
} else {
|
||||||
BlastingRecipe blasting = (BlastingRecipe) recipe;
|
BlastingRecipe blasting = (BlastingRecipe) recipe;
|
||||||
dropExperience(player.level, player.position(), entry.getIntValue(), blasting.getExperience());
|
dropExperience(player.level(), player.position(), entry.getIntValue(), blasting.getExperience());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -320,7 +322,7 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
|
||||||
if (output.isEmpty()) {
|
if (output.isEmpty()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!output.sameItem(result)) {
|
if (!ItemStack.isSameItem(output, result)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (outCount < getMaxStackSize() && outCount < output.getMaxStackSize()) {
|
if (outCount < getMaxStackSize() && outCount < output.getMaxStackSize()) {
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class ColoredMaterial {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Block getByColor(DyeColor color) {
|
public Block getByColor(DyeColor color) {
|
||||||
return colors.get(color.getMaterialColor().col);
|
return colors.get(color.getMapColor().col);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Block getByColor(int color) {
|
public Block getByColor(int color) {
|
||||||
|
@ -69,7 +69,7 @@ public class ColoredMaterial {
|
||||||
|
|
||||||
static {
|
static {
|
||||||
for (DyeColor color : DyeColor.values()) {
|
for (DyeColor color : DyeColor.values()) {
|
||||||
int colorRGB = color.getMaterialColor().col;
|
int colorRGB = color.getMapColor().col;
|
||||||
COLORS.put(colorRGB, color.getName());
|
COLORS.put(colorRGB, color.getName());
|
||||||
DYES.put(colorRGB, DyeItem.byColor(color));
|
DYES.put(colorRGB, DyeItem.byColor(color));
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,8 +130,8 @@ public class CubozoaEntity extends AbstractSchoolingFish {
|
||||||
protected void dropFromLootTable(DamageSource source, boolean causedByPlayer) {
|
protected void dropFromLootTable(DamageSource source, boolean causedByPlayer) {
|
||||||
int count = random.nextInt(3);
|
int count = random.nextInt(3);
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
ItemEntity drop = new ItemEntity(level, getX(), getY(), getZ(), new ItemStack(EndItems.GELATINE, count));
|
ItemEntity drop = new ItemEntity(level(), getX(), getY(), getZ(), new ItemStack(EndItems.GELATINE, count));
|
||||||
this.level.addFreshEntity(drop);
|
this.level().addFreshEntity(drop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,7 @@ public class DragonflyEntity extends DespawnableAnimal implements FlyingAnimal {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isFlying() {
|
public boolean isFlying() {
|
||||||
return !this.onGround;
|
return !this.onGround();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -163,7 +163,7 @@ public class DragonflyEntity extends DespawnableAnimal implements FlyingAnimal {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Vec3 getRandomLocation() {
|
private Vec3 getRandomLocation() {
|
||||||
int h = BlocksHelper.downRay(DragonflyEntity.this.level, DragonflyEntity.this.blockPosition(), 16);
|
int h = BlocksHelper.downRay(DragonflyEntity.this.level(), DragonflyEntity.this.blockPosition(), 16);
|
||||||
Vec3 rotation = DragonflyEntity.this.getViewVector(0.0F);
|
Vec3 rotation = DragonflyEntity.this.getViewVector(0.0F);
|
||||||
Vec3 airPos = HoverRandomPos.getPos(DragonflyEntity.this, 8, 7, rotation.x, rotation.z, 1.5707964F, 3, 1);
|
Vec3 airPos = HoverRandomPos.getPos(DragonflyEntity.this, 8, 7, rotation.x, rotation.z, 1.5707964F, 3, 1);
|
||||||
if (airPos != null) {
|
if (airPos != null) {
|
||||||
|
@ -203,7 +203,7 @@ public class DragonflyEntity extends DespawnableAnimal implements FlyingAnimal {
|
||||||
|
|
||||||
private boolean isInVoid(Vec3 pos) {
|
private boolean isInVoid(Vec3 pos) {
|
||||||
int h = BlocksHelper.downRay(
|
int h = BlocksHelper.downRay(
|
||||||
DragonflyEntity.this.level,
|
DragonflyEntity.this.level(),
|
||||||
new BlockPos((int) pos.x, (int) pos.y, (int) pos.z),
|
new BlockPos((int) pos.x, (int) pos.y, (int) pos.z),
|
||||||
128
|
128
|
||||||
);
|
);
|
||||||
|
|
|
@ -137,7 +137,7 @@ public class EndFishEntity extends AbstractSchoolingFish {
|
||||||
double x = getX() + random.nextGaussian() * 0.2;
|
double x = getX() + random.nextGaussian() * 0.2;
|
||||||
double y = getY() + random.nextGaussian() * 0.2;
|
double y = getY() + random.nextGaussian() * 0.2;
|
||||||
double z = getZ() + random.nextGaussian() * 0.2;
|
double z = getZ() + random.nextGaussian() * 0.2;
|
||||||
level.addParticle(ParticleTypes.BUBBLE, x, y, z, 0, 0, 0);
|
level().addParticle(ParticleTypes.BUBBLE, x, y, z, 0, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ public class EndFishEntity extends AbstractSchoolingFish {
|
||||||
item = EndItems.END_FISH_COOKED;
|
item = EndItems.END_FISH_COOKED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ItemEntity drop = new ItemEntity(level, getX(), getY(), getZ(), new ItemStack(item));
|
ItemEntity drop = new ItemEntity(level(), getX(), getY(), getZ(), new ItemStack(item));
|
||||||
this.level.addFreshEntity(drop);
|
this.level().addFreshEntity(drop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,7 +134,7 @@ public class EndSlimeEntity extends Slime {
|
||||||
@Override
|
@Override
|
||||||
public void remove(RemovalReason reason) {
|
public void remove(RemovalReason reason) {
|
||||||
int i = this.getSize();
|
int i = this.getSize();
|
||||||
if (!this.level.isClientSide && i > 1 && this.isDeadOrDying()) {
|
if (!this.level().isClientSide && i > 1 && this.isDeadOrDying()) {
|
||||||
Component text = this.getCustomName();
|
Component text = this.getCustomName();
|
||||||
boolean bl = this.isNoAi();
|
boolean bl = this.isNoAi();
|
||||||
float f = (float) i / 4.0F;
|
float f = (float) i / 4.0F;
|
||||||
|
@ -145,7 +145,7 @@ public class EndSlimeEntity extends Slime {
|
||||||
for (int l = 0; l < k; ++l) {
|
for (int l = 0; l < k; ++l) {
|
||||||
float g = ((float) (l % 2) - 0.5F) * f;
|
float g = ((float) (l % 2) - 0.5F) * f;
|
||||||
float h = ((float) (l / 2) - 0.5F) * f;
|
float h = ((float) (l / 2) - 0.5F) * f;
|
||||||
EndSlimeEntity slimeEntity = (EndSlimeEntity) this.getType().create(this.level);
|
EndSlimeEntity slimeEntity = (EndSlimeEntity) this.getType().create(this.level());
|
||||||
if (this.isPersistenceRequired()) {
|
if (this.isPersistenceRequired()) {
|
||||||
slimeEntity.setPersistenceRequired();
|
slimeEntity.setPersistenceRequired();
|
||||||
}
|
}
|
||||||
|
@ -163,7 +163,7 @@ public class EndSlimeEntity extends Slime {
|
||||||
this.random.nextFloat() * 360.0F,
|
this.random.nextFloat() * 360.0F,
|
||||||
0.0F
|
0.0F
|
||||||
);
|
);
|
||||||
this.level.addFreshEntity(slimeEntity);
|
this.level().addFreshEntity(slimeEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,8 +182,8 @@ public class EndSlimeEntity extends Slime {
|
||||||
minCount += looting;
|
minCount += looting;
|
||||||
}
|
}
|
||||||
int count = minCount < maxCount ? MHelper.randRange(minCount, maxCount, random) : maxCount;
|
int count = minCount < maxCount ? MHelper.randRange(minCount, maxCount, random) : maxCount;
|
||||||
ItemEntity drop = new ItemEntity(level, getX(), getY(), getZ(), new ItemStack(Items.SLIME_BALL, count));
|
ItemEntity drop = new ItemEntity(level(), getX(), getY(), getZ(), new ItemStack(Items.SLIME_BALL, count));
|
||||||
this.level.addFreshEntity(drop);
|
this.level().addFreshEntity(drop);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSlimeType() {
|
public int getSlimeType() {
|
||||||
|
@ -280,7 +280,7 @@ public class EndSlimeEntity extends Slime {
|
||||||
0,
|
0,
|
||||||
(int) (dz * speed * 4)
|
(int) (dz * speed * 4)
|
||||||
);
|
);
|
||||||
int down = BlocksHelper.downRay(EndSlimeEntity.this.level, pos, 16);
|
int down = BlocksHelper.downRay(EndSlimeEntity.this.level(), pos, 16);
|
||||||
return down < 5;
|
return down < 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -320,7 +320,7 @@ public class EndSlimeEntity extends Slime {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUse() {
|
public boolean canUse() {
|
||||||
return EndSlimeEntity.this.getTarget() == null && (EndSlimeEntity.this.onGround || EndSlimeEntity.this.isInWater() || EndSlimeEntity.this
|
return EndSlimeEntity.this.getTarget() == null && (EndSlimeEntity.this.onGround() || EndSlimeEntity.this.isInWater() || EndSlimeEntity.this
|
||||||
.isInLava() || EndSlimeEntity.this.hasEffect(MobEffects.LEVITATION)) && EndSlimeEntity.this.getMoveControl() instanceof EndSlimeMoveControl;
|
.isInLava() || EndSlimeEntity.this.hasEffect(MobEffects.LEVITATION)) && EndSlimeEntity.this.getMoveControl() instanceof EndSlimeMoveControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -408,7 +408,7 @@ public class EndSlimeEntity extends Slime {
|
||||||
this.mob.setZza(0.0F);
|
this.mob.setZza(0.0F);
|
||||||
} else {
|
} else {
|
||||||
this.operation = MoveControl.Operation.WAIT;
|
this.operation = MoveControl.Operation.WAIT;
|
||||||
if (this.mob.isOnGround()) {
|
if (this.mob.onGround()) {
|
||||||
this.mob.setSpeed((float) (this.speedModifier * this.mob.getAttributeValue(Attributes.MOVEMENT_SPEED)));
|
this.mob.setSpeed((float) (this.speedModifier * this.mob.getAttributeValue(Attributes.MOVEMENT_SPEED)));
|
||||||
if (this.ticksUntilJump-- <= 0) {
|
if (this.ticksUntilJump-- <= 0) {
|
||||||
this.ticksUntilJump = EndSlimeEntity.this.getJumpDelay();
|
this.ticksUntilJump = EndSlimeEntity.this.getJumpDelay();
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class ShadowWalkerEntity extends Monster {
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
super.tick();
|
super.tick();
|
||||||
level.addParticle(
|
level().addParticle(
|
||||||
ParticleTypes.ASH,
|
ParticleTypes.ASH,
|
||||||
getX() + random.nextGaussian() * 0.2,
|
getX() + random.nextGaussian() * 0.2,
|
||||||
getY() + random.nextGaussian() * 0.5 + 1,
|
getY() + random.nextGaussian() * 0.5 + 1,
|
||||||
|
@ -60,7 +60,7 @@ public class ShadowWalkerEntity extends Monster {
|
||||||
0,
|
0,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
level.addParticle(
|
level().addParticle(
|
||||||
ParticleTypes.SMOKE,
|
ParticleTypes.SMOKE,
|
||||||
getX() + random.nextGaussian() * 0.2,
|
getX() + random.nextGaussian() * 0.2,
|
||||||
getY() + random.nextGaussian() * 0.5 + 1,
|
getY() + random.nextGaussian() * 0.5 + 1,
|
||||||
|
@ -69,7 +69,7 @@ public class ShadowWalkerEntity extends Monster {
|
||||||
0,
|
0,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
level.addParticle(
|
level().addParticle(
|
||||||
ParticleTypes.ENTITY_EFFECT,
|
ParticleTypes.ENTITY_EFFECT,
|
||||||
getX() + random.nextGaussian() * 0.2,
|
getX() + random.nextGaussian() * 0.2,
|
||||||
getY() + random.nextGaussian() * 0.5 + 1,
|
getY() + random.nextGaussian() * 0.5 + 1,
|
||||||
|
|
|
@ -95,7 +95,7 @@ public class SilkMothEntity extends Animal implements FlyingAnimal {
|
||||||
hivePos = NbtUtils.readBlockPos(tag.getCompound("HivePos"));
|
hivePos = NbtUtils.readBlockPos(tag.getCompound("HivePos"));
|
||||||
ResourceLocation worldID = new ResourceLocation(tag.getString("HiveWorld"));
|
ResourceLocation worldID = new ResourceLocation(tag.getString("HiveWorld"));
|
||||||
try {
|
try {
|
||||||
hiveWorld = level.getServer().getLevel(ResourceKey.create(Registries.DIMENSION, worldID));
|
hiveWorld = level().getServer().getLevel(ResourceKey.create(Registries.DIMENSION, worldID));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
BetterEnd.LOGGER.warning("Silk Moth Hive World {} is missing!", worldID);
|
BetterEnd.LOGGER.warning("Silk Moth Hive World {} is missing!", worldID);
|
||||||
hivePos = null;
|
hivePos = null;
|
||||||
|
@ -148,7 +148,7 @@ public class SilkMothEntity extends Animal implements FlyingAnimal {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isFlying() {
|
public boolean isFlying() {
|
||||||
return !this.onGround;
|
return !this.onGround();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -174,8 +174,8 @@ public class SilkMothEntity extends Animal implements FlyingAnimal {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int count = minCount < maxCount ? MHelper.randRange(minCount, maxCount, random) : maxCount;
|
int count = minCount < maxCount ? MHelper.randRange(minCount, maxCount, random) : maxCount;
|
||||||
ItemEntity drop = new ItemEntity(level, getX(), getY(), getZ(), new ItemStack(EndItems.SILK_FIBER, count));
|
ItemEntity drop = new ItemEntity(level(), getX(), getY(), getZ(), new ItemStack(EndItems.SILK_FIBER, count));
|
||||||
this.level.addFreshEntity(drop);
|
this.level().addFreshEntity(drop);
|
||||||
}
|
}
|
||||||
|
|
||||||
class MothLookControl extends LookControl {
|
class MothLookControl extends LookControl {
|
||||||
|
@ -206,7 +206,7 @@ public class SilkMothEntity extends Animal implements FlyingAnimal {
|
||||||
@Override
|
@Override
|
||||||
public void start() {
|
public void start() {
|
||||||
Vec3 vec3d = null;
|
Vec3 vec3d = null;
|
||||||
if (SilkMothEntity.this.hivePos != null && SilkMothEntity.this.hiveWorld == SilkMothEntity.this.level) {
|
if (SilkMothEntity.this.hivePos != null && SilkMothEntity.this.hiveWorld == SilkMothEntity.this.level()) {
|
||||||
if (SilkMothEntity.this.position()
|
if (SilkMothEntity.this.position()
|
||||||
.distanceToSqr(
|
.distanceToSqr(
|
||||||
SilkMothEntity.this.hivePos.getX(),
|
SilkMothEntity.this.hivePos.getX(),
|
||||||
|
@ -252,7 +252,7 @@ public class SilkMothEntity extends Animal implements FlyingAnimal {
|
||||||
@Override
|
@Override
|
||||||
public boolean canUse() {
|
public boolean canUse() {
|
||||||
return SilkMothEntity.this.hivePos != null &&
|
return SilkMothEntity.this.hivePos != null &&
|
||||||
SilkMothEntity.this.hiveWorld == SilkMothEntity.this.level &&
|
SilkMothEntity.this.hiveWorld == SilkMothEntity.this.level() &&
|
||||||
SilkMothEntity.this.navigation.isDone() &&
|
SilkMothEntity.this.navigation.isDone() &&
|
||||||
SilkMothEntity.this.random.nextInt(8) == 0 &&
|
SilkMothEntity.this.random.nextInt(8) == 0 &&
|
||||||
SilkMothEntity.this.position().distanceToSqr(
|
SilkMothEntity.this.position().distanceToSqr(
|
||||||
|
@ -264,16 +264,16 @@ public class SilkMothEntity extends Animal implements FlyingAnimal {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canContinueToUse() {
|
public boolean canContinueToUse() {
|
||||||
return SilkMothEntity.this.navigation.isInProgress() && level.getBlockState(entrance)
|
return SilkMothEntity.this.navigation.isInProgress() && level().getBlockState(entrance)
|
||||||
.isAir() && (level.getBlockState(hivePos)
|
.isAir() && (level().getBlockState(hivePos)
|
||||||
.is(EndBlocks.SILK_MOTH_NEST) || level
|
.is(EndBlocks.SILK_MOTH_NEST) || level()
|
||||||
.getBlockState(hivePos)
|
.getBlockState(hivePos)
|
||||||
.is(EndBlocks.SILK_MOTH_HIVE));
|
.is(EndBlocks.SILK_MOTH_HIVE));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start() {
|
public void start() {
|
||||||
BlockState state = SilkMothEntity.this.level.getBlockState(SilkMothEntity.this.hivePos);
|
BlockState state = SilkMothEntity.this.level().getBlockState(SilkMothEntity.this.hivePos);
|
||||||
if (!state.is(EndBlocks.SILK_MOTH_NEST) && !state.is(EndBlocks.SILK_MOTH_HIVE)) {
|
if (!state.is(EndBlocks.SILK_MOTH_NEST) && !state.is(EndBlocks.SILK_MOTH_HIVE)) {
|
||||||
SilkMothEntity.this.hivePos = null;
|
SilkMothEntity.this.hivePos = null;
|
||||||
return;
|
return;
|
||||||
|
@ -295,7 +295,7 @@ public class SilkMothEntity extends Animal implements FlyingAnimal {
|
||||||
double dy = Math.abs(SilkMothEntity.this.entrance.getY() - SilkMothEntity.this.getY());
|
double dy = Math.abs(SilkMothEntity.this.entrance.getY() - SilkMothEntity.this.getY());
|
||||||
double dz = Math.abs(SilkMothEntity.this.entrance.getZ() - SilkMothEntity.this.getZ());
|
double dz = Math.abs(SilkMothEntity.this.entrance.getZ() - SilkMothEntity.this.getZ());
|
||||||
if (dx + dy + dz < 1) {
|
if (dx + dy + dz < 1) {
|
||||||
BlockState state = SilkMothEntity.this.level.getBlockState(hivePos);
|
BlockState state = SilkMothEntity.this.level().getBlockState(hivePos);
|
||||||
if (state.is(EndBlocks.SILK_MOTH_NEST) || state.is(EndBlocks.SILK_MOTH_HIVE)) {
|
if (state.is(EndBlocks.SILK_MOTH_NEST) || state.is(EndBlocks.SILK_MOTH_HIVE)) {
|
||||||
int fullness = state.getValue(EndBlockProperties.FULLNESS);
|
int fullness = state.getValue(EndBlockProperties.FULLNESS);
|
||||||
boolean isHive = state.is(EndBlocks.SILK_MOTH_HIVE);
|
boolean isHive = state.is(EndBlocks.SILK_MOTH_HIVE);
|
||||||
|
@ -310,7 +310,7 @@ public class SilkMothEntity extends Animal implements FlyingAnimal {
|
||||||
state.setValue(EndBlockProperties.FULLNESS, fullness)
|
state.setValue(EndBlockProperties.FULLNESS, fullness)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
SilkMothEntity.this.level.playSound(
|
SilkMothEntity.this.level().playSound(
|
||||||
null,
|
null,
|
||||||
SilkMothEntity.this.entrance,
|
SilkMothEntity.this.entrance,
|
||||||
SoundEvents.BEEHIVE_ENTER,
|
SoundEvents.BEEHIVE_ENTER,
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class MinecraftClientMixin {
|
||||||
@Inject(method = "getSituationalMusic", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "getSituationalMusic", at = @At("HEAD"), cancellable = true)
|
||||||
private void be_getEndMusic(CallbackInfoReturnable<Music> info) {
|
private void be_getEndMusic(CallbackInfoReturnable<Music> info) {
|
||||||
if (!(this.screen instanceof WinScreen) && this.player != null) {
|
if (!(this.screen instanceof WinScreen) && this.player != null) {
|
||||||
if (this.player.level.dimension() == Level.END) {
|
if (this.player.level().dimension() == Level.END) {
|
||||||
if (this.gui.getBossOverlay().shouldPlayMusic() && MHelper.lengthSqr(
|
if (this.gui.getBossOverlay().shouldPlayMusic() && MHelper.lengthSqr(
|
||||||
this.player.getX(),
|
this.player.getX(),
|
||||||
this.player.getZ()
|
this.player.getZ()
|
||||||
|
|
|
@ -49,7 +49,7 @@ public abstract class LivingEntityMixin extends Entity {
|
||||||
|
|
||||||
@Inject(method = "tickEffects", at = @At("HEAD"))
|
@Inject(method = "tickEffects", at = @At("HEAD"))
|
||||||
protected void be_applyEffects(CallbackInfo info) {
|
protected void be_applyEffects(CallbackInfo info) {
|
||||||
if (!level.isClientSide()) {
|
if (!level().isClientSide()) {
|
||||||
LivingEntity owner = LivingEntity.class.cast(this);
|
LivingEntity owner = LivingEntity.class.cast(this);
|
||||||
if (CrystaliteArmor.hasFullSet(owner)) {
|
if (CrystaliteArmor.hasFullSet(owner)) {
|
||||||
CrystaliteArmor.applySetEffect(owner);
|
CrystaliteArmor.applySetEffect(owner);
|
||||||
|
|
|
@ -83,7 +83,7 @@ public abstract class ServerPlayerMixin extends Player implements TeleportingEnt
|
||||||
|
|
||||||
@Inject(method = "changeDimension", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "changeDimension", at = @At("HEAD"), cancellable = true)
|
||||||
public void be_changeDimension(ServerLevel destination, CallbackInfoReturnable<Entity> info) {
|
public void be_changeDimension(ServerLevel destination, CallbackInfoReturnable<Entity> info) {
|
||||||
if (be_canTeleport() && level instanceof ServerLevel) {
|
if (be_canTeleport() && level() instanceof ServerLevel) {
|
||||||
isChangingDimension = true;
|
isChangingDimension = true;
|
||||||
ServerLevel serverWorld = getLevel();
|
ServerLevel serverWorld = getLevel();
|
||||||
LevelData worldProperties = destination.getLevelData();
|
LevelData worldProperties = destination.getLevelData();
|
||||||
|
@ -98,7 +98,8 @@ public abstract class ServerPlayerMixin extends Player implements TeleportingEnt
|
||||||
destination.isDebug(),
|
destination.isDebug(),
|
||||||
destination.isFlat(),
|
destination.isFlat(),
|
||||||
(byte) 1,
|
(byte) 1,
|
||||||
Optional.empty()
|
Optional.empty(),
|
||||||
|
getPortalCooldown()
|
||||||
));
|
));
|
||||||
connection.send(new ClientboundChangeDifficultyPacket(
|
connection.send(new ClientboundChangeDifficultyPacket(
|
||||||
worldProperties.getDifficulty(),
|
worldProperties.getDifficulty(),
|
||||||
|
@ -113,7 +114,7 @@ public abstract class ServerPlayerMixin extends Player implements TeleportingEnt
|
||||||
serverWorld.getProfiler().push("moving");
|
serverWorld.getProfiler().push("moving");
|
||||||
serverWorld.getProfiler().pop();
|
serverWorld.getProfiler().pop();
|
||||||
serverWorld.getProfiler().push("placing");
|
serverWorld.getProfiler().push("placing");
|
||||||
this.level = destination;
|
this.setLevel(destination);
|
||||||
destination.addDuringPortalTeleport(player);
|
destination.addDuringPortalTeleport(player);
|
||||||
setRot(teleportTarget.yRot, teleportTarget.xRot);
|
setRot(teleportTarget.yRot, teleportTarget.xRot);
|
||||||
moveTo(teleportTarget.pos.x, teleportTarget.pos.y, teleportTarget.pos.z);
|
moveTo(teleportTarget.pos.x, teleportTarget.pos.y, teleportTarget.pos.z);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue