Skip to content

Commit

Permalink
Update the switch command
Browse files Browse the repository at this point in the history
step 1 on my list of things to update >.>
  • Loading branch information
mcmonkey4eva committed Nov 29, 2014
1 parent 69b6888 commit 530eb67
Showing 1 changed file with 11 additions and 9 deletions.
@@ -1,5 +1,6 @@
package net.aufdemrand.denizen.scripts.commands.world;

import com.google.common.collect.ImmutableMap;
import net.aufdemrand.denizen.BukkitScriptEntryData;
import net.aufdemrand.denizen.utilities.DenizenAPI;
import net.aufdemrand.denizen.utilities.depends.Depends;
Expand All @@ -14,7 +15,7 @@
import net.aufdemrand.denizen.utilities.debugging.dB;
import net.citizensnpcs.api.CitizensAPI;
import net.citizensnpcs.api.npc.NPC;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.*;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
Expand All @@ -23,6 +24,7 @@
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;

import java.util.Collection;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

Expand Down Expand Up @@ -155,15 +157,15 @@ else if (Depends.citizens != null) {
else {

// TODO: Rewrite the below code to not use freakin' NMS!
/*
BlockPosition pos =
new BlockPosition(interactLocation.getBlockX(),
interactLocation.getBlockY(),
interactLocation.getBlockZ());
Block.getById(interactLocation.getBlock().getType().getId())
.interact(((CraftWorld)world).getHandle(),
interactLocation.getBlockX(),
interactLocation.getBlockY(),
interactLocation.getBlockZ(),
craftPlayer != null ? craftPlayer.getHandle(): null, 0, 0f, 0f, 0f);
*/
// TODO: 1.8 UPDATE
.interact(((CraftWorld) interactLocation.getWorld()).getHandle(),
pos,
((CraftWorld) interactLocation.getWorld()).getHandle().getType(pos),
craftPlayer != null ? craftPlayer.getHandle() : null, EnumDirection.NORTH, 0f, 0f, 0f);
}

dB.echoDebug(scriptEntry, "Switched " + interactLocation.getBlock().getType().toString() + "! Current state now: " +
Expand Down

0 comments on commit 530eb67

Please sign in to comment.