finish merge
remove old assets
|
@ -3,7 +3,6 @@ package com.simibubi.create;
|
||||||
import com.simibubi.create.content.contraptions.components.actors.SeatEntity;
|
import com.simibubi.create.content.contraptions.components.actors.SeatEntity;
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.*;
|
import com.simibubi.create.content.contraptions.components.structureMovement.*;
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.gantry.GantryContraptionEntity;
|
import com.simibubi.create.content.contraptions.components.structureMovement.gantry.GantryContraptionEntity;
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.gantry.GantryContraptionEntityRenderer;
|
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.glue.SuperGlueEntity;
|
import com.simibubi.create.content.contraptions.components.structureMovement.glue.SuperGlueEntity;
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.glue.SuperGlueRenderer;
|
import com.simibubi.create.content.contraptions.components.structureMovement.glue.SuperGlueRenderer;
|
||||||
import com.simibubi.create.foundation.utility.Lang;
|
import com.simibubi.create.foundation.utility.Lang;
|
||||||
|
@ -62,7 +61,7 @@ public class AllEntityTypes {
|
||||||
RenderingRegistry.registerEntityRenderingHandler(ORIENTED_CONTRAPTION.get(),
|
RenderingRegistry.registerEntityRenderingHandler(ORIENTED_CONTRAPTION.get(),
|
||||||
OrientedContraptionEntityRenderer::new);
|
OrientedContraptionEntityRenderer::new);
|
||||||
RenderingRegistry.registerEntityRenderingHandler(GANTRY_CONTRAPTION.get(),
|
RenderingRegistry.registerEntityRenderingHandler(GANTRY_CONTRAPTION.get(),
|
||||||
GantryContraptionEntityRenderer::new);
|
ContraptionEntityRenderer::new);
|
||||||
RenderingRegistry.registerEntityRenderingHandler(SUPER_GLUE.get(), SuperGlueRenderer::new);
|
RenderingRegistry.registerEntityRenderingHandler(SUPER_GLUE.get(), SuperGlueRenderer::new);
|
||||||
RenderingRegistry.registerEntityRenderingHandler(SEAT.get(), SeatEntity.Render::new);
|
RenderingRegistry.registerEntityRenderingHandler(SEAT.get(), SeatEntity.Render::new);
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class AllSpriteShifts {
|
||||||
CREATIVE_FLUID_TANK = getCT(CTType.CROSS, "creative_fluid_tank");
|
CREATIVE_FLUID_TANK = getCT(CTType.CROSS, "creative_fluid_tank");
|
||||||
|
|
||||||
public static final SpriteShiftEntry BELT = SpriteShifter.get("block/belt", "block/belt_scroll"),
|
public static final SpriteShiftEntry BELT = SpriteShifter.get("block/belt", "block/belt_scroll"),
|
||||||
BELT_OFFSET = SpriteShifter.get("block/belt_offset", "block/belt_offset_scroll"),
|
BELT_OFFSET = SpriteShifter.get("block/belt_offset", "block/belt_scroll"),
|
||||||
BELT_DIAGONAL = SpriteShifter.get("block/belt_diagonal", "block/belt_diagonal_scroll"),
|
BELT_DIAGONAL = SpriteShifter.get("block/belt_diagonal", "block/belt_diagonal_scroll"),
|
||||||
ANDESIDE_BELT_CASING = SpriteShifter.get("block/brass_casing_belt", "block/andesite_casing_belt"),
|
ANDESIDE_BELT_CASING = SpriteShifter.get("block/brass_casing_belt", "block/andesite_casing_belt"),
|
||||||
CRAFTER_THINGIES = SpriteShifter.get("block/crafter_thingies", "block/crafter_thingies");
|
CRAFTER_THINGIES = SpriteShifter.get("block/crafter_thingies", "block/crafter_thingies");
|
||||||
|
@ -92,9 +92,9 @@ public class AllSpriteShifts {
|
||||||
|
|
||||||
for (DyeColor color : DyeColor.values()) {
|
for (DyeColor color : DyeColor.values()) {
|
||||||
String id = color.getName();
|
String id = color.getName();
|
||||||
DYED_BELTS.put(color, SpriteShifter.get("block/belt", "block/belt/" + id));
|
DYED_BELTS.put(color, SpriteShifter.get("block/belt", "block/belt/" + id + "_scroll"));
|
||||||
DYED_OFFSET_BELTS.put(color, SpriteShifter.get("block/belt_offset", "block/belt/" + id));
|
DYED_OFFSET_BELTS.put(color, SpriteShifter.get("block/belt_offset", "block/belt/" + id + "_scroll"));
|
||||||
DYED_DIAGONAL_BELTS.put(color, SpriteShifter.get("block/belt_diagonal", "block/belt/" + id + "_diagonal"));
|
DYED_DIAGONAL_BELTS.put(color, SpriteShifter.get("block/belt_diagonal", "block/belt/" + id + "_diagonal_scroll"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -205,12 +205,14 @@ public class AllTileEntities {
|
||||||
.tileEntity("gantry_shaft", GantryShaftTileEntity::new)
|
.tileEntity("gantry_shaft", GantryShaftTileEntity::new)
|
||||||
.validBlocks(AllBlocks.GANTRY_SHAFT)
|
.validBlocks(AllBlocks.GANTRY_SHAFT)
|
||||||
.renderer(() -> KineticTileEntityRenderer::new)
|
.renderer(() -> KineticTileEntityRenderer::new)
|
||||||
|
.onRegister(SingleRotatingInstance::register)
|
||||||
.register();
|
.register();
|
||||||
|
|
||||||
public static final TileEntityEntry<GantryPinionTileEntity> GANTRY_PINION = Create.registrate()
|
public static final TileEntityEntry<GantryPinionTileEntity> GANTRY_PINION = Create.registrate()
|
||||||
.tileEntity("gantry_pinion", GantryPinionTileEntity::new)
|
.tileEntity("gantry_pinion", GantryPinionTileEntity::new)
|
||||||
.validBlocks(AllBlocks.GANTRY_PINION)
|
.validBlocks(AllBlocks.GANTRY_PINION)
|
||||||
.renderer(() -> GantryPinionRenderer::new)
|
.renderer(() -> GantryPinionRenderer::new)
|
||||||
|
.onRegister(ShaftInstance::register)
|
||||||
.register();
|
.register();
|
||||||
|
|
||||||
public static final TileEntityEntry<PumpTileEntity> MECHANICAL_PUMP = Create.registrate()
|
public static final TileEntityEntry<PumpTileEntity> MECHANICAL_PUMP = Create.registrate()
|
||||||
|
|
|
@ -17,14 +17,13 @@ public abstract class ContraptionLighter<C extends Contraption> {
|
||||||
|
|
||||||
bounds = getContraptionBounds();
|
bounds = getContraptionBounds();
|
||||||
|
|
||||||
lightVolume = new LightVolume(contraptionBoundsToVolume(bounds));
|
lightVolume = new LightVolume(contraptionBoundsToVolume(bounds.copy()));
|
||||||
|
|
||||||
lightVolume.initialize(contraption.entity.world);
|
lightVolume.initialize(contraption.entity.world);
|
||||||
scheduleRebuild = true;
|
scheduleRebuild = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected GridAlignedBB contraptionBoundsToVolume(GridAlignedBB bounds) {
|
protected GridAlignedBB contraptionBoundsToVolume(GridAlignedBB bounds) {
|
||||||
bounds = bounds.copy();
|
|
||||||
bounds.grow(1); // so we have at least enough data on the edges to avoid artifacts and have smooth lighting
|
bounds.grow(1); // so we have at least enough data on the edges to avoid artifacts and have smooth lighting
|
||||||
bounds.minY = Math.max(bounds.minY, 0);
|
bounds.minY = Math.max(bounds.minY, 0);
|
||||||
bounds.maxY = Math.min(bounds.maxY, 255);
|
bounds.maxY = Math.min(bounds.maxY, 255);
|
||||||
|
|
|
@ -10,7 +10,6 @@ public class NonStationaryLighter<C extends Contraption> extends ContraptionLigh
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected GridAlignedBB contraptionBoundsToVolume(GridAlignedBB bounds) {
|
protected GridAlignedBB contraptionBoundsToVolume(GridAlignedBB bounds) {
|
||||||
bounds = bounds.copy();
|
|
||||||
bounds.grow(2); // so we have at least enough data on the edges to avoid artifacts and have smooth lighting
|
bounds.grow(2); // so we have at least enough data on the edges to avoid artifacts and have smooth lighting
|
||||||
bounds.minY = Math.max(bounds.minY, 0);
|
bounds.minY = Math.max(bounds.minY, 0);
|
||||||
bounds.maxY = Math.min(bounds.maxY, 255);
|
bounds.maxY = Math.min(bounds.maxY, 255);
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
package com.simibubi.create.content.contraptions.components.structureMovement.gantry;
|
package com.simibubi.create.content.contraptions.components.structureMovement.gantry;
|
||||||
|
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.AssemblyException;
|
import com.simibubi.create.content.contraptions.components.structureMovement.*;
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionType;
|
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.TranslatingContraption;
|
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.util.Direction;
|
import net.minecraft.util.Direction;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
@ -60,4 +58,8 @@ public class GantryContraption extends TranslatingContraption {
|
||||||
return super.shouldUpdateAfterMovement(info) && !AllBlocks.GANTRY_PINION.has(info.state);
|
return super.shouldUpdateAfterMovement(info) && !AllBlocks.GANTRY_PINION.has(info.state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ContraptionLighter<?> makeLighter() {
|
||||||
|
return new NonStationaryLighter<>(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.simibubi.create.content.contraptions.components.structureMovement.gantry;
|
package com.simibubi.create.content.contraptions.components.structureMovement.gantry;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.AllEntityTypes;
|
import com.simibubi.create.AllEntityTypes;
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntity;
|
import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntity;
|
||||||
|
@ -172,6 +173,9 @@ public class GantryContraptionEntity extends AbstractContraptionEntity {
|
||||||
return ContraptionRotationState.NONE;
|
return ContraptionRotationState.NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doLocalTransforms(float partialTicks, MatrixStack[] matrixStacks) { }
|
||||||
|
|
||||||
public void updateClientMotion() {
|
public void updateClientMotion() {
|
||||||
float modifier = movementAxis.getAxisDirection()
|
float modifier = movementAxis.getAxisDirection()
|
||||||
.getOffset();
|
.getOffset();
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
package com.simibubi.create.content.contraptions.components.structureMovement.gantry;
|
|
||||||
|
|
||||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntityRenderer;
|
|
||||||
|
|
||||||
import net.minecraft.client.renderer.entity.EntityRendererManager;
|
|
||||||
|
|
||||||
public class GantryContraptionEntityRenderer extends AbstractContraptionEntityRenderer<GantryContraptionEntity> {
|
|
||||||
|
|
||||||
public GantryContraptionEntityRenderer(EntityRendererManager p_i46179_1_) {
|
|
||||||
super(p_i46179_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void transform(GantryContraptionEntity contraptionEntity, float partialTicks,
|
|
||||||
MatrixStack[] matrixStacks) {}
|
|
||||||
|
|
||||||
}
|
|
|
@ -164,4 +164,8 @@ public class GantryPinionTileEntity extends KineticTileEntity implements IDispla
|
||||||
return te instanceof GantryShaftTileEntity && ((GantryShaftTileEntity) te).canAssembleOn();
|
return te instanceof GantryShaftTileEntity && ((GantryShaftTileEntity) te).canAssembleOn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRenderAsTE() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,8 +30,8 @@ public class SpeedControllerRenderer extends SmartTileEntityRenderer<SpeedContro
|
||||||
IRenderTypeBuffer buffer, int light, int overlay) {
|
IRenderTypeBuffer buffer, int light, int overlay) {
|
||||||
super.renderSafe(tileEntityIn, partialTicks, ms, buffer, light, overlay);
|
super.renderSafe(tileEntityIn, partialTicks, ms, buffer, light, overlay);
|
||||||
|
|
||||||
if (!FastRenderDispatcher.available(tileEntityIn.getWorld())) {
|
|
||||||
IVertexBuilder builder = buffer.getBuffer(RenderType.getSolid());
|
IVertexBuilder builder = buffer.getBuffer(RenderType.getSolid());
|
||||||
|
if (!FastRenderDispatcher.available(tileEntityIn.getWorld())) {
|
||||||
KineticTileEntityRenderer.renderRotatingBuffer(tileEntityIn, getRotatedModel(tileEntityIn), ms, builder, light);
|
KineticTileEntityRenderer.renderRotatingBuffer(tileEntityIn, getRotatedModel(tileEntityIn), ms, builder, light);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRen
|
||||||
import com.simibubi.create.foundation.render.backend.instancing.*;
|
import com.simibubi.create.foundation.render.backend.instancing.*;
|
||||||
import com.simibubi.create.foundation.utility.Iterate;
|
import com.simibubi.create.foundation.utility.Iterate;
|
||||||
import com.simibubi.create.foundation.utility.MatrixStacker;
|
import com.simibubi.create.foundation.utility.MatrixStacker;
|
||||||
|
import net.minecraft.item.DyeColor;
|
||||||
import net.minecraft.tileentity.TileEntityType;
|
import net.minecraft.tileentity.TileEntityType;
|
||||||
import net.minecraft.util.Direction;
|
import net.minecraft.util.Direction;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
@ -61,13 +62,14 @@ public class BeltInstance extends KineticTileInstance<BeltTileEntity> {
|
||||||
BeltPart part = lastState.get(BeltBlock.PART);
|
BeltPart part = lastState.get(BeltBlock.PART);
|
||||||
boolean start = part == BeltPart.START;
|
boolean start = part == BeltPart.START;
|
||||||
boolean end = part == BeltPart.END;
|
boolean end = part == BeltPart.END;
|
||||||
|
DyeColor color = tile.color.orElse(null);
|
||||||
|
|
||||||
for (boolean bottom : Iterate.trueAndFalse) {
|
for (boolean bottom : Iterate.trueAndFalse) {
|
||||||
AllBlockPartials beltPartial = BeltRenderer.getBeltPartial(diagonal, start, end, bottom);
|
AllBlockPartials beltPartial = BeltRenderer.getBeltPartial(diagonal, start, end, bottom);
|
||||||
SpriteShiftEntry spriteShift = BeltRenderer.getSpriteShiftEntry(diagonal, bottom);
|
SpriteShiftEntry spriteShift = BeltRenderer.getSpriteShiftEntry(color, diagonal, bottom);
|
||||||
|
|
||||||
InstancedModel<BeltData> beltModel = beltPartial.renderOnBelt(modelManager, lastState);
|
InstancedModel<BeltData> beltModel = beltPartial.renderOnBelt(modelManager, lastState);
|
||||||
Consumer<BeltData> setupFunc = setupFunc(spriteShift);
|
Consumer<BeltData> setupFunc = setupFunc(bottom, spriteShift);
|
||||||
|
|
||||||
keys.add(beltModel.setupInstance(setupFunc));
|
keys.add(beltModel.setupInstance(setupFunc));
|
||||||
|
|
||||||
|
@ -83,8 +85,16 @@ public class BeltInstance extends KineticTileInstance<BeltTileEntity> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate() {
|
public void onUpdate() {
|
||||||
|
DyeColor color = tile.color.orElse(null);
|
||||||
|
|
||||||
|
boolean bottom = true;
|
||||||
for (InstanceKey<BeltData> key : keys) {
|
for (InstanceKey<BeltData> key : keys) {
|
||||||
key.modifyInstance(data -> data.setColor(tile.network).setRotationalSpeed(getScrollSpeed()));
|
|
||||||
|
SpriteShiftEntry spriteShiftEntry = BeltRenderer.getSpriteShiftEntry(color, diagonal, bottom);
|
||||||
|
key.modifyInstance(data -> data.setScrollTexture(spriteShiftEntry)
|
||||||
|
.setColor(tile.network)
|
||||||
|
.setRotationalSpeed(getScrollSpeed()));
|
||||||
|
bottom = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pulleyKey != null) {
|
if (pulleyKey != null) {
|
||||||
|
@ -152,7 +162,7 @@ public class BeltInstance extends KineticTileInstance<BeltTileEntity> {
|
||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Consumer<BeltData> setupFunc(SpriteShiftEntry spriteShift) {
|
private Consumer<BeltData> setupFunc(boolean bottom, SpriteShiftEntry spriteShift) {
|
||||||
return data -> {
|
return data -> {
|
||||||
float rotX = (!diagonal && beltSlope != BeltSlope.HORIZONTAL ? 90 : 0) + (beltSlope == BeltSlope.DOWNWARD ? 180 : 0);
|
float rotX = (!diagonal && beltSlope != BeltSlope.HORIZONTAL ? 90 : 0) + (beltSlope == BeltSlope.DOWNWARD ? 180 : 0);
|
||||||
float rotY = facing.getHorizontalAngle() + (upward ? 180 : 0) + (sideways ? 90 : 0);
|
float rotY = facing.getHorizontalAngle() + (upward ? 180 : 0) + (sideways ? 90 : 0);
|
||||||
|
@ -164,7 +174,7 @@ public class BeltInstance extends KineticTileInstance<BeltTileEntity> {
|
||||||
.setSkyLight(world.getLightLevel(LightType.SKY, pos))
|
.setSkyLight(world.getLightLevel(LightType.SKY, pos))
|
||||||
.setRotation(rotX, rotY, rotZ)
|
.setRotation(rotX, rotY, rotZ)
|
||||||
.setRotationalSpeed(getScrollSpeed())
|
.setRotationalSpeed(getScrollSpeed())
|
||||||
.setRotationOffset(0)
|
.setRotationOffset(bottom ? 0.5f : 0f)
|
||||||
.setScrollTexture(spriteShift)
|
.setScrollTexture(spriteShift)
|
||||||
.setScrollMult(diagonal ? 3f / 8f : 0.5f);
|
.setScrollMult(diagonal ? 3f / 8f : 0.5f);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.simibubi.create.content.contraptions.relays.belt;
|
package com.simibubi.create.content.contraptions.relays.belt;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||||
|
@ -11,6 +12,9 @@ import com.simibubi.create.CreateClient;
|
||||||
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
|
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
|
||||||
import com.simibubi.create.content.contraptions.relays.belt.transport.TransportedItemStack;
|
import com.simibubi.create.content.contraptions.relays.belt.transport.TransportedItemStack;
|
||||||
import com.simibubi.create.foundation.block.render.SpriteShiftEntry;
|
import com.simibubi.create.foundation.block.render.SpriteShiftEntry;
|
||||||
|
import com.simibubi.create.foundation.render.ShadowRenderHelper;
|
||||||
|
import com.simibubi.create.foundation.render.SuperByteBuffer;
|
||||||
|
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
|
||||||
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
|
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
|
||||||
import com.simibubi.create.foundation.utility.AngleHelper;
|
import com.simibubi.create.foundation.utility.AngleHelper;
|
||||||
import com.simibubi.create.foundation.utility.AnimationTickHolder;
|
import com.simibubi.create.foundation.utility.AnimationTickHolder;
|
||||||
|
@ -83,6 +87,8 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
|
||||||
end = b;
|
end = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DyeColor color = te.color.orElse(null);
|
||||||
|
|
||||||
for (boolean bottom : Iterate.trueAndFalse) {
|
for (boolean bottom : Iterate.trueAndFalse) {
|
||||||
|
|
||||||
AllBlockPartials beltPartial = getBeltPartial(diagonal, start, end, bottom);
|
AllBlockPartials beltPartial = getBeltPartial(diagonal, start, end, bottom);
|
||||||
|
@ -90,17 +96,7 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
|
||||||
SuperByteBuffer beltBuffer = beltPartial.renderOn(blockState)
|
SuperByteBuffer beltBuffer = beltPartial.renderOn(blockState)
|
||||||
.light(light);
|
.light(light);
|
||||||
|
|
||||||
SpriteShiftEntry spriteShift = null;
|
SpriteShiftEntry spriteShift = getSpriteShiftEntry(color, diagonal, bottom);
|
||||||
if (te.color.isPresent()) {
|
|
||||||
DyeColor color = te.color.get();
|
|
||||||
spriteShift = (diagonal ? AllSpriteShifts.DYED_DIAGONAL_BELTS
|
|
||||||
: bottom ? AllSpriteShifts.DYED_OFFSET_BELTS : AllSpriteShifts.DYED_BELTS).get(color);
|
|
||||||
} else
|
|
||||||
spriteShift = diagonal ? AllSpriteShifts.BELT_DIAGONAL
|
|
||||||
: bottom ? AllSpriteShifts.BELT_OFFSET : AllSpriteShifts.BELT;
|
|
||||||
|
|
||||||
int cycleLength = diagonal ? 12 : 16;
|
|
||||||
int cycleOffset = bottom ? 8 : 0;
|
|
||||||
|
|
||||||
// UV shift
|
// UV shift
|
||||||
float speed = te.getSpeed();
|
float speed = te.getSpeed();
|
||||||
|
@ -113,7 +109,7 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
|
||||||
|
|
||||||
float spriteSize = spriteShift.getTarget().getMaxV() - spriteShift.getTarget().getMinV();
|
float spriteSize = spriteShift.getTarget().getMaxV() - spriteShift.getTarget().getMinV();
|
||||||
|
|
||||||
double scroll = speed * time / (36 * 16);
|
double scroll = speed * time / (36 * 16) + (bottom ? 0.5 : 0.0);
|
||||||
scroll = scroll - Math.floor(scroll);
|
scroll = scroll - Math.floor(scroll);
|
||||||
scroll = scroll * spriteSize * scrollMult;
|
scroll = scroll * spriteSize * scrollMult;
|
||||||
|
|
||||||
|
@ -147,10 +143,13 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
|
||||||
renderItems(te, partialTicks, ms, buffer, light, overlay);
|
renderItems(te, partialTicks, ms, buffer, light, overlay);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SpriteShiftEntry getSpriteShiftEntry(boolean diagonal, boolean bottom) {
|
public static SpriteShiftEntry getSpriteShiftEntry(DyeColor color, boolean diagonal, boolean bottom) {
|
||||||
if (diagonal) return AllSpriteShifts.BELT_DIAGONAL;
|
if (color != null) {
|
||||||
if (bottom) return AllSpriteShifts.BELT_OFFSET;
|
return (diagonal ? AllSpriteShifts.DYED_DIAGONAL_BELTS
|
||||||
return AllSpriteShifts.BELT;
|
: bottom ? AllSpriteShifts.DYED_OFFSET_BELTS : AllSpriteShifts.DYED_BELTS).get(color);
|
||||||
|
} else
|
||||||
|
return diagonal ? AllSpriteShifts.BELT_DIAGONAL
|
||||||
|
: bottom ? AllSpriteShifts.BELT_OFFSET : AllSpriteShifts.BELT;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AllBlockPartials getBeltPartial(boolean diagonal, boolean start, boolean end, boolean bottom) {
|
public static AllBlockPartials getBeltPartial(boolean diagonal, boolean start, boolean end, boolean bottom) {
|
||||||
|
@ -158,12 +157,11 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
|
||||||
if (start) return AllBlockPartials.BELT_DIAGONAL_START;
|
if (start) return AllBlockPartials.BELT_DIAGONAL_START;
|
||||||
if (end) return AllBlockPartials.BELT_DIAGONAL_END;
|
if (end) return AllBlockPartials.BELT_DIAGONAL_END;
|
||||||
return AllBlockPartials.BELT_DIAGONAL_MIDDLE;
|
return AllBlockPartials.BELT_DIAGONAL_MIDDLE;
|
||||||
} else {
|
} else if (bottom) {
|
||||||
if (bottom) {
|
|
||||||
if (start) return AllBlockPartials.BELT_START_BOTTOM;
|
if (start) return AllBlockPartials.BELT_START_BOTTOM;
|
||||||
if (end) return AllBlockPartials.BELT_END_BOTTOM;
|
if (end) return AllBlockPartials.BELT_END_BOTTOM;
|
||||||
return AllBlockPartials.BELT_MIDDLE_BOTTOM;
|
return AllBlockPartials.BELT_MIDDLE_BOTTOM;
|
||||||
}
|
} else {
|
||||||
if (start) return AllBlockPartials.BELT_START;
|
if (start) return AllBlockPartials.BELT_START;
|
||||||
if (end) return AllBlockPartials.BELT_END;
|
if (end) return AllBlockPartials.BELT_END;
|
||||||
return AllBlockPartials.BELT_MIDDLE;
|
return AllBlockPartials.BELT_MIDDLE;
|
||||||
|
|
|
@ -21,6 +21,7 @@ import com.simibubi.create.content.contraptions.relays.belt.transport.BeltTunnel
|
||||||
import com.simibubi.create.content.contraptions.relays.belt.transport.ItemHandlerBeltSegment;
|
import com.simibubi.create.content.contraptions.relays.belt.transport.ItemHandlerBeltSegment;
|
||||||
import com.simibubi.create.content.contraptions.relays.belt.transport.TransportedItemStack;
|
import com.simibubi.create.content.contraptions.relays.belt.transport.TransportedItemStack;
|
||||||
import com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelTileEntity;
|
import com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelTileEntity;
|
||||||
|
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
|
||||||
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
|
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
|
||||||
import com.simibubi.create.foundation.tileEntity.behaviour.belt.DirectBeltInputBehaviour;
|
import com.simibubi.create.foundation.tileEntity.behaviour.belt.DirectBeltInputBehaviour;
|
||||||
import com.simibubi.create.foundation.tileEntity.behaviour.belt.TransportedItemStackHandlerBehaviour;
|
import com.simibubi.create.foundation.tileEntity.behaviour.belt.TransportedItemStackHandlerBehaviour;
|
||||||
|
@ -44,11 +45,13 @@ import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
import net.minecraft.util.math.Vec3i;
|
import net.minecraft.util.math.Vec3i;
|
||||||
import net.minecraft.world.LightType;
|
import net.minecraft.world.LightType;
|
||||||
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.client.model.data.IModelData;
|
import net.minecraftforge.client.model.data.IModelData;
|
||||||
import net.minecraftforge.client.model.data.ModelDataMap;
|
import net.minecraftforge.client.model.data.ModelDataMap;
|
||||||
import net.minecraftforge.client.model.data.ModelProperty;
|
import net.minecraftforge.client.model.data.ModelProperty;
|
||||||
import net.minecraftforge.common.capabilities.Capability;
|
import net.minecraftforge.common.capabilities.Capability;
|
||||||
import net.minecraftforge.common.util.LazyOptional;
|
import net.minecraftforge.common.util.LazyOptional;
|
||||||
|
import net.minecraftforge.fml.DistExecutor;
|
||||||
import net.minecraftforge.items.CapabilityItemHandler;
|
import net.minecraftforge.items.CapabilityItemHandler;
|
||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
|
|
||||||
|
@ -260,6 +263,7 @@ public class BeltTileEntity extends KineticTileEntity {
|
||||||
belt.color = Optional.ofNullable(colorIn);
|
belt.color = Optional.ofNullable(colorIn);
|
||||||
belt.markDirty();
|
belt.markDirty();
|
||||||
belt.sendData();
|
belt.sendData();
|
||||||
|
DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> FastRenderDispatcher.enqueueUpdate(belt));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 531 B |