mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-14 15:53:48 +01:00
Shuffling the shade
- Update Flywheel and add support for unshaded quads - Fix models marking shafts and other parts as unshaded - Refactor SchematicRenderer buffer building - Improve block entity render bounding box caching - Fix #2785
This commit is contained in:
parent
984cde4d43
commit
0cf0d3930e
51 changed files with 230 additions and 227 deletions
|
@ -19,7 +19,7 @@ parchment_version = 2022.01.23
|
||||||
|
|
||||||
# dependency versions
|
# dependency versions
|
||||||
registrate_version = MC1.18-1.0.21
|
registrate_version = MC1.18-1.0.21
|
||||||
flywheel_version = 1.18-0.6.1.61
|
flywheel_version = 1.18-0.6.1.62
|
||||||
jei_minecraft_version = 1.18.1
|
jei_minecraft_version = 1.18.1
|
||||||
jei_version = 9.3.2.92
|
jei_version = 9.3.2.92
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,6 @@ import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.AABB;
|
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
import net.minecraftforge.fml.DistExecutor;
|
import net.minecraftforge.fml.DistExecutor;
|
||||||
|
@ -96,7 +95,6 @@ public class KineticTileEntity extends SmartTileEntity
|
||||||
effects.tick();
|
effects.tick();
|
||||||
|
|
||||||
if (level.isClientSide) {
|
if (level.isClientSide) {
|
||||||
cachedBoundingBox = null; // cache the bounding box for every frame between ticks
|
|
||||||
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> this.tickAudio());
|
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> this.tickAudio());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -570,20 +568,6 @@ public class KineticTileEntity extends SmartTileEntity
|
||||||
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> InstancedRenderDispatcher.enqueueUpdate(this));
|
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> InstancedRenderDispatcher.enqueueUpdate(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected AABB cachedBoundingBox;
|
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
|
||||||
public AABB getRenderBoundingBox() {
|
|
||||||
if (cachedBoundingBox == null) {
|
|
||||||
cachedBoundingBox = makeRenderBoundingBox();
|
|
||||||
}
|
|
||||||
return cachedBoundingBox;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected AABB makeRenderBoundingBox() {
|
|
||||||
return super.getRenderBoundingBox();
|
|
||||||
}
|
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public void tickAudio() {
|
public void tickAudio() {
|
||||||
float componentSpeed = Math.abs(getSpeed());
|
float componentSpeed = Math.abs(getSpeed());
|
||||||
|
|
|
@ -1,17 +1,13 @@
|
||||||
package com.simibubi.create.content.contraptions.components.actors;
|
package com.simibubi.create.content.contraptions.components.actors;
|
||||||
|
|
||||||
import com.simibubi.create.foundation.tileEntity.SyncedTileEntity;
|
import com.simibubi.create.foundation.tileEntity.CachedRenderBBTileEntity;
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
|
||||||
|
|
||||||
public class HarvesterTileEntity extends SyncedTileEntity {
|
public class HarvesterTileEntity extends CachedRenderBBTileEntity {
|
||||||
|
|
||||||
private static final AABB RENDER_BOX = new AABB(0, 0, 0, 1, 1, 1);
|
|
||||||
|
|
||||||
// For simulations such as Ponder
|
// For simulations such as Ponder
|
||||||
private float manuallyAnimatedSpeed;
|
private float manuallyAnimatedSpeed;
|
||||||
|
@ -21,9 +17,8 @@ public class HarvesterTileEntity extends SyncedTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@OnlyIn(Dist.CLIENT)
|
protected AABB createRenderBoundingBox() {
|
||||||
public AABB getRenderBoundingBox() {
|
return new AABB(worldPosition);
|
||||||
return RENDER_BOX.move(worldPosition);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getAnimatedSpeed() {
|
public float getAnimatedSpeed() {
|
||||||
|
|
|
@ -15,8 +15,6 @@ import net.minecraft.world.entity.Entity;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
|
||||||
|
|
||||||
public abstract class PortableStorageInterfaceTileEntity extends SmartTileEntity {
|
public abstract class PortableStorageInterfaceTileEntity extends SmartTileEntity {
|
||||||
|
|
||||||
|
@ -113,15 +111,9 @@ public abstract class PortableStorageInterfaceTileEntity extends SmartTileEntity
|
||||||
return powered;
|
return powered;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected AABB cachedBoundingBox;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@OnlyIn(Dist.CLIENT)
|
protected AABB createRenderBoundingBox() {
|
||||||
public AABB getRenderBoundingBox() {
|
return super.createRenderBoundingBox().inflate(2);
|
||||||
if (cachedBoundingBox == null) {
|
|
||||||
cachedBoundingBox = super.getRenderBoundingBox().inflate(2);
|
|
||||||
}
|
|
||||||
return cachedBoundingBox;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isTransferring() {
|
public boolean isTransferring() {
|
||||||
|
|
|
@ -231,7 +231,7 @@ public class CrushingWheelControllerTileEntity extends SmartTileEntity {
|
||||||
processingEntity.setPos(entityOutPos.x, entityOutPos.y, entityOutPos.z);
|
processingEntity.setPos(entityOutPos.x, entityOutPos.y, entityOutPos.z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
processingEntity.hurt(CrushingWheelTileEntity.damageSource, crusherDamage);
|
processingEntity.hurt(CrushingWheelTileEntity.DAMAGE_SOURCE, crusherDamage);
|
||||||
if (!processingEntity.isAlive()) {
|
if (!processingEntity.isAlive()) {
|
||||||
processingEntity.setPos(entityOutPos.x, entityOutPos.y, entityOutPos.z);
|
processingEntity.setPos(entityOutPos.x, entityOutPos.y, entityOutPos.z);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
|
||||||
@EventBusSubscriber
|
@EventBusSubscriber
|
||||||
public class CrushingWheelTileEntity extends KineticTileEntity {
|
public class CrushingWheelTileEntity extends KineticTileEntity {
|
||||||
|
|
||||||
public static DamageSource damageSource = new DamageSource("create.crush").bypassArmor()
|
public static final DamageSource DAMAGE_SOURCE = new DamageSource("create.crush").bypassArmor()
|
||||||
.setScalesWithDifficulty();
|
.setScalesWithDifficulty();
|
||||||
|
|
||||||
public CrushingWheelTileEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) {
|
public CrushingWheelTileEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) {
|
||||||
|
@ -40,7 +40,7 @@ public class CrushingWheelTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AABB makeRenderBoundingBox() {
|
protected AABB createRenderBoundingBox() {
|
||||||
return new AABB(worldPosition).inflate(1);
|
return new AABB(worldPosition).inflate(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,14 +52,14 @@ public class CrushingWheelTileEntity extends KineticTileEntity {
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void crushingIsFortunate(LootingLevelEvent event) {
|
public static void crushingIsFortunate(LootingLevelEvent event) {
|
||||||
if (event.getDamageSource() != damageSource)
|
if (event.getDamageSource() != DAMAGE_SOURCE)
|
||||||
return;
|
return;
|
||||||
event.setLootingLevel(2); //This does not currently increase mob drops. It seems like this only works for damage done by an entity.
|
event.setLootingLevel(2); //This does not currently increase mob drops. It seems like this only works for damage done by an entity.
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void handleCrushedMobDrops(LivingDropsEvent event) {
|
public static void handleCrushedMobDrops(LivingDropsEvent event) {
|
||||||
if (event.getSource() != CrushingWheelTileEntity.damageSource)
|
if (event.getSource() != CrushingWheelTileEntity.DAMAGE_SOURCE)
|
||||||
return;
|
return;
|
||||||
Vec3 outSpeed = Vec3.ZERO;
|
Vec3 outSpeed = Vec3.ZERO;
|
||||||
for (ItemEntity outputItem : event.getDrops()) {
|
for (ItemEntity outputItem : event.getDrops()) {
|
||||||
|
|
|
@ -388,8 +388,8 @@ public class DeployerTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AABB makeRenderBoundingBox() {
|
protected AABB createRenderBoundingBox() {
|
||||||
return super.makeRenderBoundingBox().inflate(3);
|
return super.createRenderBoundingBox().inflate(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -50,8 +50,8 @@ public class FlywheelTileEntity extends GeneratingKineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AABB makeRenderBoundingBox() {
|
protected AABB createRenderBoundingBox() {
|
||||||
return super.makeRenderBoundingBox().inflate(2);
|
return super.createRenderBoundingBox().inflate(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -14,8 +14,6 @@ import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
|
||||||
|
|
||||||
public class EngineTileEntity extends SmartTileEntity {
|
public class EngineTileEntity extends SmartTileEntity {
|
||||||
|
|
||||||
|
@ -31,14 +29,9 @@ public class EngineTileEntity extends SmartTileEntity {
|
||||||
public void addBehaviours(List<TileEntityBehaviour> behaviours) {
|
public void addBehaviours(List<TileEntityBehaviour> behaviours) {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected AABB cachedBoundingBox;
|
|
||||||
@Override
|
@Override
|
||||||
@OnlyIn(Dist.CLIENT)
|
protected AABB createRenderBoundingBox() {
|
||||||
public AABB getRenderBoundingBox() {
|
return super.createRenderBoundingBox().inflate(1.5f);
|
||||||
if (cachedBoundingBox == null) {
|
|
||||||
cachedBoundingBox = super.getRenderBoundingBox().inflate(1.5f);
|
|
||||||
}
|
|
||||||
return cachedBoundingBox;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -91,7 +91,7 @@ public class MechanicalMixerTileEntity extends BasinOperatingTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AABB makeRenderBoundingBox() {
|
protected AABB createRenderBoundingBox() {
|
||||||
return new AABB(worldPosition).expandTowards(0, -1.5, 0);
|
return new AABB(worldPosition).expandTowards(0, -1.5, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ public class MechanicalPressTileEntity extends BasinOperatingTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AABB makeRenderBoundingBox() {
|
protected AABB createRenderBoundingBox() {
|
||||||
return new AABB(worldPosition).expandTowards(0, -1.5, 0)
|
return new AABB(worldPosition).expandTowards(0, -1.5, 0)
|
||||||
.expandTowards(0, 1, 0);
|
.expandTowards(0, 1, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,8 +73,6 @@ import net.minecraftforge.items.IItemHandler;
|
||||||
@MethodsReturnNonnullByDefault
|
@MethodsReturnNonnullByDefault
|
||||||
public class SawTileEntity extends BlockBreakingKineticTileEntity {
|
public class SawTileEntity extends BlockBreakingKineticTileEntity {
|
||||||
|
|
||||||
private static final AABB RENDER_BOX = new AABB(0, 0, 0, 1, 1, 1);
|
|
||||||
|
|
||||||
private static final Object cuttingRecipesKey = new Object();
|
private static final Object cuttingRecipesKey = new Object();
|
||||||
public static final Supplier<RecipeType<?>> woodcuttingRecipeType =
|
public static final Supplier<RecipeType<?>> woodcuttingRecipeType =
|
||||||
Suppliers.memoize(() -> Registry.RECIPE_TYPE.get(new ResourceLocation("druidcraft", "woodcutting")));
|
Suppliers.memoize(() -> Registry.RECIPE_TYPE.get(new ResourceLocation("druidcraft", "woodcutting")));
|
||||||
|
@ -125,9 +123,8 @@ public class SawTileEntity extends BlockBreakingKineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected AABB makeRenderBoundingBox() {
|
protected AABB createRenderBoundingBox() {
|
||||||
return RENDER_BOX.inflate(.125f)
|
return new AABB(worldPosition).inflate(.125f);
|
||||||
.move(worldPosition);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -34,8 +34,8 @@ public class PulleyTileEntity extends LinearActuatorTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AABB makeRenderBoundingBox() {
|
protected AABB createRenderBoundingBox() {
|
||||||
return super.makeRenderBoundingBox().expandTowards(0, -offset, 0);
|
return super.createRenderBoundingBox().expandTowards(0, -offset, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -43,6 +43,7 @@ public class PulleyTileEntity extends LinearActuatorTileEntity {
|
||||||
super.tick();
|
super.tick();
|
||||||
if (isVirtual())
|
if (isVirtual())
|
||||||
prevAnimatedOffset = offset;
|
prevAnimatedOffset = offset;
|
||||||
|
invalidateRenderBoundingBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class WaterWheelTileEntity extends GeneratingKineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AABB makeRenderBoundingBox() {
|
protected AABB createRenderBoundingBox() {
|
||||||
return new AABB(worldPosition).inflate(1);
|
return new AABB(worldPosition).inflate(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,6 @@ import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
|
||||||
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.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
@ -99,9 +97,8 @@ public class HosePulleyTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@OnlyIn(Dist.CLIENT)
|
protected AABB createRenderBoundingBox() {
|
||||||
public AABB getRenderBoundingBox() {
|
return super.createRenderBoundingBox().expandTowards(0, -offset.getValue(), 0);
|
||||||
return super.getRenderBoundingBox().expandTowards(0, -offset.getValue(), 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -122,6 +119,7 @@ public class HosePulleyTileEntity extends KineticTileEntity {
|
||||||
isMoving = false;
|
isMoving = false;
|
||||||
|
|
||||||
offset.setValue(newOffset);
|
offset.setValue(newOffset);
|
||||||
|
invalidateRenderBoundingBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -33,8 +33,6 @@ import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
|
||||||
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.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
@ -56,14 +54,9 @@ public class SpoutTileEntity extends SmartTileEntity implements IHaveGoggleInfor
|
||||||
processingTicks = -1;
|
processingTicks = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected AABB cachedBoundingBox;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@OnlyIn(Dist.CLIENT)
|
protected AABB createRenderBoundingBox() {
|
||||||
public AABB getRenderBoundingBox() {
|
return super.createRenderBoundingBox().expandTowards(0, -2, 0);
|
||||||
if (cachedBoundingBox == null)
|
|
||||||
cachedBoundingBox = super.getRenderBoundingBox().expandTowards(0, -2, 0);
|
|
||||||
return cachedBoundingBox;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -25,8 +25,6 @@ import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
|
||||||
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.fluids.FluidAttributes;
|
import net.minecraftforge.fluids.FluidAttributes;
|
||||||
|
@ -58,7 +56,6 @@ public class FluidTankTileEntity extends SmartTileEntity implements IHaveGoggleI
|
||||||
|
|
||||||
// For rendering purposes only
|
// For rendering purposes only
|
||||||
private InterpolatedChasingValue fluidLevel;
|
private InterpolatedChasingValue fluidLevel;
|
||||||
private AABB renderBoundingBox;
|
|
||||||
|
|
||||||
public FluidTankTileEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) {
|
public FluidTankTileEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) {
|
||||||
super(type, pos, state);
|
super(type, pos, state);
|
||||||
|
@ -123,7 +120,7 @@ public class FluidTankTileEntity extends SmartTileEntity implements IHaveGoggleI
|
||||||
super.initialize();
|
super.initialize();
|
||||||
sendData();
|
sendData();
|
||||||
if (level.isClientSide)
|
if (level.isClientSide)
|
||||||
updateRenderBoundingBox();
|
invalidateRenderBoundingBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onPositionChanged() {
|
private void onPositionChanged() {
|
||||||
|
@ -304,20 +301,12 @@ public class FluidTankTileEntity extends SmartTileEntity implements IHaveGoggleI
|
||||||
return isController() ? worldPosition : controller;
|
return isController() ? worldPosition : controller;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateRenderBoundingBox() {
|
|
||||||
if (isController())
|
|
||||||
renderBoundingBox = super.getRenderBoundingBox().expandTowards(width - 1, height - 1, width - 1);
|
|
||||||
else
|
|
||||||
renderBoundingBox = super.getRenderBoundingBox();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@OnlyIn(Dist.CLIENT)
|
protected AABB createRenderBoundingBox() {
|
||||||
public AABB getRenderBoundingBox() {
|
if (isController())
|
||||||
if (renderBoundingBox == null) {
|
return super.createRenderBoundingBox().expandTowards(width - 1, height - 1, width - 1);
|
||||||
renderBoundingBox = super.getRenderBoundingBox();
|
else
|
||||||
}
|
return super.createRenderBoundingBox();
|
||||||
return renderBoundingBox;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
@ -380,7 +369,7 @@ public class FluidTankTileEntity extends SmartTileEntity implements IHaveGoggleI
|
||||||
level.sendBlockUpdated(getBlockPos(), getBlockState(), getBlockState(), 16);
|
level.sendBlockUpdated(getBlockPos(), getBlockState(), getBlockState(), 16);
|
||||||
if (isController())
|
if (isController())
|
||||||
tankInventory.setCapacity(getCapacityMultiplier() * getTotalTankSize());
|
tankInventory.setCapacity(getCapacityMultiplier() * getTotalTankSize());
|
||||||
updateRenderBoundingBox();
|
invalidateRenderBoundingBox();
|
||||||
}
|
}
|
||||||
if (isController()) {
|
if (isController()) {
|
||||||
float fillState = getFillState();
|
float fillState = getFillState();
|
||||||
|
|
|
@ -126,6 +126,7 @@ public class BeltTileEntity extends KineticTileEntity {
|
||||||
lighter = new BeltLighter();
|
lighter = new BeltLighter();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
invalidateRenderBoundingBox();
|
||||||
|
|
||||||
getInventory().tick();
|
getInventory().tick();
|
||||||
|
|
||||||
|
@ -160,11 +161,11 @@ public class BeltTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AABB makeRenderBoundingBox() {
|
public AABB createRenderBoundingBox() {
|
||||||
if (!isController())
|
if (!isController())
|
||||||
return super.makeRenderBoundingBox();
|
return super.createRenderBoundingBox();
|
||||||
else
|
else
|
||||||
return super.makeRenderBoundingBox().inflate(beltLength + 1);
|
return super.createRenderBoundingBox().inflate(beltLength + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void initializeItemHandler() {
|
protected void initializeItemHandler() {
|
||||||
|
|
|
@ -17,7 +17,7 @@ public class SimpleKineticTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AABB makeRenderBoundingBox() {
|
protected AABB createRenderBoundingBox() {
|
||||||
return new AABB(worldPosition).inflate(1);
|
return new AABB(worldPosition).inflate(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,6 @@ import net.minecraft.world.entity.EquipmentSlot;
|
||||||
import net.minecraft.world.item.ArmorMaterial;
|
import net.minecraft.world.item.ArmorMaterial;
|
||||||
import net.minecraft.world.item.Items;
|
import net.minecraft.world.item.Items;
|
||||||
import net.minecraft.world.item.crafting.Ingredient;
|
import net.minecraft.world.item.crafting.Ingredient;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
|
||||||
|
|
||||||
public enum AllArmorMaterials implements ArmorMaterial {
|
public enum AllArmorMaterials implements ArmorMaterial {
|
||||||
|
|
||||||
|
@ -30,47 +28,54 @@ public enum AllArmorMaterials implements ArmorMaterial {
|
||||||
private final float knockbackResistance;
|
private final float knockbackResistance;
|
||||||
private final Supplier<Ingredient> repairMaterial;
|
private final Supplier<Ingredient> repairMaterial;
|
||||||
|
|
||||||
private AllArmorMaterials(String p_i231593_3_, int p_i231593_4_, int[] p_i231593_5_, int p_i231593_6_,
|
private AllArmorMaterials(String name, int maxDamageFactor, int[] damageReductionAmountArray, int enchantability,
|
||||||
SoundEvent p_i231593_7_, float p_i231593_8_, float p_i231593_9_, Supplier<Ingredient> p_i231593_10_) {
|
SoundEvent soundEvent, float toughness, float knockbackResistance, Supplier<Ingredient> repairMaterial) {
|
||||||
this.name = p_i231593_3_;
|
this.name = name;
|
||||||
this.maxDamageFactor = p_i231593_4_;
|
this.maxDamageFactor = maxDamageFactor;
|
||||||
this.damageReductionAmountArray = p_i231593_5_;
|
this.damageReductionAmountArray = damageReductionAmountArray;
|
||||||
this.enchantability = p_i231593_6_;
|
this.enchantability = enchantability;
|
||||||
this.soundEvent = p_i231593_7_;
|
this.soundEvent = soundEvent;
|
||||||
this.toughness = p_i231593_8_;
|
this.toughness = toughness;
|
||||||
this.knockbackResistance = p_i231593_9_;
|
this.knockbackResistance = knockbackResistance;
|
||||||
this.repairMaterial = Suppliers.memoize(p_i231593_10_::get);
|
this.repairMaterial = Suppliers.memoize(repairMaterial::get);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getDurabilityForSlot(EquipmentSlot p_200896_1_) {
|
@Override
|
||||||
return MAX_DAMAGE_ARRAY[p_200896_1_.getIndex()] * this.maxDamageFactor;
|
public int getDurabilityForSlot(EquipmentSlot slot) {
|
||||||
|
return MAX_DAMAGE_ARRAY[slot.getIndex()] * this.maxDamageFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getDefenseForSlot(EquipmentSlot p_200902_1_) {
|
@Override
|
||||||
return this.damageReductionAmountArray[p_200902_1_.getIndex()];
|
public int getDefenseForSlot(EquipmentSlot slot) {
|
||||||
|
return this.damageReductionAmountArray[slot.getIndex()];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getEnchantmentValue() {
|
public int getEnchantmentValue() {
|
||||||
return this.enchantability;
|
return this.enchantability;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public SoundEvent getEquipSound() {
|
public SoundEvent getEquipSound() {
|
||||||
return this.soundEvent;
|
return this.soundEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Ingredient getRepairIngredient() {
|
public Ingredient getRepairIngredient() {
|
||||||
return this.repairMaterial.get();
|
return this.repairMaterial.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return this.name;
|
return this.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public float getToughness() {
|
public float getToughness() {
|
||||||
return this.toughness;
|
return this.toughness;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public float getKnockbackResistance() {
|
public float getKnockbackResistance() {
|
||||||
return this.knockbackResistance;
|
return this.knockbackResistance;
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,7 +127,7 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AABB getRenderBoundingBox() {
|
protected AABB createRenderBoundingBox() {
|
||||||
return new AABB(worldPosition).expandTowards(0, -3, 0);
|
return new AABB(worldPosition).expandTowards(0, -3, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,6 @@ import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
|
||||||
|
|
||||||
public class ArmTileEntity extends KineticTileEntity implements ITransformableTE {
|
public class ArmTileEntity extends KineticTileEntity implements ITransformableTE {
|
||||||
|
|
||||||
|
@ -160,9 +158,8 @@ public class ArmTileEntity extends KineticTileEntity implements ITransformableTE
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@OnlyIn(Dist.CLIENT)
|
protected AABB createRenderBoundingBox() {
|
||||||
public AABB makeRenderBoundingBox() {
|
return super.createRenderBoundingBox().inflate(3);
|
||||||
return super.makeRenderBoundingBox().inflate(3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkForMusicAmong(List<ArmInteractionPoint> list) {
|
private boolean checkForMusicAmong(List<ArmInteractionPoint> list) {
|
||||||
|
|
|
@ -55,6 +55,8 @@ import net.minecraft.world.level.block.state.properties.BedPart;
|
||||||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||||
import net.minecraft.world.level.block.state.properties.DoubleBlockHalf;
|
import net.minecraft.world.level.block.state.properties.DoubleBlockHalf;
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
import net.minecraftforge.common.util.LazyOptional;
|
import net.minecraftforge.common.util.LazyOptional;
|
||||||
import net.minecraftforge.items.CapabilityItemHandler;
|
import net.minecraftforge.items.CapabilityItemHandler;
|
||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
|
@ -812,6 +814,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements MenuPro
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@OnlyIn(Dist.CLIENT)
|
||||||
public AABB getRenderBoundingBox() {
|
public AABB getRenderBoundingBox() {
|
||||||
return INFINITE_EXTENT_AABB;
|
return INFINITE_EXTENT_AABB;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,12 @@
|
||||||
package com.simibubi.create.content.schematics.client;
|
package com.simibubi.create.content.schematics.client;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import com.jozufozu.flywheel.core.model.ModelUtil;
|
import com.jozufozu.flywheel.core.model.ModelUtil;
|
||||||
import com.jozufozu.flywheel.util.transform.TransformStack;
|
import com.jozufozu.flywheel.core.model.ShadeSeparatedBufferBuilder;
|
||||||
|
import com.jozufozu.flywheel.core.model.ShadeSeparatingVertexConsumer;
|
||||||
import com.mojang.blaze3d.vertex.BufferBuilder;
|
import com.mojang.blaze3d.vertex.BufferBuilder;
|
||||||
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
|
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
@ -23,17 +20,20 @@ import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.ItemBlockRenderTypes;
|
import net.minecraft.client.renderer.ItemBlockRenderTypes;
|
||||||
import net.minecraft.client.renderer.RenderType;
|
import net.minecraft.client.renderer.RenderType;
|
||||||
import net.minecraft.client.renderer.block.BlockRenderDispatcher;
|
import net.minecraft.client.renderer.block.BlockRenderDispatcher;
|
||||||
|
import net.minecraft.client.renderer.block.ModelBlockRenderer;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.world.level.block.RenderShape;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
||||||
import net.minecraftforge.client.ForgeHooksClient;
|
import net.minecraftforge.client.ForgeHooksClient;
|
||||||
import net.minecraftforge.client.model.data.EmptyModelData;
|
import net.minecraftforge.client.model.data.EmptyModelData;
|
||||||
|
|
||||||
public class SchematicRenderer {
|
public class SchematicRenderer {
|
||||||
|
|
||||||
|
private static final ThreadLocal<ThreadLocalObjects> THREAD_LOCAL_OBJECTS = ThreadLocal.withInitial(ThreadLocalObjects::new);
|
||||||
|
|
||||||
private final Map<RenderType, SuperByteBuffer> bufferCache = new HashMap<>(getLayerCount());
|
private final Map<RenderType, SuperByteBuffer> bufferCache = new HashMap<>(getLayerCount());
|
||||||
private final Set<RenderType> usedBlockRenderLayers = new HashSet<>(getLayerCount());
|
|
||||||
private final Set<RenderType> startedBufferBuilders = new HashSet<>(getLayerCount());
|
|
||||||
private boolean active;
|
private boolean active;
|
||||||
private boolean changed;
|
private boolean changed;
|
||||||
protected SchematicWorld schematic;
|
protected SchematicWorld schematic;
|
||||||
|
@ -69,75 +69,81 @@ public class SchematicRenderer {
|
||||||
changed = false;
|
changed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void render(PoseStack ms, SuperRenderTypeBuffer buffer) {
|
public void render(PoseStack ms, SuperRenderTypeBuffer buffers) {
|
||||||
if (!active)
|
if (!active)
|
||||||
return;
|
return;
|
||||||
for (RenderType layer : RenderType.chunkBufferLayers()) {
|
bufferCache.forEach((layer, buffer) -> {
|
||||||
if (!usedBlockRenderLayers.contains(layer))
|
buffer.renderInto(ms, buffers.getBuffer(layer));
|
||||||
continue;
|
});
|
||||||
SuperByteBuffer superByteBuffer = bufferCache.get(layer);
|
TileEntityRenderHelper.renderTileEntities(schematic, schematic.getRenderedTileEntities(), ms, buffers);
|
||||||
superByteBuffer.renderInto(ms, buffer.getBuffer(layer));
|
|
||||||
}
|
|
||||||
TileEntityRenderHelper.renderTileEntities(schematic, schematic.getRenderedTileEntities(), ms, buffer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void redraw() {
|
protected void redraw() {
|
||||||
usedBlockRenderLayers.clear();
|
bufferCache.clear();
|
||||||
startedBufferBuilders.clear();
|
|
||||||
|
|
||||||
final SchematicWorld blockAccess = schematic;
|
|
||||||
final BlockRenderDispatcher blockRendererDispatcher = ModelUtil.VANILLA_RENDERER;
|
|
||||||
|
|
||||||
List<BlockState> blockstates = new LinkedList<>();
|
|
||||||
Map<RenderType, BufferBuilder> buffers = new HashMap<>();
|
|
||||||
PoseStack ms = new PoseStack();
|
|
||||||
Random random = new Random();
|
|
||||||
|
|
||||||
BlockPos.betweenClosedStream(blockAccess.getBounds())
|
|
||||||
.forEach(localPos -> {
|
|
||||||
ms.pushPose();
|
|
||||||
TransformStack.cast(ms)
|
|
||||||
.translate(localPos);
|
|
||||||
BlockPos pos = localPos.offset(anchor);
|
|
||||||
BlockState state = blockAccess.getBlockState(pos);
|
|
||||||
|
|
||||||
for (RenderType blockRenderLayer : RenderType.chunkBufferLayers()) {
|
|
||||||
if (!ItemBlockRenderTypes.canRenderInLayer(state, blockRenderLayer))
|
|
||||||
continue;
|
|
||||||
ForgeHooksClient.setRenderType(blockRenderLayer);
|
|
||||||
if (!buffers.containsKey(blockRenderLayer))
|
|
||||||
buffers.put(blockRenderLayer, new BufferBuilder(512));
|
|
||||||
|
|
||||||
BufferBuilder bufferBuilder = buffers.get(blockRenderLayer);
|
|
||||||
if (startedBufferBuilders.add(blockRenderLayer))
|
|
||||||
bufferBuilder.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK);
|
|
||||||
|
|
||||||
BlockEntity tileEntity = blockAccess.getBlockEntity(localPos);
|
|
||||||
|
|
||||||
if (blockRendererDispatcher.renderBatched(state, pos, blockAccess, ms, bufferBuilder, true,
|
|
||||||
random, tileEntity != null ? tileEntity.getModelData() : EmptyModelData.INSTANCE)) {
|
|
||||||
usedBlockRenderLayers.add(blockRenderLayer);
|
|
||||||
}
|
|
||||||
blockstates.add(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
ForgeHooksClient.setRenderType(null);
|
|
||||||
ms.popPose();
|
|
||||||
});
|
|
||||||
|
|
||||||
// finishDrawing
|
|
||||||
for (RenderType layer : RenderType.chunkBufferLayers()) {
|
for (RenderType layer : RenderType.chunkBufferLayers()) {
|
||||||
if (!startedBufferBuilders.contains(layer))
|
SuperByteBuffer buffer = drawLayer(layer);
|
||||||
continue;
|
if (!buffer.isEmpty())
|
||||||
BufferBuilder buf = buffers.get(layer);
|
bufferCache.put(layer, buffer);
|
||||||
buf.end();
|
|
||||||
bufferCache.put(layer, new SuperByteBuffer(buf));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected SuperByteBuffer drawLayer(RenderType layer) {
|
||||||
|
BlockRenderDispatcher dispatcher = ModelUtil.VANILLA_RENDERER;
|
||||||
|
ThreadLocalObjects objects = THREAD_LOCAL_OBJECTS.get();
|
||||||
|
|
||||||
|
PoseStack poseStack = objects.poseStack;
|
||||||
|
Random random = objects.random;
|
||||||
|
BlockPos.MutableBlockPos mutableBlockPos = objects.mutableBlockPos;
|
||||||
|
SchematicWorld renderWorld = schematic;
|
||||||
|
BoundingBox bounds = renderWorld.getBounds();
|
||||||
|
|
||||||
|
ShadeSeparatingVertexConsumer shadeSeparatingWrapper = objects.shadeSeparatingWrapper;
|
||||||
|
ShadeSeparatedBufferBuilder builder = new ShadeSeparatedBufferBuilder(512);
|
||||||
|
BufferBuilder unshadedBuilder = objects.unshadedBuilder;
|
||||||
|
|
||||||
|
builder.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK);
|
||||||
|
unshadedBuilder.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK);
|
||||||
|
shadeSeparatingWrapper.prepare(builder, unshadedBuilder);
|
||||||
|
|
||||||
|
ForgeHooksClient.setRenderType(layer);
|
||||||
|
ModelBlockRenderer.enableCaching();
|
||||||
|
for (BlockPos localPos : BlockPos.betweenClosed(bounds.minX(), bounds.minY(), bounds.minZ(), bounds.maxX(), bounds.maxY(), bounds.maxZ())) {
|
||||||
|
BlockPos pos = mutableBlockPos.setWithOffset(localPos, anchor);
|
||||||
|
BlockState state = renderWorld.getBlockState(pos);
|
||||||
|
|
||||||
|
poseStack.pushPose();
|
||||||
|
poseStack.translate(localPos.getX(), localPos.getY(), localPos.getZ());
|
||||||
|
|
||||||
|
if (state.getRenderShape() == RenderShape.MODEL && ItemBlockRenderTypes.canRenderInLayer(state, layer)) {
|
||||||
|
BlockEntity tileEntity = renderWorld.getBlockEntity(localPos);
|
||||||
|
dispatcher.renderBatched(state, pos, renderWorld, poseStack, shadeSeparatingWrapper, true, random,
|
||||||
|
tileEntity != null ? tileEntity.getModelData() : EmptyModelData.INSTANCE);
|
||||||
|
}
|
||||||
|
|
||||||
|
poseStack.popPose();
|
||||||
|
}
|
||||||
|
ModelBlockRenderer.clearCache();
|
||||||
|
ForgeHooksClient.setRenderType(null);
|
||||||
|
|
||||||
|
shadeSeparatingWrapper.clear();
|
||||||
|
unshadedBuilder.end();
|
||||||
|
builder.appendUnshadedVertices(unshadedBuilder);
|
||||||
|
builder.end();
|
||||||
|
|
||||||
|
return new SuperByteBuffer(builder);
|
||||||
|
}
|
||||||
|
|
||||||
private static int getLayerCount() {
|
private static int getLayerCount() {
|
||||||
return RenderType.chunkBufferLayers()
|
return RenderType.chunkBufferLayers()
|
||||||
.size();
|
.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static class ThreadLocalObjects {
|
||||||
|
public final PoseStack poseStack = new PoseStack();
|
||||||
|
public final Random random = new Random();
|
||||||
|
public final BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos();
|
||||||
|
public final ShadeSeparatingVertexConsumer shadeSeparatingWrapper = new ShadeSeparatingVertexConsumer();
|
||||||
|
public final BufferBuilder unshadedBuilder = new BufferBuilder(512);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,8 @@ import java.util.Random;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.core.model.ModelUtil;
|
import com.jozufozu.flywheel.core.model.ModelUtil;
|
||||||
|
import com.jozufozu.flywheel.core.model.ShadeSeparatedBufferBuilder;
|
||||||
|
import com.jozufozu.flywheel.core.model.ShadeSeparatingVertexConsumer;
|
||||||
import com.jozufozu.flywheel.util.transform.TransformStack;
|
import com.jozufozu.flywheel.util.transform.TransformStack;
|
||||||
import com.mojang.blaze3d.vertex.BufferBuilder;
|
import com.mojang.blaze3d.vertex.BufferBuilder;
|
||||||
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
|
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
|
||||||
|
@ -33,6 +35,7 @@ import net.minecraft.client.renderer.ItemBlockRenderTypes;
|
||||||
import net.minecraft.client.renderer.MultiBufferSource;
|
import net.minecraft.client.renderer.MultiBufferSource;
|
||||||
import net.minecraft.client.renderer.RenderType;
|
import net.minecraft.client.renderer.RenderType;
|
||||||
import net.minecraft.client.renderer.block.BlockRenderDispatcher;
|
import net.minecraft.client.renderer.block.BlockRenderDispatcher;
|
||||||
|
import net.minecraft.client.renderer.block.ModelBlockRenderer;
|
||||||
import net.minecraft.client.resources.model.ModelBakery;
|
import net.minecraft.client.resources.model.ModelBakery;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction.Axis;
|
import net.minecraft.core.Direction.Axis;
|
||||||
|
@ -58,6 +61,8 @@ public class WorldSectionElement extends AnimatedSceneElement {
|
||||||
public static final SuperByteBufferCache.Compartment<Pair<Integer, Integer>> DOC_WORLD_SECTION =
|
public static final SuperByteBufferCache.Compartment<Pair<Integer, Integer>> DOC_WORLD_SECTION =
|
||||||
new SuperByteBufferCache.Compartment<>();
|
new SuperByteBufferCache.Compartment<>();
|
||||||
|
|
||||||
|
private static final ThreadLocal<ThreadLocalObjects> THREAD_LOCAL_OBJECTS = ThreadLocal.withInitial(ThreadLocalObjects::new);
|
||||||
|
|
||||||
List<BlockEntity> renderedTileEntities;
|
List<BlockEntity> renderedTileEntities;
|
||||||
List<Pair<BlockEntity, Consumer<Level>>> tickableTileEntities;
|
List<Pair<BlockEntity, Consumer<Level>>> tickableTileEntities;
|
||||||
Selection section;
|
Selection section;
|
||||||
|
@ -401,37 +406,57 @@ public class WorldSectionElement extends AnimatedSceneElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
private SuperByteBuffer buildStructureBuffer(PonderWorld world, RenderType layer) {
|
private SuperByteBuffer buildStructureBuffer(PonderWorld world, RenderType layer) {
|
||||||
ForgeHooksClient.setRenderType(layer);
|
|
||||||
BlockRenderDispatcher dispatcher = ModelUtil.VANILLA_RENDERER;
|
BlockRenderDispatcher dispatcher = ModelUtil.VANILLA_RENDERER;
|
||||||
PoseStack ms = new PoseStack();
|
ThreadLocalObjects objects = THREAD_LOCAL_OBJECTS.get();
|
||||||
Random random = new Random();
|
|
||||||
BufferBuilder builder = new BufferBuilder(512);
|
|
||||||
builder.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK);
|
|
||||||
world.setMask(this.section);
|
|
||||||
|
|
||||||
|
PoseStack poseStack = objects.poseStack;
|
||||||
|
Random random = objects.random;
|
||||||
|
ShadeSeparatingVertexConsumer shadeSeparatingWrapper = objects.shadeSeparatingWrapper;
|
||||||
|
ShadeSeparatedBufferBuilder builder = new ShadeSeparatedBufferBuilder(512);
|
||||||
|
BufferBuilder unshadedBuilder = objects.unshadedBuilder;
|
||||||
|
|
||||||
|
builder.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK);
|
||||||
|
unshadedBuilder.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK);
|
||||||
|
shadeSeparatingWrapper.prepare(builder, unshadedBuilder);
|
||||||
|
|
||||||
|
world.setMask(this.section);
|
||||||
|
ForgeHooksClient.setRenderType(layer);
|
||||||
|
ModelBlockRenderer.enableCaching();
|
||||||
section.forEach(pos -> {
|
section.forEach(pos -> {
|
||||||
BlockState state = world.getBlockState(pos);
|
BlockState state = world.getBlockState(pos);
|
||||||
FluidState fluidState = world.getFluidState(pos);
|
FluidState fluidState = world.getFluidState(pos);
|
||||||
|
|
||||||
ms.pushPose();
|
poseStack.pushPose();
|
||||||
ms.translate(pos.getX(), pos.getY(), pos.getZ());
|
poseStack.translate(pos.getX(), pos.getY(), pos.getZ());
|
||||||
|
|
||||||
if (state.getRenderShape() == RenderShape.MODEL && ItemBlockRenderTypes.canRenderInLayer(state, layer)) {
|
if (state.getRenderShape() == RenderShape.MODEL && ItemBlockRenderTypes.canRenderInLayer(state, layer)) {
|
||||||
BlockEntity tileEntity = world.getBlockEntity(pos);
|
BlockEntity tileEntity = world.getBlockEntity(pos);
|
||||||
dispatcher.renderBatched(state, pos, world, ms, builder, true, random,
|
dispatcher.renderBatched(state, pos, world, poseStack, shadeSeparatingWrapper, true, random,
|
||||||
tileEntity != null ? tileEntity.getModelData() : EmptyModelData.INSTANCE);
|
tileEntity != null ? tileEntity.getModelData() : EmptyModelData.INSTANCE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fluidState.isEmpty() && ItemBlockRenderTypes.canRenderInLayer(fluidState, layer))
|
if (!fluidState.isEmpty() && ItemBlockRenderTypes.canRenderInLayer(fluidState, layer))
|
||||||
dispatcher.renderLiquid(pos, world, builder, fluidState);
|
dispatcher.renderLiquid(pos, world, builder, fluidState);
|
||||||
|
|
||||||
ms.popPose();
|
poseStack.popPose();
|
||||||
});
|
});
|
||||||
|
ModelBlockRenderer.clearCache();
|
||||||
world.clearMask();
|
|
||||||
builder.end();
|
|
||||||
ForgeHooksClient.setRenderType(null);
|
ForgeHooksClient.setRenderType(null);
|
||||||
|
world.clearMask();
|
||||||
|
|
||||||
|
shadeSeparatingWrapper.clear();
|
||||||
|
unshadedBuilder.end();
|
||||||
|
builder.appendUnshadedVertices(unshadedBuilder);
|
||||||
|
builder.end();
|
||||||
|
|
||||||
return new SuperByteBuffer(builder);
|
return new SuperByteBuffer(builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static class ThreadLocalObjects {
|
||||||
|
public final PoseStack poseStack = new PoseStack();
|
||||||
|
public final Random random = new Random();
|
||||||
|
public final ShadeSeparatingVertexConsumer shadeSeparatingWrapper = new ShadeSeparatingVertexConsumer();
|
||||||
|
public final BufferBuilder unshadedBuilder = new BufferBuilder(512);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
package com.simibubi.create.foundation.render;
|
package com.simibubi.create.foundation.render;
|
||||||
|
|
||||||
|
import java.util.function.IntPredicate;
|
||||||
|
|
||||||
|
import com.jozufozu.flywheel.api.vertex.ShadedVertexList;
|
||||||
import com.jozufozu.flywheel.api.vertex.VertexList;
|
import com.jozufozu.flywheel.api.vertex.VertexList;
|
||||||
import com.jozufozu.flywheel.backend.OptifineHandler;
|
import com.jozufozu.flywheel.backend.OptifineHandler;
|
||||||
|
import com.jozufozu.flywheel.core.model.ShadeSeparatedBufferBuilder;
|
||||||
import com.jozufozu.flywheel.core.vertex.BlockVertexList;
|
import com.jozufozu.flywheel.core.vertex.BlockVertexList;
|
||||||
import com.jozufozu.flywheel.util.DiffuseLightCalculator;
|
import com.jozufozu.flywheel.util.DiffuseLightCalculator;
|
||||||
import com.jozufozu.flywheel.util.transform.Rotate;
|
import com.jozufozu.flywheel.util.transform.Rotate;
|
||||||
|
@ -34,6 +38,7 @@ import net.minecraft.world.level.Level;
|
||||||
public class SuperByteBuffer implements Scale<SuperByteBuffer>, Translate<SuperByteBuffer>, Rotate<SuperByteBuffer>, TStack<SuperByteBuffer> {
|
public class SuperByteBuffer implements Scale<SuperByteBuffer>, Translate<SuperByteBuffer>, Rotate<SuperByteBuffer>, TStack<SuperByteBuffer> {
|
||||||
|
|
||||||
private final VertexList template;
|
private final VertexList template;
|
||||||
|
private final IntPredicate shadedPredicate;
|
||||||
|
|
||||||
// Vertex Position
|
// Vertex Position
|
||||||
private final PoseStack transforms;
|
private final PoseStack transforms;
|
||||||
|
@ -65,7 +70,14 @@ public class SuperByteBuffer implements Scale<SuperByteBuffer>, Translate<SuperB
|
||||||
private static final Long2IntMap WORLD_LIGHT_CACHE = new Long2IntOpenHashMap();
|
private static final Long2IntMap WORLD_LIGHT_CACHE = new Long2IntOpenHashMap();
|
||||||
|
|
||||||
public SuperByteBuffer(BufferBuilder buf) {
|
public SuperByteBuffer(BufferBuilder buf) {
|
||||||
|
if (buf instanceof ShadeSeparatedBufferBuilder separated) {
|
||||||
|
ShadedVertexList template = new BlockVertexList.Shaded(separated);
|
||||||
|
shadedPredicate = template::isShaded;
|
||||||
|
this.template = template;
|
||||||
|
} else {
|
||||||
template = new BlockVertexList(buf);
|
template = new BlockVertexList(buf);
|
||||||
|
shadedPredicate = index -> true;
|
||||||
|
}
|
||||||
transforms = new PoseStack();
|
transforms = new PoseStack();
|
||||||
transforms.pushPose();
|
transforms.pushPose();
|
||||||
}
|
}
|
||||||
|
@ -142,7 +154,7 @@ public class SuperByteBuffer implements Scale<SuperByteBuffer>, Translate<SuperB
|
||||||
if (disableDiffuseMult) {
|
if (disableDiffuseMult) {
|
||||||
builder.color(r, g, b, a);
|
builder.color(r, g, b, a);
|
||||||
} else {
|
} else {
|
||||||
float instanceDiffuse = diffuseCalculator.getDiffuse(nx, ny, nz);
|
float instanceDiffuse = diffuseCalculator.getDiffuse(nx, ny, nz, shadedPredicate.test(i));
|
||||||
int colorR = transformColor(r, instanceDiffuse);
|
int colorR = transformColor(r, instanceDiffuse);
|
||||||
int colorG = transformColor(g, instanceDiffuse);
|
int colorG = transformColor(g, instanceDiffuse);
|
||||||
int colorB = transformColor(b, instanceDiffuse);
|
int colorB = transformColor(b, instanceDiffuse);
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.simibubi.create.foundation.tileEntity;
|
||||||
|
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import net.minecraft.world.phys.AABB;
|
||||||
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
|
public abstract class CachedRenderBBTileEntity extends SyncedTileEntity {
|
||||||
|
|
||||||
|
private AABB renderBoundingBox;
|
||||||
|
|
||||||
|
public CachedRenderBBTileEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) {
|
||||||
|
super(type, pos, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@OnlyIn(Dist.CLIENT)
|
||||||
|
public AABB getRenderBoundingBox() {
|
||||||
|
if (renderBoundingBox == null) {
|
||||||
|
renderBoundingBox = createRenderBoundingBox();
|
||||||
|
}
|
||||||
|
return renderBoundingBox;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void invalidateRenderBoundingBox() {
|
||||||
|
renderBoundingBox = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected AABB createRenderBoundingBox() {
|
||||||
|
return super.getRenderBoundingBox();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -23,7 +23,7 @@ import net.minecraftforge.common.capabilities.Capability;
|
||||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||||
import net.minecraftforge.items.CapabilityItemHandler;
|
import net.minecraftforge.items.CapabilityItemHandler;
|
||||||
|
|
||||||
public abstract class SmartTileEntity extends SyncedTileEntity implements IPartialSafeNBT, IInteractionChecker {
|
public abstract class SmartTileEntity extends CachedRenderBBTileEntity implements IPartialSafeNBT, IInteractionChecker {
|
||||||
|
|
||||||
private final Map<BehaviourType<?>, TileEntityBehaviour> behaviours = new HashMap<>();
|
private final Map<BehaviourType<?>, TileEntityBehaviour> behaviours = new HashMap<>();
|
||||||
private boolean initialized = false;
|
private boolean initialized = false;
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
"name": "Axis",
|
"name": "Axis",
|
||||||
"from": [6, 0, 6],
|
"from": [6, 0, 6],
|
||||||
"to": [10, 16, 10],
|
"to": [10, 16, 10],
|
||||||
"shade": false,
|
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
"north": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
||||||
"east": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
"east": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
"name": "Axis",
|
"name": "Axis",
|
||||||
"from": [6, 0, 6],
|
"from": [6, 0, 6],
|
||||||
"to": [10, 16, 10],
|
"to": [10, 16, 10],
|
||||||
"shade": false,
|
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
"north": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
||||||
"east": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
"east": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
||||||
|
|
|
@ -139,7 +139,6 @@
|
||||||
"name": "Axis",
|
"name": "Axis",
|
||||||
"from": [6, 6, 6],
|
"from": [6, 6, 6],
|
||||||
"to": [10, 10, 16],
|
"to": [10, 10, 16],
|
||||||
"shade": false,
|
|
||||||
"rotation": {"angle": 22.5, "axis": "z", "origin": [8, 8, 8]},
|
"rotation": {"angle": 22.5, "axis": "z", "origin": [8, 8, 8]},
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [6, 6, 10, 10], "rotation": 180, "texture": "#1_1"},
|
"north": {"uv": [6, 6, 10, 10], "rotation": 180, "texture": "#1_1"},
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
"name": "Axis",
|
"name": "Axis",
|
||||||
"from": [6, 0, 6],
|
"from": [6, 0, 6],
|
||||||
"to": [10, 16, 10],
|
"to": [10, 16, 10],
|
||||||
"shade": false,
|
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [6, 0, 10, 16], "texture": "#axis"},
|
"north": {"uv": [6, 0, 10, 16], "texture": "#axis"},
|
||||||
"east": {"uv": [6, 0, 10, 16], "texture": "#axis"},
|
"east": {"uv": [6, 0, 10, 16], "texture": "#axis"},
|
||||||
|
|
|
@ -185,7 +185,6 @@
|
||||||
"name": "Axis",
|
"name": "Axis",
|
||||||
"from": [6, 0, 6],
|
"from": [6, 0, 6],
|
||||||
"to": [10, 16, 10],
|
"to": [10, 16, 10],
|
||||||
"shade": false,
|
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
"north": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
||||||
"east": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
"east": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
"name": "Axis",
|
"name": "Axis",
|
||||||
"from": [6, 6, 0],
|
"from": [6, 6, 0],
|
||||||
"to": [10, 10, 16],
|
"to": [10, 10, 16],
|
||||||
"shade": false,
|
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [6, 6, 10, 10], "rotation": 180, "texture": "#1_1"},
|
"north": {"uv": [6, 6, 10, 10], "rotation": 180, "texture": "#1_1"},
|
||||||
"east": {"uv": [6, 0, 10, 16], "rotation": 90, "texture": "#1_0"},
|
"east": {"uv": [6, 0, 10, 16], "rotation": 90, "texture": "#1_0"},
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
"name": "Axis",
|
"name": "Axis",
|
||||||
"from": [6, 0, 6],
|
"from": [6, 0, 6],
|
||||||
"to": [10, 16, 10],
|
"to": [10, 16, 10],
|
||||||
"shade": false,
|
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
"north": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
||||||
"east": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
"east": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
"name": "Axis",
|
"name": "Axis",
|
||||||
"from": [6, 0, 6],
|
"from": [6, 0, 6],
|
||||||
"to": [10, 16, 10],
|
"to": [10, 16, 10],
|
||||||
"shade": false,
|
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [6, 0, 10, 16], "rotation": 180, "texture": "#0"},
|
"north": {"uv": [6, 0, 10, 16], "rotation": 180, "texture": "#0"},
|
||||||
"east": {"uv": [6, 0, 10, 16], "rotation": 180, "texture": "#0"},
|
"east": {"uv": [6, 0, 10, 16], "rotation": 180, "texture": "#0"},
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
"name": "Axis",
|
"name": "Axis",
|
||||||
"from": [6, 0, 6],
|
"from": [6, 0, 6],
|
||||||
"to": [10, 16, 10],
|
"to": [10, 16, 10],
|
||||||
"shade": false,
|
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
"north": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
||||||
"east": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
"east": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
"name": "Axis",
|
"name": "Axis",
|
||||||
"from": [6, 0, 6],
|
"from": [6, 0, 6],
|
||||||
"to": [10, 5, 10],
|
"to": [10, 5, 10],
|
||||||
"shade": false,
|
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [6, 0, 10, 5], "rotation": 180, "texture": "#0"},
|
"north": {"uv": [6, 0, 10, 5], "rotation": 180, "texture": "#0"},
|
||||||
"east": {"uv": [6, 0, 10, 5], "rotation": 180, "texture": "#0"},
|
"east": {"uv": [6, 0, 10, 5], "rotation": 180, "texture": "#0"},
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
"name": "Axis",
|
"name": "Axis",
|
||||||
"from": [6, 6, 11],
|
"from": [6, 6, 11],
|
||||||
"to": [10, 10, 16],
|
"to": [10, 10, 16],
|
||||||
"shade": false,
|
|
||||||
"faces": {
|
"faces": {
|
||||||
"east": {"uv": [6, 0, 10, 5], "rotation": 270, "texture": "#0"},
|
"east": {"uv": [6, 0, 10, 5], "rotation": 270, "texture": "#0"},
|
||||||
"south": {"uv": [6, 6, 10, 10], "texture": "#1"},
|
"south": {"uv": [6, 6, 10, 10], "texture": "#1"},
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
"name": "Axis",
|
"name": "Axis",
|
||||||
"from": [6, 0, 6],
|
"from": [6, 0, 6],
|
||||||
"to": [10, 16, 10],
|
"to": [10, 16, 10],
|
||||||
"shade": false,
|
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
"north": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
||||||
"east": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
"east": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
"name": "Axle",
|
"name": "Axle",
|
||||||
"from": [6, 6, 0],
|
"from": [6, 6, 0],
|
||||||
"to": [10, 10, 4],
|
"to": [10, 10, 4],
|
||||||
"shade": false,
|
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [6, 6, 10, 10], "texture": "#0"},
|
"north": {"uv": [6, 6, 10, 10], "texture": "#0"},
|
||||||
"east": {"uv": [6, 12, 10, 16], "rotation": 90, "texture": "#1"},
|
"east": {"uv": [6, 12, 10, 16], "rotation": 90, "texture": "#1"},
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
"name": "Axle",
|
"name": "Axle",
|
||||||
"from": [6, 6, 0],
|
"from": [6, 6, 0],
|
||||||
"to": [10, 10, 4],
|
"to": [10, 10, 4],
|
||||||
"shade": false,
|
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [6, 6, 10, 10], "texture": "#0"},
|
"north": {"uv": [6, 6, 10, 10], "texture": "#0"},
|
||||||
"east": {"uv": [6, 12, 10, 16], "rotation": 90, "texture": "#1"},
|
"east": {"uv": [6, 12, 10, 16], "rotation": 90, "texture": "#1"},
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
"name": "MixerCenter",
|
"name": "MixerCenter",
|
||||||
"from": [7, -4.5, 7],
|
"from": [7, -4.5, 7],
|
||||||
"to": [9, 7.5, 9],
|
"to": [9, 7.5, 9],
|
||||||
"shade": false,
|
|
||||||
"rotation": {"angle": 0, "axis": "y", "origin": [8, 7, 8]},
|
"rotation": {"angle": 0, "axis": "y", "origin": [8, 7, 8]},
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [0, 12, 12, 14], "rotation": 90, "texture": "#6"},
|
"north": {"uv": [0, 12, 12, 14], "rotation": 90, "texture": "#6"},
|
||||||
|
|
|
@ -121,7 +121,6 @@
|
||||||
"name": "MixerCenter",
|
"name": "MixerCenter",
|
||||||
"from": [7, -4.5, 7],
|
"from": [7, -4.5, 7],
|
||||||
"to": [9, 7.5, 9],
|
"to": [9, 7.5, 9],
|
||||||
"shade": false,
|
|
||||||
"rotation": {"angle": 22.5, "axis": "y", "origin": [8, 7, 8]},
|
"rotation": {"angle": 22.5, "axis": "y", "origin": [8, 7, 8]},
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [0, 12, 12, 14], "rotation": 90, "texture": "#6"},
|
"north": {"uv": [0, 12, 12, 14], "rotation": 90, "texture": "#6"},
|
||||||
|
|
|
@ -94,7 +94,6 @@
|
||||||
"name": "Axis",
|
"name": "Axis",
|
||||||
"from": [6, 0, 6],
|
"from": [6, 0, 6],
|
||||||
"to": [10, 8, 10],
|
"to": [10, 8, 10],
|
||||||
"shade": false,
|
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [6, 8, 10, 16], "rotation": 180, "texture": "#1_0"},
|
"north": {"uv": [6, 8, 10, 16], "rotation": 180, "texture": "#1_0"},
|
||||||
"east": {"uv": [6, 8, 10, 16], "rotation": 180, "texture": "#1_0"},
|
"east": {"uv": [6, 8, 10, 16], "rotation": 180, "texture": "#1_0"},
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
"name": "Axis",
|
"name": "Axis",
|
||||||
"from": [ 6.0, 0.0, 6.0 ],
|
"from": [ 6.0, 0.0, 6.0 ],
|
||||||
"to": [ 10.0, 16.0, 10.0 ],
|
"to": [ 10.0, 16.0, 10.0 ],
|
||||||
"shade": false,
|
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 16.0 ] },
|
"north": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 16.0 ] },
|
||||||
"east": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 16.0 ] },
|
"east": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 16.0 ] },
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
"name": "Axis",
|
"name": "Axis",
|
||||||
"from": [6, 6, 8],
|
"from": [6, 6, 8],
|
||||||
"to": [10, 10, 16],
|
"to": [10, 10, 16],
|
||||||
"shade": false,
|
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [6, 6, 10, 10], "rotation": 180, "texture": "#1"},
|
"north": {"uv": [6, 6, 10, 10], "rotation": 180, "texture": "#1"},
|
||||||
"east": {"uv": [6, 0, 10, 8], "rotation": 270, "texture": "#0"},
|
"east": {"uv": [6, 0, 10, 8], "rotation": 270, "texture": "#0"},
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
"name": "Axis",
|
"name": "Axis",
|
||||||
"from": [6, 0, 6],
|
"from": [6, 0, 6],
|
||||||
"to": [10, 7, 10],
|
"to": [10, 7, 10],
|
||||||
"shade": false,
|
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [6, 9, 10, 16], "texture": "#0"},
|
"north": {"uv": [6, 9, 10, 16], "texture": "#0"},
|
||||||
"east": {"uv": [6, 9, 10, 16], "texture": "#0"},
|
"east": {"uv": [6, 9, 10, 16], "texture": "#0"},
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
"name": "Axis",
|
"name": "Axis",
|
||||||
"from": [6, 0, 6],
|
"from": [6, 0, 6],
|
||||||
"to": [10, 16, 10],
|
"to": [10, 16, 10],
|
||||||
"shade": false,
|
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [6, 0, 10, 16], "texture": "#axis"},
|
"north": {"uv": [6, 0, 10, 16], "texture": "#axis"},
|
||||||
"east": {"uv": [6, 0, 10, 16], "texture": "#axis"},
|
"east": {"uv": [6, 0, 10, 16], "texture": "#axis"},
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
"name": "Axis",
|
"name": "Axis",
|
||||||
"from": [6, 0, 6],
|
"from": [6, 0, 6],
|
||||||
"to": [10, 16, 10],
|
"to": [10, 16, 10],
|
||||||
"shade": false,
|
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
"north": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
||||||
"east": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
"east": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
"name": "Axis",
|
"name": "Axis",
|
||||||
"from": [6, 0, 6],
|
"from": [6, 0, 6],
|
||||||
"to": [10, 16, 10],
|
"to": [10, 16, 10],
|
||||||
"shade": false,
|
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
"north": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
||||||
"east": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
"east": {"uv": [6, 0, 10, 16], "texture": "#0"},
|
||||||
|
|
Loading…
Reference in a new issue