finish merge

remove old assets
This commit is contained in:
JozsefA 2021-02-16 14:47:03 -08:00
parent 15302495f5
commit d2e30eeab5
78 changed files with 62 additions and 59 deletions

View File

@ -3,7 +3,6 @@ package com.simibubi.create;
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.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.SuperGlueRenderer;
import com.simibubi.create.foundation.utility.Lang;
@ -62,7 +61,7 @@ public class AllEntityTypes {
RenderingRegistry.registerEntityRenderingHandler(ORIENTED_CONTRAPTION.get(),
OrientedContraptionEntityRenderer::new);
RenderingRegistry.registerEntityRenderingHandler(GANTRY_CONTRAPTION.get(),
GantryContraptionEntityRenderer::new);
ContraptionEntityRenderer::new);
RenderingRegistry.registerEntityRenderingHandler(SUPER_GLUE.get(), SuperGlueRenderer::new);
RenderingRegistry.registerEntityRenderingHandler(SEAT.get(), SeatEntity.Render::new);
}

View File

@ -52,7 +52,7 @@ public class AllSpriteShifts {
CREATIVE_FLUID_TANK = getCT(CTType.CROSS, "creative_fluid_tank");
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"),
ANDESIDE_BELT_CASING = SpriteShifter.get("block/brass_casing_belt", "block/andesite_casing_belt"),
CRAFTER_THINGIES = SpriteShifter.get("block/crafter_thingies", "block/crafter_thingies");
@ -92,9 +92,9 @@ public class AllSpriteShifts {
for (DyeColor color : DyeColor.values()) {
String id = color.getName();
DYED_BELTS.put(color, SpriteShifter.get("block/belt", "block/belt/" + id));
DYED_OFFSET_BELTS.put(color, SpriteShifter.get("block/belt_offset", "block/belt/" + id));
DYED_DIAGONAL_BELTS.put(color, SpriteShifter.get("block/belt_diagonal", "block/belt/" + id + "_diagonal"));
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 + "_scroll"));
DYED_DIAGONAL_BELTS.put(color, SpriteShifter.get("block/belt_diagonal", "block/belt/" + id + "_diagonal_scroll"));
}
}

View File

@ -205,12 +205,14 @@ public class AllTileEntities {
.tileEntity("gantry_shaft", GantryShaftTileEntity::new)
.validBlocks(AllBlocks.GANTRY_SHAFT)
.renderer(() -> KineticTileEntityRenderer::new)
.onRegister(SingleRotatingInstance::register)
.register();
public static final TileEntityEntry<GantryPinionTileEntity> GANTRY_PINION = Create.registrate()
.tileEntity("gantry_pinion", GantryPinionTileEntity::new)
.validBlocks(AllBlocks.GANTRY_PINION)
.renderer(() -> GantryPinionRenderer::new)
.onRegister(ShaftInstance::register)
.register();
public static final TileEntityEntry<PumpTileEntity> MECHANICAL_PUMP = Create.registrate()

View File

@ -17,14 +17,13 @@ public abstract class ContraptionLighter<C extends Contraption> {
bounds = getContraptionBounds();
lightVolume = new LightVolume(contraptionBoundsToVolume(bounds));
lightVolume = new LightVolume(contraptionBoundsToVolume(bounds.copy()));
lightVolume.initialize(contraption.entity.world);
scheduleRebuild = true;
}
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.minY = Math.max(bounds.minY, 0);
bounds.maxY = Math.min(bounds.maxY, 255);

View File

@ -10,7 +10,6 @@ public class NonStationaryLighter<C extends Contraption> extends ContraptionLigh
@Override
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.minY = Math.max(bounds.minY, 0);
bounds.maxY = Math.min(bounds.maxY, 255);

View File

@ -1,9 +1,7 @@
package com.simibubi.create.content.contraptions.components.structureMovement.gantry;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.content.contraptions.components.structureMovement.AssemblyException;
import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionType;
import com.simibubi.create.content.contraptions.components.structureMovement.TranslatingContraption;
import com.simibubi.create.content.contraptions.components.structureMovement.*;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.Direction;
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);
}
@Override
public ContraptionLighter<?> makeLighter() {
return new NonStationaryLighter<>(this);
}
}

View File

@ -1,5 +1,6 @@
package com.simibubi.create.content.contraptions.components.structureMovement.gantry;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllEntityTypes;
import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntity;
@ -172,6 +173,9 @@ public class GantryContraptionEntity extends AbstractContraptionEntity {
return ContraptionRotationState.NONE;
}
@Override
public void doLocalTransforms(float partialTicks, MatrixStack[] matrixStacks) { }
public void updateClientMotion() {
float modifier = movementAxis.getAxisDirection()
.getOffset();

View File

@ -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) {}
}

View File

@ -164,4 +164,8 @@ public class GantryPinionTileEntity extends KineticTileEntity implements IDispla
return te instanceof GantryShaftTileEntity && ((GantryShaftTileEntity) te).canAssembleOn();
}
@Override
public boolean shouldRenderAsTE() {
return true;
}
}

View File

@ -30,8 +30,8 @@ public class SpeedControllerRenderer extends SmartTileEntityRenderer<SpeedContro
IRenderTypeBuffer buffer, int light, int overlay) {
super.renderSafe(tileEntityIn, partialTicks, ms, buffer, light, overlay);
IVertexBuilder builder = buffer.getBuffer(RenderType.getSolid());
if (!FastRenderDispatcher.available(tileEntityIn.getWorld())) {
IVertexBuilder builder = buffer.getBuffer(RenderType.getSolid());
KineticTileEntityRenderer.renderRotatingBuffer(tileEntityIn, getRotatedModel(tileEntityIn), ms, builder, light);
}

View File

@ -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.utility.Iterate;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.item.DyeColor;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
@ -61,13 +62,14 @@ public class BeltInstance extends KineticTileInstance<BeltTileEntity> {
BeltPart part = lastState.get(BeltBlock.PART);
boolean start = part == BeltPart.START;
boolean end = part == BeltPart.END;
DyeColor color = tile.color.orElse(null);
for (boolean bottom : Iterate.trueAndFalse) {
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);
Consumer<BeltData> setupFunc = setupFunc(spriteShift);
Consumer<BeltData> setupFunc = setupFunc(bottom, spriteShift);
keys.add(beltModel.setupInstance(setupFunc));
@ -83,8 +85,16 @@ public class BeltInstance extends KineticTileInstance<BeltTileEntity> {
@Override
public void onUpdate() {
DyeColor color = tile.color.orElse(null);
boolean bottom = true;
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) {
@ -152,7 +162,7 @@ public class BeltInstance extends KineticTileInstance<BeltTileEntity> {
return dir;
}
private Consumer<BeltData> setupFunc(SpriteShiftEntry spriteShift) {
private Consumer<BeltData> setupFunc(boolean bottom, SpriteShiftEntry spriteShift) {
return data -> {
float rotX = (!diagonal && beltSlope != BeltSlope.HORIZONTAL ? 90 : 0) + (beltSlope == BeltSlope.DOWNWARD ? 180 : 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))
.setRotation(rotX, rotY, rotZ)
.setRotationalSpeed(getScrollSpeed())
.setRotationOffset(0)
.setRotationOffset(bottom ? 0.5f : 0f)
.setScrollTexture(spriteShift)
.setScrollMult(diagonal ? 3f / 8f : 0.5f);
};

View File

@ -1,5 +1,6 @@
package com.simibubi.create.content.contraptions.relays.belt;
import java.util.Optional;
import java.util.Random;
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.relays.belt.transport.TransportedItemStack;
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.utility.AngleHelper;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
@ -83,24 +87,16 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
end = b;
}
DyeColor color = te.color.orElse(null);
for (boolean bottom : Iterate.trueAndFalse) {
AllBlockPartials beltPartial = getBeltPartial(diagonal, start, end, bottom);
SuperByteBuffer beltBuffer = beltPartial.renderOn(blockState)
.light(light);
SuperByteBuffer beltBuffer = beltPartial.renderOn(blockState)
.light(light);
SpriteShiftEntry spriteShift = null;
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;
SpriteShiftEntry spriteShift = getSpriteShiftEntry(color, diagonal, bottom);
// UV shift
float speed = te.getSpeed();
@ -113,7 +109,7 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
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 * spriteSize * scrollMult;
@ -147,10 +143,13 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
renderItems(te, partialTicks, ms, buffer, light, overlay);
}
public static SpriteShiftEntry getSpriteShiftEntry(boolean diagonal, boolean bottom) {
if (diagonal) return AllSpriteShifts.BELT_DIAGONAL;
if (bottom) return AllSpriteShifts.BELT_OFFSET;
return AllSpriteShifts.BELT;
public static SpriteShiftEntry getSpriteShiftEntry(DyeColor color, boolean diagonal, boolean bottom) {
if (color != null) {
return (diagonal ? AllSpriteShifts.DYED_DIAGONAL_BELTS
: 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) {
@ -158,12 +157,11 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
if (start) return AllBlockPartials.BELT_DIAGONAL_START;
if (end) return AllBlockPartials.BELT_DIAGONAL_END;
return AllBlockPartials.BELT_DIAGONAL_MIDDLE;
} else if (bottom) {
if (start) return AllBlockPartials.BELT_START_BOTTOM;
if (end) return AllBlockPartials.BELT_END_BOTTOM;
return AllBlockPartials.BELT_MIDDLE_BOTTOM;
} else {
if (bottom) {
if (start) return AllBlockPartials.BELT_START_BOTTOM;
if (end) return AllBlockPartials.BELT_END_BOTTOM;
return AllBlockPartials.BELT_MIDDLE_BOTTOM;
}
if (start) return AllBlockPartials.BELT_START;
if (end) return AllBlockPartials.BELT_END;
return AllBlockPartials.BELT_MIDDLE;

View File

@ -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.TransportedItemStack;
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.behaviour.belt.DirectBeltInputBehaviour;
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.Vec3i;
import net.minecraft.world.LightType;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.model.data.IModelData;
import net.minecraftforge.client.model.data.ModelDataMap;
import net.minecraftforge.client.model.data.ModelProperty;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
@ -260,6 +263,7 @@ public class BeltTileEntity extends KineticTileEntity {
belt.color = Optional.ofNullable(colorIn);
belt.markDirty();
belt.sendData();
DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> FastRenderDispatcher.enqueueUpdate(belt));
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 531 B