Skip to content

Commit

Permalink
ItemSupplier now "locks" the item that was firstly put in.
Browse files Browse the repository at this point in the history
This is to combat the trend of mis-clicking.
This may subject to change in the future.
  • Loading branch information
3TUSK committed Aug 20, 2022
1 parent a72b6af commit 90c85c6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void attack(BlockState state, Level level, BlockPos pos, Player player) {
@Override
public InteractionResult use(BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
if (level.getBlockEntity(pos) instanceof ItemSupplierBlockEntity theBE) {
if (player.getAbilities().instabuild) {
if (theBE.theItem.isEmpty() && player.getAbilities().instabuild) {
theBE.theItem = player.getItemInHand(hand).copy();
if (!level.isClientSide) {
theBE.setChanged();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/powertool/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"block.powertool.power_supply": "Power Supply",
"block.powertool.trash_can": "Trash Can",
"block.powertool.item_supplier": "Item Supplier",
"block.powertool.item_supplier.tooltip": "In creative mode, right-click to put held items in. In other modes, left-click or right-click to get unlimited items out.",
"block.powertool.item_supplier.tooltip": "In creative mode, right-click to permanently put held items in. After that, left-click or right-click to get unlimited items out.",
"block.powertool.cosmetic_hopper": "Hopper (Cosmetic)",
"block.powertool.cosmetic_hopper.tooltip": "No functionality, safe for buildings",
"block.powertool.cosmetic_campfire": "Campfire (Cosmetic)",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/powertool/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"block.powertool.power_supply": "电源",
"block.powertool.trash_can": "垃圾桶",
"block.powertool.item_supplier": "供货箱",
"block.powertool.item_supplier.tooltip": "创造模式下右击放入物品,其他模式下左击右击都可以取出不限量物品",
"block.powertool.item_supplier.tooltip": "创造模式下右击永久放入物品,此后不论左击右击都可以取出不限量物品",
"block.powertool.cosmetic_hopper": "漏斗(装饰品)",
"block.powertool.cosmetic_hopper.tooltip": "没有实际功能,可放心在建筑中使用",
"block.powertool.cosmetic_campfire": "营火(装饰品)",
Expand Down

0 comments on commit 90c85c6

Please sign in to comment.