Skip to content

Commit

Permalink
First compile for 1.7.2
Browse files Browse the repository at this point in the history
This -just- compiles. No tests, and some features are disabled, such as
item serialization for persistent desires.
  • Loading branch information
Tim H committed Dec 1, 2013
1 parent a9feadc commit 7ea92ab
Show file tree
Hide file tree
Showing 124 changed files with 597 additions and 629 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.6.4-R2.0</version>
<version>1.7.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void run()
}
else
{
entity.getHandle().y();
entity.getHandle().C();
if(entity.getHandle().dead)
{
if(entity.despawn(DespawnReason.DEATH))
Expand Down Expand Up @@ -335,9 +335,9 @@ public RemoteEntity[] getRemoteEntitiesByName(String inName)

for(RemoteEntity entity : this.getAllEntities())
{
if(entity instanceof Nameable)
if(entity != null)
{
if(((Nameable)entity).getName().equals(inName))
if(entity.getName().equals(inName))
entities.add(entity);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public class RemoteEntities extends JavaPlugin
{
private final Map<String, EntityManager> m_managers = new HashMap<String, EntityManager>();
private static RemoteEntities s_instance;
private static String COMPATIBLE_VERSION = "1.6.4";
private static String COMPATIBLE_REVISION = "v1_6_R3";
private static String COMPATIBLE_VERSION = "1.7.2";
private static String COMPATIBLE_REVISION = "v1_7_R1";
private static final String VERSION_FILE = "http://repo.infinityblade.de/re_versions.txt";
private static String MINECRAFT_REVISION;
private final ClassPool m_pool = new ClassPool();
Expand Down Expand Up @@ -111,8 +111,8 @@ private void checkClasses()
private void checkConfig()
{
this.getConfig().set("autoUpdateSources", this.getConfig().get("autoUpdateSources", false));
COMPATIBLE_REVISION = this.getConfig().getString("COMPATIBLE_REVISION", "1_6_R3");
COMPATIBLE_VERSION = this.getConfig().getString("COMPATIBLE_VERSION", "1.6.4");
COMPATIBLE_REVISION = this.getConfig().getString("COMPATIBLE_REVISION", "1_7_R1");
COMPATIBLE_VERSION = this.getConfig().getString("COMPATIBLE_VERSION", "1.7.2");
this.saveConfig();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.kumpelblase2.remoteentities.api;

import java.util.Map;
import net.minecraft.server.v1_6_R3.EntityLiving;
import net.minecraft.server.v1_7_R1.EntityLiving;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.kumpelblase2.remoteentities.api;

import java.util.*;
import net.minecraft.server.v1_6_R3.EntityLiving;
import net.minecraft.server.v1_7_R1.EntityLiving;
import de.kumpelblase2.remoteentities.entities.*;

public class RemoteEntityType
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package de.kumpelblase2.remoteentities.api.features;

import org.bukkit.craftbukkit.v1_6_R3.inventory.CraftInventoryCustom;
import org.bukkit.craftbukkit.v1_7_R1.inventory.CraftInventoryCustom;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import de.kumpelblase2.remoteentities.api.RemoteEntity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.kumpelblase2.remoteentities.api.features;

import net.minecraft.server.v1_6_R3.EntityAnimal;
import net.minecraft.server.v1_6_R3.EntityLiving;
import net.minecraft.server.v1_7_R1.EntityAnimal;
import net.minecraft.server.v1_7_R1.EntityLiving;
import org.bukkit.entity.LivingEntity;

public abstract class RemoteMateFeature extends RemoteFeature implements MateFeature
Expand Down Expand Up @@ -35,13 +35,13 @@ public boolean mate(LivingEntity inPartner)
public boolean isAffected()
{
EntityLiving handle = this.m_entity.getHandle();
return !(handle instanceof EntityAnimal) || ((EntityAnimal)handle).bY();
return !(handle instanceof EntityAnimal) || ((EntityAnimal)handle).cc();
}

@Override
public void resetAffection()
{
if(this.m_entity.getHandle() instanceof EntityAnimal)
((EntityAnimal)this.m_entity.getHandle()).bZ();
((EntityAnimal)this.m_entity.getHandle()).cd();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package de.kumpelblase2.remoteentities.api.features;

import net.minecraft.server.v1_6_R3.MathHelper;
import net.minecraft.server.v1_7_R1.MathHelper;
import de.kumpelblase2.remoteentities.api.RemoteEntity;
import de.kumpelblase2.remoteentities.persistence.ParameterData;
import de.kumpelblase2.remoteentities.persistence.SerializeAs;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package de.kumpelblase2.remoteentities.api.features;

import net.minecraft.server.v1_6_R3.MathHelper;
import net.minecraft.server.v1_7_R1.MathHelper;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import de.kumpelblase2.remoteentities.api.RemoteEntity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package de.kumpelblase2.remoteentities.api.features;

import java.util.*;
import net.minecraft.server.v1_6_R3.MerchantRecipe;
import net.minecraft.server.v1_6_R3.MerchantRecipeList;
import net.minecraft.server.v1_7_R1.MerchantRecipe;
import net.minecraft.server.v1_7_R1.MerchantRecipeList;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_6_R3.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_7_R1.inventory.CraftItemStack;
import org.bukkit.entity.Player;
import org.bukkit.event.*;
import org.bukkit.event.inventory.InventoryCloseEvent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package de.kumpelblase2.remoteentities.api.pathfinding;

import java.util.List;
import net.minecraft.server.v1_6_R3.PathEntity;
import net.minecraft.server.v1_6_R3.PathPoint;
import net.minecraft.server.v1_7_R1.PathEntity;
import net.minecraft.server.v1_7_R1.PathPoint;

public class Path
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.kumpelblase2.remoteentities.api.pathfinding;

import java.util.*;
import net.minecraft.server.v1_6_R3.EntityLiving;
import net.minecraft.server.v1_7_R1.EntityLiving;
import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.util.Vector;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package de.kumpelblase2.remoteentities.api.thinking;

import net.minecraft.server.v1_6_R3.*;
import net.minecraft.server.v1_7_R1.*;
import de.kumpelblase2.remoteentities.api.RemoteEntity;
import de.kumpelblase2.remoteentities.entities.RemoteBaseEntity;
import de.kumpelblase2.remoteentities.persistence.ParameterData;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package de.kumpelblase2.remoteentities.api.thinking;

import net.minecraft.server.v1_6_R3.EntityLiving;
import net.minecraft.server.v1_7_R1.EntityLiving;
import de.kumpelblase2.remoteentities.api.RemoteEntity;
import de.kumpelblase2.remoteentities.persistence.ParameterData;
import de.kumpelblase2.remoteentities.persistence.SerializeAs;
Expand Down Expand Up @@ -44,7 +44,7 @@ public void ride(float[] inMotion)

this.m_entity.setYaw(entity.passenger.yaw);
this.m_entity.setPitch(entity.passenger.pitch);
entity.Y = 0.5f;
entity.X = 0.5f;
if(inMotion[0] == 0)
inMotion[0] = ((EntityLiving)entity.passenger).be * 0.5f;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.Iterator;
import java.util.List;
import net.minecraft.server.v1_6_R3.*;
import net.minecraft.server.v1_7_R1.*;
import de.kumpelblase2.remoteentities.api.RemoteEntity;
import de.kumpelblase2.remoteentities.api.thinking.DesireBase;
import de.kumpelblase2.remoteentities.api.thinking.DesireType;
Expand Down Expand Up @@ -53,7 +53,7 @@ else if(!entity.world.v())
while(it.hasNext())
{
EntityIronGolem golem = it.next();
if(golem.bV() > 0)
if(golem.bZ() > 0)
{
this.m_nearestGolem = golem;
break;
Expand All @@ -67,13 +67,13 @@ else if(!entity.world.v())
@Override
public boolean canContinue()
{
return this.m_nearestGolem.o() > 0;
return this.m_nearestGolem.q() > 0;
}

@Override
public void startExecuting()
{
this.m_takeFlowerTick = this.getEntityHandle().aD().nextInt(320);
this.m_takeFlowerTick = this.getEntityHandle().aI().nextInt(320);
this.m_takeFlower = false;
this.m_nearestGolem.getNavigation().g();
}
Expand All @@ -90,7 +90,7 @@ public boolean update()
{
EntityLiving entity = this.getEntityHandle();
NMSUtil.getControllerLook(entity).a(this.m_nearestGolem, 30, 30);
if(this.m_nearestGolem.bV() == this.m_takeFlowerTick)
if(this.m_nearestGolem.bZ() == this.m_takeFlowerTick)
{
this.getNavigation().a(this.m_nearestGolem, this.getRemoteEntity().getSpeed());
this.m_takeFlower = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.kumpelblase2.remoteentities.api.thinking.goals;

import java.util.List;
import net.minecraft.server.v1_6_R3.*;
import net.minecraft.server.v1_7_R1.*;
import de.kumpelblase2.remoteentities.api.RemoteEntity;
import de.kumpelblase2.remoteentities.api.thinking.DesireBase;
import de.kumpelblase2.remoteentities.api.thinking.DesireType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.kumpelblase2.remoteentities.api.thinking.goals;

import net.minecraft.server.v1_6_R3.*;
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
import net.minecraft.server.v1_7_R1.*;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import de.kumpelblase2.remoteentities.api.RemoteEntity;
import de.kumpelblase2.remoteentities.api.thinking.*;
import de.kumpelblase2.remoteentities.api.thinking.selectors.EntitySelectorViewable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.kumpelblase2.remoteentities.api.thinking.goals;

import java.util.Random;
import net.minecraft.server.v1_6_R3.*;
import net.minecraft.server.v1_7_R1.*;
import org.bukkit.Location;
import de.kumpelblase2.remoteentities.api.RemoteEntity;
import de.kumpelblase2.remoteentities.api.thinking.DesireBase;
Expand Down Expand Up @@ -47,7 +47,7 @@ public boolean shouldExecute()
return false;
else if(!entity.isBurning())
return false;
else if(!entity.world.l(MathHelper.floor(entity.locX), (int)entity.boundingBox.b, MathHelper.floor(entity.locZ)))
else if(!entity.world.i(MathHelper.floor(entity.locX), (int)entity.boundingBox.b, MathHelper.floor(entity.locZ)))
return false;
else
{
Expand Down Expand Up @@ -75,7 +75,7 @@ public boolean canContinue()
protected Vec3D getShadowPlace()
{
EntityLiving entity = this.getEntityHandle();
Random r = entity.aD();
Random r = entity.aI();

for(int i = 0; i < 10; i++)
{
Expand All @@ -85,12 +85,12 @@ protected Vec3D getShadowPlace()

if(entity instanceof EntityCreature)
{
if(!entity.world.l(x, y, z) && ((EntityCreature)entity).a(x, y, z) < 0.0F)
if(!entity.world.i(x, y, z) && ((EntityCreature)entity).a(x, y, z) < 0.0F)
return entity.world.getVec3DPool().create(x, y, z);
}
else
{
if(!entity.world.l(x, y, z) && (0.5F - entity.world.q(x, y, z)) < 0.0F)
if(!entity.world.i(x, y, z) && (0.5F - entity.world.n(x, y, z)) < 0.0F)
return entity.world.getVec3DPool().create(x, y, z);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.kumpelblase2.remoteentities.api.thinking.goals;

import net.minecraft.server.v1_6_R3.EntityHuman;
import net.minecraft.server.v1_6_R3.EntityWolf;
import net.minecraft.server.v1_7_R1.EntityHuman;
import net.minecraft.server.v1_7_R1.EntityWolf;
import org.bukkit.Material;
import de.kumpelblase2.remoteentities.api.RemoteEntity;
import de.kumpelblase2.remoteentities.api.thinking.DesireBase;
Expand Down Expand Up @@ -57,7 +57,7 @@ public void startExecuting()
if(this.getEntityHandle() instanceof EntityWolf)
((EntityWolf)this.getEntityHandle()).m(true);

this.m_ticks = 40 + this.getEntityHandle().aD().nextInt(40);
this.m_ticks = 40 + this.getEntityHandle().aI().nextInt(40);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package de.kumpelblase2.remoteentities.api.thinking.goals;

import java.util.*;
import net.minecraft.server.v1_6_R3.*;
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftLivingEntity;
import net.minecraft.server.v1_7_R1.*;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftLivingEntity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
import de.kumpelblase2.remoteentities.api.RemoteEntity;
Expand Down Expand Up @@ -70,7 +70,7 @@ public boolean shouldExecute()
else if(this.getEntityHandle() instanceof EntityAnimal)
{
EntityAnimal entity = (EntityAnimal)this.getEntityHandle();
if(!entity.bY())
if(!entity.cc())
return false;
else
{
Expand Down Expand Up @@ -151,12 +151,12 @@ else if(this.m_mate instanceof EntityAnimal)
if(this.getRemoteEntity().getFeatures().hasFeature(MateFeature.class))
this.getRemoteEntity().getFeatures().getFeature(MateFeature.class).resetAffection();
else
((EntityAnimal)this.getEntityHandle()).bZ();
((EntityAnimal)this.getEntityHandle()).cd();

if(this.m_mate instanceof RemoteEntityHandle && ((RemoteEntityHandle)this.m_mate).getRemoteEntity().getFeatures().hasFeature(MateFeature.class))
((RemoteEntityHandle)this.m_mate).getRemoteEntity().getFeatures().getFeature(MateFeature.class).resetAffection();
else if(this.m_mate instanceof EntityAnimal)
((EntityAnimal)this.m_mate).bZ();
((EntityAnimal)this.m_mate).cd();

EntityLiving entity = this.getEntityHandle();
if(baby instanceof RemoteEntityHandle && ((RemoteEntityHandle)baby).getRemoteEntity().getFeatures().hasFeature(AgeFeature.class))
Expand All @@ -166,7 +166,7 @@ else if(baby instanceof EntityAgeable)

((CraftLivingEntity)baby).getHandle().setPositionRotation(entity.locX, entity.locY, entity.locZ, 0, 0);
entity.world.addEntity(((CraftLivingEntity)baby).getHandle(), SpawnReason.BREEDING);
Random r = entity.aD();
Random r = entity.aI();
for(int i = 0; i < 7; ++i)
{
double d0 = r.nextGaussian() * 0.02D;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package de.kumpelblase2.remoteentities.api.thinking.goals;

import net.minecraft.server.v1_6_R3.*;
import net.minecraft.server.v1_7_R1.*;
import de.kumpelblase2.remoteentities.api.RemoteEntity;
import de.kumpelblase2.remoteentities.api.thinking.DesireType;
import de.kumpelblase2.remoteentities.utilities.NMSUtil;
Expand Down Expand Up @@ -46,7 +46,7 @@ public boolean shouldExecute()

Village nextVillage;
if(this.getEntityHandle() instanceof EntityIronGolem)
nextVillage = ((EntityIronGolem)this.getEntityHandle()).bT();
nextVillage = ((EntityIronGolem)this.getEntityHandle()).bX();
else
nextVillage = WorldUtilities.getClosestVillage(this.getEntityHandle());

Expand All @@ -57,7 +57,7 @@ public boolean shouldExecute()
this.m_nextTarget = nextVillage.b(this.getEntityHandle());
if(!this.isSuitableTarget(this.m_nextTarget, false))
{
if(this.getEntityHandle().aD().nextInt(20) == 0)
if(this.getEntityHandle().aI().nextInt(20) == 0)
{
this.m_nextTarget = nextVillage.c(this.getEntityHandle());
return this.isSuitableTarget(this.m_nextTarget, false);
Expand Down
Loading

0 comments on commit 7ea92ab

Please sign in to comment.