mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-18 07:53:07 +01:00
SmarterTileEntity
- Clean up SyncedTileEntity and SmartTileEntity - Allow schematicannons to be rotated based on placement angle - Fix DirectionalExtenderScrollOptionSlot rotation - Remove deprecated usage of JsonReader and LazyLoadedValue - Move ToolSelectionScreen to content.schematics.client - Organize imports - Update to 1.18.1
This commit is contained in:
parent
8101f19611
commit
080b048b2f
130 changed files with 428 additions and 465 deletions
|
@ -168,8 +168,8 @@ dependencies {
|
||||||
implementation fg.deobf("com.jozufozu.flywheel:Flywheel-Forge:${flywheel_version}")
|
implementation fg.deobf("com.jozufozu.flywheel:Flywheel-Forge:${flywheel_version}")
|
||||||
}
|
}
|
||||||
|
|
||||||
compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}:${jei_version}:api")
|
compileOnly fg.deobf("mezz.jei:jei-${jei_minecraft_version}:${jei_version}:api")
|
||||||
runtimeOnly fg.deobf("mezz.jei:jei-${minecraft_version}:${jei_version}")
|
runtimeOnly fg.deobf("mezz.jei:jei-${jei_minecraft_version}:${jei_version}")
|
||||||
|
|
||||||
// implementation fg.deobf("curse.maven:druidcraft-340991:3101903")
|
// implementation fg.deobf("curse.maven:druidcraft-340991:3101903")
|
||||||
// implementation fg.deobf("com.ferreusveritas.dynamictrees:DynamicTrees-1.16.5:0.10.0-Beta25")
|
// implementation fg.deobf("com.ferreusveritas.dynamictrees:DynamicTrees-1.16.5:0.10.0-Beta25")
|
||||||
|
|
|
@ -5,8 +5,8 @@ org.gradle.daemon = false
|
||||||
|
|
||||||
# mod version info
|
# mod version info
|
||||||
mod_version = 0.4
|
mod_version = 0.4
|
||||||
minecraft_version = 1.18
|
minecraft_version = 1.18.1
|
||||||
forge_version = 38.0.15
|
forge_version = 39.0.0
|
||||||
|
|
||||||
# build dependency versions
|
# build dependency versions
|
||||||
forgegradle_version = 5.1.+
|
forgegradle_version = 5.1.+
|
||||||
|
@ -19,7 +19,8 @@ parchment_version = 2021.10.31
|
||||||
|
|
||||||
# dependency versions
|
# dependency versions
|
||||||
registrate_version = MC1.18-1.0.21
|
registrate_version = MC1.18-1.0.21
|
||||||
flywheel_version = 1.18-0.4.0.11
|
flywheel_version = 1.18-0.4.0.15
|
||||||
|
jei_minecraft_version = 1.18
|
||||||
jei_version = 9.0.0.40
|
jei_version = 9.0.0.40
|
||||||
|
|
||||||
# curseforge information
|
# curseforge information
|
||||||
|
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,5 +1,5 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|
|
@ -11,18 +11,18 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraftforge.eventbus.api.GenericEvent;
|
import net.minecraftforge.eventbus.api.GenericEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event that is fired just before a SmartTileEntity is being deserealized <br>
|
* Event that is fired just before a SmartTileEntity is being deserialized<br>
|
||||||
* Also if a new one is placed<br>
|
* Also if a new one is placed<br>
|
||||||
* Use it to attach a new {@link TileEntityBehaviour} or replace existing ones
|
* Use it to attach a new {@link TileEntityBehaviour} or replace existing ones
|
||||||
* (with caution) <br>
|
* (with caution)<br>
|
||||||
* <br>
|
* <br>
|
||||||
* Actual setup of the behaviours internal workings and data should be done in
|
* Actual setup of the behaviours internal workings and data should be done in
|
||||||
* TileEntityBehaviour#read() and TileEntityBehaviour#initialize()
|
* TileEntityBehaviour#read() and TileEntityBehaviour#initialize()
|
||||||
* respectively.<br>
|
* respectively.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* Because of the earlyness of this event, the added behaviours will have access
|
* Because of the earliness of this event, the added behaviours will have access
|
||||||
* to the initial nbt read (unless the TE was placed, not loaded), thereby
|
* to the initial NBT read (unless the TE was placed, not loaded), thereby
|
||||||
* allowing tiles to store and retrieve data for injected behaviours
|
* allowing tiles to store and retrieve data for injected behaviours.
|
||||||
*/
|
*/
|
||||||
public class TileEntityBehaviourEvent<T extends SmartTileEntity> extends GenericEvent<T> {
|
public class TileEntityBehaviourEvent<T extends SmartTileEntity> extends GenericEvent<T> {
|
||||||
|
|
||||||
|
|
|
@ -226,13 +226,13 @@ public class KineticTileEntity extends SmartTileEntity
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
boolean overStressedBefore = overStressed;
|
boolean overStressedBefore = overStressed;
|
||||||
clearKineticInformation();
|
clearKineticInformation();
|
||||||
|
|
||||||
// DO NOT READ kinetic information when placed after movement
|
// DO NOT READ kinetic information when placed after movement
|
||||||
if (wasMoved) {
|
if (wasMoved) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ public class KineticTileEntity extends SmartTileEntity
|
||||||
overStressed = capacity < stress && StressImpact.isEnabled();
|
overStressed = capacity < stress && StressImpact.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
|
|
||||||
if (clientPacket && overStressedBefore != overStressed && speed != 0)
|
if (clientPacket && overStressedBefore != overStressed && speed != 0)
|
||||||
effects.triggerOverStressedEffect();
|
effects.triggerOverStressedEffect();
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package com.simibubi.create.content.contraptions.base;
|
package com.simibubi.create.content.contraptions.base;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
|
|
||||||
import com.jozufozu.flywheel.api.Material;
|
import com.jozufozu.flywheel.api.Material;
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
|
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
|
import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
|
||||||
import com.simibubi.create.content.contraptions.relays.elementary.ICogWheel;
|
import com.simibubi.create.content.contraptions.relays.elementary.ICogWheel;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package com.simibubi.create.content.contraptions.base.flwdata;
|
package com.simibubi.create.content.contraptions.base.flwdata;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.backend.gl.attrib.VertexFormat;
|
|
||||||
import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer;
|
|
||||||
import com.jozufozu.flywheel.api.struct.Batched;
|
import com.jozufozu.flywheel.api.struct.Batched;
|
||||||
import com.jozufozu.flywheel.api.struct.BatchingTransformer;
|
import com.jozufozu.flywheel.api.struct.BatchingTransformer;
|
||||||
import com.jozufozu.flywheel.api.struct.StructWriter;
|
|
||||||
import com.jozufozu.flywheel.api.struct.Instanced;
|
import com.jozufozu.flywheel.api.struct.Instanced;
|
||||||
|
import com.jozufozu.flywheel.api.struct.StructWriter;
|
||||||
|
import com.jozufozu.flywheel.backend.gl.attrib.VertexFormat;
|
||||||
|
import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer;
|
||||||
import com.jozufozu.flywheel.core.model.Model;
|
import com.jozufozu.flywheel.core.model.Model;
|
||||||
import com.simibubi.create.foundation.render.AllInstanceFormats;
|
import com.simibubi.create.foundation.render.AllInstanceFormats;
|
||||||
import com.simibubi.create.foundation.render.AllProgramSpecs;
|
import com.simibubi.create.foundation.render.AllProgramSpecs;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package com.simibubi.create.content.contraptions.base.flwdata;
|
package com.simibubi.create.content.contraptions.base.flwdata;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.backend.gl.attrib.VertexFormat;
|
|
||||||
import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer;
|
|
||||||
import com.jozufozu.flywheel.api.struct.Batched;
|
import com.jozufozu.flywheel.api.struct.Batched;
|
||||||
import com.jozufozu.flywheel.api.struct.BatchingTransformer;
|
import com.jozufozu.flywheel.api.struct.BatchingTransformer;
|
||||||
import com.jozufozu.flywheel.api.struct.StructWriter;
|
|
||||||
import com.jozufozu.flywheel.api.struct.Instanced;
|
import com.jozufozu.flywheel.api.struct.Instanced;
|
||||||
|
import com.jozufozu.flywheel.api.struct.StructWriter;
|
||||||
|
import com.jozufozu.flywheel.backend.gl.attrib.VertexFormat;
|
||||||
|
import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer;
|
||||||
import com.jozufozu.flywheel.core.model.Model;
|
import com.jozufozu.flywheel.core.model.Model;
|
||||||
import com.simibubi.create.foundation.render.AllInstanceFormats;
|
import com.simibubi.create.foundation.render.AllInstanceFormats;
|
||||||
import com.simibubi.create.foundation.render.AllProgramSpecs;
|
import com.simibubi.create.foundation.render.AllProgramSpecs;
|
||||||
|
|
|
@ -2,8 +2,8 @@ package com.simibubi.create.content.contraptions.base.flwdata;
|
||||||
|
|
||||||
import org.lwjgl.system.MemoryUtil;
|
import org.lwjgl.system.MemoryUtil;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer;
|
|
||||||
import com.jozufozu.flywheel.api.struct.StructType;
|
import com.jozufozu.flywheel.api.struct.StructType;
|
||||||
|
import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer;
|
||||||
import com.jozufozu.flywheel.backend.struct.UnsafeBufferWriter;
|
import com.jozufozu.flywheel.backend.struct.UnsafeBufferWriter;
|
||||||
|
|
||||||
public class UnsafeBeltWriter extends UnsafeBufferWriter<BeltData> {
|
public class UnsafeBeltWriter extends UnsafeBufferWriter<BeltData> {
|
||||||
|
|
|
@ -2,8 +2,8 @@ package com.simibubi.create.content.contraptions.base.flwdata;
|
||||||
|
|
||||||
import org.lwjgl.system.MemoryUtil;
|
import org.lwjgl.system.MemoryUtil;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer;
|
|
||||||
import com.jozufozu.flywheel.api.struct.StructType;
|
import com.jozufozu.flywheel.api.struct.StructType;
|
||||||
|
import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer;
|
||||||
import com.jozufozu.flywheel.backend.struct.UnsafeBufferWriter;
|
import com.jozufozu.flywheel.backend.struct.UnsafeBufferWriter;
|
||||||
|
|
||||||
public class UnsafeRotatingWriter extends UnsafeBufferWriter<RotatingData> {
|
public class UnsafeRotatingWriter extends UnsafeBufferWriter<RotatingData> {
|
||||||
|
|
|
@ -68,12 +68,12 @@ public abstract class BlockBreakingKineticTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
destroyProgress = compound.getInt("Progress");
|
destroyProgress = compound.getInt("Progress");
|
||||||
ticksUntilNextProgress = compound.getInt("NextTick");
|
ticksUntilNextProgress = compound.getInt("NextTick");
|
||||||
if (compound.contains("Breaking"))
|
if (compound.contains("Breaking"))
|
||||||
breakingPos = NbtUtils.readBlockPos(compound.getCompound("Breaking"));
|
breakingPos = NbtUtils.readBlockPos(compound.getCompound("Breaking"));
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -2,8 +2,8 @@ package com.simibubi.create.content.contraptions.components.actors;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.backend.Backend;
|
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
|
import com.jozufozu.flywheel.backend.Backend;
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
|
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance;
|
import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance;
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices;
|
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices;
|
||||||
|
|
|
@ -4,8 +4,8 @@ import javax.annotation.Nullable;
|
||||||
|
|
||||||
import org.apache.commons.lang3.mutable.MutableBoolean;
|
import org.apache.commons.lang3.mutable.MutableBoolean;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.backend.Backend;
|
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
|
import com.jozufozu.flywheel.backend.Backend;
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour;
|
import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour;
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
|
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance;
|
import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance;
|
||||||
|
|
|
@ -86,8 +86,8 @@ public abstract class PortableStorageInterfaceTileEntity extends SmartTileEntity
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
transferTimer = compound.getInt("Timer");
|
transferTimer = compound.getInt("Timer");
|
||||||
distance = compound.getFloat("Distance");
|
distance = compound.getFloat("Distance");
|
||||||
powered = compound.getBoolean("Powered");
|
powered = compound.getBoolean("Powered");
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package com.simibubi.create.content.contraptions.components.actors.flwdata;
|
package com.simibubi.create.content.contraptions.components.actors.flwdata;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.backend.gl.attrib.VertexFormat;
|
|
||||||
import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer;
|
|
||||||
import com.jozufozu.flywheel.api.struct.Batched;
|
import com.jozufozu.flywheel.api.struct.Batched;
|
||||||
import com.jozufozu.flywheel.api.struct.BatchingTransformer;
|
import com.jozufozu.flywheel.api.struct.BatchingTransformer;
|
||||||
import com.jozufozu.flywheel.api.struct.StructWriter;
|
|
||||||
import com.jozufozu.flywheel.api.struct.Instanced;
|
import com.jozufozu.flywheel.api.struct.Instanced;
|
||||||
|
import com.jozufozu.flywheel.api.struct.StructWriter;
|
||||||
|
import com.jozufozu.flywheel.backend.gl.attrib.VertexFormat;
|
||||||
|
import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer;
|
||||||
import com.jozufozu.flywheel.core.model.Model;
|
import com.jozufozu.flywheel.core.model.Model;
|
||||||
import com.simibubi.create.foundation.render.AllInstanceFormats;
|
import com.simibubi.create.foundation.render.AllInstanceFormats;
|
||||||
import com.simibubi.create.foundation.render.AllProgramSpecs;
|
import com.simibubi.create.foundation.render.AllProgramSpecs;
|
||||||
|
|
|
@ -2,8 +2,8 @@ package com.simibubi.create.content.contraptions.components.actors.flwdata;
|
||||||
|
|
||||||
import org.lwjgl.system.MemoryUtil;
|
import org.lwjgl.system.MemoryUtil;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer;
|
|
||||||
import com.jozufozu.flywheel.api.struct.StructType;
|
import com.jozufozu.flywheel.api.struct.StructType;
|
||||||
|
import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer;
|
||||||
import com.jozufozu.flywheel.backend.struct.UnsafeBufferWriter;
|
import com.jozufozu.flywheel.backend.struct.UnsafeBufferWriter;
|
||||||
|
|
||||||
public class UnsafeActorWriter extends UnsafeBufferWriter<ActorData> {
|
public class UnsafeActorWriter extends UnsafeBufferWriter<ActorData> {
|
||||||
|
|
|
@ -44,8 +44,8 @@ public class CuckooClockTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
if (clientPacket && compound.contains("Animation")) {
|
if (clientPacket && compound.contains("Animation")) {
|
||||||
animationType = NBTHelper.readEnum(compound, "Animation", Animation.class);
|
animationType = NBTHelper.readEnum(compound, "Animation", Animation.class);
|
||||||
animationProgress.lastValue = 0;
|
animationProgress.lastValue = 0;
|
||||||
|
|
|
@ -168,7 +168,7 @@ public class MechanicalCrafterTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
Phase phaseBefore = phase;
|
Phase phaseBefore = phase;
|
||||||
GroupedItems before = this.groupedItems;
|
GroupedItems before = this.groupedItems;
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ public class MechanicalCrafterTileEntity extends KineticTileEntity {
|
||||||
this.phase = phase;
|
this.phase = phase;
|
||||||
countDown = compound.getInt("CountDown");
|
countDown = compound.getInt("CountDown");
|
||||||
covered = compound.getBoolean("Cover");
|
covered = compound.getBoolean("Cover");
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
if (!clientPacket)
|
if (!clientPacket)
|
||||||
return;
|
return;
|
||||||
if (compound.contains("Redraw"))
|
if (compound.contains("Redraw"))
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package com.simibubi.create.content.contraptions.components.crank;
|
package com.simibubi.create.content.contraptions.components.crank;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
|
||||||
import com.jozufozu.flywheel.api.Instancer;
|
import com.jozufozu.flywheel.api.Instancer;
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
|
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
||||||
import com.jozufozu.flywheel.core.PartialModel;
|
import com.jozufozu.flywheel.core.PartialModel;
|
||||||
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
||||||
import com.simibubi.create.content.contraptions.base.SingleRotatingInstance;
|
import com.simibubi.create.content.contraptions.base.SingleRotatingInstance;
|
||||||
|
|
|
@ -53,9 +53,9 @@ public class HandCrankTileEntity extends GeneratingKineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
inUse = compound.getInt("InUse");
|
inUse = compound.getInt("InUse");
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -331,8 +331,8 @@ public class CrushingWheelControllerTileEntity extends SmartTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
if (compound.contains("Entity") && !isOccupied()) {
|
if (compound.contains("Entity") && !isOccupied()) {
|
||||||
entityUUID = NbtUtils.loadUUID(NBTHelper.getINBT(compound, "Entity"));
|
entityUUID = NbtUtils.loadUUID(NBTHelper.getINBT(compound, "Entity"));
|
||||||
this.searchForEntity = true;
|
this.searchForEntity = true;
|
||||||
|
|
|
@ -3,9 +3,9 @@ package com.simibubi.create.content.contraptions.components.deployer;
|
||||||
import static com.simibubi.create.content.contraptions.base.DirectionalAxisKineticBlock.AXIS_ALONG_FIRST_COORDINATE;
|
import static com.simibubi.create.content.contraptions.base.DirectionalAxisKineticBlock.AXIS_ALONG_FIRST_COORDINATE;
|
||||||
import static com.simibubi.create.content.contraptions.base.DirectionalKineticBlock.FACING;
|
import static com.simibubi.create.content.contraptions.base.DirectionalKineticBlock.FACING;
|
||||||
|
|
||||||
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
||||||
import com.jozufozu.flywheel.api.instance.ITickableInstance;
|
import com.jozufozu.flywheel.api.instance.ITickableInstance;
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
|
||||||
import com.jozufozu.flywheel.core.PartialModel;
|
import com.jozufozu.flywheel.core.PartialModel;
|
||||||
import com.jozufozu.flywheel.core.materials.oriented.OrientedData;
|
import com.jozufozu.flywheel.core.materials.oriented.OrientedData;
|
||||||
import com.mojang.math.Quaternion;
|
import com.mojang.math.Quaternion;
|
||||||
|
|
|
@ -7,8 +7,8 @@ import javax.annotation.Nullable;
|
||||||
|
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.backend.Backend;
|
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
|
import com.jozufozu.flywheel.backend.Backend;
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.AllItems;
|
import com.simibubi.create.AllItems;
|
||||||
import com.simibubi.create.AllTags.AllBlockTags;
|
import com.simibubi.create.AllTags.AllBlockTags;
|
||||||
|
|
|
@ -309,7 +309,7 @@ public class DeployerTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
state = NBTHelper.readEnum(compound, "State", State.class);
|
state = NBTHelper.readEnum(compound, "State", State.class);
|
||||||
mode = NBTHelper.readEnum(compound, "Mode", Mode.class);
|
mode = NBTHelper.readEnum(compound, "Mode", Mode.class);
|
||||||
timer = compound.getInt("Timer");
|
timer = compound.getInt("Timer");
|
||||||
|
@ -319,7 +319,7 @@ public class DeployerTileEntity extends KineticTileEntity {
|
||||||
overflowItems = NBTHelper.readItemList(compound.getList("Overflow", Tag.TAG_COMPOUND));
|
overflowItems = NBTHelper.readItemList(compound.getList("Overflow", Tag.TAG_COMPOUND));
|
||||||
if (compound.contains("HeldItem"))
|
if (compound.contains("HeldItem"))
|
||||||
heldItem = ItemStack.of(compound.getCompound("HeldItem"));
|
heldItem = ItemStack.of(compound.getCompound("HeldItem"));
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
|
|
||||||
if (!clientPacket)
|
if (!clientPacket)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -38,8 +38,8 @@ public class EncasedFanTileEntity extends GeneratingKineticTileEntity implements
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
if (!wasMoved)
|
if (!wasMoved)
|
||||||
isGenerator = compound.getBoolean("Generating");
|
isGenerator = compound.getBoolean("Generating");
|
||||||
if (clientPacket)
|
if (clientPacket)
|
||||||
|
|
|
@ -51,8 +51,8 @@ public class NozzleTileEntity extends SmartTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
if (!clientPacket)
|
if (!clientPacket)
|
||||||
return;
|
return;
|
||||||
range = compound.getFloat("Range");
|
range = compound.getFloat("Range");
|
||||||
|
|
|
@ -6,11 +6,11 @@ import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
|
||||||
import com.jozufozu.flywheel.api.InstanceData;
|
import com.jozufozu.flywheel.api.InstanceData;
|
||||||
import com.jozufozu.flywheel.api.Instancer;
|
import com.jozufozu.flywheel.api.Instancer;
|
||||||
import com.jozufozu.flywheel.api.Material;
|
import com.jozufozu.flywheel.api.Material;
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
|
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
||||||
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
||||||
import com.jozufozu.flywheel.util.transform.TransformStack;
|
import com.jozufozu.flywheel.util.transform.TransformStack;
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
|
|
@ -63,11 +63,11 @@ public class FlywheelTileEntity extends GeneratingKineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
generatedSpeed = compound.getFloat("GeneratedSpeed");
|
generatedSpeed = compound.getFloat("GeneratedSpeed");
|
||||||
generatedCapacity = compound.getFloat("GeneratedCapacity");
|
generatedCapacity = compound.getFloat("GeneratedCapacity");
|
||||||
stoppingCooldown = compound.getInt("Cooldown");
|
stoppingCooldown = compound.getInt("Cooldown");
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
if (clientPacket)
|
if (clientPacket)
|
||||||
visualSpeed.withSpeed(1 / 32f)
|
visualSpeed.withSpeed(1 / 32f)
|
||||||
.target(getGeneratedSpeed());
|
.target(getGeneratedSpeed());
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.simibubi.create.content.contraptions.components.flywheel.engine;
|
package com.simibubi.create.content.contraptions.components.flywheel.engine;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
|
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
|
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
|
||||||
import com.jozufozu.flywheel.core.PartialModel;
|
import com.jozufozu.flywheel.core.PartialModel;
|
||||||
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
||||||
import com.simibubi.create.foundation.utility.AngleHelper;
|
import com.simibubi.create.foundation.utility.AngleHelper;
|
||||||
|
|
|
@ -163,11 +163,11 @@ public class MillstoneTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
timer = compound.getInt("Timer");
|
timer = compound.getInt("Timer");
|
||||||
inputInv.deserializeNBT(compound.getCompound("InputInventory"));
|
inputInv.deserializeNBT(compound.getCompound("InputInventory"));
|
||||||
outputInv.deserializeNBT(compound.getCompound("OutputInventory"));
|
outputInv.deserializeNBT(compound.getCompound("OutputInventory"));
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getProcessingSpeed() {
|
public int getProcessingSpeed() {
|
||||||
|
|
|
@ -96,10 +96,10 @@ public class MechanicalMixerTileEntity extends BasinOperatingTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
running = compound.getBoolean("Running");
|
running = compound.getBoolean("Running");
|
||||||
runningTicks = compound.getInt("Ticks");
|
runningTicks = compound.getInt("Ticks");
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
|
|
||||||
if (clientPacket && hasLevel())
|
if (clientPacket && hasLevel())
|
||||||
getBasin().ifPresent(bte -> bte.setAreFluidsMoving(running && runningTicks <= 20));
|
getBasin().ifPresent(bte -> bte.setAreFluidsMoving(running && runningTicks <= 20));
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package com.simibubi.create.content.contraptions.components.mixer;
|
package com.simibubi.create.content.contraptions.components.mixer;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
|
||||||
import com.jozufozu.flywheel.api.Instancer;
|
import com.jozufozu.flywheel.api.Instancer;
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
|
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
||||||
import com.jozufozu.flywheel.core.materials.oriented.OrientedData;
|
import com.jozufozu.flywheel.core.materials.oriented.OrientedData;
|
||||||
import com.simibubi.create.AllBlockPartials;
|
import com.simibubi.create.AllBlockPartials;
|
||||||
import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
|
import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
|
||||||
|
|
|
@ -82,12 +82,12 @@ public class MechanicalPressTileEntity extends BasinOperatingTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
running = compound.getBoolean("Running");
|
running = compound.getBoolean("Running");
|
||||||
mode = Mode.values()[compound.getInt("Mode")];
|
mode = Mode.values()[compound.getInt("Mode")];
|
||||||
finished = compound.getBoolean("Finished");
|
finished = compound.getBoolean("Finished");
|
||||||
prevRunningTicks = runningTicks = compound.getInt("Ticks");
|
prevRunningTicks = runningTicks = compound.getInt("Ticks");
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
|
|
||||||
if (clientPacket) {
|
if (clientPacket) {
|
||||||
NBTHelper.iterateCompoundList(compound.getList("ParticleItems", Tag.TAG_COMPOUND),
|
NBTHelper.iterateCompoundList(compound.getList("ParticleItems", Tag.TAG_COMPOUND),
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.simibubi.create.content.contraptions.components.press;
|
package com.simibubi.create.content.contraptions.components.press;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
|
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
||||||
import com.jozufozu.flywheel.core.Materials;
|
import com.jozufozu.flywheel.core.Materials;
|
||||||
import com.jozufozu.flywheel.core.materials.oriented.OrientedData;
|
import com.jozufozu.flywheel.core.materials.oriented.OrientedData;
|
||||||
import com.mojang.math.Quaternion;
|
import com.mojang.math.Quaternion;
|
||||||
|
|
|
@ -6,10 +6,12 @@ import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
|
import java.util.function.Supplier;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.annotation.ParametersAreNonnullByDefault;
|
import javax.annotation.ParametersAreNonnullByDefault;
|
||||||
|
|
||||||
|
import com.google.common.base.Suppliers;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.simibubi.create.AllRecipeTypes;
|
import com.simibubi.create.AllRecipeTypes;
|
||||||
import com.simibubi.create.AllSoundEvents;
|
import com.simibubi.create.AllSoundEvents;
|
||||||
|
@ -39,7 +41,6 @@ import net.minecraft.core.particles.ParticleTypes;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.tags.BlockTags;
|
import net.minecraft.tags.BlockTags;
|
||||||
import net.minecraft.util.LazyLoadedValue;
|
|
||||||
import net.minecraft.util.Mth;
|
import net.minecraft.util.Mth;
|
||||||
import net.minecraft.world.entity.item.ItemEntity;
|
import net.minecraft.world.entity.item.ItemEntity;
|
||||||
import net.minecraft.world.item.BlockItem;
|
import net.minecraft.world.item.BlockItem;
|
||||||
|
@ -75,8 +76,8 @@ public class SawTileEntity extends BlockBreakingKineticTileEntity {
|
||||||
private static final AABB RENDER_BOX = new AABB(0, 0, 0, 1, 1, 1);
|
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 LazyLoadedValue<RecipeType<?>> woodcuttingRecipeType =
|
public static final Supplier<RecipeType<?>> woodcuttingRecipeType =
|
||||||
new LazyLoadedValue<>(() -> Registry.RECIPE_TYPE.get(new ResourceLocation("druidcraft", "woodcutting")));
|
Suppliers.memoize(() -> Registry.RECIPE_TYPE.get(new ResourceLocation("druidcraft", "woodcutting")));
|
||||||
|
|
||||||
public ProcessingInventory inventory;
|
public ProcessingInventory inventory;
|
||||||
private int recipeIndex;
|
private int recipeIndex;
|
||||||
|
@ -115,8 +116,8 @@ public class SawTileEntity extends BlockBreakingKineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
inventory.deserializeNBT(compound.getCompound("Inventory"));
|
inventory.deserializeNBT(compound.getCompound("Inventory"));
|
||||||
recipeIndex = compound.getInt("RecipeIndex");
|
recipeIndex = compound.getInt("RecipeIndex");
|
||||||
if (compound.contains("PlayEvent"))
|
if (compound.contains("PlayEvent"))
|
||||||
|
|
|
@ -2,8 +2,8 @@ package com.simibubi.create.content.contraptions.components.structureMovement;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.light.GPULightVolume;
|
import com.jozufozu.flywheel.light.GPULightVolume;
|
||||||
import com.jozufozu.flywheel.light.GridAlignedBB;
|
import com.jozufozu.flywheel.light.GridAlignedBB;
|
||||||
import com.jozufozu.flywheel.light.LightListener;
|
|
||||||
import com.jozufozu.flywheel.light.ImmutableBox;
|
import com.jozufozu.flywheel.light.ImmutableBox;
|
||||||
|
import com.jozufozu.flywheel.light.LightListener;
|
||||||
import com.jozufozu.flywheel.light.LightProvider;
|
import com.jozufozu.flywheel.light.LightProvider;
|
||||||
import com.jozufozu.flywheel.light.LightUpdater;
|
import com.jozufozu.flywheel.light.LightUpdater;
|
||||||
import com.jozufozu.flywheel.light.ListenerStatus;
|
import com.jozufozu.flywheel.light.ListenerStatus;
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class DirectionalExtenderScrollOptionSlot extends CenteredSideValueBoxTra
|
||||||
protected void rotate(BlockState state, PoseStack ms) {
|
protected void rotate(BlockState state, PoseStack ms) {
|
||||||
if (!getSide().getAxis().isHorizontal())
|
if (!getSide().getAxis().isHorizontal())
|
||||||
TransformStack.cast(ms)
|
TransformStack.cast(ms)
|
||||||
.rotateY(AngleHelper.horizontalAngle(state.getValue(BlockStateProperties.FACING)) - 90);
|
.rotateY(AngleHelper.horizontalAngle(state.getValue(BlockStateProperties.FACING)) + 180);
|
||||||
super.rotate(state, ms);
|
super.rotate(state, ms);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package com.simibubi.create.content.contraptions.components.structureMovement;
|
package com.simibubi.create.content.contraptions.components.structureMovement;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.light.GridAlignedBB;
|
import com.jozufozu.flywheel.light.GridAlignedBB;
|
||||||
import com.jozufozu.flywheel.light.MovingListener;
|
|
||||||
import com.jozufozu.flywheel.light.ImmutableBox;
|
import com.jozufozu.flywheel.light.ImmutableBox;
|
||||||
import com.jozufozu.flywheel.light.LightProvider;
|
import com.jozufozu.flywheel.light.LightProvider;
|
||||||
|
import com.jozufozu.flywheel.light.MovingListener;
|
||||||
import com.simibubi.create.foundation.config.AllConfigs;
|
import com.simibubi.create.foundation.config.AllConfigs;
|
||||||
|
|
||||||
public class NonStationaryLighter<C extends Contraption> extends ContraptionLighter<C> implements MovingListener {
|
public class NonStationaryLighter<C extends Contraption> extends ContraptionLighter<C> implements MovingListener {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.simibubi.create.content.contraptions.components.structureMovement.bearing;
|
package com.simibubi.create.content.contraptions.components.structureMovement.bearing;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
|
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
||||||
import com.jozufozu.flywheel.core.PartialModel;
|
import com.jozufozu.flywheel.core.PartialModel;
|
||||||
import com.jozufozu.flywheel.core.materials.oriented.OrientedData;
|
import com.jozufozu.flywheel.core.materials.oriented.OrientedData;
|
||||||
import com.mojang.math.Quaternion;
|
import com.mojang.math.Quaternion;
|
||||||
|
|
|
@ -310,7 +310,7 @@ public class ClockworkBearingTileEntity extends KineticTileEntity
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
float hourAngleBefore = hourAngle;
|
float hourAngleBefore = hourAngle;
|
||||||
float minuteAngleBefore = minuteAngle;
|
float minuteAngleBefore = minuteAngle;
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@ public class ClockworkBearingTileEntity extends KineticTileEntity
|
||||||
hourAngle = compound.getFloat("HourAngle");
|
hourAngle = compound.getFloat("HourAngle");
|
||||||
minuteAngle = compound.getFloat("MinuteAngle");
|
minuteAngle = compound.getFloat("MinuteAngle");
|
||||||
lastException = AssemblyException.read(compound);
|
lastException = AssemblyException.read(compound);
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
|
|
||||||
if (!clientPacket)
|
if (!clientPacket)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -73,9 +73,9 @@ public class MechanicalBearingTileEntity extends GeneratingKineticTileEntity
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
if (wasMoved) {
|
if (wasMoved) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ public class MechanicalBearingTileEntity extends GeneratingKineticTileEntity
|
||||||
running = compound.getBoolean("Running");
|
running = compound.getBoolean("Running");
|
||||||
angle = compound.getFloat("Angle");
|
angle = compound.getFloat("Angle");
|
||||||
lastException = AssemblyException.read(compound);
|
lastException = AssemblyException.read(compound);
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
if (!clientPacket)
|
if (!clientPacket)
|
||||||
return;
|
return;
|
||||||
if (running) {
|
if (running) {
|
||||||
|
|
|
@ -2,8 +2,8 @@ package com.simibubi.create.content.contraptions.components.structureMovement.be
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.backend.Backend;
|
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
|
import com.jozufozu.flywheel.backend.Backend;
|
||||||
import com.jozufozu.flywheel.core.PartialModel;
|
import com.jozufozu.flywheel.core.PartialModel;
|
||||||
import com.mojang.math.Quaternion;
|
import com.mojang.math.Quaternion;
|
||||||
import com.simibubi.create.AllBlockPartials;
|
import com.simibubi.create.AllBlockPartials;
|
||||||
|
|
|
@ -65,10 +65,10 @@ public class WindmillBearingTileEntity extends MechanicalBearingTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
if (!wasMoved)
|
if (!wasMoved)
|
||||||
lastGeneratedSpeed = compound.getFloat("LastGenerated");
|
lastGeneratedSpeed = compound.getFloat("LastGenerated");
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package com.simibubi.create.content.contraptions.components.structureMovement.chassis;
|
package com.simibubi.create.content.contraptions.components.structureMovement.chassis;
|
||||||
|
|
||||||
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
||||||
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
|
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
|
||||||
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
||||||
import com.simibubi.create.AllBlockPartials;
|
import com.simibubi.create.AllBlockPartials;
|
||||||
import com.simibubi.create.foundation.utility.AngleHelper;
|
import com.simibubi.create.foundation.utility.AngleHelper;
|
||||||
|
|
|
@ -83,8 +83,8 @@ public class StickerTileEntity extends SmartTileEntity implements FlywheelRender
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
if (clientPacket)
|
if (clientPacket)
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.simibubi.create.content.contraptions.components.structureMovement.gantry;
|
package com.simibubi.create.content.contraptions.components.structureMovement.gantry;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
|
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
||||||
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
||||||
import com.simibubi.create.AllBlockPartials;
|
import com.simibubi.create.AllBlockPartials;
|
||||||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||||
|
|
|
@ -117,9 +117,9 @@ public class GantryCarriageTileEntity extends KineticTileEntity implements IDisp
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
lastException = AssemblyException.read(compound);
|
lastException = AssemblyException.read(compound);
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package com.simibubi.create.content.contraptions.components.structureMovement.glue;
|
package com.simibubi.create.content.contraptions.components.structureMovement.glue;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.backend.gl.attrib.VertexFormat;
|
|
||||||
import com.jozufozu.flywheel.api.instance.ITickableInstance;
|
|
||||||
import com.jozufozu.flywheel.api.Instancer;
|
import com.jozufozu.flywheel.api.Instancer;
|
||||||
import com.jozufozu.flywheel.backend.instancing.entity.EntityInstance;
|
|
||||||
import com.jozufozu.flywheel.api.MaterialGroup;
|
import com.jozufozu.flywheel.api.MaterialGroup;
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
|
import com.jozufozu.flywheel.api.instance.ITickableInstance;
|
||||||
|
import com.jozufozu.flywheel.backend.gl.attrib.VertexFormat;
|
||||||
|
import com.jozufozu.flywheel.backend.instancing.entity.EntityInstance;
|
||||||
import com.jozufozu.flywheel.core.Formats;
|
import com.jozufozu.flywheel.core.Formats;
|
||||||
import com.jozufozu.flywheel.core.Materials;
|
import com.jozufozu.flywheel.core.Materials;
|
||||||
import com.jozufozu.flywheel.core.instancing.ConditionalInstance;
|
import com.jozufozu.flywheel.core.instancing.ConditionalInstance;
|
||||||
|
|
|
@ -242,9 +242,9 @@ public class CartAssemblerTileEntity extends SmartTileEntity implements IDisplay
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
lastException = AssemblyException.read(compound);
|
lastException = AssemblyException.read(compound);
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -194,7 +194,7 @@ public abstract class LinearActuatorTileEntity extends KineticTileEntity
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
boolean forceMovement = compound.contains("ForceMovement");
|
boolean forceMovement = compound.contains("ForceMovement");
|
||||||
float offsetBefore = offset;
|
float offsetBefore = offset;
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ public abstract class LinearActuatorTileEntity extends KineticTileEntity
|
||||||
waitingForSpeedChange = compound.getBoolean("Waiting");
|
waitingForSpeedChange = compound.getBoolean("Waiting");
|
||||||
offset = compound.getFloat("Offset");
|
offset = compound.getFloat("Offset");
|
||||||
lastException = AssemblyException.read(compound);
|
lastException = AssemblyException.read(compound);
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
|
|
||||||
if (!clientPacket)
|
if (!clientPacket)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -32,9 +32,9 @@ public class MechanicalPistonTileEntity extends LinearActuatorTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
extensionLength = compound.getInt("ExtensionLength");
|
extensionLength = compound.getInt("ExtensionLength");
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
package com.simibubi.create.content.contraptions.components.structureMovement.pulley;
|
package com.simibubi.create.content.contraptions.components.structureMovement.pulley;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
|
||||||
import com.jozufozu.flywheel.api.Instancer;
|
import com.jozufozu.flywheel.api.Instancer;
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
|
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
||||||
import com.jozufozu.flywheel.core.instancing.ConditionalInstance;
|
import com.jozufozu.flywheel.core.instancing.ConditionalInstance;
|
||||||
import com.jozufozu.flywheel.core.instancing.GroupInstance;
|
import com.jozufozu.flywheel.core.instancing.GroupInstance;
|
||||||
import com.jozufozu.flywheel.core.instancing.SelectInstance;
|
import com.jozufozu.flywheel.core.instancing.SelectInstance;
|
||||||
import com.jozufozu.flywheel.core.materials.oriented.OrientedData;
|
import com.jozufozu.flywheel.core.materials.oriented.OrientedData;
|
||||||
import com.jozufozu.flywheel.light.GridAlignedBB;
|
import com.jozufozu.flywheel.light.GridAlignedBB;
|
||||||
import com.jozufozu.flywheel.light.MovingListener;
|
|
||||||
import com.jozufozu.flywheel.light.ImmutableBox;
|
import com.jozufozu.flywheel.light.ImmutableBox;
|
||||||
import com.jozufozu.flywheel.light.LightPacking;
|
import com.jozufozu.flywheel.light.LightPacking;
|
||||||
import com.jozufozu.flywheel.light.LightProvider;
|
import com.jozufozu.flywheel.light.LightProvider;
|
||||||
import com.jozufozu.flywheel.light.LightUpdater;
|
import com.jozufozu.flywheel.light.LightUpdater;
|
||||||
import com.jozufozu.flywheel.light.LightVolume;
|
import com.jozufozu.flywheel.light.LightVolume;
|
||||||
|
import com.jozufozu.flywheel.light.MovingListener;
|
||||||
import com.mojang.math.Vector3f;
|
import com.mojang.math.Vector3f;
|
||||||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||||
import com.simibubi.create.content.contraptions.relays.encased.ShaftInstance;
|
import com.simibubi.create.content.contraptions.relays.encased.ShaftInstance;
|
||||||
|
|
|
@ -193,10 +193,10 @@ public class PulleyTileEntity extends LinearActuatorTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
initialOffset = compound.getInt("InitialOffset");
|
initialOffset = compound.getInt("InitialOffset");
|
||||||
needsContraption = compound.getBoolean("NeedsContraption");
|
needsContraption = compound.getBoolean("NeedsContraption");
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -7,8 +7,8 @@ import javax.annotation.Nullable;
|
||||||
|
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.backend.instancing.tile.TileInstanceManager;
|
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
|
import com.jozufozu.flywheel.backend.instancing.tile.TileInstanceManager;
|
||||||
import com.simibubi.create.AllMovementBehaviours;
|
import com.simibubi.create.AllMovementBehaviours;
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour;
|
import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour;
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
|
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
|
||||||
|
|
|
@ -4,9 +4,9 @@ import static org.lwjgl.opengl.GL11.glBindTexture;
|
||||||
import static org.lwjgl.opengl.GL12.GL_TEXTURE_3D;
|
import static org.lwjgl.opengl.GL12.GL_TEXTURE_3D;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.backend.Backend;
|
import com.jozufozu.flywheel.backend.Backend;
|
||||||
|
import com.jozufozu.flywheel.backend.RenderLayer;
|
||||||
import com.jozufozu.flywheel.backend.gl.GlTextureUnit;
|
import com.jozufozu.flywheel.backend.gl.GlTextureUnit;
|
||||||
import com.jozufozu.flywheel.backend.gl.GlVertexArray;
|
import com.jozufozu.flywheel.backend.gl.GlVertexArray;
|
||||||
import com.jozufozu.flywheel.backend.RenderLayer;
|
|
||||||
import com.jozufozu.flywheel.event.RenderLayerEvent;
|
import com.jozufozu.flywheel.event.RenderLayerEvent;
|
||||||
import com.jozufozu.flywheel.util.TextureBinder;
|
import com.jozufozu.flywheel.util.TextureBinder;
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.Contraption;
|
import com.simibubi.create.content.contraptions.components.structureMovement.Contraption;
|
||||||
|
|
|
@ -28,8 +28,8 @@ public class WaterWheelTileEntity extends GeneratingKineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
if (compound.contains("Flows")) {
|
if (compound.contains("Flows")) {
|
||||||
for (Direction d : Iterate.directions)
|
for (Direction d : Iterate.directions)
|
||||||
setFlow(d, compound.getCompound("Flows")
|
setFlow(d, compound.getCompound("Flows")
|
||||||
|
|
|
@ -311,9 +311,9 @@ public class PumpTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
reversed = compound.getBoolean("Reversed");
|
reversed = compound.getBoolean("Reversed");
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updatePipesOnSide(Direction side) {
|
public void updatePipesOnSide(Direction side) {
|
||||||
|
|
|
@ -155,10 +155,10 @@ public class HosePulleyTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
offset.readNBT(compound.getCompound("Offset"), clientPacket);
|
offset.readNBT(compound.getCompound("Offset"), clientPacket);
|
||||||
internalTank.readFromNBT(compound.getCompound("Tank"));
|
internalTank.readFromNBT(compound.getCompound("Tank"));
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
if (clientPacket)
|
if (clientPacket)
|
||||||
infinite = compound.getBoolean("Infinite");
|
infinite = compound.getBoolean("Infinite");
|
||||||
}
|
}
|
||||||
|
|
|
@ -270,12 +270,12 @@ public class ItemDrainTileEntity extends SmartTileEntity implements IHaveGoggleI
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
heldItem = null;
|
heldItem = null;
|
||||||
processingTicks = compound.getInt("ProcessingTicks");
|
processingTicks = compound.getInt("ProcessingTicks");
|
||||||
if (compound.contains("HeldItem"))
|
if (compound.contains("HeldItem"))
|
||||||
heldItem = TransportedItemStack.read(compound.getCompound("HeldItem"));
|
heldItem = TransportedItemStack.read(compound.getCompound("HeldItem"));
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -151,8 +151,8 @@ public class SpoutTileEntity extends SmartTileEntity implements IHaveGoggleInfor
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
processingTicks = compound.getInt("ProcessingTicks");
|
processingTicks = compound.getInt("ProcessingTicks");
|
||||||
if (!clientPacket)
|
if (!clientPacket)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.simibubi.create.content.contraptions.fluids.pipes;
|
package com.simibubi.create.content.contraptions.fluids.pipes;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
|
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
||||||
import com.jozufozu.flywheel.core.Materials;
|
import com.jozufozu.flywheel.core.Materials;
|
||||||
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
||||||
import com.simibubi.create.AllBlockPartials;
|
import com.simibubi.create.AllBlockPartials;
|
||||||
|
|
|
@ -70,8 +70,8 @@ public class FluidValveTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
pointer.readNBT(compound.getCompound("Pointer"), clientPacket);
|
pointer.readNBT(compound.getCompound("Pointer"), clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -338,8 +338,8 @@ public class FluidTankTileEntity extends SmartTileEntity implements IHaveGoggleI
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
|
|
||||||
BlockPos controllerBefore = controller;
|
BlockPos controllerBefore = controller;
|
||||||
int prevSize = width;
|
int prevSize = width;
|
||||||
|
|
|
@ -26,7 +26,6 @@ import com.simibubi.create.foundation.utility.outliner.Outline;
|
||||||
import com.simibubi.create.foundation.utility.outliner.Outliner.OutlineEntry;
|
import com.simibubi.create.foundation.utility.outliner.Outliner.OutlineEntry;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.screens.Screen;
|
|
||||||
import net.minecraft.client.multiplayer.ClientLevel;
|
import net.minecraft.client.multiplayer.ClientLevel;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
|
@ -151,10 +150,7 @@ public class GoggleOverlayRenderer {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
poseStack.pushPose();
|
poseStack.pushPose();
|
||||||
Screen tooltipScreen = new TooltipScreen(new TextComponent(""));
|
|
||||||
tooltipScreen.init(mc, width, height);
|
|
||||||
|
|
||||||
int titleLinesCount = 1;
|
|
||||||
int tooltipTextWidth = 0;
|
int tooltipTextWidth = 0;
|
||||||
for (FormattedText textLine : tooltip) {
|
for (FormattedText textLine : tooltip) {
|
||||||
int textLineWidth = mc.font.width(textLine);
|
int textLineWidth = mc.font.width(textLine);
|
||||||
|
@ -164,17 +160,16 @@ public class GoggleOverlayRenderer {
|
||||||
|
|
||||||
int tooltipHeight = 8;
|
int tooltipHeight = 8;
|
||||||
if (tooltip.size() > 1) {
|
if (tooltip.size() > 1) {
|
||||||
|
tooltipHeight += 2; // gap between title lines and next lines
|
||||||
tooltipHeight += (tooltip.size() - 1) * 10;
|
tooltipHeight += (tooltip.size() - 1) * 10;
|
||||||
if (tooltip.size() > titleLinesCount)
|
|
||||||
tooltipHeight += 2; // gap between title lines and next lines
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CClient cfg = AllConfigs.CLIENT;
|
CClient cfg = AllConfigs.CLIENT;
|
||||||
int posX = tooltipScreen.width / 2 + cfg.overlayOffsetX.get();
|
int posX = width / 2 + cfg.overlayOffsetX.get();
|
||||||
int posY = tooltipScreen.height / 2 + cfg.overlayOffsetY.get();
|
int posY = height / 2 + cfg.overlayOffsetY.get();
|
||||||
|
|
||||||
posX = Math.min(posX, tooltipScreen.width - tooltipTextWidth - 20);
|
posX = Math.min(posX, width - tooltipTextWidth - 20);
|
||||||
posY = Math.min(posY, tooltipScreen.height - tooltipHeight - 20);
|
posY = Math.min(posY, height - tooltipHeight - 20);
|
||||||
|
|
||||||
float fade = Mth.clamp((hoverTicks + partialTicks) / 12f, 0, 1);
|
float fade = Mth.clamp((hoverTicks + partialTicks) / 12f, 0, 1);
|
||||||
Boolean useCustom = cfg.overlayCustomColor.get();
|
Boolean useCustom = cfg.overlayCustomColor.get();
|
||||||
|
@ -195,7 +190,7 @@ public class GoggleOverlayRenderer {
|
||||||
colorBorderBot.scaleAlpha(fade);
|
colorBorderBot.scaleAlpha(fade);
|
||||||
}
|
}
|
||||||
|
|
||||||
RemovedGuiUtils.drawHoveringText(poseStack, tooltip, posX, posY, tooltipScreen.width, tooltipScreen.height, -1,
|
RemovedGuiUtils.drawHoveringText(poseStack, tooltip, posX, posY, width, height, -1,
|
||||||
colorBackground.getRGB(), colorBorderTop.getRGB(), colorBorderBot.getRGB(), mc.font);
|
colorBackground.getRGB(), colorBorderTop.getRGB(), colorBorderBot.getRGB(), mc.font);
|
||||||
|
|
||||||
ItemStack item = AllItems.GOGGLES.asStack();
|
ItemStack item = AllItems.GOGGLES.asStack();
|
||||||
|
@ -206,26 +201,11 @@ public class GoggleOverlayRenderer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use this method to add custom entry points to the goggle overay, e.g. custom
|
* Use this method to add custom entry points to the goggles overlay, e.g. custom
|
||||||
* armor, handheld alternatives, etc.
|
* armor, handheld alternatives, etc.
|
||||||
*/
|
*/
|
||||||
public static void registerCustomGoggleCondition(Supplier<Boolean> condition) {
|
public static void registerCustomGoggleCondition(Supplier<Boolean> condition) {
|
||||||
customGogglePredicates.add(condition);
|
customGogglePredicates.add(condition);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class TooltipScreen extends Screen {
|
|
||||||
public TooltipScreen(Component p_i51108_1_) {
|
|
||||||
super(p_i51108_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Override
|
|
||||||
// public void init(Minecraft mc, int width, int height) {
|
|
||||||
// this.minecraft = mc;
|
|
||||||
// this.itemRenderer = mc.getItemRenderer();
|
|
||||||
// this.font = mc.font;
|
|
||||||
// this.width = width;
|
|
||||||
// this.height = height;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,8 +140,8 @@ public class BasinTileEntity extends SmartTileEntity implements IHaveGoggleInfor
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
inputInventory.deserializeNBT(compound.getCompound("InputItems"));
|
inputInventory.deserializeNBT(compound.getCompound("InputItems"));
|
||||||
outputInventory.deserializeNBT(compound.getCompound("OutputItems"));
|
outputInventory.deserializeNBT(compound.getCompound("OutputItems"));
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ public class ProcessingOutput {
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
json.addProperty("count", count);
|
json.addProperty("count", count);
|
||||||
if (stack.hasTag())
|
if (stack.hasTag())
|
||||||
json.add("nbt", new JsonParser().parse(stack.getTag()
|
json.add("nbt", JsonParser.parseString(stack.getTag()
|
||||||
.toString()));
|
.toString()));
|
||||||
if (chance != 1)
|
if (chance != 1)
|
||||||
json.addProperty("chance", chance);
|
json.addProperty("chance", chance);
|
||||||
|
|
|
@ -135,11 +135,11 @@ public class BlazeBurnerTileEntity extends SmartTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
activeFuel = FuelType.values()[compound.getInt("fuelLevel")];
|
activeFuel = FuelType.values()[compound.getInt("fuelLevel")];
|
||||||
remainingBurnTime = compound.getInt("burnTimeRemaining");
|
remainingBurnTime = compound.getInt("burnTimeRemaining");
|
||||||
isCreative = compound.getBoolean("isCreative");
|
isCreative = compound.getBoolean("isCreative");
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BlazeBurnerBlock.HeatLevel getHeatLevelFromBlock() {
|
public BlazeBurnerBlock.HeatLevel getHeatLevelFromBlock() {
|
||||||
|
|
|
@ -146,14 +146,14 @@ public class SequencedGearshiftTileEntity extends SplitShaftTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
currentInstruction = compound.getInt("InstructionIndex");
|
currentInstruction = compound.getInt("InstructionIndex");
|
||||||
currentInstructionDuration = compound.getInt("InstructionDuration");
|
currentInstructionDuration = compound.getInt("InstructionDuration");
|
||||||
currentInstructionProgress = compound.getFloat("InstructionProgress");
|
currentInstructionProgress = compound.getFloat("InstructionProgress");
|
||||||
poweredPreviously = compound.getBoolean("PrevPowered");
|
poweredPreviously = compound.getBoolean("PrevPowered");
|
||||||
timer = compound.getInt("Timer");
|
timer = compound.getInt("Timer");
|
||||||
instructions = Instruction.deserializeAll(compound.getList("Instructions", Tag.TAG_COMPOUND));
|
instructions = Instruction.deserializeAll(compound.getList("Instructions", Tag.TAG_COMPOUND));
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -14,8 +14,8 @@ import java.util.function.Function;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher;
|
import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher;
|
||||||
import com.jozufozu.flywheel.light.GridAlignedBB;
|
import com.jozufozu.flywheel.light.GridAlignedBB;
|
||||||
import com.jozufozu.flywheel.light.LightListener;
|
|
||||||
import com.jozufozu.flywheel.light.ImmutableBox;
|
import com.jozufozu.flywheel.light.ImmutableBox;
|
||||||
|
import com.jozufozu.flywheel.light.LightListener;
|
||||||
import com.jozufozu.flywheel.light.LightProvider;
|
import com.jozufozu.flywheel.light.LightProvider;
|
||||||
import com.jozufozu.flywheel.light.LightUpdater;
|
import com.jozufozu.flywheel.light.LightUpdater;
|
||||||
import com.jozufozu.flywheel.light.ListenerStatus;
|
import com.jozufozu.flywheel.light.ListenerStatus;
|
||||||
|
@ -214,9 +214,9 @@ public class BeltTileEntity extends KineticTileEntity implements LightListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
int prevBeltLength = beltLength;
|
int prevBeltLength = beltLength;
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
|
|
||||||
if (compound.getBoolean("IsController"))
|
if (compound.getBoolean("IsController"))
|
||||||
controller = worldPosition;
|
controller = worldPosition;
|
||||||
|
|
|
@ -25,9 +25,9 @@ public class AdjustablePulleyTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
signal = compound.getInt("Signal");
|
signal = compound.getInt("Signal");
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getModifier() {
|
public float getModifier() {
|
||||||
|
|
|
@ -2,9 +2,9 @@ package com.simibubi.create.content.contraptions.relays.gauge;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
|
||||||
import com.jozufozu.flywheel.api.Instancer;
|
import com.jozufozu.flywheel.api.Instancer;
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
|
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
||||||
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
||||||
import com.jozufozu.flywheel.util.transform.TransformStack;
|
import com.jozufozu.flywheel.util.transform.TransformStack;
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
|
|
@ -31,10 +31,10 @@ public class GaugeTileEntity extends KineticTileEntity implements IHaveGoggleInf
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
dialTarget = compound.getFloat("Value");
|
dialTarget = compound.getFloat("Value");
|
||||||
color = compound.getInt("Color");
|
color = compound.getInt("Color");
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -2,10 +2,10 @@ package com.simibubi.create.content.curiosities.armor;
|
||||||
|
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
import com.google.common.base.Suppliers;
|
||||||
import com.simibubi.create.AllSoundEvents;
|
import com.simibubi.create.AllSoundEvents;
|
||||||
|
|
||||||
import net.minecraft.sounds.SoundEvent;
|
import net.minecraft.sounds.SoundEvent;
|
||||||
import net.minecraft.util.LazyLoadedValue;
|
|
||||||
import net.minecraft.world.entity.EquipmentSlot;
|
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;
|
||||||
|
@ -28,7 +28,7 @@ public enum AllArmorMaterials implements ArmorMaterial {
|
||||||
private final SoundEvent soundEvent;
|
private final SoundEvent soundEvent;
|
||||||
private final float toughness;
|
private final float toughness;
|
||||||
private final float knockbackResistance;
|
private final float knockbackResistance;
|
||||||
private final LazyLoadedValue<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 p_i231593_3_, int p_i231593_4_, int[] p_i231593_5_, int p_i231593_6_,
|
||||||
SoundEvent p_i231593_7_, float p_i231593_8_, float p_i231593_9_, Supplier<Ingredient> p_i231593_10_) {
|
SoundEvent p_i231593_7_, float p_i231593_8_, float p_i231593_9_, Supplier<Ingredient> p_i231593_10_) {
|
||||||
|
@ -39,7 +39,7 @@ public enum AllArmorMaterials implements ArmorMaterial {
|
||||||
this.soundEvent = p_i231593_7_;
|
this.soundEvent = p_i231593_7_;
|
||||||
this.toughness = p_i231593_8_;
|
this.toughness = p_i231593_8_;
|
||||||
this.knockbackResistance = p_i231593_9_;
|
this.knockbackResistance = p_i231593_9_;
|
||||||
this.repairMaterial = new LazyLoadedValue<>(p_i231593_10_);
|
this.repairMaterial = Suppliers.memoize(p_i231593_10_::get);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getDurabilityForSlot(EquipmentSlot p_200896_1_) {
|
public int getDurabilityForSlot(EquipmentSlot p_200896_1_) {
|
||||||
|
|
|
@ -95,8 +95,8 @@ public class CopperBacktankTileEntity extends KineticTileEntity implements Namea
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
int prev = airLevel;
|
int prev = airLevel;
|
||||||
capacityEnchantLevel = compound.getInt("CapacityEnchantment");
|
capacityEnchantLevel = compound.getInt("CapacityEnchantment");
|
||||||
airLevel = compound.getInt("Air");
|
airLevel = compound.getInt("Air");
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
package com.simibubi.create.content.curiosities.bell;
|
package com.simibubi.create.content.curiosities.bell;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.core.PartialModel;
|
import com.jozufozu.flywheel.core.PartialModel;
|
||||||
import com.simibubi.create.AllBlockPartials;
|
import com.simibubi.create.AllBlockPartials;
|
||||||
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
|
@ -29,9 +27,6 @@ public class HauntedBellTileEntity extends AbstractBellTileEntity {
|
||||||
super(type, pos, state);
|
super(type, pos, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addBehaviours(List<TileEntityBehaviour> behaviours) { }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PartialModel getBellModel() {
|
public PartialModel getBellModel() {
|
||||||
return AllBlockPartials.HAUNTED_BELL;
|
return AllBlockPartials.HAUNTED_BELL;
|
||||||
|
@ -65,8 +60,8 @@ public class HauntedBellTileEntity extends AbstractBellTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
effectTicks = compound.getInt("EffectTicks");
|
effectTicks = compound.getInt("EffectTicks");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package com.simibubi.create.content.curiosities.toolbox;
|
package com.simibubi.create.content.curiosities.toolbox;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
|
||||||
import com.jozufozu.flywheel.api.Instancer;
|
import com.jozufozu.flywheel.api.Instancer;
|
||||||
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
|
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
|
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
||||||
|
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
|
||||||
import com.jozufozu.flywheel.core.Materials;
|
import com.jozufozu.flywheel.core.Materials;
|
||||||
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
||||||
import com.simibubi.create.AllBlockPartials;
|
import com.simibubi.create.AllBlockPartials;
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class ToolboxContainer extends ContainerBase<ToolboxTileEntity> {
|
||||||
BlockEntity tileEntity = world.getBlockEntity(readBlockPos);
|
BlockEntity tileEntity = world.getBlockEntity(readBlockPos);
|
||||||
if (tileEntity instanceof ToolboxTileEntity) {
|
if (tileEntity instanceof ToolboxTileEntity) {
|
||||||
ToolboxTileEntity toolbox = (ToolboxTileEntity) tileEntity;
|
ToolboxTileEntity toolbox = (ToolboxTileEntity) tileEntity;
|
||||||
toolbox.handleUpdateTag(readNbt);
|
toolbox.readClient(readNbt);
|
||||||
return toolbox;
|
return toolbox;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,8 @@ import net.minecraft.server.level.ServerPlayer;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraftforge.network.NetworkEvent.Context;
|
|
||||||
import net.minecraftforge.items.ItemHandlerHelper;
|
import net.minecraftforge.items.ItemHandlerHelper;
|
||||||
|
import net.minecraftforge.network.NetworkEvent.Context;
|
||||||
|
|
||||||
public class ToolboxDisposeAllPacket extends SimplePacketBase {
|
public class ToolboxDisposeAllPacket extends SimplePacketBase {
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,8 @@ import net.minecraft.server.level.ServerPlayer;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraftforge.network.NetworkEvent.Context;
|
|
||||||
import net.minecraftforge.items.ItemHandlerHelper;
|
import net.minecraftforge.items.ItemHandlerHelper;
|
||||||
|
import net.minecraftforge.network.NetworkEvent.Context;
|
||||||
|
|
||||||
public class ToolboxEquipPacket extends SimplePacketBase {
|
public class ToolboxEquipPacket extends SimplePacketBase {
|
||||||
|
|
||||||
|
|
|
@ -283,9 +283,9 @@ public class ToolboxTileEntity extends SmartTileEntity implements MenuProvider,
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
inventory.deserializeNBT(compound.getCompound("Inventory"));
|
inventory.deserializeNBT(compound.getCompound("Inventory"));
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
if (compound.contains("UniqueId", 11))
|
if (compound.contains("UniqueId", 11))
|
||||||
this.uniqueId = compound.getUUID("UniqueId");
|
this.uniqueId = compound.getUUID("UniqueId");
|
||||||
if (compound.contains("CustomName", 8))
|
if (compound.contains("CustomName", 8))
|
||||||
|
|
|
@ -2,7 +2,9 @@ package com.simibubi.create.content.curiosities.tools;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
import com.google.common.base.Suppliers;
|
||||||
import com.google.common.collect.ImmutableMultimap;
|
import com.google.common.collect.ImmutableMultimap;
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
import com.simibubi.create.AllItems;
|
import com.simibubi.create.AllItems;
|
||||||
|
@ -17,7 +19,6 @@ import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.player.LocalPlayer;
|
import net.minecraft.client.player.LocalPlayer;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
import net.minecraft.util.LazyLoadedValue;
|
|
||||||
import net.minecraft.world.InteractionHand;
|
import net.minecraft.world.InteractionHand;
|
||||||
import net.minecraft.world.damagesource.DamageSource;
|
import net.minecraft.world.damagesource.DamageSource;
|
||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
|
@ -65,13 +66,15 @@ public class ExtendoGripItem extends Item {
|
||||||
new AttributeModifier(UUID.fromString("8f7dbdb2-0d0d-458a-aa40-ac7633691f66"), "Range modifier", 5,
|
new AttributeModifier(UUID.fromString("8f7dbdb2-0d0d-458a-aa40-ac7633691f66"), "Range modifier", 5,
|
||||||
AttributeModifier.Operation.ADDITION);
|
AttributeModifier.Operation.ADDITION);
|
||||||
|
|
||||||
static LazyLoadedValue<Multimap<Attribute, AttributeModifier>> rangeModifier = new LazyLoadedValue<>(() ->
|
static Supplier<Multimap<Attribute, AttributeModifier>> rangeModifier = Suppliers.memoize(() ->
|
||||||
// Holding an ExtendoGrip
|
// Holding an ExtendoGrip
|
||||||
ImmutableMultimap.of(ForgeMod.REACH_DISTANCE.get(), singleRangeAttributeModifier));
|
ImmutableMultimap.of(ForgeMod.REACH_DISTANCE.get(), singleRangeAttributeModifier)
|
||||||
|
);
|
||||||
|
|
||||||
static LazyLoadedValue<Multimap<Attribute, AttributeModifier>> doubleRangeModifier = new LazyLoadedValue<>(() ->
|
static Supplier<Multimap<Attribute, AttributeModifier>> doubleRangeModifier = Suppliers.memoize(() ->
|
||||||
// Holding two ExtendoGrips o.O
|
// Holding two ExtendoGrips o.O
|
||||||
ImmutableMultimap.of(ForgeMod.REACH_DISTANCE.get(), doubleRangeAttributeModifier));
|
ImmutableMultimap.of(ForgeMod.REACH_DISTANCE.get(), doubleRangeAttributeModifier)
|
||||||
|
);
|
||||||
|
|
||||||
public ExtendoGripItem(Properties properties) {
|
public ExtendoGripItem(Properties properties) {
|
||||||
super(properties.stacksTo(1)
|
super(properties.stacksTo(1)
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class ZapperLog {
|
||||||
|
|
||||||
List<StructureBlockInfo> blocks = positions.stream().map(pos -> {
|
List<StructureBlockInfo> blocks = positions.stream().map(pos -> {
|
||||||
BlockEntity tileEntity = world.getBlockEntity(pos);
|
BlockEntity tileEntity = world.getBlockEntity(pos);
|
||||||
return new StructureBlockInfo(pos, world.getBlockState(pos), tileEntity == null ? null : tileEntity.serializeNBT());
|
return new StructureBlockInfo(pos, world.getBlockState(pos), tileEntity == null ? null : tileEntity.saveWithFullMetadata());
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
log.add(0, blocks);
|
log.add(0, blocks);
|
||||||
|
|
|
@ -5,11 +5,11 @@ import java.util.Collection;
|
||||||
import java.util.EnumMap;
|
import java.util.EnumMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
|
||||||
import com.jozufozu.flywheel.api.InstanceData;
|
import com.jozufozu.flywheel.api.InstanceData;
|
||||||
import com.jozufozu.flywheel.api.Instancer;
|
import com.jozufozu.flywheel.api.Instancer;
|
||||||
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
|
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
|
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
||||||
|
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
|
||||||
import com.simibubi.create.AllBlockPartials;
|
import com.simibubi.create.AllBlockPartials;
|
||||||
import com.simibubi.create.content.logistics.block.flap.FlapData;
|
import com.simibubi.create.content.logistics.block.flap.FlapData;
|
||||||
import com.simibubi.create.foundation.render.AllMaterialSpecs;
|
import com.simibubi.create.foundation.render.AllMaterialSpecs;
|
||||||
|
|
|
@ -77,7 +77,7 @@ public class BeltTunnelTileEntity extends SmartTileEntity implements FlywheelRen
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
Set<Direction> newFlaps = new HashSet<>(6);
|
Set<Direction> newFlaps = new HashSet<>(6);
|
||||||
ListTag flapsNBT = compound.getList("Flaps", Tag.TAG_INT);
|
ListTag flapsNBT = compound.getList("Flaps", Tag.TAG_INT);
|
||||||
for (Tag inbt : flapsNBT)
|
for (Tag inbt : flapsNBT)
|
||||||
|
@ -101,7 +101,7 @@ public class BeltTunnelTileEntity extends SmartTileEntity implements FlywheelRen
|
||||||
// Backwards compat
|
// Backwards compat
|
||||||
if (!compound.contains("Sides") && compound.contains("Flaps"))
|
if (!compound.contains("Sides") && compound.contains("Flaps"))
|
||||||
sides.addAll(flaps.keySet());
|
sides.addAll(flaps.keySet());
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
if (clientPacket)
|
if (clientPacket)
|
||||||
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> InstancedRenderDispatcher.enqueueUpdate(this));
|
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> InstancedRenderDispatcher.enqueueUpdate(this));
|
||||||
}
|
}
|
||||||
|
|
|
@ -581,7 +581,7 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity implements IHave
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
boolean wasConnectedLeft = connectedLeft;
|
boolean wasConnectedLeft = connectedLeft;
|
||||||
boolean wasConnectedRight = connectedRight;
|
boolean wasConnectedRight = connectedRight;
|
||||||
|
|
||||||
|
@ -603,7 +603,7 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity implements IHave
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
|
|
||||||
if (!clientPacket)
|
if (!clientPacket)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -520,14 +520,14 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
ItemStack previousItem = item;
|
ItemStack previousItem = item;
|
||||||
item = ItemStack.of(compound.getCompound("Item"));
|
item = ItemStack.of(compound.getCompound("Item"));
|
||||||
itemPosition.lastValue = itemPosition.value = compound.getFloat("ItemPosition");
|
itemPosition.lastValue = itemPosition.value = compound.getFloat("ItemPosition");
|
||||||
pull = compound.getFloat("Pull");
|
pull = compound.getFloat("Pull");
|
||||||
push = compound.getFloat("Push");
|
push = compound.getFloat("Push");
|
||||||
bottomPullDistance = compound.getFloat("BottomAirFlowDistance");
|
bottomPullDistance = compound.getFloat("BottomAirFlowDistance");
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
// if (clientPacket)
|
// if (clientPacket)
|
||||||
// airCurrent.rebuild();
|
// airCurrent.rebuild();
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.simibubi.create.content.logistics.block.depot;
|
package com.simibubi.create.content.logistics.block.depot;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
|
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
||||||
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
||||||
import com.simibubi.create.AllBlockPartials;
|
import com.simibubi.create.AllBlockPartials;
|
||||||
import com.simibubi.create.content.contraptions.relays.encased.ShaftInstance;
|
import com.simibubi.create.content.contraptions.relays.encased.ShaftInstance;
|
||||||
|
|
|
@ -518,8 +518,8 @@ public class EjectorTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
int horizontalDistance = compound.getInt("HorizontalDistance");
|
int horizontalDistance = compound.getInt("HorizontalDistance");
|
||||||
int verticalDistance = compound.getInt("VerticalDistance");
|
int verticalDistance = compound.getInt("VerticalDistance");
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package com.simibubi.create.content.logistics.block.diodes;
|
package com.simibubi.create.content.logistics.block.diodes;
|
||||||
|
|
||||||
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
import com.jozufozu.flywheel.api.instance.ITickableInstance;
|
import com.jozufozu.flywheel.api.instance.ITickableInstance;
|
||||||
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
|
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
|
||||||
import com.jozufozu.flywheel.core.Materials;
|
import com.jozufozu.flywheel.core.Materials;
|
||||||
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
||||||
import com.simibubi.create.AllBlockPartials;
|
import com.simibubi.create.AllBlockPartials;
|
||||||
|
|
|
@ -66,9 +66,9 @@ public abstract class BrassDiodeTileEntity extends SmartTileEntity implements Fl
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
state = compound.getInt("State");
|
state = compound.getInt("State");
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package com.simibubi.create.content.logistics.block.flap;
|
package com.simibubi.create.content.logistics.block.flap;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.backend.gl.attrib.VertexFormat;
|
|
||||||
import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer;
|
|
||||||
import com.jozufozu.flywheel.api.struct.Batched;
|
import com.jozufozu.flywheel.api.struct.Batched;
|
||||||
import com.jozufozu.flywheel.api.struct.BatchingTransformer;
|
import com.jozufozu.flywheel.api.struct.BatchingTransformer;
|
||||||
import com.jozufozu.flywheel.api.struct.StructWriter;
|
|
||||||
import com.jozufozu.flywheel.api.struct.Instanced;
|
import com.jozufozu.flywheel.api.struct.Instanced;
|
||||||
|
import com.jozufozu.flywheel.api.struct.StructWriter;
|
||||||
|
import com.jozufozu.flywheel.backend.gl.attrib.VertexFormat;
|
||||||
|
import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer;
|
||||||
import com.jozufozu.flywheel.core.model.Model;
|
import com.jozufozu.flywheel.core.model.Model;
|
||||||
import com.simibubi.create.foundation.render.AllInstanceFormats;
|
import com.simibubi.create.foundation.render.AllInstanceFormats;
|
||||||
import com.simibubi.create.foundation.render.AllProgramSpecs;
|
import com.simibubi.create.foundation.render.AllProgramSpecs;
|
||||||
|
|
|
@ -2,8 +2,8 @@ package com.simibubi.create.content.logistics.block.flap;
|
||||||
|
|
||||||
import org.lwjgl.system.MemoryUtil;
|
import org.lwjgl.system.MemoryUtil;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer;
|
|
||||||
import com.jozufozu.flywheel.api.struct.StructType;
|
import com.jozufozu.flywheel.api.struct.StructType;
|
||||||
|
import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer;
|
||||||
import com.jozufozu.flywheel.backend.struct.UnsafeBufferWriter;
|
import com.jozufozu.flywheel.backend.struct.UnsafeBufferWriter;
|
||||||
|
|
||||||
public class UnsafeFlapWriter extends UnsafeBufferWriter<FlapData> {
|
public class UnsafeFlapWriter extends UnsafeBufferWriter<FlapData> {
|
||||||
|
|
|
@ -2,11 +2,11 @@ package com.simibubi.create.content.logistics.block.funnel;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
|
||||||
import com.jozufozu.flywheel.api.InstanceData;
|
import com.jozufozu.flywheel.api.InstanceData;
|
||||||
import com.jozufozu.flywheel.api.Instancer;
|
import com.jozufozu.flywheel.api.Instancer;
|
||||||
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
|
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
|
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
||||||
|
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
|
||||||
import com.jozufozu.flywheel.core.PartialModel;
|
import com.jozufozu.flywheel.core.PartialModel;
|
||||||
import com.simibubi.create.AllBlockPartials;
|
import com.simibubi.create.AllBlockPartials;
|
||||||
import com.simibubi.create.content.logistics.block.flap.FlapData;
|
import com.simibubi.create.content.logistics.block.flap.FlapData;
|
||||||
|
|
|
@ -323,8 +323,8 @@ public class FunnelTileEntity extends SmartTileEntity implements IHaveHoveringIn
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
extractionCooldown = compound.getInt("TransferCooldown");
|
extractionCooldown = compound.getInt("TransferCooldown");
|
||||||
|
|
||||||
if (clientPacket)
|
if (clientPacket)
|
||||||
|
|
|
@ -3,11 +3,11 @@ package com.simibubi.create.content.logistics.block.mechanicalArm;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
|
||||||
import com.jozufozu.flywheel.api.InstanceData;
|
import com.jozufozu.flywheel.api.InstanceData;
|
||||||
import com.jozufozu.flywheel.api.Instancer;
|
import com.jozufozu.flywheel.api.Instancer;
|
||||||
import com.jozufozu.flywheel.api.Material;
|
import com.jozufozu.flywheel.api.Material;
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
|
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
||||||
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
||||||
import com.jozufozu.flywheel.util.transform.TransformStack;
|
import com.jozufozu.flywheel.util.transform.TransformStack;
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
|
|
@ -467,12 +467,12 @@ public class ArmTileEntity extends KineticTileEntity implements ITransformableTE
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
int previousIndex = chasedPointIndex;
|
int previousIndex = chasedPointIndex;
|
||||||
Phase previousPhase = phase;
|
Phase previousPhase = phase;
|
||||||
ListTag interactionPointTagBefore = interactionPointTag;
|
ListTag interactionPointTagBefore = interactionPointTag;
|
||||||
|
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
heldItem = ItemStack.of(compound.getCompound("HeldItem"));
|
heldItem = ItemStack.of(compound.getCompound("HeldItem"));
|
||||||
phase = NBTHelper.readEnum(compound, "Phase", Phase.class);
|
phase = NBTHelper.readEnum(compound, "Phase", Phase.class);
|
||||||
chasedPointIndex = compound.getInt("TargetPointIndex");
|
chasedPointIndex = compound.getInt("TargetPointIndex");
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package com.simibubi.create.content.logistics.block.redstone;
|
package com.simibubi.create.content.logistics.block.redstone;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
|
||||||
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
|
|
||||||
import com.jozufozu.flywheel.api.Material;
|
import com.jozufozu.flywheel.api.Material;
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
|
import com.jozufozu.flywheel.api.instance.IDynamicInstance;
|
||||||
|
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
|
||||||
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
||||||
import com.jozufozu.flywheel.util.transform.Rotate;
|
import com.jozufozu.flywheel.util.transform.Rotate;
|
||||||
import com.jozufozu.flywheel.util.transform.Translate;
|
import com.jozufozu.flywheel.util.transform.Translate;
|
||||||
|
|
|
@ -34,11 +34,11 @@ public class AnalogLeverTileEntity extends SmartTileEntity implements IHaveGoggl
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
state = compound.getInt("State");
|
state = compound.getInt("State");
|
||||||
lastChange = compound.getInt("ChangeTimer");
|
lastChange = compound.getInt("ChangeTimer");
|
||||||
clientState.target(state);
|
clientState.target(state);
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -128,8 +128,8 @@ public class ContentObserverTileEntity extends SmartTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag compound, boolean clientPacket) {
|
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.read(compound, clientPacket);
|
||||||
turnOffTicks = compound.getInt("TurnOff");
|
turnOffTicks = compound.getInt("TurnOff");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -114,8 +114,8 @@ public class NixieTubeTileEntity extends SmartTileEntity {
|
||||||
//
|
//
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fromTag(CompoundTag nbt, boolean clientPacket) {
|
protected void read(CompoundTag nbt, boolean clientPacket) {
|
||||||
super.fromTag(nbt, clientPacket);
|
super.read(nbt, clientPacket);
|
||||||
|
|
||||||
if (nbt.contains("RawCustomText", Tag.TAG_STRING)) {
|
if (nbt.contains("RawCustomText", Tag.TAG_STRING)) {
|
||||||
rawCustomText = getJsonFromString(nbt.getString("RawCustomText"));
|
rawCustomText = getJsonFromString(nbt.getString("RawCustomText"));
|
||||||
|
@ -164,7 +164,7 @@ public class NixieTubeTileEntity extends SmartTileEntity {
|
||||||
|
|
||||||
private JsonElement getJsonFromString(String string) {
|
private JsonElement getJsonFromString(String string) {
|
||||||
try {
|
try {
|
||||||
return new JsonParser().parse(string);
|
return JsonParser.parseString(string);
|
||||||
} catch (JsonParseException e) {
|
} catch (JsonParseException e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue