mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-01-30 06:45:03 +01:00
Motion commotion
- Update recipe for redstone contact - Counteracted ejector inaccuracies caused by deferred activation - Rewired ponder vertex sorting to evade Optifine incompatibilities
This commit is contained in:
parent
d28e60a059
commit
fcae7e5c9a
8 changed files with 58 additions and 73 deletions
|
@ -2914,7 +2914,7 @@ fc75c87159569cb6ee978e6d51b0c3b0f504b5de data/create/recipes/crafting/logistics/
|
||||||
a32ac53848862837f3044ff9c81ed62c1134fe4f data/create/recipes/crafting/logistics/powered_latch.json
|
a32ac53848862837f3044ff9c81ed62c1134fe4f data/create/recipes/crafting/logistics/powered_latch.json
|
||||||
660eb73bcc66c1528cbd4d4204ad6b771f4bd721 data/create/recipes/crafting/logistics/powered_toggle_latch.json
|
660eb73bcc66c1528cbd4d4204ad6b771f4bd721 data/create/recipes/crafting/logistics/powered_toggle_latch.json
|
||||||
74b8a38d252cce564cc63db2ade41ed2d656d025 data/create/recipes/crafting/logistics/pulse_repeater.json
|
74b8a38d252cce564cc63db2ade41ed2d656d025 data/create/recipes/crafting/logistics/pulse_repeater.json
|
||||||
bb73dac60392f4811df033c3d1d3256df5e022af data/create/recipes/crafting/logistics/redstone_contact.json
|
739f0d8b7f98a5639ed37f7fb8ce474d5e6ba0c6 data/create/recipes/crafting/logistics/redstone_contact.json
|
||||||
bc511f7c225750743ae3e985502fa65beb1e7b8d data/create/recipes/crafting/logistics/redstone_link.json
|
bc511f7c225750743ae3e985502fa65beb1e7b8d data/create/recipes/crafting/logistics/redstone_link.json
|
||||||
10b16358664f2bb8a11589ef8ba3d69ee8d3b9fc data/create/recipes/crafting/logistics/stockpile_switch.json
|
10b16358664f2bb8a11589ef8ba3d69ee8d3b9fc data/create/recipes/crafting/logistics/stockpile_switch.json
|
||||||
0dc99b8a8c68d6a9250c3a1167ffb565be9622ec data/create/recipes/crafting/materials/andesite_alloy.json
|
0dc99b8a8c68d6a9250c3a1167ffb565be9622ec data/create/recipes/crafting/materials/andesite_alloy.json
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
{
|
{
|
||||||
"type": "minecraft:crafting_shaped",
|
"type": "minecraft:crafting_shaped",
|
||||||
"pattern": [
|
"pattern": [
|
||||||
"WDW",
|
|
||||||
" S ",
|
" S ",
|
||||||
"WDW"
|
"CWC",
|
||||||
|
"CCC"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"W": {
|
"W": {
|
||||||
"tag": "forge:dusts/redstone"
|
"tag": "forge:dusts/redstone"
|
||||||
},
|
},
|
||||||
"D": {
|
"C": {
|
||||||
"item": "create:brass_casing"
|
"item": "minecraft:cobblestone"
|
||||||
},
|
},
|
||||||
"S": {
|
"S": {
|
||||||
"tag": "forge:ingots/iron"
|
"tag": "forge:plates/iron"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
|
|
|
@ -480,15 +480,16 @@ public class AllBlocks {
|
||||||
.item()
|
.item()
|
||||||
.transform(customItemModel("_", "block"))
|
.transform(customItemModel("_", "block"))
|
||||||
.register();
|
.register();
|
||||||
|
|
||||||
public static final BlockEntry<EjectorBlock> WEIGHTED_EJECTOR = REGISTRATE.block("weighted_ejector", EjectorBlock::new)
|
public static final BlockEntry<EjectorBlock> WEIGHTED_EJECTOR =
|
||||||
.initialProperties(SharedProperties::stone)
|
REGISTRATE.block("weighted_ejector", EjectorBlock::new)
|
||||||
.properties(Block.Properties::nonOpaque)
|
.initialProperties(SharedProperties::stone)
|
||||||
.blockstate((c, p) -> p.horizontalBlock(c.getEntry(), AssetLookup.partialBaseModel(c, p), 180))
|
.properties(Block.Properties::nonOpaque)
|
||||||
.transform(StressConfigDefaults.setImpact(2.0))
|
.blockstate((c, p) -> p.horizontalBlock(c.getEntry(), AssetLookup.partialBaseModel(c, p), 180))
|
||||||
.item(EjectorItem::new)
|
.transform(StressConfigDefaults.setImpact(2.0))
|
||||||
.transform(customItemModel())
|
.item(EjectorItem::new)
|
||||||
.register();
|
.transform(customItemModel())
|
||||||
|
.register();
|
||||||
|
|
||||||
public static final BlockEntry<ChuteBlock> CHUTE = REGISTRATE.block("chute", ChuteBlock::new)
|
public static final BlockEntry<ChuteBlock> CHUTE = REGISTRATE.block("chute", ChuteBlock::new)
|
||||||
.initialProperties(SharedProperties::softMetal)
|
.initialProperties(SharedProperties::softMetal)
|
||||||
|
@ -906,6 +907,15 @@ public class AllBlocks {
|
||||||
.transform(customItemModel())
|
.transform(customItemModel())
|
||||||
.register();
|
.register();
|
||||||
|
|
||||||
|
public static final BlockEntry<RedstoneContactBlock> REDSTONE_CONTACT =
|
||||||
|
REGISTRATE.block("redstone_contact", RedstoneContactBlock::new)
|
||||||
|
.initialProperties(SharedProperties::stone)
|
||||||
|
.onRegister(addMovementBehaviour(new ContactMovementBehaviour()))
|
||||||
|
.blockstate((c, p) -> p.directionalBlock(c.get(), AssetLookup.forPowered(c, p)))
|
||||||
|
.item()
|
||||||
|
.transform(customItemModel("_", "block"))
|
||||||
|
.register();
|
||||||
|
|
||||||
public static final BlockEntry<HarvesterBlock> MECHANICAL_HARVESTER =
|
public static final BlockEntry<HarvesterBlock> MECHANICAL_HARVESTER =
|
||||||
REGISTRATE.block("mechanical_harvester", HarvesterBlock::new)
|
REGISTRATE.block("mechanical_harvester", HarvesterBlock::new)
|
||||||
.initialProperties(SharedProperties::stone)
|
.initialProperties(SharedProperties::stone)
|
||||||
|
@ -1150,15 +1160,6 @@ public class AllBlocks {
|
||||||
.onRegister(connectedTextures(new BrassTunnelCTBehaviour()))
|
.onRegister(connectedTextures(new BrassTunnelCTBehaviour()))
|
||||||
.register();
|
.register();
|
||||||
|
|
||||||
public static final BlockEntry<RedstoneContactBlock> REDSTONE_CONTACT =
|
|
||||||
REGISTRATE.block("redstone_contact", RedstoneContactBlock::new)
|
|
||||||
.initialProperties(SharedProperties::stone)
|
|
||||||
.onRegister(addMovementBehaviour(new ContactMovementBehaviour()))
|
|
||||||
.blockstate((c, p) -> p.directionalBlock(c.get(), AssetLookup.forPowered(c, p)))
|
|
||||||
.item()
|
|
||||||
.transform(customItemModel("_", "block"))
|
|
||||||
.register();
|
|
||||||
|
|
||||||
public static final BlockEntry<ContentObserverBlock> CONTENT_OBSERVER =
|
public static final BlockEntry<ContentObserverBlock> CONTENT_OBSERVER =
|
||||||
REGISTRATE.block("content_observer", ContentObserverBlock::new)
|
REGISTRATE.block("content_observer", ContentObserverBlock::new)
|
||||||
.initialProperties(SharedProperties::stone)
|
.initialProperties(SharedProperties::stone)
|
||||||
|
|
|
@ -302,22 +302,27 @@ public class EjectorTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state == State.RETRACTING) {
|
if (state == State.RETRACTING) {
|
||||||
lidProgress.updateChaseSpeed(0);
|
if (lidProgress.getChaseTarget() == 1 && !lidProgress.settled()) {
|
||||||
if (lidProgress.getValue() == 0 && doLogic) {
|
lidProgress.tickChaser();
|
||||||
state = State.CHARGED;
|
} else {
|
||||||
lidProgress.setValue(0);
|
lidProgress.updateChaseTarget(0);
|
||||||
sendData();
|
lidProgress.updateChaseSpeed(0);
|
||||||
|
if (lidProgress.getValue() == 0 && doLogic) {
|
||||||
|
state = State.CHARGED;
|
||||||
|
lidProgress.setValue(0);
|
||||||
|
sendData();
|
||||||
|
}
|
||||||
|
|
||||||
|
float value = MathHelper.clamp(lidProgress.getValue() - getWindUpSpeed(), 0, 1);
|
||||||
|
lidProgress.setValue(value);
|
||||||
|
|
||||||
|
int soundRate = (int) (1 / (getWindUpSpeed() * 5)) + 1;
|
||||||
|
float volume = .125f;
|
||||||
|
float pitch = 1.5f - lidProgress.getValue();
|
||||||
|
if (((int) world.getGameTime()) % soundRate == 0 && doLogic)
|
||||||
|
world.playSound(null, pos, SoundEvents.BLOCK_WOODEN_BUTTON_CLICK_OFF, SoundCategory.BLOCKS, volume,
|
||||||
|
pitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
float value = MathHelper.clamp(lidProgress.getValue() - getWindUpSpeed(), 0, 1);
|
|
||||||
lidProgress.setValue(value);
|
|
||||||
|
|
||||||
int soundRate = (int) (1 / (getWindUpSpeed() * 5)) + 1;
|
|
||||||
float volume = .125f;
|
|
||||||
float pitch = 1.5f - lidProgress.getValue();
|
|
||||||
if (((int) world.getGameTime()) % soundRate == 0 && doLogic)
|
|
||||||
world.playSound(null, pos, SoundEvents.BLOCK_WOODEN_BUTTON_CLICK_OFF, SoundCategory.BLOCKS, volume,
|
|
||||||
pitch);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state != prevState)
|
if (state != prevState)
|
||||||
|
@ -509,10 +514,6 @@ public class EjectorTileEntity extends KineticTileEntity {
|
||||||
|
|
||||||
public void setTarget(int horizontalDistance, int verticalDistance) {
|
public void setTarget(int horizontalDistance, int verticalDistance) {
|
||||||
launcher.set(Math.max(1, horizontalDistance), verticalDistance);
|
launcher.set(Math.max(1, horizontalDistance), verticalDistance);
|
||||||
if (horizontalDistance == 0 && verticalDistance == 0) {
|
|
||||||
state = State.CHARGED;
|
|
||||||
lidProgress.startWithValue(0);
|
|
||||||
}
|
|
||||||
sendData();
|
sendData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class EntityLauncher {
|
||||||
public void applyMotion(Entity entity, Direction facing) {
|
public void applyMotion(Entity entity, Direction facing) {
|
||||||
Vec3d motionVec = new Vec3d(0, yMotion, xMotion);
|
Vec3d motionVec = new Vec3d(0, yMotion, xMotion);
|
||||||
motionVec = VecHelper.rotate(motionVec, AngleHelper.horizontalAngle(facing), Axis.Y);
|
motionVec = VecHelper.rotate(motionVec, AngleHelper.horizontalAngle(facing), Axis.Y);
|
||||||
entity.setMotion(motionVec.x, motionVec.y, motionVec.z);
|
entity.setMotion(motionVec.x * .91, motionVec.y * .98, motionVec.z * .91);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getHorizontalDistance() {
|
public int getHorizontalDistance() {
|
||||||
|
|
|
@ -790,11 +790,11 @@ public class StandardRecipeGen extends CreateRecipeProvider {
|
||||||
REDSTONE_CONTACT = create(AllBlocks.REDSTONE_CONTACT).returns(2)
|
REDSTONE_CONTACT = create(AllBlocks.REDSTONE_CONTACT).returns(2)
|
||||||
.unlockedBy(I::brassCasing)
|
.unlockedBy(I::brassCasing)
|
||||||
.viaShaped(b -> b.key('W', I.redstone())
|
.viaShaped(b -> b.key('W', I.redstone())
|
||||||
.key('D', I.brassCasing())
|
.key('C', Blocks.COBBLESTONE)
|
||||||
.key('S', I.iron())
|
.key('S', I.ironSheet())
|
||||||
.patternLine("WDW")
|
|
||||||
.patternLine(" S ")
|
.patternLine(" S ")
|
||||||
.patternLine("WDW")),
|
.patternLine("CWC")
|
||||||
|
.patternLine("CCC")),
|
||||||
|
|
||||||
ANDESITE_FUNNEL = create(AllBlocks.ANDESITE_FUNNEL).returns(2)
|
ANDESITE_FUNNEL = create(AllBlocks.ANDESITE_FUNNEL).returns(2)
|
||||||
.unlockedBy(I::andesite)
|
.unlockedBy(I::andesite)
|
||||||
|
|
|
@ -369,7 +369,6 @@ public class PonderUI extends NavigatableSimiScreen {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void renderVisibleScenes(int mouseX, int mouseY, float partialTicks) {
|
protected void renderVisibleScenes(int mouseX, int mouseY, float partialTicks) {
|
||||||
SuperRenderTypeBuffer.vertexSortingOrigin = new BlockPos(0, 0, 800);
|
|
||||||
renderScene(mouseX, mouseY, index, partialTicks);
|
renderScene(mouseX, mouseY, index, partialTicks);
|
||||||
float lazyIndexValue = lazyIndex.getValue(partialTicks);
|
float lazyIndexValue = lazyIndex.getValue(partialTicks);
|
||||||
if (Math.abs(lazyIndexValue - index) > 1 / 512f)
|
if (Math.abs(lazyIndexValue - index) > 1 / 512f)
|
||||||
|
@ -388,13 +387,21 @@ public class PonderUI extends NavigatableSimiScreen {
|
||||||
RenderSystem.enableBlend();
|
RenderSystem.enableBlend();
|
||||||
RenderSystem.enableDepthTest();
|
RenderSystem.enableDepthTest();
|
||||||
|
|
||||||
|
RenderSystem.pushMatrix();
|
||||||
|
|
||||||
|
// has to be outside of MS transforms, important for vertex sorting
|
||||||
|
RenderSystem.translated(0, 0, 800);
|
||||||
|
|
||||||
ms.push();
|
ms.push();
|
||||||
|
ms.translate(0, 0, -800);
|
||||||
story.transform.updateScreenParams(width, height, slide);
|
story.transform.updateScreenParams(width, height, slide);
|
||||||
story.transform.apply(ms, partialTicks, false);
|
story.transform.apply(ms, partialTicks, false);
|
||||||
story.transform.updateSceneRVE(partialTicks);
|
story.transform.updateSceneRVE(partialTicks);
|
||||||
story.renderScene(buffer, ms, partialTicks);
|
story.renderScene(buffer, ms, partialTicks);
|
||||||
buffer.draw();
|
buffer.draw();
|
||||||
|
|
||||||
|
RenderSystem.popMatrix();
|
||||||
|
|
||||||
MutableBoundingBox bounds = story.getBounds();
|
MutableBoundingBox bounds = story.getBounds();
|
||||||
RenderSystem.pushMatrix();
|
RenderSystem.pushMatrix();
|
||||||
RenderSystem.multMatrix(ms.peek()
|
RenderSystem.multMatrix(ms.peek()
|
||||||
|
@ -933,10 +940,4 @@ public class PonderUI extends NavigatableSimiScreen {
|
||||||
skipCooling = 15;
|
skipCooling = 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void removed() {
|
|
||||||
super.removed();
|
|
||||||
SuperRenderTypeBuffer.vertexSortingOrigin = BlockPos.ZERO;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package com.simibubi.create.foundation.renderState;
|
package com.simibubi.create.foundation.renderState;
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.SortedMap;
|
import java.util.SortedMap;
|
||||||
|
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
|
@ -15,11 +13,9 @@ import net.minecraft.client.renderer.RegionRenderCacheBuilder;
|
||||||
import net.minecraft.client.renderer.RenderType;
|
import net.minecraft.client.renderer.RenderType;
|
||||||
import net.minecraft.client.renderer.model.ModelBakery;
|
import net.minecraft.client.renderer.model.ModelBakery;
|
||||||
import net.minecraft.util.Util;
|
import net.minecraft.util.Util;
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
public class SuperRenderTypeBuffer implements IRenderTypeBuffer {
|
public class SuperRenderTypeBuffer implements IRenderTypeBuffer {
|
||||||
|
|
||||||
public static BlockPos vertexSortingOrigin = BlockPos.ZERO;
|
|
||||||
static SuperRenderTypeBuffer instance;
|
static SuperRenderTypeBuffer instance;
|
||||||
|
|
||||||
public static SuperRenderTypeBuffer getInstance() {
|
public static SuperRenderTypeBuffer getInstance() {
|
||||||
|
@ -100,20 +96,6 @@ public class SuperRenderTypeBuffer implements IRenderTypeBuffer {
|
||||||
super(new BufferBuilder(256), createEntityBuilders());
|
super(new BufferBuilder(256), createEntityBuilders());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void draw(RenderType p_228462_1_) {
|
|
||||||
BlockPos v = vertexSortingOrigin;
|
|
||||||
BufferBuilder bufferbuilder = layerBuffers.getOrDefault(p_228462_1_, this.fallbackBuffer);
|
|
||||||
boolean flag = Objects.equals(this.currentLayer, p_228462_1_.asOptional());
|
|
||||||
if (flag || bufferbuilder != this.fallbackBuffer) {
|
|
||||||
if (this.activeConsumers.remove(bufferbuilder)) {
|
|
||||||
p_228462_1_.draw(bufferbuilder, v.getX(), v.getY(), v.getZ());
|
|
||||||
if (flag) {
|
|
||||||
this.currentLayer = Optional.empty();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue