Skip to content

Commit

Permalink
merge compatibility-1.7.10 branch with this one
Browse files Browse the repository at this point in the history
  • Loading branch information
blackwolf12333 committed Aug 16, 2014
2 parents 64970e2 + e75c4b7 commit d3e8802
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
JFLAGS = -g -d bin -classpath "libs/craftbukkit1.4.7.jar:libs/craftbukkit1.5.2.jar:libs/craftbukkit1.5_R2.jar:libs/craftbukkit1.6.1.jar:libs/craftbukkit1.6.2.jar:libs/jcsv-1.4.0.jar:libs/craftbukkit-1.6.4.jar:libs/craftbukkit1.7.2.jar:libs/craftbukkit-1.7.9.jar:libs/craftbukkit-1.7.5.jar:libs/worldedit-5.6.2.jar:bin"
JFLAGS = -g -d bin -classpath "libs/craftbukkit1.4.7.jar:libs/craftbukkit1.5.2.jar:libs/craftbukkit1.5_R2.jar:libs/craftbukkit1.6.1.jar:libs/craftbukkit1.6.2.jar:libs/jcsv-1.4.0.jar:libs/craftbukkit-1.6.4.jar:libs/craftbukkit1.7.2.jar:libs/craftbukkit-1.7.9.jar:libs/craftbukkit-1.7.5.jar:libs/craftbukkit-1.7.10.jar:libs/worldedit-5.6.2.jar:bin"
JC = javac
JAR = jar
JARFLAGS = cf GriefLog.jar -C bin
Expand Down
Binary file added libs/craftbukkit-1.7.10.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions sourcefiles
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ src/tk/blackwolf12333/grieflog/compatibility/v1_5_R3/ChangesSender.java
src/tk/blackwolf12333/grieflog/compatibility/FastBlockSetterInterface.java
src/tk/blackwolf12333/grieflog/compatibility/v1_7_R1/FastBlockSetter.java
src/tk/blackwolf12333/grieflog/compatibility/v1_7_R1/ChangesSender.java
src/tk/blackwolf12333/grieflog/compatibility/v1_7_R4/FastBlockSetter.java
src/tk/blackwolf12333/grieflog/compatibility/v1_7_R4/ChangesSender.java
src/tk/blackwolf12333/grieflog/compatibility/v1_5_R2/FastBlockSetter.java
src/tk/blackwolf12333/grieflog/compatibility/v1_5_R2/ChangesSender.java
src/tk/blackwolf12333/grieflog/compatibility/ChangesSenderInterface.java
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package tk.blackwolf12333.grieflog.compatibility.v1_7_R4;

import java.util.HashSet;

import org.bukkit.Chunk;
import org.bukkit.entity.Player;

import tk.blackwolf12333.grieflog.rollback.SendChangesTask;
import tk.blackwolf12333.grieflog.compatibility.ChangesSenderInterface;

public class ChangesSender implements ChangesSenderInterface {
@SuppressWarnings("unchecked")
@Override
public void sendChanges(SendChangesTask task, HashSet<Chunk> chunks) {
HashSet<net.minecraft.server.v1_7_R4.ChunkCoordIntPair> pairs = new HashSet<net.minecraft.server.v1_7_R4.ChunkCoordIntPair>();
for (Chunk c : chunks) {
pairs.add(new net.minecraft.server.v1_7_R4.ChunkCoordIntPair(c.getX(), c.getZ()));
}

for (Player p : task.getPlayers()) {
HashSet<net.minecraft.server.v1_7_R4.ChunkCoordIntPair> queued = new HashSet<net.minecraft.server.v1_7_R4.ChunkCoordIntPair>();
if (p != null) {
net.minecraft.server.v1_7_R4.EntityPlayer ep = ((org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer) p).getHandle();
for (Object o : ep.chunkCoordIntPairQueue) {
queued.add((net.minecraft.server.v1_7_R4.ChunkCoordIntPair) o);
}
for (net.minecraft.server.v1_7_R4.ChunkCoordIntPair pair : pairs) {
if (!queued.contains(pair)) {
ep.chunkCoordIntPairQueue.add(pair);
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package tk.blackwolf12333.grieflog.compatibility.v1_7_R4;

import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Material;

import tk.blackwolf12333.grieflog.compatibility.FastBlockSetterInterface;

public class FastBlockSetter implements FastBlockSetterInterface {
@Override
public void setBlockFast(int x, int y, int z, String world, int typeID, byte data) {
Chunk c = Bukkit.getWorld(world).getChunkAt(x >> 4, z >> 4);
net.minecraft.server.v1_7_R4.Chunk chunk = ((org.bukkit.craftbukkit.v1_7_R4.CraftChunk) c).getHandle();
net.minecraft.server.v1_7_R4.Block block = this.getBlockType(typeID);
chunk.a(x & 15, y, z & 15, block, data); // sets the block at (x,y,z)
}

private net.minecraft.server.v1_7_R4.Block getBlockType(int typeID) {
for(Material m : Material.values()) {
if(m.getId() == typeID) {
try {
return (net.minecraft.server.v1_7_R4.Block) net.minecraft.server.v1_7_R4.Blocks.class.getDeclaredField(m.toString()).get(null);
} catch (SecurityException e) {
e.printStackTrace();
} catch (NoSuchFieldException e) {
e.printStackTrace();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
return net.minecraft.server.v1_7_R4.Blocks.AIR;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void undo(Undo undo) {

@Override
public String toString() {
if(time != null) { // this is only used after searching, I think
if(time != null) {
return this.time + " " + this.event + " By: " + this.playerName + " from: " + this.blockType + ":" + this.blockData + " to: " + this.changedTo + ":" + this.changedToData + " at: " + this.xyz + " in: " + this.worldName;
}
return " " + this.event + " By: " + this.playerName + ":" + playerUUID.toString() + " from: " + this.blockType + ":" + this.blockData + " to: " + this.changedTo + ":" + this.changedToData + " at: " + this.xyz + " in: " + this.worldName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void parse(ArrayList<String> args) throws GriefLogException {
public void checkArgument(char identifier, String arg) {
switch(identifier) {
case 'p':
player = UUID.fromString(UUIDApi.getUUIDAsString(arg));
player = UUIDApi.getUUID(arg);
break;
case 'e':
event = getEventFromAlias(arg);
Expand Down

0 comments on commit d3e8802

Please sign in to comment.