[Bleeding] Set dependency for dev-module to CB 1.5.2-R0.1.

This commit is contained in:
asofold 2013-05-01 20:36:16 +02:00
parent 00a240ff9a
commit 5e8cf481a1
4 changed files with 40 additions and 39 deletions

View File

@ -22,7 +22,7 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.5.1-R0.3-SNAPSHOT</version>
<version>1.5.2-R0.1-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@ -3,16 +3,16 @@ package fr.neatmonster.nocheatplus.compat.cbdev;
import java.util.Iterator;
import java.util.List;
import net.minecraft.server.v1_5_R2.AxisAlignedBB;
import net.minecraft.server.v1_5_R2.EntityBoat;
import net.minecraft.server.v1_5_R2.IBlockAccess;
import net.minecraft.server.v1_5_R2.Material;
import net.minecraft.server.v1_5_R2.TileEntity;
import net.minecraft.server.v1_5_R2.Vec3DPool;
import net.minecraft.server.v1_5_R3.AxisAlignedBB;
import net.minecraft.server.v1_5_R3.EntityBoat;
import net.minecraft.server.v1_5_R3.IBlockAccess;
import net.minecraft.server.v1_5_R3.Material;
import net.minecraft.server.v1_5_R3.TileEntity;
import net.minecraft.server.v1_5_R3.Vec3DPool;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_5_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_5_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_5_R3.CraftWorld;
import org.bukkit.craftbukkit.v1_5_R3.entity.CraftEntity;
import org.bukkit.entity.Entity;
import fr.neatmonster.nocheatplus.utilities.BlockCache;
@ -22,7 +22,7 @@ public class BlockCacheCBDev extends BlockCache implements IBlockAccess{
/** Box for one time use, no nesting, no extra storing this(!). */
protected static final AxisAlignedBB useBox = AxisAlignedBB.a(0, 0, 0, 0, 0, 0);
protected net.minecraft.server.v1_5_R2.World world;
protected net.minecraft.server.v1_5_R3.World world;
public BlockCacheCBDev(World world) {
setAccess(world);
@ -48,7 +48,7 @@ public class BlockCacheCBDev extends BlockCache implements IBlockAccess{
// TODO: change api for this / use nodes (!)
final int id = getTypeId(x, y, z);
final net.minecraft.server.v1_5_R2.Block block = net.minecraft.server.v1_5_R2.Block.byId[id];
final net.minecraft.server.v1_5_R3.Block block = net.minecraft.server.v1_5_R3.Block.byId[id];
if (block == null) return null;
block.updateShape(this, x, y, z); // TODO: use THIS instead of world.
@ -61,7 +61,7 @@ public class BlockCacheCBDev extends BlockCache implements IBlockAccess{
try{
// TODO: Probably check other ids too before doing this ?
final net.minecraft.server.v1_5_R2.Entity mcEntity = ((CraftEntity) entity).getHandle();
final net.minecraft.server.v1_5_R3.Entity mcEntity = ((CraftEntity) entity).getHandle();
final AxisAlignedBB box = useBox.b(minX, minY, minZ, maxX, maxY, maxZ);
@SuppressWarnings("rawtypes")
@ -69,7 +69,7 @@ public class BlockCacheCBDev extends BlockCache implements IBlockAccess{
@SuppressWarnings("rawtypes")
final Iterator iterator = list.iterator();
while (iterator.hasNext()) {
final net.minecraft.server.v1_5_R2.Entity other = (net.minecraft.server.v1_5_R2.Entity) iterator.next();
final net.minecraft.server.v1_5_R3.Entity other = (net.minecraft.server.v1_5_R3.Entity) iterator.next();
if (!(other instanceof EntityBoat)){ // && !(other instanceof EntityMinecart)) continue;
continue;
}

View File

@ -1,19 +1,19 @@
package fr.neatmonster.nocheatplus.compat.cbdev;
import net.minecraft.server.v1_5_R2.AxisAlignedBB;
import net.minecraft.server.v1_5_R2.Block;
import net.minecraft.server.v1_5_R2.DamageSource;
import net.minecraft.server.v1_5_R2.EntityComplexPart;
import net.minecraft.server.v1_5_R2.EntityPlayer;
import net.minecraft.server.v1_5_R2.MobEffectList;
import net.minecraft.server.v1_5_R3.AxisAlignedBB;
import net.minecraft.server.v1_5_R3.Block;
import net.minecraft.server.v1_5_R3.DamageSource;
import net.minecraft.server.v1_5_R3.EntityComplexPart;
import net.minecraft.server.v1_5_R3.EntityPlayer;
import net.minecraft.server.v1_5_R3.MobEffectList;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.command.CommandMap;
import org.bukkit.craftbukkit.v1_5_R2.CraftServer;
import org.bukkit.craftbukkit.v1_5_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_5_R2.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_5_R3.CraftServer;
import org.bukkit.craftbukkit.v1_5_R3.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_5_R3.entity.CraftPlayer;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
@ -31,18 +31,18 @@ public class MCAccessCBDev implements MCAccess{
*/
public MCAccessCBDev(){
getCommandMap();
ReflectionUtil.checkMembers("net.minecraft.server.v1_5_R2.", new String[]{"Entity" , "dead"});
ReflectionUtil.checkMembers("net.minecraft.server.v1_5_R3.", new String[]{"Entity" , "dead"});
}
@Override
public String getMCVersion() {
// 1_5_R2
return "1.5.1";
// 1_5_R3
return "1.5.2";
}
@Override
public String getServerVersionTag() {
return "CB2691-DEV";
return "CB2763-DEV";
}
@Override
@ -57,7 +57,7 @@ public class MCAccessCBDev implements MCAccess{
@Override
public double getHeight(final Entity entity) {
final net.minecraft.server.v1_5_R2.Entity mcEntity = ((CraftEntity) entity).getHandle();
final net.minecraft.server.v1_5_R3.Entity mcEntity = ((CraftEntity) entity).getHandle();
final double entityHeight = Math.max(mcEntity.length, Math.max(mcEntity.height, mcEntity.boundingBox.e - mcEntity.boundingBox.b));
if (entity instanceof LivingEntity) {
return Math.max(((LivingEntity) entity).getEyeHeight(), entityHeight);
@ -106,7 +106,7 @@ public class MCAccessCBDev implements MCAccess{
@Override
public double getJumpAmplifier(final Player player) {
final net.minecraft.server.v1_5_R2.EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
final net.minecraft.server.v1_5_R3.EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
if (mcPlayer.hasEffect(MobEffectList.JUMP)) return mcPlayer.getEffect(MobEffectList.JUMP).getAmplifier();
else return Double.NEGATIVE_INFINITY;
@ -114,7 +114,7 @@ public class MCAccessCBDev implements MCAccess{
@Override
public double getFasterMovementAmplifier(final Player player) {
final net.minecraft.server.v1_5_R2.EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
final net.minecraft.server.v1_5_R3.EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
if (mcPlayer.hasEffect(MobEffectList.FASTER_MOVEMENT)) return mcPlayer.getEffect(MobEffectList.FASTER_MOVEMENT).getAmplifier();
else return Double.NEGATIVE_INFINITY;
}
@ -141,13 +141,13 @@ public class MCAccessCBDev implements MCAccess{
@Override
public boolean shouldBeZombie(final Player player) {
final net.minecraft.server.v1_5_R2.EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
final net.minecraft.server.v1_5_R3.EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
return !mcPlayer.dead && mcPlayer.getHealth() <= 0 ;
}
@Override
public void setDead(final Player player, final int deathTicks) {
final net.minecraft.server.v1_5_R2.EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
final net.minecraft.server.v1_5_R3.EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
mcPlayer.deathTicks = deathTicks;
mcPlayer.dead = true;
}

View File

@ -10,6 +10,7 @@ import fr.neatmonster.nocheatplus.compat.cb2545.MCAccessCB2545;
import fr.neatmonster.nocheatplus.compat.cb2602.MCAccessCB2602;
import fr.neatmonster.nocheatplus.compat.cb2645.MCAccessCB2645;
import fr.neatmonster.nocheatplus.compat.cb2691.MCAccessCB2691;
import fr.neatmonster.nocheatplus.compat.cbdev.MCAccessCBDev;
import fr.neatmonster.nocheatplus.config.ConfPaths;
import fr.neatmonster.nocheatplus.config.ConfigManager;
import fr.neatmonster.nocheatplus.logging.LogUtil;
@ -49,14 +50,14 @@ public class MCAccessFactory {
if (!bukkitOnly){
// TEST //
// // Only add as long as no stable module has been added.
// // 1.5.1
// try{
// return new MCAccessCBDev();
// }
// catch(Throwable t){
// throwables.add(t);
// };
// Only add as long as no stable module has been added.
// 1.5.2
try{
return new MCAccessCBDev();
}
catch(Throwable t){
throwables.add(t);
};
// TEST END //
// 1.5.1 (cb beta)