Dispenser Wand Functionality for Sneak-Right Clicking. (#3165)

* Update TilePool.java

* Break Force Relay with dispenser.

Why not?

* Hopperhock cycle filter type with dispenser.

This could lead to new functionality and could certainly not break anything.

* Reverse or change turntable speed with wand.

Reverse if in function mode, or cycle speed if in bind mode.

* Look who missed a parenthesis.

* Fix crash.

* Lexicon Additions

Since these actions normally require sneaking, it may be ambiguous whether a dispenser can perform it.

* Fix typo in Spreader Turntable entry.

* Side distinction rather than mode distinction for turntable.
This commit is contained in:
Eutro authored and GitHub committed 2020-02-25 12:42:32 -06:00
1 parent d365273ead
commit 6f02a65c60
7 files changed
+23 -23

No files matched your search

@@ -117,10 +117,13 @@ public class BlockPistonRelay extends BlockMod implements IWandable {
@Override
public boolean onUsedByWand(PlayerEntity player, ItemStack stack, World world, BlockPos pos, Direction side) {
if(player == null || world.isRemote)
if(world.isRemote)
return false;
if(!player.isSneaking()) {
if(player == null || player.isSneaking()) {
spawnAsEntity(world, pos, new ItemStack(this));
world.destroyBlock(pos, false);
} else {
GlobalPos clicked = GlobalPos.of(world.getDimension().getType(), pos.toImmutable());
if(ItemTwigWand.getBindMode(stack)) {
activeBindingAttempts.put(player.getUniqueID(), clicked);
@@ -134,9 +137,6 @@ public class BlockPistonRelay extends BlockMod implements IWandable {
dest.getPos().getX(), dest.getPos().getY(), dest.getPos().getZ()));
}
}
} else {
spawnAsEntity(world, pos, new ItemStack(this));
world.destroyBlock(pos, false);
}
return true;
@@ -53,7 +53,7 @@ public class BlockTurntable extends BlockMod implements IWandable, IWandHUD {
@Override
public boolean onUsedByWand(PlayerEntity player, ItemStack stack, World world, BlockPos pos, Direction side) {
((TileTurntable) world.getTileEntity(pos)).onWanded(player, stack);
((TileTurntable) world.getTileEntity(pos)).onWanded(player, stack, side);
return true;
}
@@ -198,10 +198,7 @@ public class SubTileHopperhock extends TileEntityFunctionalFlower {
@Override
public boolean onWanded(PlayerEntity player, ItemStack wand) {
if(player == null)
return false;
if(player.isSneaking()) {
if(player == null || player.isSneaking()) {
filterType = filterType == 2 ? 0 : filterType + 1;
sync();
@@ -372,10 +372,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt
}
public void onWanded(PlayerEntity player, ItemStack wand) {
if(player == null)
return;
if(player.isSneaking()) {
if(player == null || player.isSneaking()) {
outputting = !outputting;
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos);
}
@@ -388,7 +385,11 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt
((ServerPlayerEntity) player).connection.sendPacket(new SUpdateTileEntityPacket(pos, -999, nbttagcompound));
}
world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.ding, SoundCategory.PLAYERS, 0.11F, 1F);
if(player == null) {
world.playSound(null, getPos(), ModSounds.ding, SoundCategory.PLAYERS, 0.11F, 1F);
} else {
world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.ding, SoundCategory.PLAYERS, 0.11F, 1F);
}
}
@OnlyIn(Dist.CLIENT)
@@ -77,11 +77,8 @@ public class TileTurntable extends TileMod implements ITickableTileEntity {
backwards = cmp.getBoolean(TAG_BACKWARDS);
}
public void onWanded(PlayerEntity player, ItemStack wand) {
if(player == null)
return;
if(player.isSneaking())
public void onWanded(PlayerEntity player, ItemStack wand, Direction side) {
if((player != null && player.isSneaking()) || (player == null && side == Direction.DOWN))
backwards = !backwards;
else speed = speed == 6 ? 1 : speed + 1;
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos);
@@ -1908,7 +1908,7 @@
"botania.entry.manaTablet": "Mana Tablet",
"botania.tagline.manaTablet": "Portable Mana Storage",
"botania.page.manaTablet0": "Using $(l:mana/spreader)$(item)Mana Spreaders$(0)$(/l) to transport $(thing)Mana$(0) is all well and good, but there are other ways of getting the stuff around too.$(p)The $(item)Mana Tablet$(0) is a portable item that can carry $(thing)Mana$(0) within itself.$(p)In addition, other items in an inventory can draw from it for their own use, making it an essential tool.",
"botania.page.manaTablet1": "Tossing a tablet into a $(l:mana/pool)$(item)Mana Pool$(0)$(/l) will allow for flow of $(thing)Mana$(0) between them.$(p)Sneak-right clicking the $(l:mana/pool)$(item)Mana Pool$(0)$(/l) with a $(l:basics/wand)$(item)Wand of the Forest$(0)$(/l) will change which way the $(thing)Mana$(0) will flow.$(p)Unlike normal items, dropped tablets never despawn.",
"botania.page.manaTablet1": "Tossing a tablet into a $(l:mana/pool)$(item)Mana Pool$(0)$(/l) will allow for flow of $(thing)Mana$(0) between them.$(p)Sneak-right clicking (or using a $(item)Dispenser$(0)) on the $(l:mana/pool)$(item)Mana Pool$(0)$(/l) with a $(l:basics/wand)$(item)Wand of the Forest$(0)$(/l) will change which way the $(thing)Mana$(0) will flow.$(p)Unlike normal items, dropped tablets never despawn.",
"botania.page.manaTablet2": "Sadly, it doesn't have wifi",
"botania.entry.manaMirror": "Mana Mirror",
@@ -2054,7 +2054,7 @@
"botania.entry.hopperhock": "Hopperhock",
"botania.tagline.hopperhock": "Picks up items",
"botania.page.hopperhock0": "The $(item)Hopperhock$(0) simply picks up items around it and put them in adjacent inventories (like $(item)Chests$(0)). $(thing)Mana$(0) is optional, but will increase its range if provided.$(p)Placing $(item)Item Frames$(0) on adjacent inventories will specify which items can or can't go in them.",
"botania.page.hopperhock1": "Any inventory with no adjacent $(item)Item Frame$(0) can accept any items, but labelled inventories will take priority.$(p)The rule used to sort items can be changed by sneak-right clicking the flower with a $(l:basics/wand)$(item)Wand of the Forest$(0)$(/l) in $(thing)Function Mode$(0).",
"botania.page.hopperhock1": "Any inventory with no adjacent $(item)Item Frame$(0) can accept any items, but labelled inventories will take priority.$(p)The rule used to sort items can be changed by sneak-right clicking (or using a $(item)Dispenser$(0)) on the flower with a $(l:basics/wand)$(item)Wand of the Forest$(0)$(/l) in $(thing)Function Mode$(0).",
"botania.page.hopperhock2": "$(o)Hungry hungry flowers$().",
"botania.entry.tangleberrie": "Tangleberrie",
@@ -2247,6 +2247,7 @@
"botania.entry.turntable": "Spreader Turntable",
"botania.tagline.turntable": "Spin spreaders around",
"botania.page.turntable0": "The $(item)Spreader Turntable$(0), as its name implies, continually rotates a $(l:mana/spreader)$(item)Mana Spreaders$(0)$(/l) placed upon it. Placing a spreader on a turntable will set it spinning; a redstone signal pauses its spin.$(p)To change the speed of a turntable, right-click it with a $(l:basics/wand)$(item)Wand of the Forest$(0)$(/l); sneak-right clicking it will change its direction.",
"botania.page.turntable2": "Similarly, a $(item)Dispenser$(0) with a $(l:basics/wand)$(item)Wand of the Forest$(0)$(/l) from the side will change the speed, and one from the bottom will change the direction.",
"botania.page.turntable1": "You spin me right round",
"botania.entry.manaAlchemy": "Alchemising with Mana",
@@ -2759,7 +2760,7 @@
"botania.entry.pistonRelay": "Force Relay",
"botania.tagline.pistonRelay": "Remote piston extension",
"botania.page.pistonRelay0": "It seems that $(item)Pistons$(0) and $(thing)Mana$(0) react in strange ways. The former, when infused with the latter, becomes a $(item)Force Relay$(0), a block that tears the fabric of space. When one of these is pushed by a $(item)Piston$(0), the block it's bound to is pushed the exact same way.$(p)To bind it to a block, right-click it with a $(l:basics/wand)$(item)Wand of the Forest$(0)$(/l), then right-click on the block you want to bind it to.",
"botania.page.pistonRelay1": "To retrieve a $(item)Force Relay$(0), sneak-right click it with a $(l:basics/wand)$(item)Wand of the Forest$(0)$(/l); any other attempts to retrieve it (including $(thing)Silk Touch$(0)) will destroy it.$(p)Furthermore, this block is highly unstable, and may create uncanny effects; care should be taken with it. It ignores pushes and pulls from $(item)Sticky Pistons$(0) entirely, allowing for the building of piston \"frames.\"",
"botania.page.pistonRelay1": "To retrieve a $(item)Force Relay$(0), sneak-right click it, or use a $(item)Dispenser$(0) on it, with a $(l:basics/wand)$(item)Wand of the Forest$(0)$(/l); any other attempts to retrieve it (including $(thing)Silk Touch$(0)) will destroy it.$(p)Furthermore, this block is highly unstable, and may create uncanny effects; care should be taken with it. It ignores pushes and pulls from $(item)Sticky Pistons$(0) entirely, allowing for the building of piston \"frames.\"",
"botania.page.pistonRelay2": "Infusing a $(item)Piston$(0) with $(thing)Mana$(0).",
"botania.entry.enderHand": "Hand of Ender",
@@ -7,6 +7,10 @@
{
"type": "text",
"text": "botania.page.turntable0"
},
{
"type": "text",
"text": "botania.page.turntable2"
},
{
"type": "crafting",