fixes
This commit is contained in:
parent
d404c1743a
commit
28d6850668
93 changed files with 420 additions and 499 deletions
|
@ -80,7 +80,7 @@ import common.packet.SPacketSetExperience;
|
|||
import common.packet.SPacketSkin;
|
||||
import common.packet.SPacketTimeUpdate;
|
||||
import common.packet.SPacketWorld;
|
||||
import common.potion.PotionEffect;
|
||||
import common.potion.StatusEffect;
|
||||
import common.tags.TagObject;
|
||||
import common.util.BlockPos;
|
||||
import common.util.EncryptUtil;
|
||||
|
@ -755,7 +755,7 @@ public final class Server implements IThreadListener, Executor {
|
|||
conn.sendPacket(new SPacketSkin(player.getId(), player.getSkin())); // , player.getModel()));
|
||||
conn.setPlayerLocation(player.posX, player.posY, player.posZ, player.rotYaw, player.rotPitch);
|
||||
this.updateTimeAndWeatherForPlayer(conn, world);
|
||||
for(PotionEffect effect : player.getEffects()) {
|
||||
for(StatusEffect effect : player.getEffects()) {
|
||||
conn.sendPacket(new SPacketEntityEffect(player.getId(), effect));
|
||||
}
|
||||
conn.sendPacket(new SPacketPlayerAbilities(player));
|
||||
|
@ -926,7 +926,7 @@ public final class Server implements IThreadListener, Executor {
|
|||
nplayer.setHealth(nplayer.getHealth());
|
||||
this.updateTimeAndWeatherForPlayer(conn, world);
|
||||
this.syncPlayerInventory(nplayer);
|
||||
for(PotionEffect effect : nplayer.getEffects()) {
|
||||
for(StatusEffect effect : nplayer.getEffects()) {
|
||||
conn.sendPacket(new SPacketEntityEffect(nplayer.getId(), effect));
|
||||
}
|
||||
conn.sendPlayerAbilities();
|
||||
|
@ -951,7 +951,7 @@ public final class Server implements IThreadListener, Executor {
|
|||
player.setRotationYawHead(yaw);
|
||||
this.updateTimeAndWeatherForPlayer((Player)player.connection, newWorld);
|
||||
this.syncPlayerInventory(player);
|
||||
for(PotionEffect effect : player.getEffects()) {
|
||||
for(StatusEffect effect : player.getEffects()) {
|
||||
player.connection.sendPacket(new SPacketEntityEffect(player.getId(), effect));
|
||||
}
|
||||
player.connection.sendPlayerAbilities();
|
||||
|
|
|
@ -2,8 +2,8 @@ package server.command.commands;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import common.model.ParticleType;
|
||||
import common.packet.SPacketParticles;
|
||||
import common.util.ParticleType;
|
||||
import common.util.Vec3;
|
||||
import server.command.Command;
|
||||
import server.command.CommandEnvironment;
|
||||
|
|
|
@ -4,7 +4,7 @@ import java.util.List;
|
|||
|
||||
import common.color.TextColor;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.potion.Potion;
|
||||
import common.potion.Effect;
|
||||
import server.command.Command;
|
||||
import server.command.CommandEnvironment;
|
||||
import server.command.Executor;
|
||||
|
@ -21,7 +21,7 @@ public class CommandGod extends Command {
|
|||
}
|
||||
|
||||
public void exec(CommandEnvironment env, Executor exec, List<EntityNPC> players, boolean remove, boolean quiet) {
|
||||
remove = !remove && exec.isPlayer() && players.size() == 1 && players.get(0).connection == exec ? players.get(0).hasEffect(Potion.HASTE) && players.get(0).getEffect(Potion.HASTE).getAmplifier() == 255 : remove;
|
||||
remove = !remove && exec.isPlayer() && players.size() == 1 && players.get(0).connection == exec ? players.get(0).hasEffect(Effect.HASTE) && players.get(0).getEffect(Effect.HASTE).getAmplifier() == 255 : remove;
|
||||
for(EntityNPC player : players) {
|
||||
player.setGodMode(!remove);
|
||||
if(!quiet)
|
||||
|
|
|
@ -4,7 +4,7 @@ import java.util.List;
|
|||
|
||||
import common.collect.Lists;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.potion.Potion;
|
||||
import common.potion.Effect;
|
||||
import server.command.Command;
|
||||
import server.command.CommandEnvironment;
|
||||
import server.command.Executor;
|
||||
|
@ -16,17 +16,17 @@ public class CommandMilk extends Command {
|
|||
|
||||
this.addLivingEntityList("entities", true, UserPolicy.NON_ADMINS_OR_SELF);
|
||||
this.setParamsOptional();
|
||||
List<Potion> potions = Lists.newArrayList();
|
||||
for(Potion potion : Potion.values()) {
|
||||
List<Effect> potions = Lists.newArrayList();
|
||||
for(Effect potion : Effect.values()) {
|
||||
if(!potion.isInstant())
|
||||
potions.add(potion);
|
||||
}
|
||||
this.addEnum("type", Potion.class, potions);
|
||||
this.addEnum("type", Effect.class, potions);
|
||||
|
||||
this.addFlag("negative", 'n');
|
||||
}
|
||||
|
||||
public Object exec(CommandEnvironment env, Executor exec, List<EntityLiving> entities, Potion type, boolean negative) {
|
||||
public Object exec(CommandEnvironment env, Executor exec, List<EntityLiving> entities, Effect type, boolean negative) {
|
||||
int done = 0;
|
||||
for(EntityLiving entity : entities) {
|
||||
if(type != null && entity.hasEffect(type)) {
|
||||
|
|
|
@ -3,8 +3,8 @@ package server.command.commands;
|
|||
import java.util.List;
|
||||
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.potion.Potion;
|
||||
import common.potion.PotionEffect;
|
||||
import common.potion.Effect;
|
||||
import common.potion.StatusEffect;
|
||||
import server.command.Command;
|
||||
import server.command.CommandEnvironment;
|
||||
import server.command.Executor;
|
||||
|
@ -15,7 +15,7 @@ public class CommandPotion extends Command {
|
|||
super("potion");
|
||||
|
||||
this.addLivingEntityList("entities", true, UserPolicy.NON_ADMINS_OR_SELF);
|
||||
this.addEnum("type", Potion.class, Potion.values());
|
||||
this.addEnum("type", Effect.class, Effect.values());
|
||||
this.setParamsOptional();
|
||||
this.addInt("duration", 0, 1000000, 1000000);
|
||||
this.addInt("strength", 1, 256, 1);
|
||||
|
@ -23,7 +23,7 @@ public class CommandPotion extends Command {
|
|||
this.addFlag("keep", 'k');
|
||||
}
|
||||
|
||||
public Object exec(CommandEnvironment env, Executor exec, List<EntityLiving> entities, Potion type, int duration, int strength, boolean keep) {
|
||||
public Object exec(CommandEnvironment env, Executor exec, List<EntityLiving> entities, Effect type, int duration, int strength, boolean keep) {
|
||||
int done = 0;
|
||||
for(EntityLiving entity : entities) {
|
||||
if(entity.isPotionApplicable(type, strength - 1)) {
|
||||
|
@ -31,7 +31,7 @@ public class CommandPotion extends Command {
|
|||
type.onImpact(null, null, entity, strength - 1, 1.0);
|
||||
}
|
||||
else {
|
||||
PotionEffect effect = new PotionEffect(type, duration == 0 ? Integer.MAX_VALUE : (duration * 20), strength - 1);
|
||||
StatusEffect effect = new StatusEffect(type, duration == 0 ? Integer.MAX_VALUE : (duration * 20), strength - 1);
|
||||
if(!keep && entity.hasEffect(type))
|
||||
entity.removeEffect(type);
|
||||
entity.addEffect(effect);
|
||||
|
|
|
@ -97,8 +97,8 @@ import common.packet.SPacketTrades;
|
|||
import common.packet.SPacketUpdateHealth;
|
||||
import common.packet.CPacketAction.Action;
|
||||
import common.packet.SPacketMessage.Type;
|
||||
import common.potion.Potion;
|
||||
import common.potion.PotionEffect;
|
||||
import common.potion.Effect;
|
||||
import common.potion.StatusEffect;
|
||||
import common.tags.TagObject;
|
||||
import common.tileentity.IInteractionObject;
|
||||
import common.tileentity.ILockableContainer;
|
||||
|
@ -786,17 +786,17 @@ public class Player extends User implements Executor, IPlayer
|
|||
// }
|
||||
// }
|
||||
|
||||
public void onNewEffect(PotionEffect id)
|
||||
public void onNewEffect(StatusEffect id)
|
||||
{
|
||||
this.sendPacket(new SPacketEntityEffect(this.entity.getId(), id));
|
||||
}
|
||||
|
||||
public void onChangedEffect(PotionEffect id, boolean added)
|
||||
public void onChangedEffect(StatusEffect id, boolean added)
|
||||
{
|
||||
this.sendPacket(new SPacketEntityEffect(this.entity.getId(), id));
|
||||
}
|
||||
|
||||
public void onFinishedEffect(PotionEffect effect)
|
||||
public void onFinishedEffect(StatusEffect effect)
|
||||
{
|
||||
this.sendPacket(new SPacketRemoveEntityEffect(this.entity.getId(), effect));
|
||||
}
|
||||
|
@ -1715,7 +1715,7 @@ public class Player extends User implements Executor, IPlayer
|
|||
super.setAdmin(admin);
|
||||
if(!this.isAdmin() && this.entity != null && this.entity.noclip) {
|
||||
this.entity.noclip = false;
|
||||
this.entity.flying &= this.entity.hasEffect(Potion.FLYING) || this.entity.canNaturallyFly();
|
||||
this.entity.flying &= this.entity.hasEffect(Effect.FLYING) || this.entity.canNaturallyFly();
|
||||
this.entity.fallDistance = 0.0F;
|
||||
this.sendPlayerAbilities();
|
||||
this.addFeed(TextColor.RED + "NoClip wurde deaktiviert");
|
||||
|
@ -2553,7 +2553,7 @@ public class Player extends User implements Executor, IPlayer
|
|||
break;
|
||||
|
||||
case START_FLYING:
|
||||
this.entity.flying = this.entity.hasEffect(Potion.FLYING) || this.entity.noclip || this.entity.canNaturallyFly();
|
||||
this.entity.flying = this.entity.hasEffect(Effect.FLYING) || this.entity.noclip || this.entity.canNaturallyFly();
|
||||
break;
|
||||
|
||||
case STOP_FLYING:
|
||||
|
@ -2678,7 +2678,7 @@ public class Player extends User implements Executor, IPlayer
|
|||
|
||||
case GOD:
|
||||
if(this.isAdmin()) {
|
||||
boolean god = !this.entity.hasEffect(Potion.HASTE) || this.entity.getEffect(Potion.HASTE).getAmplifier() != 255;
|
||||
boolean god = !this.entity.hasEffect(Effect.HASTE) || this.entity.getEffect(Effect.HASTE).getAmplifier() != 255;
|
||||
this.entity.setGodMode(god);
|
||||
this.addFeed(god ? (TextColor.GREEN + "Statuseffekte wurden hinzugefügt") : (TextColor.RED + "Statuseffekte wurden entfernt"));
|
||||
}
|
||||
|
@ -2693,10 +2693,10 @@ public class Player extends User implements Executor, IPlayer
|
|||
|
||||
case SPEED:
|
||||
if(this.isAdmin()) {
|
||||
if(this.entity.hasEffect(Potion.SPEED))
|
||||
this.entity.removeEffect(Potion.SPEED);
|
||||
if(this.entity.hasEffect(Effect.SPEED))
|
||||
this.entity.removeEffect(Effect.SPEED);
|
||||
else
|
||||
this.entity.addEffect(new PotionEffect(Potion.SPEED, Integer.MAX_VALUE, 19));
|
||||
this.entity.addEffect(new StatusEffect(Effect.SPEED, Integer.MAX_VALUE, 19));
|
||||
this.addFeed(TextColor.GREEN + "Deine Geschwindigkeit wurde auf %dx geändert", (int)(this.entity.getAIMoveSpeed() * 10.0f));
|
||||
// int speed = this.playerEntity.speed != 1.0f ? 1 : 5;
|
||||
// this.playerEntity.speed = (float)speed;
|
||||
|
|
|
@ -39,7 +39,6 @@ import common.init.SoundEvent;
|
|||
import common.init.UniverseRegistry;
|
||||
import common.item.block.ItemDoor;
|
||||
import common.log.Log;
|
||||
import common.model.ParticleType;
|
||||
import common.network.IPlayer;
|
||||
import common.network.Packet;
|
||||
import common.packet.SPacketEntityStatus;
|
||||
|
@ -64,6 +63,7 @@ import common.util.ChunkPos;
|
|||
import common.util.ExtMath;
|
||||
import common.util.IntHashMap;
|
||||
import common.util.LongHashMap;
|
||||
import common.util.ParticleType;
|
||||
import common.util.PortalType;
|
||||
import common.util.Position;
|
||||
import common.util.Vec3;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue