mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-16 00:03:41 +01:00
Hot Fix-ups
- Change to proper key handling for closing create screens - Fixed inconsistent collection behaviour of in-world funnels
This commit is contained in:
parent
f528520a53
commit
83e7074f12
3 changed files with 18 additions and 5 deletions
|
@ -107,7 +107,8 @@ public abstract class FunnelBlock extends AbstractDirectionalFunnelBlock {
|
||||||
|
|
||||||
Direction direction = getFunnelFacing(state);
|
Direction direction = getFunnelFacing(state);
|
||||||
Vec3d diff = entityIn.getPositionVec()
|
Vec3d diff = entityIn.getPositionVec()
|
||||||
.subtract(VecHelper.getCenterOf(pos));
|
.subtract(VecHelper.getCenterOf(pos)
|
||||||
|
.add(new Vec3d(direction.getDirectionVec()).scale(-.325f)));
|
||||||
double projectedDiff = direction.getAxis()
|
double projectedDiff = direction.getAxis()
|
||||||
.getCoordinate(diff.x, diff.y, diff.z);
|
.getCoordinate(diff.x, diff.y, diff.z);
|
||||||
if (projectedDiff < 0 == (direction.getAxisDirection() == AxisDirection.POSITIVE))
|
if (projectedDiff < 0 == (direction.getAxisDirection() == AxisDirection.POSITIVE))
|
||||||
|
|
|
@ -18,6 +18,7 @@ import net.minecraft.client.renderer.Rectangle2d;
|
||||||
import net.minecraft.client.renderer.RenderHelper;
|
import net.minecraft.client.renderer.RenderHelper;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
|
import net.minecraft.client.util.InputMappings;
|
||||||
import net.minecraft.entity.player.PlayerInventory;
|
import net.minecraft.entity.player.PlayerInventory;
|
||||||
import net.minecraft.inventory.container.Container;
|
import net.minecraft.inventory.container.Container;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -79,6 +80,13 @@ public abstract class AbstractSimiContainerScreen<T extends Container> extends C
|
||||||
if (widget.keyPressed(code, p_keyPressed_2_, p_keyPressed_3_))
|
if (widget.keyPressed(code, p_keyPressed_2_, p_keyPressed_3_))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
InputMappings.Input mouseKey = InputMappings.getInputByCode(code, p_keyPressed_2_);
|
||||||
|
if (code == 256 || this.minecraft.gameSettings.keyBindInventory.isActiveAndMatches(mouseKey)) {
|
||||||
|
this.minecraft.player.closeScreen();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return super.keyPressed(code, p_keyPressed_2_, p_keyPressed_3_);
|
return super.keyPressed(code, p_keyPressed_2_, p_keyPressed_3_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,8 +96,6 @@ public abstract class AbstractSimiContainerScreen<T extends Container> extends C
|
||||||
if (widget.charTyped(character, code))
|
if (widget.charTyped(character, code))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (character == 'e')
|
|
||||||
onClose();
|
|
||||||
return super.charTyped(character, code);
|
return super.charTyped(character, code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ import com.simibubi.create.foundation.gui.widgets.AbstractSimiWidget;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
import net.minecraft.client.gui.widget.Widget;
|
import net.minecraft.client.gui.widget.Widget;
|
||||||
|
import net.minecraft.client.util.InputMappings;
|
||||||
import net.minecraft.util.text.StringTextComponent;
|
import net.minecraft.util.text.StringTextComponent;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
@ -69,6 +70,13 @@ public abstract class AbstractSimiScreen extends Screen {
|
||||||
for (Widget widget : widgets)
|
for (Widget widget : widgets)
|
||||||
if (widget.keyPressed(code, p_keyPressed_2_, p_keyPressed_3_))
|
if (widget.keyPressed(code, p_keyPressed_2_, p_keyPressed_3_))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
InputMappings.Input mouseKey = InputMappings.getInputByCode(code, p_keyPressed_2_);
|
||||||
|
if (code == 256 || this.minecraft.gameSettings.keyBindInventory.isActiveAndMatches(mouseKey)) {
|
||||||
|
this.minecraft.player.closeScreen();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return super.keyPressed(code, p_keyPressed_2_, p_keyPressed_3_);
|
return super.keyPressed(code, p_keyPressed_2_, p_keyPressed_3_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,8 +86,6 @@ public abstract class AbstractSimiScreen extends Screen {
|
||||||
if (widget.charTyped(character, code))
|
if (widget.charTyped(character, code))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (character == 'e')
|
|
||||||
onClose();
|
|
||||||
return super.charTyped(character, code);
|
return super.charTyped(character, code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue