The polish continues

- Fixed water bottles able to be gather by clicking honey or chocolate fluids
- Fixed deployer not parting with its excess items
- Added hint message for backed up deployers
- Fixed basin spoutputs appearing on blocked faces
This commit is contained in:
simibubi 2020-12-09 18:45:47 +01:00
parent 9a7886f406
commit f4961e5ede
15 changed files with 139 additions and 31 deletions

View file

@ -398,16 +398,16 @@ a3a11524cd3515fc01d905767b4b7ea782adaf03 assets/create/blockstates/yellow_seat.j
7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json
b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json
e96a0de54cb3d36052a7bd095808ed46ca0f64fa assets/create/lang/en_ud.json
0764ce807bdddebe92ef99e3fd13e052748b3b41 assets/create/lang/en_us.json
1975c0fceab9ee3d753ec569ac6ecc2c3f5e1f39 assets/create/lang/unfinished/de_de.json
d049baed825c956aa1d00b6deacb9bfe5e116f0d assets/create/lang/unfinished/fr_fr.json
10bf11768a3d403a5fea0f0a850f598d3a3936d8 assets/create/lang/unfinished/it_it.json
8a266673ef48e237c0c4a9790f572d9ed80e1271 assets/create/lang/unfinished/ja_jp.json
6ba9b6af47ff4ec15f15ca4200e2ef095588d5e6 assets/create/lang/unfinished/ko_kr.json
f6025a4e558df63caffacc5db8c33bc129f9bc23 assets/create/lang/unfinished/nl_nl.json
674244ccc19c4d3ad64d3739c64b2722655dbd1c assets/create/lang/unfinished/pt_br.json
8263e5797f22425212d9943c93113f365f9bc9e8 assets/create/lang/unfinished/ru_ru.json
708abafd9e4a2a92fd51d5a57192b30c3e46c0e3 assets/create/lang/unfinished/zh_cn.json
6f79ac70589f7fd6de07e48dec66f441c5ca7818 assets/create/lang/en_us.json
42c095a35221e07aeef0b4b698170cbf62a0894f assets/create/lang/unfinished/de_de.json
fba38fc49535b7638665a1d62bf9e2cd4b747bc5 assets/create/lang/unfinished/fr_fr.json
f446ccbfdd485b2c35c8b54dedf38c11118eb85a assets/create/lang/unfinished/it_it.json
2b4a52e224d5e88ce4219259529ca1a33e9fc85e assets/create/lang/unfinished/ja_jp.json
ed3416742ace57807c12a93bf9cfa1967a4b389f assets/create/lang/unfinished/ko_kr.json
133502bc3f33561734ad7224fbd7ffbe6e4ebd6b assets/create/lang/unfinished/nl_nl.json
92614f1ff6de3997f9f651fae7dae67750d9a624 assets/create/lang/unfinished/pt_br.json
d2a743bab85a496061399e066d29ae76e935a26e assets/create/lang/unfinished/ru_ru.json
d005533b61da04b215048790252419bdee3cbd34 assets/create/lang/unfinished/zh_cn.json
846200eb548d3bfa2e77b41039de159b4b6cfb45 assets/create/models/block/acacia_window.json
1930fa3a3c98d53dd19e4ee7f55bc27fd47aa281 assets/create/models/block/acacia_window_pane_noside.json
1763ea2c9b981d187f5031ba608f3d5d3be3986a assets/create/models/block/acacia_window_pane_noside_alt.json

View file

@ -1010,6 +1010,8 @@
"create.hint.upward_funnel": "can only transfer items inserted by _Arms_, fan-powered _Chutes_, or items _thrown_ at them. Try building some _Chutes_ if you are looking to move your items _vertically_.",
"create.hint.empty_bearing.title": "Update Bearing",
"create.hint.empty_bearing": "_Right-click_ the bearing with an _empty_ _hand_ to _attach_ the structure you just built in front of it.",
"create.hint.full_deployer.title": "Deployer Item Overflow",
"create.hint.full_deployer": "It appears this _Deployer_ contains _excess_ _items_ that need to be _extracted._ Use a _hopper,_ _funnel_ or other means to free it from its overflow.",
"create.gui.config.overlay1": "Hi :)",
"create.gui.config.overlay2": "This is a sample overlay",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1071",
"_": "Missing Localizations: 1073",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1011,6 +1011,8 @@
"create.hint.upward_funnel": "UNLOCALIZED: can only transfer items inserted by _Arms_, fan-powered _Chutes_, or items _thrown_ at them. Try building some _Chutes_ if you are looking to move your items _vertically_.",
"create.hint.empty_bearing.title": "UNLOCALIZED: Update Bearing",
"create.hint.empty_bearing": "UNLOCALIZED: _Right-click_ the bearing with an _empty_ _hand_ to _attach_ the structure you just built in front of it.",
"create.hint.full_deployer.title": "UNLOCALIZED: Deployer Item Overflow",
"create.hint.full_deployer": "UNLOCALIZED: It appears this _Deployer_ contains _excess_ _items_ that need to be _extracted._ Use a _hopper,_ _funnel_ or other means to free it from its overflow.",
"create.gui.config.overlay1": "UNLOCALIZED: Hi :)",
"create.gui.config.overlay2": "UNLOCALIZED: This is a sample overlay",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 701",
"_": "Missing Localizations: 703",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1011,6 +1011,8 @@
"create.hint.upward_funnel": "UNLOCALIZED: can only transfer items inserted by _Arms_, fan-powered _Chutes_, or items _thrown_ at them. Try building some _Chutes_ if you are looking to move your items _vertically_.",
"create.hint.empty_bearing.title": "UNLOCALIZED: Update Bearing",
"create.hint.empty_bearing": "UNLOCALIZED: _Right-click_ the bearing with an _empty_ _hand_ to _attach_ the structure you just built in front of it.",
"create.hint.full_deployer.title": "UNLOCALIZED: Deployer Item Overflow",
"create.hint.full_deployer": "UNLOCALIZED: It appears this _Deployer_ contains _excess_ _items_ that need to be _extracted._ Use a _hopper,_ _funnel_ or other means to free it from its overflow.",
"create.gui.config.overlay1": "UNLOCALIZED: Hi :)",
"create.gui.config.overlay2": "UNLOCALIZED: This is a sample overlay",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 685",
"_": "Missing Localizations: 687",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1011,6 +1011,8 @@
"create.hint.upward_funnel": "UNLOCALIZED: can only transfer items inserted by _Arms_, fan-powered _Chutes_, or items _thrown_ at them. Try building some _Chutes_ if you are looking to move your items _vertically_.",
"create.hint.empty_bearing.title": "UNLOCALIZED: Update Bearing",
"create.hint.empty_bearing": "UNLOCALIZED: _Right-click_ the bearing with an _empty_ _hand_ to _attach_ the structure you just built in front of it.",
"create.hint.full_deployer.title": "UNLOCALIZED: Deployer Item Overflow",
"create.hint.full_deployer": "UNLOCALIZED: It appears this _Deployer_ contains _excess_ _items_ that need to be _extracted._ Use a _hopper,_ _funnel_ or other means to free it from its overflow.",
"create.gui.config.overlay1": "UNLOCALIZED: Hi :)",
"create.gui.config.overlay2": "UNLOCALIZED: This is a sample overlay",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 684",
"_": "Missing Localizations: 686",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1011,6 +1011,8 @@
"create.hint.upward_funnel": "UNLOCALIZED: can only transfer items inserted by _Arms_, fan-powered _Chutes_, or items _thrown_ at them. Try building some _Chutes_ if you are looking to move your items _vertically_.",
"create.hint.empty_bearing.title": "UNLOCALIZED: Update Bearing",
"create.hint.empty_bearing": "UNLOCALIZED: _Right-click_ the bearing with an _empty_ _hand_ to _attach_ the structure you just built in front of it.",
"create.hint.full_deployer.title": "UNLOCALIZED: Deployer Item Overflow",
"create.hint.full_deployer": "UNLOCALIZED: It appears this _Deployer_ contains _excess_ _items_ that need to be _extracted._ Use a _hopper,_ _funnel_ or other means to free it from its overflow.",
"create.gui.config.overlay1": "UNLOCALIZED: Hi :)",
"create.gui.config.overlay2": "UNLOCALIZED: This is a sample overlay",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 685",
"_": "Missing Localizations: 687",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1011,6 +1011,8 @@
"create.hint.upward_funnel": "UNLOCALIZED: can only transfer items inserted by _Arms_, fan-powered _Chutes_, or items _thrown_ at them. Try building some _Chutes_ if you are looking to move your items _vertically_.",
"create.hint.empty_bearing.title": "UNLOCALIZED: Update Bearing",
"create.hint.empty_bearing": "UNLOCALIZED: _Right-click_ the bearing with an _empty_ _hand_ to _attach_ the structure you just built in front of it.",
"create.hint.full_deployer.title": "UNLOCALIZED: Deployer Item Overflow",
"create.hint.full_deployer": "UNLOCALIZED: It appears this _Deployer_ contains _excess_ _items_ that need to be _extracted._ Use a _hopper,_ _funnel_ or other means to free it from its overflow.",
"create.gui.config.overlay1": "UNLOCALIZED: Hi :)",
"create.gui.config.overlay2": "UNLOCALIZED: This is a sample overlay",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1012",
"_": "Missing Localizations: 1014",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1011,6 +1011,8 @@
"create.hint.upward_funnel": "UNLOCALIZED: can only transfer items inserted by _Arms_, fan-powered _Chutes_, or items _thrown_ at them. Try building some _Chutes_ if you are looking to move your items _vertically_.",
"create.hint.empty_bearing.title": "UNLOCALIZED: Update Bearing",
"create.hint.empty_bearing": "UNLOCALIZED: _Right-click_ the bearing with an _empty_ _hand_ to _attach_ the structure you just built in front of it.",
"create.hint.full_deployer.title": "UNLOCALIZED: Deployer Item Overflow",
"create.hint.full_deployer": "UNLOCALIZED: It appears this _Deployer_ contains _excess_ _items_ that need to be _extracted._ Use a _hopper,_ _funnel_ or other means to free it from its overflow.",
"create.gui.config.overlay1": "UNLOCALIZED: Hi :)",
"create.gui.config.overlay2": "UNLOCALIZED: This is a sample overlay",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1078",
"_": "Missing Localizations: 1080",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1011,6 +1011,8 @@
"create.hint.upward_funnel": "UNLOCALIZED: can only transfer items inserted by _Arms_, fan-powered _Chutes_, or items _thrown_ at them. Try building some _Chutes_ if you are looking to move your items _vertically_.",
"create.hint.empty_bearing.title": "UNLOCALIZED: Update Bearing",
"create.hint.empty_bearing": "UNLOCALIZED: _Right-click_ the bearing with an _empty_ _hand_ to _attach_ the structure you just built in front of it.",
"create.hint.full_deployer.title": "UNLOCALIZED: Deployer Item Overflow",
"create.hint.full_deployer": "UNLOCALIZED: It appears this _Deployer_ contains _excess_ _items_ that need to be _extracted._ Use a _hopper,_ _funnel_ or other means to free it from its overflow.",
"create.gui.config.overlay1": "UNLOCALIZED: Hi :)",
"create.gui.config.overlay2": "UNLOCALIZED: This is a sample overlay",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 354",
"_": "Missing Localizations: 356",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1011,6 +1011,8 @@
"create.hint.upward_funnel": "UNLOCALIZED: can only transfer items inserted by _Arms_, fan-powered _Chutes_, or items _thrown_ at them. Try building some _Chutes_ if you are looking to move your items _vertically_.",
"create.hint.empty_bearing.title": "UNLOCALIZED: Update Bearing",
"create.hint.empty_bearing": "UNLOCALIZED: _Right-click_ the bearing with an _empty_ _hand_ to _attach_ the structure you just built in front of it.",
"create.hint.full_deployer.title": "UNLOCALIZED: Deployer Item Overflow",
"create.hint.full_deployer": "UNLOCALIZED: It appears this _Deployer_ contains _excess_ _items_ that need to be _extracted._ Use a _hopper,_ _funnel_ or other means to free it from its overflow.",
"create.gui.config.overlay1": "UNLOCALIZED: Hi :)",
"create.gui.config.overlay2": "UNLOCALIZED: This is a sample overlay",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 367",
"_": "Missing Localizations: 369",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1011,6 +1011,8 @@
"create.hint.upward_funnel": "UNLOCALIZED: can only transfer items inserted by _Arms_, fan-powered _Chutes_, or items _thrown_ at them. Try building some _Chutes_ if you are looking to move your items _vertically_.",
"create.hint.empty_bearing.title": "UNLOCALIZED: Update Bearing",
"create.hint.empty_bearing": "UNLOCALIZED: _Right-click_ the bearing with an _empty_ _hand_ to _attach_ the structure you just built in front of it.",
"create.hint.full_deployer.title": "UNLOCALIZED: Deployer Item Overflow",
"create.hint.full_deployer": "UNLOCALIZED: It appears this _Deployer_ contains _excess_ _items_ that need to be _extracted._ Use a _hopper,_ _funnel_ or other means to free it from its overflow.",
"create.gui.config.overlay1": "UNLOCALIZED: Hi :)",
"create.gui.config.overlay2": "UNLOCALIZED: This is a sample overlay",

View file

@ -10,6 +10,7 @@ import com.simibubi.create.AllBlocks;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.content.curiosities.tools.SandPaperItem;
import com.simibubi.create.foundation.advancement.AllTriggers;
import com.simibubi.create.foundation.item.TooltipHelper;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBehaviour;
import com.simibubi.create.foundation.utility.NBTHelper;
@ -37,6 +38,7 @@ import net.minecraftforge.common.util.Constants.NBT;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandlerModifiable;
import net.minecraftforge.items.wrapper.InvWrapper;
public class DeployerTileEntity extends KineticTileEntity {
@ -129,13 +131,22 @@ public class DeployerTileEntity extends KineticTileEntity {
return;
}
if (!filtering.test(stack)) {
if (!stack.isEmpty()) {
overflowItems.add(stack);
player.setHeldItem(Hand.MAIN_HAND, ItemStack.EMPTY);
sendData();
return;
boolean changed = false;
for (int i = 0; i < player.inventory.getSizeInventory(); i++) {
if (overflowItems.size() > 10)
break;
ItemStack item = player.inventory.getStackInSlot(i);
if (item.isEmpty())
continue;
if (item != stack || !filtering.test(item)) {
overflowItems.add(item);
player.inventory.setInventorySlotContents(i, ItemStack.EMPTY);
changed = true;
}
}
if (changed) {
sendData();
timer = getTimerSpeed() * 10;
return;
}
@ -152,7 +163,7 @@ public class DeployerTileEntity extends KineticTileEntity {
if (redstoneLocked)
return;
state = State.EXPANDING;
Vec3d movementVector = getMovementVector();
Vec3d rayOrigin = VecHelper.getCenterOf(pos)
@ -265,7 +276,7 @@ public class DeployerTileEntity extends KineticTileEntity {
mode = NBTHelper.readEnum(compound, "Mode", Mode.class);
timer = compound.getInt("Timer");
redstoneLocked = compound.getBoolean("Powered");
deferredInventoryList = compound.getList("Inventory", NBT.TAG_COMPOUND);
overflowItems = NBTHelper.readItemList(compound.getList("Overflow", NBT.TAG_COMPOUND));
if (compound.contains("HeldItem"))
@ -288,7 +299,7 @@ public class DeployerTileEntity extends KineticTileEntity {
NBTHelper.writeEnum(compound, "State", state);
compound.putInt("Timer", timer);
compound.putBoolean("Powered", redstoneLocked);
if (player != null) {
compound.put("HeldItem", player.getHeldItemMainhand()
.serializeNBT());
@ -326,7 +337,7 @@ public class DeployerTileEntity extends KineticTileEntity {
redstoneLocked = blockPowered;
sendData();
}
@Override
public boolean hasFastRenderer() {
return false;
@ -357,10 +368,21 @@ public class DeployerTileEntity extends KineticTileEntity {
@Override
public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) {
if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY && invHandler != null) {
if (isItemHandlerCap(cap) && invHandler != null)
return invHandler.cast();
}
return super.getCapability(cap, side);
}
@Override
public boolean addToTooltip(List<String> tooltip, boolean isPlayerSneaking) {
if (super.addToTooltip(tooltip, isPlayerSneaking))
return true;
if (getSpeed() == 0)
return false;
if (overflowItems.isEmpty())
return false;
TooltipHelper.addHint(tooltip, "hint.full_deployer");
return true;
}
}

View file

@ -0,0 +1,58 @@
package com.simibubi.create.content.contraptions.fluids;
import com.simibubi.create.Create;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.fluid.IFluidState;
import net.minecraft.item.GlassBottleItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tags.FluidTags;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.RayTraceContext;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
@EventBusSubscriber
public class FluidBottleItemHook extends Item {
public FluidBottleItemHook(Properties p_i48487_1_) {
super(p_i48487_1_);
}
@SubscribeEvent
public static void preventWaterBottlesFromCreatesFluids(PlayerInteractEvent.RightClickItem event) {
ItemStack itemStack = event.getItemStack();
if (itemStack.isEmpty())
return;
if (!(itemStack.getItem() instanceof GlassBottleItem))
return;
World world = event.getWorld();
PlayerEntity player = event.getPlayer();
RayTraceResult raytraceresult = rayTrace(world, player, RayTraceContext.FluidMode.SOURCE_ONLY);
if (raytraceresult.getType() != RayTraceResult.Type.BLOCK)
return;
BlockPos blockpos = ((BlockRayTraceResult) raytraceresult).getPos();
if (!world.isBlockModifiable(player, blockpos))
return;
IFluidState fluidState = world.getFluidState(blockpos);
if (fluidState.isTagged(FluidTags.WATER) && fluidState.getFluid()
.getRegistryName()
.getNamespace()
.equals(Create.ID)) {
event.setCancellationResult(ActionResultType.PASS);
event.setCanceled(true);
return;
}
return;
}
}

View file

@ -182,6 +182,12 @@ public class BasinBlock extends Block implements ITE<BasinTileEntity>, IWrenchab
}
public static boolean canOutputTo(IBlockReader world, BlockPos basinPos, Direction direction) {
BlockPos neighbour = basinPos.offset(direction);
if (!world.getBlockState(neighbour)
.getCollisionShape(world, neighbour)
.isEmpty())
return false;
BlockPos offset = basinPos.down()
.offset(direction);
DirectBeltInputBehaviour directBeltInputBehaviour =

View file

@ -455,6 +455,8 @@
"create.hint.upward_funnel": "can only transfer items inserted by _Arms_, fan-powered _Chutes_, or items _thrown_ at them. Try building some _Chutes_ if you are looking to move your items _vertically_.",
"create.hint.empty_bearing.title": "Update Bearing",
"create.hint.empty_bearing": "_Right-click_ the bearing with an _empty_ _hand_ to _attach_ the structure you just built in front of it.",
"create.hint.full_deployer.title": "Deployer Item Overflow",
"create.hint.full_deployer": "It appears this _Deployer_ contains _excess_ _items_ that need to be _extracted._ Use a _hopper,_ _funnel_ or other means to free it from its overflow.",
"create.gui.config.overlay1": "Hi :)",
"create.gui.config.overlay2": "This is a sample overlay",