Better address these

- Fixed Nixies rendering inconsistently
- Fixed belts not showing items under certain conditions
- Fixed vertical/sideways belts accepting items from other belts
- Spouts can now interact with belts/depots with a mounted funnel
This commit is contained in:
simibubi 2021-04-10 01:50:13 +02:00
parent 2db49997df
commit 939c640e14
3 changed files with 22 additions and 5 deletions

View file

@ -60,7 +60,6 @@ import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
public class BeltTileEntity extends KineticTileEntity implements LightUpdateListener {
public Map<Entity, TransportedEntityInfo> passengers;
@ -118,7 +117,8 @@ public class BeltTileEntity extends KineticTileEntity implements LightUpdateList
if (light == null && world.isRemote) {
initializeLight();
LightUpdater.getInstance().startListening(getBeltVolume(), this);
LightUpdater.getInstance()
.startListening(getBeltVolume(), this);
}
getInventory().tick();
@ -423,6 +423,10 @@ public class BeltTileEntity extends KineticTileEntity implements LightUpdateList
private boolean canInsertFrom(Direction side) {
if (getSpeed() == 0)
return false;
BlockState state = getBlockState();
if (state.contains(BeltBlock.SLOPE)
&& (state.get(BeltBlock.SLOPE) == BeltSlope.SIDEWAYS || state.get(BeltBlock.SLOPE) == BeltSlope.VERTICAL))
return false;
return getMovementFacing() != side.getOpposite();
}
@ -515,7 +519,10 @@ public class BeltTileEntity extends KineticTileEntity implements LightUpdateList
@Override
public boolean shouldRenderAsTE() {
if (world == null)
return isController();
BlockState state = getBlockState();
return state != null && state.contains(BeltBlock.PART) && state.get(BeltBlock.PART) == BeltPart.START;
}
@Override

View file

@ -12,7 +12,9 @@ import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.block.BlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.fonts.TexturedGlyph;
import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.IRenderTypeBuffer.Impl;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.util.text.Style;
@ -86,6 +88,10 @@ public class NixieTubeRenderer extends SafeTileEntityRenderer<NixieTubeTileEntit
FontRenderer fontRenderer = Minecraft.getInstance().fontRenderer;
fontRenderer.draw(c, 0, 0, color, false, ms.peek()
.getModel(), buffer, false, 0, 15728880);
if (buffer instanceof Impl) {
TexturedGlyph texturedglyph = fontRenderer.getFontStorage(Style.DEFAULT_FONT_ID).getRectangleRenderer();
((Impl) buffer).draw(texturedglyph.getLayer(false));
}
}
private static float getCharWidth(char p_211125_1_, FontRenderer fontRenderer) {

View file

@ -1,10 +1,12 @@
package com.simibubi.create.foundation.tileEntity.behaviour.belt;
import com.simibubi.create.content.contraptions.relays.belt.transport.TransportedItemStack;
import com.simibubi.create.content.logistics.block.funnel.AbstractFunnelBlock;
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import com.simibubi.create.foundation.tileEntity.behaviour.BehaviourType;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
@ -41,8 +43,10 @@ public class BeltProcessingBehaviour extends TileEntityBehaviour {
}
public static boolean isBlocked(IBlockReader world, BlockPos processingSpace) {
return !world.getBlockState(processingSpace.up())
.getCollisionShape(world, processingSpace.up())
BlockState blockState = world.getBlockState(processingSpace.up());
if (AbstractFunnelBlock.isFunnel(blockState))
return false;
return !blockState.getCollisionShape(world, processingSpace.up())
.isEmpty();
}