Skip to content
This repository has been archived by the owner on Jul 1, 2018. It is now read-only.

Commit

Permalink
Various fixes from updating
Browse files Browse the repository at this point in the history
 - Bump unborked version
 - Ensure pocket computers work with hands now
  • Loading branch information
SquidDev committed Apr 27, 2017
1 parent 738245e commit 5b88236
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion gradle/scripts/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dependencies {
}

shade('org.squiddev:Patcher:1.2.4') { exclude group: 'org.ow2.asm' }
compile "org.squiddev:unborked:${mc_version}-${cc_version}-1.0.4:dev"
compile "org.squiddev:unborked:${mc_version}-${cc_version}-1.0.6:dev"
provided('org.squiddev:ConfigGen:1.2.5') { exclude group: 'net.minecraftforge' }

testCompile group: "junit", name: "junit", version: "4.12"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public String getCommandName() {
@Nonnull
@Override
public String getCommandUsage(@Nonnull ICommandSender sender) {
return "/" + command.getName() + " " + command.getUsage(new CommandContext(server, sender, command));
return "/" + command.getName() + " " + command.getUsage(new CommandContext(sender.getServer(), sender, command));
}

@Nonnull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
* Note: this container is also used by printed pages so we have to check it is a pocket computer first.
*/
public abstract class ContainerHeldItem_Patch extends ContainerHeldItem implements IContainerComputer {
@MergeVisitor.Stub
private final ItemStack m_stack = null;

@MergeVisitor.Stub
public ContainerHeldItem_Patch() {
super(null);
Expand All @@ -28,7 +25,10 @@ public ContainerHeldItem_Patch() {
@Nullable
@Override
public IComputer getComputer() {
NBTTagCompound compound = m_stack.getTagCompound();
ItemStack stack = getStack();
if (stack == null) return null;

NBTTagCompound compound = stack.getTagCompound();
if (compound == null) return null;

if (!compound.hasKey("instanceID", 99) || !compound.hasKey("sessionID", 99)) return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.squiddev.cctweaks.core.utils.DebugLogger;
import org.squiddev.cctweaks.core.utils.Helpers;
import org.squiddev.patcher.visitors.MergeVisitor;
import org.squiddev.unborked.ProxyServer;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
Expand All @@ -41,17 +42,15 @@ public class ItemPocketComputer_Patch extends ItemPocketComputer implements ICom
@Override
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack stack, World world, EntityPlayer player, EnumHand hand) {
if (!world.isRemote) {
ServerComputer computer = createServerComputer(world, player.inventory, stack);
ServerComputer computer = this.createServerComputer(world, player.inventory, stack);
if (computer != null) computer.turnOn();

if (PocketHooks.rightClick(world, player, stack, computer)) {
return ActionResult.newResult(EnumActionResult.SUCCESS, stack);
if (!PocketHooks.rightClick(world, player, stack, computer)) {
ProxyServer.openPocketComputerGUI(player, hand);
}

ComputerCraft.openPocketComputerGUI(player);
}

return ActionResult.newResult(EnumActionResult.PASS, stack);
return ActionResult.newResult(EnumActionResult.SUCCESS, stack);
}

@Nonnull
Expand Down

0 comments on commit 5b88236

Please sign in to comment.