mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-12-27 10:57:47 +01:00
[BLEEDING] Set DEV module to 1.5.1.
This commit is contained in:
parent
72c69df73c
commit
d6d465418f
@ -22,7 +22,7 @@
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.5-R0.1-SNAPSHOT</version>
|
||||
<version>1.5.1-R0.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -3,16 +3,16 @@ package fr.neatmonster.nocheatplus.compat.cbdev;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.server.v1_5_R1.AxisAlignedBB;
|
||||
import net.minecraft.server.v1_5_R1.EntityBoat;
|
||||
import net.minecraft.server.v1_5_R1.IBlockAccess;
|
||||
import net.minecraft.server.v1_5_R1.Material;
|
||||
import net.minecraft.server.v1_5_R1.TileEntity;
|
||||
import net.minecraft.server.v1_5_R1.Vec3DPool;
|
||||
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 org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.v1_5_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_5_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_5_R2.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_5_R2.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_R1.World world;
|
||||
protected net.minecraft.server.v1_5_R2.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_R1.Block block = net.minecraft.server.v1_5_R1.Block.byId[id];
|
||||
final net.minecraft.server.v1_5_R2.Block block = net.minecraft.server.v1_5_R2.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_R1.Entity mcEntity = ((CraftEntity) entity).getHandle();
|
||||
final net.minecraft.server.v1_5_R2.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_R1.Entity other = (net.minecraft.server.v1_5_R1.Entity) iterator.next();
|
||||
final net.minecraft.server.v1_5_R2.Entity other = (net.minecraft.server.v1_5_R2.Entity) iterator.next();
|
||||
if (!(other instanceof EntityBoat)){ // && !(other instanceof EntityMinecart)) continue;
|
||||
continue;
|
||||
}
|
||||
|
@ -1,18 +1,18 @@
|
||||
package fr.neatmonster.nocheatplus.compat.cbdev;
|
||||
|
||||
import net.minecraft.server.v1_5_R1.AxisAlignedBB;
|
||||
import net.minecraft.server.v1_5_R1.Block;
|
||||
import net.minecraft.server.v1_5_R1.DamageSource;
|
||||
import net.minecraft.server.v1_5_R1.EntityComplexPart;
|
||||
import net.minecraft.server.v1_5_R1.EntityPlayer;
|
||||
import net.minecraft.server.v1_5_R1.MobEffectList;
|
||||
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 org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.CommandMap;
|
||||
import org.bukkit.craftbukkit.v1_5_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_5_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_5_R1.entity.CraftPlayer;
|
||||
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.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -30,18 +30,18 @@ public class MCAccessCBDev implements MCAccess{
|
||||
*/
|
||||
public MCAccessCBDev(){
|
||||
getCommandMap();
|
||||
ReflectionUtil.checkMembers("net.minecraft.server.v1_5_R1.", new String[]{"Entity" , "dead"});
|
||||
ReflectionUtil.checkMembers("net.minecraft.server.v1_5_R2.", new String[]{"Entity" , "dead"});
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMCVersion() {
|
||||
// 1_5_R1
|
||||
return "1.5";
|
||||
// 1_5_R2
|
||||
return "1.5.1";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getServerVersionTag() {
|
||||
return "CB-DEV(2645+)";
|
||||
return "CB2691-DEV";
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -56,7 +56,7 @@ public class MCAccessCBDev implements MCAccess{
|
||||
|
||||
@Override
|
||||
public double getHeight(final Entity entity) {
|
||||
final net.minecraft.server.v1_5_R1.Entity mcEntity = ((CraftEntity) entity).getHandle();
|
||||
final net.minecraft.server.v1_5_R2.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);
|
||||
@ -105,7 +105,7 @@ public class MCAccessCBDev implements MCAccess{
|
||||
|
||||
@Override
|
||||
public double getJumpAmplifier(final Player player) {
|
||||
final net.minecraft.server.v1_5_R1.EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
|
||||
final net.minecraft.server.v1_5_R2.EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
|
||||
|
||||
if (mcPlayer.hasEffect(MobEffectList.JUMP)) return mcPlayer.getEffect(MobEffectList.JUMP).getAmplifier();
|
||||
else return Double.NEGATIVE_INFINITY;
|
||||
@ -113,7 +113,7 @@ public class MCAccessCBDev implements MCAccess{
|
||||
|
||||
@Override
|
||||
public double getFasterMovementAmplifier(final Player player) {
|
||||
final net.minecraft.server.v1_5_R1.EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
|
||||
final net.minecraft.server.v1_5_R2.EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
|
||||
if (mcPlayer.hasEffect(MobEffectList.FASTER_MOVEMENT)) return mcPlayer.getEffect(MobEffectList.FASTER_MOVEMENT).getAmplifier();
|
||||
else return Double.NEGATIVE_INFINITY;
|
||||
}
|
||||
@ -140,13 +140,13 @@ public class MCAccessCBDev implements MCAccess{
|
||||
|
||||
@Override
|
||||
public boolean shouldBeZombie(final Player player) {
|
||||
final net.minecraft.server.v1_5_R1.EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
|
||||
final net.minecraft.server.v1_5_R2.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_R1.EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
|
||||
final net.minecraft.server.v1_5_R2.EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
|
||||
mcPlayer.deathTicks = deathTicks;
|
||||
mcPlayer.dead = true;
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import fr.neatmonster.nocheatplus.compat.cb2512.MCAccessCB2512;
|
||||
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.cbdev.MCAccessCBDev;
|
||||
import fr.neatmonster.nocheatplus.config.ConfPaths;
|
||||
import fr.neatmonster.nocheatplus.config.ConfigManager;
|
||||
import fr.neatmonster.nocheatplus.logging.LogUtil;
|
||||
@ -37,16 +38,16 @@ public class MCAccessFactory {
|
||||
// Try to set up native access.
|
||||
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);
|
||||
// };
|
||||
// // TEST END //
|
||||
// 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);
|
||||
};
|
||||
// TEST END //
|
||||
|
||||
// 1.5
|
||||
try{
|
||||
|
Loading…
Reference in New Issue
Block a user