use latest Netty and Guava

This commit is contained in:
Sen 2025-03-16 17:40:47 +01:00
parent 7f32e87ef4
commit 3af1b1f5b6
463 changed files with 611 additions and 68249 deletions

View file

@ -6,8 +6,9 @@ import java.util.Map;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import game.collect.Lists;
import game.collect.Maps;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import game.item.ItemStack;
import game.network.PacketBuffer;
import game.world.BlockPos;

View file

@ -4,7 +4,8 @@ import java.util.Collection;
import java.util.List;
import java.util.Set;
import game.collect.Sets;
import com.google.common.collect.Sets;
import game.entity.attributes.AttributeInstance;
import game.entity.attributes.AttributeMap;
import game.entity.npc.EntityNPC;

View file

@ -2,7 +2,8 @@ package game.entity.animal;
import java.util.List;
import game.collect.Lists;
import com.google.common.collect.Lists;
import game.entity.DamageSource;
import game.entity.Entity;
import game.entity.npc.Alignment;

View file

@ -1,6 +1,6 @@
package game.entity.animal;
import java.util.function.Predicate;
import com.google.common.base.Predicate;
import game.ai.EntityAIFollowParent;
import game.ai.EntityAILookIdle;
@ -44,7 +44,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
{
private static final Predicate<Entity> horseBreedingSelector = new Predicate<Entity>()
{
public boolean test(Entity p_apply_1_)
public boolean apply(Entity p_apply_1_)
{
return p_apply_1_ instanceof EntityHorse && ((EntityHorse)p_apply_1_).isBreeding();
}

View file

@ -1,6 +1,6 @@
package game.entity.animal;
import java.util.function.Predicate;
import com.google.common.base.Predicate;
import game.ai.EntityAIAvoidEntity;
import game.ai.EntityAIFollowOwner;
@ -56,7 +56,7 @@ public class EntityOcelot extends EntityTameable
this.tasks.addTask(10, new EntityAIWander(this, 0.8D));
this.tasks.addTask(11, new EntityAIWatchClosest(this, null, 10.0F));
this.targets.addTask(1, new EntityAITargetNonTamed(this, EntityAnimal.class, false, new Predicate<EntityAnimal>() {
public boolean test(EntityAnimal entity) {
public boolean apply(EntityAnimal entity) {
return entity instanceof EntityChicken || entity instanceof EntityMouse;
}
}));

View file

@ -1,6 +1,6 @@
package game.entity.animal;
import java.util.function.Predicate;
import com.google.common.base.Predicate;
import game.ai.EntityAIAttackOnCollide;
import game.ai.EntityAIAvoidEntity;
@ -336,7 +336,7 @@ public class EntityRabbit extends EntityAnimal {
this.grow(this.rand.range(250, 350));
if(Config.rabbitMateChance > 0 && this.rand.chance(Config.rabbitMateChance) && this.getGrowingAge() == 0 && !this.isInLove() &&
!this.worldObj.getEntitiesWithinAABB(EntityRabbit.class, this.getEntityBoundingBox().expand(15.0f, 15.0f, 15.0f), new Predicate<EntityRabbit>() {
public boolean test(EntityRabbit entity) {
public boolean apply(EntityRabbit entity) {
return entity != EntityRabbit.this && entity.getGrowingAge() == 0;
}
}).isEmpty())

View file

@ -2,6 +2,8 @@ package game.entity.animal;
import java.util.Map;
import com.google.common.collect.Maps;
import game.ai.EntityAIEatGrass;
import game.ai.EntityAIFollowParent;
import game.ai.EntityAILookIdle;
@ -12,7 +14,6 @@ import game.ai.EntityAITempt;
import game.ai.EntityAIWander;
import game.ai.EntityAIWatchClosest;
import game.biome.Biome;
import game.collect.Maps;
import game.color.DyeColor;
import game.entity.attributes.Attributes;
import game.entity.item.EntityItem;

View file

@ -1,6 +1,6 @@
package game.entity.animal;
import java.util.function.Predicate;
import com.google.common.base.Predicate;
import game.ai.EntityAIAttackOnCollide;
import game.ai.EntityAIBeg;
@ -74,7 +74,7 @@ public class EntityWolf extends EntityTameable
this.targets.addTask(3, new EntityAIHurtByTarget(this, true));
this.targets.addTask(4, new EntityAITargetNonTamed(this, EntityAnimal.class, false, new Predicate<Entity>()
{
public boolean test(Entity p_apply_1_)
public boolean apply(Entity p_apply_1_)
{
return p_apply_1_ instanceof EntitySheep || p_apply_1_ instanceof EntityRabbit;
}

View file

@ -2,7 +2,8 @@ package game.entity.attributes;
import java.util.Map;
import game.collect.Maps;
import com.google.common.collect.Maps;
import game.util.ExtMath;
public class Attribute

View file

@ -4,9 +4,9 @@ import java.util.Collection;
import java.util.Map;
import java.util.Set;
import game.collect.Lists;
import game.collect.Maps;
import game.collect.Sets;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
public class AttributeInstance
{

View file

@ -3,10 +3,11 @@ package game.entity.attributes;
import java.util.Collection;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import game.collect.Maps;
import game.collect.Sets;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import java.util.Set;
public class AttributeMap
{

View file

@ -4,7 +4,7 @@ import java.util.Collection;
import java.util.Map;
import java.util.Set;
import game.collect.Maps;
import com.google.common.collect.Maps;
public class LowerStringMap<V> implements Map<String, V>
{

View file

@ -2,11 +2,12 @@ package game.entity.item;
import java.util.List;
import com.google.common.collect.Lists;
import game.block.Block;
import game.block.BlockAnvil;
import game.block.BlockFalling;
import game.block.ITileEntityProvider;
import game.collect.Lists;
import game.entity.DamageSource;
import game.entity.Entity;
import game.entity.types.IObjectData;

View file

@ -1,7 +1,7 @@
package game.entity.item;
import java.util.List;
import java.util.function.Predicate;
import com.google.common.base.Predicate;
import game.entity.DamageSource;
import game.entity.npc.EntityNPC;
@ -174,7 +174,7 @@ public class EntityHopperCart extends EntityCartContainer implements IHopper
else
{
List<EntityItem> list = this.worldObj.<EntityItem>getEntitiesWithinAABB(EntityItem.class, this.getEntityBoundingBox().expand(0.25D, 0.0D, 0.25D), new Predicate<EntityItem>() {
public boolean test(EntityItem entity) {
public boolean apply(EntityItem entity) {
return entity.isEntityAlive();
}
});

View file

@ -2,7 +2,8 @@ package game.entity.npc;
import java.util.Map;
import game.collect.Maps;
import com.google.common.collect.Maps;
import game.color.TextColor;
public enum Alignment {

View file

@ -2,7 +2,8 @@ package game.entity.npc;
import java.util.List;
import game.collect.Lists;
import com.google.common.collect.Lists;
import game.item.RngLoot;
import game.rng.WeightedList;

View file

@ -2,7 +2,8 @@ package game.entity.npc;
import java.util.List;
import game.collect.Lists;
import com.google.common.collect.Lists;
import game.entity.attributes.Attributes;
import game.init.SpeciesRegistry;
import game.properties.IStringSerializable;

View file

@ -2,7 +2,8 @@ package game.entity.npc;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import java.util.function.Predicate;
import com.google.common.base.Predicate;
import game.Game;
import game.ai.AIRangedAttack;
@ -274,7 +275,7 @@ public abstract class EntityNPC extends EntityLiving
// this.tasks.addTask(1, new EntityAIAttackOnCollide(this, EntityLivingBase.class, 0.6D, true, true));
this.tasks.addTask(1, new EntityAINpcMate(this));
this.tasks.addTask(2, new EntityAIAvoidEntity(this, EntityLiving.class, new Predicate<EntityLiving>() {
public boolean test(EntityLiving entity) {
public boolean apply(EntityLiving entity) {
return entity != EntityNPC.this && EntityNPC.this.shouldFlee(entity);
}
}, 8.0F, 1.1D, 1.1D) {
@ -301,7 +302,7 @@ public abstract class EntityNPC extends EntityLiving
// }
});
this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityLiving.class, new Predicate<EntityLiving>() {
public boolean test(EntityLiving entity) {
public boolean apply(EntityLiving entity) {
return entity != EntityNPC.this && EntityNPC.this.shouldFlee(entity);
}
}, 8.0F, 1.1D, 1.1D) {
@ -364,7 +365,7 @@ public abstract class EntityNPC extends EntityLiving
}
});
this.targets.addTask(2, new EntityAINearestAttackableTarget(this, EntityLiving.class, 10, true, false, new Predicate<EntityLiving>() {
public boolean test(EntityLiving entity) {
public boolean apply(EntityLiving entity) {
if(entity != null && entity != EntityNPC.this && EntityNPC.this.shouldFlee(entity)) {
EntityNPC.this.setAttackTarget(null);
EntityNPC.this.fleeing = true;

View file

@ -2,7 +2,8 @@ package game.entity.npc;
import java.util.List;
import game.collect.Lists;
import com.google.common.collect.Lists;
import game.entity.attributes.Attributes;
import game.properties.IStringSerializable;
import game.rng.Random;

View file

@ -2,7 +2,8 @@ package game.entity.npc;
import java.util.List;
import game.collect.Lists;
import com.google.common.collect.Lists;
import game.entity.attributes.Attributes;
import game.init.SpeciesRegistry;
import game.properties.IStringSerializable;

View file

@ -1,7 +1,7 @@
package game.entity.npc;
import java.util.List;
import java.util.function.Predicate;
import com.google.common.base.Predicate;
import game.ai.EntityAIMoveThroughVillage;
import game.entity.DamageSource;
@ -211,7 +211,7 @@ public class EntityZombie extends EntityNPC
if ((double)this.worldObj.rand.floatv() < 0.05D)
{
List<EntityChicken> list = this.worldObj.<EntityChicken>getEntitiesWithinAABB(EntityChicken.class, this.getEntityBoundingBox().expand(5.0D, 3.0D, 5.0D), new Predicate<EntityChicken>() {
public boolean test(EntityChicken entity) {
public boolean apply(EntityChicken entity) {
return entity.isEntityAlive() && entity.passenger == null && entity.vehicle == null;
}
});

View file

@ -3,11 +3,12 @@ package game.entity.npc;
import java.util.List;
import java.util.Map;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import game.block.Block;
import game.collect.BiMap;
import game.collect.HashBiMap;
import game.collect.Lists;
import game.collect.Maps;
import game.init.SpeciesRegistry;
import game.init.SpeciesRegistry.ModelType;
import game.item.Item;

View file

@ -2,8 +2,9 @@ package game.entity.types;
import java.util.Set;
import com.google.common.collect.Sets;
import game.block.Block;
import game.collect.Sets;
import game.entity.DamageSource;
import game.entity.npc.Alignment;
import game.entity.npc.EntityNPC;

View file

@ -4,7 +4,10 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.function.Predicate;
import com.google.common.base.Predicate;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import game.ai.EntityAIBase;
import game.ai.EntityAIMoveTowardsRestriction;
@ -15,8 +18,6 @@ import game.ai.EntityMoveHelper;
import game.ai.EntitySenses;
import game.audio.SoundType;
import game.block.Block;
import game.collect.Lists;
import game.collect.Maps;
import game.color.TextColor;
import game.enchantment.EnchantmentHelper;
import game.entity.DamageSource;
@ -2124,7 +2125,7 @@ public abstract class EntityLiving extends Entity
{
List<Entity> list = this.worldObj.getEntitiesInAABBexcluding(this, this.getEntityBoundingBox().expand(0.20000000298023224D, 0.0D, 0.20000000298023224D), new Predicate<Entity>()
{
public boolean test(Entity p_apply_1_)
public boolean apply(Entity p_apply_1_)
{
return p_apply_1_.canBePushed();
}