made another port attempt, SPTiles.java is screwing me over real hard rn.
This commit is contained in:
parent
432430bf23
commit
74b14a3a58
15
build.gradle
15
build.gradle
|
@ -18,12 +18,13 @@ apply plugin: 'net.minecraftforge.gradle'
|
|||
apply plugin: 'org.spongepowered.mixin'
|
||||
apply plugin: 'maven-publish'
|
||||
apply plugin: 'idea'
|
||||
apply from: 'https://raw.githubusercontent.com/SizableShrimp/Forge-Class-Remapper/main/classremapper.gradle'
|
||||
|
||||
group = 'com.teammoeg'
|
||||
version = "${minecraft_version}-${mod_version}"
|
||||
archivesBaseName = 'steampowered'
|
||||
|
||||
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
|
||||
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
||||
|
||||
minecraft {
|
||||
mappings channel: 'official', version: "${minecraft_version}"
|
||||
|
@ -110,13 +111,13 @@ repositories {
|
|||
dependencies {
|
||||
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
||||
|
||||
implementation fg.deobf("curse.maven:create-328085:3499718")
|
||||
implementation fg.deobf("curse.maven:flywheel-486392:3459739")
|
||||
implementation fg.deobf("curse.maven:immersive-engineering-231951:3377691")
|
||||
implementation fg.deobf("curse.maven:create-alloyed-564792:3602444")
|
||||
implementation fg.deobf("curse.maven:create-328085:3623348")
|
||||
implementation fg.deobf("curse.maven:flywheel-486392:3623314")
|
||||
//implementation fg.deobf("curse.maven:immersive-engineering-231951:3377691")
|
||||
//implementation fg.deobf("curse.maven:create-alloyed-564792:3602444")
|
||||
|
||||
compileOnly fg.deobf("mezz.jei:jei-1.16.5:7.6.4.88:api")
|
||||
runtimeOnly fg.deobf("mezz.jei:jei-1.16.5:7.6.4.88")
|
||||
//compileOnly fg.deobf("mezz.jei:jei-1.16.5:7.6.4.88:api")
|
||||
//runtimeOnly fg.deobf("mezz.jei:jei-1.16.5:7.6.4.88")
|
||||
|
||||
// FG5 requires 0.8.3
|
||||
annotationProcessor "org.spongepowered:mixin:0.8.3:processor"
|
||||
|
|
|
@ -4,9 +4,9 @@ org.gradle.jvmargs=-Xmx3G
|
|||
org.gradle.daemon=false
|
||||
|
||||
# mod version info
|
||||
mod_version = 1.1.14
|
||||
minecraft_version = 1.16.5
|
||||
forge_version = 36.2.2
|
||||
mod_version = 1.1.15
|
||||
minecraft_version = 1.18.1
|
||||
forge_version = 39.0.64
|
||||
|
||||
# build dependency versions
|
||||
forgegradle_version = 5.1.+
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
package com.teammoeg.steampowered;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
||||
|
|
|
@ -18,15 +18,16 @@
|
|||
|
||||
package com.teammoeg.steampowered;
|
||||
|
||||
import net.minecraft.fluid.FlowingFluid;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.level.material.FlowingFluid;
|
||||
import net.minecraft.world.level.material.Fluid;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraftforge.fluids.FluidAttributes;
|
||||
import net.minecraftforge.fluids.ForgeFlowingFluid;
|
||||
import net.minecraftforge.fml.RegistryObject;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
public class FluidRegistry {
|
||||
public static final ResourceLocation STILL_STEAM_TEXTURE = new ResourceLocation(SteamPowered.MODID, "block/steam");
|
||||
public static final ResourceLocation FLOWING_STEAM_TEXTURE = new ResourceLocation(SteamPowered.MODID, "block/steam");
|
||||
|
|
|
@ -18,11 +18,12 @@
|
|||
|
||||
package com.teammoeg.steampowered;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.fml.RegistryObject;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
public class ItemRegistry {
|
||||
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, SteamPowered.MODID);
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import com.simibubi.create.foundation.block.BlockStressDefaults;
|
|||
import com.simibubi.create.foundation.block.BlockStressValues.IStressValueProvider;
|
||||
import com.teammoeg.steampowered.content.alternator.DynamoBlock;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
|
||||
public class SPStress implements IStressValueProvider {
|
||||
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
|
||||
package com.teammoeg.steampowered;
|
||||
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.world.level.material.Fluid;
|
||||
import net.minecraft.tags.FluidTags;
|
||||
import net.minecraft.tags.ITag;
|
||||
import net.minecraft.tags.Tag;
|
||||
|
||||
public class SPTags {
|
||||
|
||||
|
@ -28,9 +28,9 @@ public class SPTags {
|
|||
|
||||
}
|
||||
|
||||
public static final ITag.INamedTag<Fluid> STEAM = forgeTag("steam");
|
||||
public static final Tag.Named<Fluid> STEAM = forgeTag("steam");
|
||||
|
||||
private static ITag.INamedTag<Fluid> forgeTag(String name) {
|
||||
private static Tag.Named<Fluid> forgeTag(String name) {
|
||||
return FluidTags.bind("forge:" + name);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,9 +33,9 @@ import com.teammoeg.steampowered.registrate.SPBlocks;
|
|||
import com.teammoeg.steampowered.registrate.SPItems;
|
||||
import com.teammoeg.steampowered.registrate.SPTiles;
|
||||
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.item.CreativeModeTab;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
|
@ -56,7 +56,7 @@ public class SteamPowered {
|
|||
return new ResourceLocation(MODID, path);
|
||||
}
|
||||
|
||||
public static final ItemGroup itemGroup = new ItemGroup(MODID) {
|
||||
public static final CreativeModeTab itemGroup = new CreativeModeTab(MODID) {
|
||||
@Override
|
||||
@Nonnull
|
||||
public ItemStack makeIcon() {
|
||||
|
|
|
@ -20,7 +20,7 @@ package com.teammoeg.steampowered.block;
|
|||
|
||||
import com.jozufozu.flywheel.core.PartialModel;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
public class SPBlockPartials {
|
||||
public static final PartialModel BRONZE_FLYWHEEL = get("bronze_flywheel/wheel");
|
||||
|
|
|
@ -18,18 +18,16 @@
|
|||
|
||||
package com.teammoeg.steampowered.block;
|
||||
|
||||
import static net.minecraft.util.Direction.UP;
|
||||
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
import com.simibubi.create.foundation.utility.VoxelShaper;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction.Axis;
|
||||
import net.minecraft.util.math.shapes.IBooleanFunction;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.core.Direction.Axis;
|
||||
import net.minecraft.world.phys.shapes.BooleanOp;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.Shapes;
|
||||
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
public class SPShapes {
|
||||
|
||||
|
@ -55,7 +53,7 @@ public class SPShapes {
|
|||
}
|
||||
|
||||
public Builder add(VoxelShape shape) {
|
||||
this.shape = VoxelShapes.or(this.shape, shape);
|
||||
this.shape = Shapes.or(this.shape, shape);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -65,7 +63,7 @@ public class SPShapes {
|
|||
|
||||
public Builder erase(double x1, double y1, double z1, double x2, double y2, double z2) {
|
||||
this.shape =
|
||||
VoxelShapes.join(shape, cuboid(x1, y1, z1, x2, y2, z2), IBooleanFunction.ONLY_FIRST);
|
||||
Shapes.join(shape, cuboid(x1, y1, z1, x2, y2, z2), BooleanOp.ONLY_FIRST);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -98,7 +96,7 @@ public class SPShapes {
|
|||
}
|
||||
|
||||
public VoxelShaper forDirectional() {
|
||||
return forDirectional(UP);
|
||||
return forDirectional(Direction.UP);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,8 +21,8 @@ package com.teammoeg.steampowered.client;
|
|||
import com.simibubi.create.AllItems;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.inventory.EquipmentSlotType;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.entity.EquipmentSlot;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
|
@ -32,10 +32,10 @@ public class ClientUtils {
|
|||
return Minecraft.getInstance();
|
||||
}
|
||||
|
||||
public static World getClientWorld() {
|
||||
public static Level getClientWorld() {
|
||||
return mc().level;
|
||||
}
|
||||
public static boolean hasGoggles() {
|
||||
return AllItems.GOGGLES.isIn(mc().player.getItemBySlot(EquipmentSlotType.HEAD));
|
||||
return AllItems.GOGGLES.isIn(mc().player.getItemBySlot(EquipmentSlot.HEAD));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,34 +18,34 @@
|
|||
|
||||
package com.teammoeg.steampowered.client;
|
||||
|
||||
import com.mojang.blaze3d.vertex.IVertexBuilder;
|
||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||
|
||||
import net.minecraft.client.particle.IParticleRenderType;
|
||||
import net.minecraft.client.particle.SpriteTexturedParticle;
|
||||
import net.minecraft.client.renderer.ActiveRenderInfo;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.client.particle.ParticleRenderType;
|
||||
import net.minecraft.client.particle.TextureSheetParticle;
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.util.Mth;
|
||||
|
||||
public class ParticleBase extends SpriteTexturedParticle {
|
||||
public class ParticleBase extends TextureSheetParticle {
|
||||
protected float originalScale = 1.3F;
|
||||
|
||||
protected ParticleBase(ClientWorld world, double x, double y, double z) {
|
||||
protected ParticleBase(ClientLevel world, double x, double y, double z) {
|
||||
super(world, x, y, z);
|
||||
}
|
||||
|
||||
public ParticleBase(ClientWorld world, double x, double y, double z, double motionX, double motionY, double motionZ) {
|
||||
public ParticleBase(ClientLevel world, double x, double y, double z, double motionX, double motionY, double motionZ) {
|
||||
super(world, x, y, z, motionX, motionY, motionZ);
|
||||
}
|
||||
|
||||
public IParticleRenderType getRenderType() {
|
||||
return IParticleRenderType.PARTICLE_SHEET_TRANSLUCENT;
|
||||
public ParticleRenderType getRenderType() {
|
||||
return ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(IVertexBuilder worldRendererIn, ActiveRenderInfo entityIn, float pt) {
|
||||
public void render(VertexConsumer worldRendererIn, Camera entityIn, float pt) {
|
||||
float age = (this.age + pt) / lifetime * 32.0F;
|
||||
|
||||
age = MathHelper.clamp(age, 0.0F, 1.0F);
|
||||
age = Mth.clamp(age, 0.0F, 1.0F);
|
||||
|
||||
super.quadSize = originalScale * age;
|
||||
super.render(worldRendererIn, entityIn, pt);
|
||||
|
|
|
@ -20,14 +20,15 @@ package com.teammoeg.steampowered.client;
|
|||
|
||||
import com.teammoeg.steampowered.SteamPowered;
|
||||
|
||||
import net.minecraft.particles.BasicParticleType;
|
||||
import net.minecraft.particles.ParticleType;
|
||||
import net.minecraftforge.fml.RegistryObject;
|
||||
import net.minecraft.core.particles.SimpleParticleType;
|
||||
import net.minecraft.core.particles.ParticleType;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
public class Particles {
|
||||
public static final DeferredRegister<ParticleType<?>> REGISTER = DeferredRegister.create(ForgeRegistries.PARTICLE_TYPES, SteamPowered.MODID);
|
||||
|
||||
public static final RegistryObject<BasicParticleType> STEAM = REGISTER.register("steam", () -> new BasicParticleType(false));
|
||||
public static final RegistryObject<SimpleParticleType> STEAM = REGISTER.register("steam", () -> new SimpleParticleType(false));
|
||||
}
|
||||
|
|
|
@ -18,15 +18,15 @@
|
|||
|
||||
package com.teammoeg.steampowered.client;
|
||||
|
||||
import net.minecraft.client.particle.IAnimatedSprite;
|
||||
import net.minecraft.client.particle.IParticleFactory;
|
||||
import net.minecraft.client.particle.SpriteSet;
|
||||
import net.minecraft.client.particle.ParticleProvider;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.particles.BasicParticleType;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.core.particles.SimpleParticleType;
|
||||
|
||||
public class SteamParticle extends ParticleBase {
|
||||
|
||||
public SteamParticle(ClientWorld world, double x, double y, double z, double motionX, double motionY, double motionZ) {
|
||||
public SteamParticle(ClientLevel world, double x, double y, double z, double motionX, double motionY, double motionZ) {
|
||||
super(world, x, y, z, motionX, motionY, motionZ);
|
||||
this.gravity = -0.1F;
|
||||
this.rCol = this.gCol = this.bCol = (float) (Math.random() * 0.4) + 0.4f;
|
||||
|
@ -34,15 +34,15 @@ public class SteamParticle extends ParticleBase {
|
|||
this.lifetime= (int) (12.0D / (Math.random() * 0.8D + 0.2D));
|
||||
}
|
||||
|
||||
public static class Factory implements IParticleFactory<BasicParticleType> {
|
||||
private final IAnimatedSprite spriteSet;
|
||||
public static class Factory implements ParticleProvider<SimpleParticleType> {
|
||||
private final SpriteSet spriteSet;
|
||||
|
||||
public Factory(IAnimatedSprite spriteSet) {
|
||||
public Factory(SpriteSet spriteSet) {
|
||||
this.spriteSet = spriteSet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Particle createParticle(BasicParticleType typeIn, ClientWorld worldIn, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) {
|
||||
public Particle createParticle(SimpleParticleType typeIn, ClientLevel worldIn, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) {
|
||||
SteamParticle steamParticle = new SteamParticle(worldIn, x, y, z, xSpeed, ySpeed, zSpeed);
|
||||
steamParticle.pickSprite(this.spriteSet);
|
||||
return steamParticle;
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.teammoeg.steampowered.registrate.SPBlocks;
|
|||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.client.renderer.RenderTypeLookup;
|
||||
import net.minecraft.client.renderer.ItemBlockRenderTypes;
|
||||
import net.minecraftforge.client.event.ParticleFactoryRegisterEvent;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
||||
|
@ -46,9 +46,9 @@ public class SteamPoweredClient {
|
|||
}
|
||||
public static void setupRenderType(FMLClientSetupEvent event) {
|
||||
event.enqueueWork(() -> {
|
||||
RenderTypeLookup.setRenderLayer(FluidRegistry.steam.get(), RenderType.translucent());
|
||||
RenderTypeLookup.setRenderLayer(FluidRegistry.steamFlowing.get(), RenderType.translucent());
|
||||
RenderTypeLookup.setRenderLayer(SPBlocks.DYNAMO.get(), RenderType.cutoutMipped());
|
||||
ItemBlockRenderTypes.setRenderLayer(FluidRegistry.steam.get(), RenderType.translucent());
|
||||
ItemBlockRenderTypes.setRenderLayer(FluidRegistry.steamFlowing.get(), RenderType.translucent());
|
||||
ItemBlockRenderTypes.setRenderLayer(SPBlocks.DYNAMO.get(), RenderType.cutoutMipped());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,34 +18,39 @@
|
|||
|
||||
package com.teammoeg.steampowered.client.instance;
|
||||
|
||||
import static net.minecraft.state.properties.BlockStateProperties.HORIZONTAL_FACING;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.jozufozu.flywheel.api.InstanceData;
|
||||
import com.jozufozu.flywheel.api.Instancer;
|
||||
import com.jozufozu.flywheel.api.MaterialManager;
|
||||
import com.jozufozu.flywheel.backend.instancing.IDynamicInstance;
|
||||
import com.jozufozu.flywheel.backend.instancing.InstanceData;
|
||||
import com.jozufozu.flywheel.backend.instancing.Instancer;
|
||||
import com.jozufozu.flywheel.backend.material.InstanceMaterial;
|
||||
import com.jozufozu.flywheel.backend.material.MaterialManager;
|
||||
import com.jozufozu.flywheel.core.materials.ModelData;
|
||||
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
||||
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileInstance;
|
||||
import com.simibubi.create.content.contraptions.base.RotatingData;
|
||||
import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
|
||||
import com.simibubi.create.content.contraptions.components.flywheel.FlywheelBlock;
|
||||
import com.simibubi.create.content.contraptions.components.flywheel.FlywheelTileEntity;
|
||||
import com.simibubi.create.foundation.utility.AngleHelper;
|
||||
import com.simibubi.create.foundation.utility.AnimationTickHolder;
|
||||
import com.teammoeg.steampowered.block.SPBlockPartials;
|
||||
import com.teammoeg.steampowered.mixin.FlywheelTileEntityAccess;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.level.block.Rotation;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static com.simibubi.create.content.contraptions.base.HorizontalKineticBlock.HORIZONTAL_FACING;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Rotation;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
public class BronzeFlywheelInstance extends KineticTileInstance<FlywheelTileEntity> implements IDynamicInstance {
|
||||
protected final Direction facing;
|
||||
|
@ -101,7 +106,7 @@ public class BronzeFlywheelInstance extends KineticTileInstance<FlywheelTileEnti
|
|||
animate(access.getAngle());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public void beginFrame() {
|
||||
|
||||
float partialTicks = AnimationTickHolder.getPartialTicks();
|
||||
|
@ -119,7 +124,7 @@ public class BronzeFlywheelInstance extends KineticTileInstance<FlywheelTileEnti
|
|||
}
|
||||
|
||||
private void animate(float angle) {
|
||||
MatrixStack ms = new MatrixStack();
|
||||
PoseStack ms = new PoseStack();
|
||||
MatrixTransformStack msr = MatrixTransformStack.of(ms);
|
||||
|
||||
msr.translate(getInstancePosition());
|
||||
|
@ -192,14 +197,14 @@ public class BronzeFlywheelInstance extends KineticTileInstance<FlywheelTileEnti
|
|||
float shift = upper ? 1 / 4f : -1 / 8f;
|
||||
float offset = upper ? 1 / 4f : 1 / 4f;
|
||||
float radians = (float) (angle / 180 * Math.PI);
|
||||
float shifting = MathHelper.sin(radians) * shift + offset;
|
||||
float shifting = Mth.sin(radians) * shift + offset;
|
||||
|
||||
float maxAngle = upper ? -5 : -15;
|
||||
float minAngle = upper ? -45 : 5;
|
||||
float barAngle = 0;
|
||||
|
||||
if (rotating)
|
||||
barAngle = MathHelper.lerp((MathHelper.sin((float) (radians + Math.PI / 2)) + 1) / 2, minAngle, maxAngle);
|
||||
barAngle = Mth.lerp((Mth.sin((float) (radians + Math.PI / 2)) + 1) / 2, minAngle, maxAngle);
|
||||
|
||||
float pivotX = (upper ? 8f : 3f) / 16;
|
||||
float pivotY = (upper ? 8f : 2f) / 16;
|
||||
|
|
|
@ -18,34 +18,38 @@
|
|||
|
||||
package com.teammoeg.steampowered.client.instance;
|
||||
|
||||
import static net.minecraft.state.properties.BlockStateProperties.HORIZONTAL_FACING;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.jozufozu.flywheel.api.InstanceData;
|
||||
import com.jozufozu.flywheel.api.Instancer;
|
||||
import com.jozufozu.flywheel.api.MaterialManager;
|
||||
import com.jozufozu.flywheel.backend.instancing.IDynamicInstance;
|
||||
import com.jozufozu.flywheel.backend.instancing.InstanceData;
|
||||
import com.jozufozu.flywheel.backend.instancing.Instancer;
|
||||
import com.jozufozu.flywheel.backend.material.InstanceMaterial;
|
||||
import com.jozufozu.flywheel.backend.material.MaterialManager;
|
||||
import com.jozufozu.flywheel.core.materials.ModelData;
|
||||
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
||||
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileInstance;
|
||||
import com.simibubi.create.content.contraptions.base.RotatingData;
|
||||
import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
|
||||
import com.simibubi.create.content.contraptions.components.flywheel.FlywheelBlock;
|
||||
import com.simibubi.create.content.contraptions.components.flywheel.FlywheelTileEntity;
|
||||
import com.simibubi.create.foundation.utility.AngleHelper;
|
||||
import com.simibubi.create.foundation.utility.AnimationTickHolder;
|
||||
import com.teammoeg.steampowered.block.SPBlockPartials;
|
||||
import com.teammoeg.steampowered.mixin.FlywheelTileEntityAccess;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.level.block.Rotation;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static com.simibubi.create.content.logistics.block.funnel.AbstractHorizontalFunnelBlock.HORIZONTAL_FACING;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Rotation;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
public class CastIronFlywheelInstance extends KineticTileInstance<FlywheelTileEntity> implements IDynamicInstance {
|
||||
protected final Direction facing;
|
||||
|
@ -66,7 +70,7 @@ public class CastIronFlywheelInstance extends KineticTileInstance<FlywheelTileEn
|
|||
|
||||
protected float lastAngle = Float.NaN;
|
||||
|
||||
public CastIronFlywheelInstance(MaterialManager<?> modelManager, FlywheelTileEntity tile) {
|
||||
public CastIronFlywheelInstance(MaterialManager modelManager, FlywheelTileEntity tile) {
|
||||
super(modelManager, tile);
|
||||
|
||||
facing = blockState.getValue(HORIZONTAL_FACING);
|
||||
|
@ -119,7 +123,7 @@ public class CastIronFlywheelInstance extends KineticTileInstance<FlywheelTileEn
|
|||
}
|
||||
|
||||
private void animate(float angle) {
|
||||
MatrixStack ms = new MatrixStack();
|
||||
PoseStack ms = new PoseStack();
|
||||
MatrixTransformStack msr = MatrixTransformStack.of(ms);
|
||||
|
||||
msr.translate(getInstancePosition());
|
||||
|
@ -192,14 +196,14 @@ public class CastIronFlywheelInstance extends KineticTileInstance<FlywheelTileEn
|
|||
float shift = upper ? 1 / 4f : -1 / 8f;
|
||||
float offset = upper ? 1 / 4f : 1 / 4f;
|
||||
float radians = (float) (angle / 180 * Math.PI);
|
||||
float shifting = MathHelper.sin(radians) * shift + offset;
|
||||
float shifting = Mth.sin(radians) * shift + offset;
|
||||
|
||||
float maxAngle = upper ? -5 : -15;
|
||||
float minAngle = upper ? -45 : 5;
|
||||
float barAngle = 0;
|
||||
|
||||
if (rotating)
|
||||
barAngle = MathHelper.lerp((MathHelper.sin((float) (radians + Math.PI / 2)) + 1) / 2, minAngle, maxAngle);
|
||||
barAngle = Mth.lerp((Mth.sin((float) (radians + Math.PI / 2)) + 1) / 2, minAngle, maxAngle);
|
||||
|
||||
float pivotX = (upper ? 8f : 3f) / 16;
|
||||
float pivotY = (upper ? 8f : 2f) / 16;
|
||||
|
|
|
@ -18,34 +18,32 @@
|
|||
|
||||
package com.teammoeg.steampowered.client.instance;
|
||||
|
||||
import static net.minecraft.state.properties.BlockStateProperties.HORIZONTAL_FACING;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.jozufozu.flywheel.backend.instancing.IDynamicInstance;
|
||||
import com.jozufozu.flywheel.backend.instancing.InstanceData;
|
||||
import com.jozufozu.flywheel.backend.instancing.Instancer;
|
||||
import com.jozufozu.flywheel.backend.material.InstanceMaterial;
|
||||
import com.jozufozu.flywheel.backend.material.MaterialManager;
|
||||
import com.jozufozu.flywheel.core.materials.ModelData;
|
||||
import com.jozufozu.flywheel.api.InstanceData;
|
||||
import com.jozufozu.flywheel.api.Instancer;
|
||||
import com.jozufozu.flywheel.api.MaterialManager;
|
||||
import com.jozufozu.flywheel.core.materials.model.ModelData;
|
||||
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileInstance;
|
||||
import com.simibubi.create.content.contraptions.base.RotatingData;
|
||||
import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
|
||||
import com.simibubi.create.content.contraptions.components.flywheel.FlywheelBlock;
|
||||
import com.simibubi.create.content.contraptions.components.flywheel.FlywheelTileEntity;
|
||||
import com.simibubi.create.foundation.utility.AngleHelper;
|
||||
import com.simibubi.create.foundation.utility.AnimationTickHolder;
|
||||
import com.teammoeg.steampowered.block.SPBlockPartials;
|
||||
import com.teammoeg.steampowered.mixin.FlywheelTileEntityAccess;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.level.block.Rotation;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static com.simibubi.create.content.contraptions.base.HorizontalKineticBlock.HORIZONTAL_FACING;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Rotation;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
public class SteelFlywheelInstance extends KineticTileInstance<FlywheelTileEntity> implements IDynamicInstance {
|
||||
protected final Direction facing;
|
||||
|
@ -119,7 +117,7 @@ public class SteelFlywheelInstance extends KineticTileInstance<FlywheelTileEntit
|
|||
}
|
||||
|
||||
private void animate(float angle) {
|
||||
MatrixStack ms = new MatrixStack();
|
||||
PoseStack ms = new PoseStack();
|
||||
MatrixTransformStack msr = MatrixTransformStack.of(ms);
|
||||
|
||||
msr.translate(getInstancePosition());
|
||||
|
@ -192,14 +190,14 @@ public class SteelFlywheelInstance extends KineticTileInstance<FlywheelTileEntit
|
|||
float shift = upper ? 1 / 4f : -1 / 8f;
|
||||
float offset = upper ? 1 / 4f : 1 / 4f;
|
||||
float radians = (float) (angle / 180 * Math.PI);
|
||||
float shifting = MathHelper.sin(radians) * shift + offset;
|
||||
float shifting = Mth.sin(radians) * shift + offset;
|
||||
|
||||
float maxAngle = upper ? -5 : -15;
|
||||
float minAngle = upper ? -45 : 5;
|
||||
float barAngle = 0;
|
||||
|
||||
if (rotating)
|
||||
barAngle = MathHelper.lerp((MathHelper.sin((float) (radians + Math.PI / 2)) + 1) / 2, minAngle, maxAngle);
|
||||
barAngle = Mth.lerp((Mth.sin((float) (radians + Math.PI / 2)) + 1) / 2, minAngle, maxAngle);
|
||||
|
||||
float pivotX = (upper ? 8f : 3f) / 16;
|
||||
float pivotY = (upper ? 8f : 2f) / 16;
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
package com.teammoeg.steampowered.client.render;
|
||||
|
||||
import com.jozufozu.flywheel.backend.Backend;
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.vertex.IVertexBuilder;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.content.contraptions.base.HorizontalKineticBlock;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||
|
@ -33,22 +33,22 @@ import com.simibubi.create.foundation.utility.AngleHelper;
|
|||
import com.teammoeg.steampowered.block.SPBlockPartials;
|
||||
import com.teammoeg.steampowered.mixin.FlywheelTileEntityAccess;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.client.renderer.MultiBufferSource;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Rotation;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.client.renderer.LevelRenderer;
|
||||
import net.minecraft.client.renderer.blockentity.BlockEntityRenderDispatcher;
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.level.block.Rotation;
|
||||
import net.minecraft.util.Mth;
|
||||
|
||||
public class BronzeFlywheelRenderer extends KineticTileEntityRenderer {
|
||||
public BronzeFlywheelRenderer(TileEntityRendererDispatcher dispatcher) {
|
||||
public BronzeFlywheelRenderer(BlockEntityRenderDispatcher dispatcher) {
|
||||
super(dispatcher);
|
||||
}
|
||||
|
||||
protected void renderSafe(KineticTileEntity te, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffer, int light, int overlay) {
|
||||
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light, int overlay) {
|
||||
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
||||
if (!Backend.getInstance().canUseInstancing(te.getLevel())) {
|
||||
BlockState blockState = te.getBlockState();
|
||||
|
@ -58,10 +58,10 @@ public class BronzeFlywheelRenderer extends KineticTileEntityRenderer {
|
|||
float speed = access.getVisualSpeed().get(partialTicks) * 3.0F / 10.0F;
|
||||
float angle = access.getAngle() + speed * partialTicks;
|
||||
// Mixin ends
|
||||
IVertexBuilder vb = buffer.getBuffer(RenderType.solid());
|
||||
VertexConsumer vb = buffer.getBuffer(RenderType.solid());
|
||||
if (FlywheelBlock.isConnected(blockState)) {
|
||||
Direction connection = FlywheelBlock.getConnection(blockState);
|
||||
light = WorldRenderer.getLightColor(te.getLevel(), blockState, te.getBlockPos().relative(connection));
|
||||
light = LevelRenderer.getLightColor(te.getLevel(), blockState, te.getBlockPos().relative(connection));
|
||||
float rotation = connection.getAxis() == Direction.Axis.X ^ connection.getAxisDirection() == Direction.AxisDirection.NEGATIVE ? -angle : angle;
|
||||
boolean flip = blockState.getValue(FlywheelBlock.CONNECTION) == FlywheelBlock.ConnectionState.LEFT;
|
||||
this.transformConnector(this.rotateToFacing(PartialBufferer.get(SPBlockPartials.BRONZE_FLYWHEEL_UPPER_ROTATING, blockState), connection), true, true, rotation, flip).light(light).renderInto(ms, vb);
|
||||
|
@ -74,7 +74,7 @@ public class BronzeFlywheelRenderer extends KineticTileEntityRenderer {
|
|||
}
|
||||
}
|
||||
|
||||
private void renderFlywheel(KineticTileEntity te, MatrixStack ms, int light, BlockState blockState, float angle, IVertexBuilder vb) {
|
||||
private void renderFlywheel(KineticTileEntity te, PoseStack ms, int light, BlockState blockState, float angle, VertexConsumer vb) {
|
||||
BlockState referenceState = blockState.rotate(Rotation.CLOCKWISE_90);
|
||||
Direction facing = (Direction) referenceState.getValue(BlockStateProperties.HORIZONTAL_FACING);
|
||||
SuperByteBuffer wheel = PartialBufferer.getFacing(SPBlockPartials.BRONZE_FLYWHEEL, referenceState, facing);
|
||||
|
@ -90,12 +90,12 @@ public class BronzeFlywheelRenderer extends KineticTileEntityRenderer {
|
|||
float shift = upper ? 0.25F : -0.125F;
|
||||
float offset = upper ? 0.25F : 0.25F;
|
||||
float radians = (float) ((double) (angle / 180.0F) * 3.141592653589793D);
|
||||
float shifting = MathHelper.sin(radians) * shift + offset;
|
||||
float shifting = Mth.sin(radians) * shift + offset;
|
||||
float maxAngle = upper ? -5.0F : -15.0F;
|
||||
float minAngle = upper ? -45.0F : 5.0F;
|
||||
float barAngle = 0.0F;
|
||||
if (rotating) {
|
||||
barAngle = MathHelper.lerp((MathHelper.sin((float) ((double) radians + 1.5707963267948966D)) + 1.0F) / 2.0F, minAngle, maxAngle);
|
||||
barAngle = Mth.lerp((Mth.sin((float) ((double) radians + 1.5707963267948966D)) + 1.0F) / 2.0F, minAngle, maxAngle);
|
||||
}
|
||||
|
||||
float pivotX = (upper ? 8.0F : 3.0F) / 16.0F;
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
package com.teammoeg.steampowered.client.render;
|
||||
|
||||
import com.jozufozu.flywheel.backend.Backend;
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.vertex.IVertexBuilder;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.content.contraptions.base.HorizontalKineticBlock;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||
|
@ -33,22 +33,22 @@ import com.simibubi.create.foundation.utility.AngleHelper;
|
|||
import com.teammoeg.steampowered.block.SPBlockPartials;
|
||||
import com.teammoeg.steampowered.mixin.FlywheelTileEntityAccess;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.client.renderer.MultiBufferSource;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Rotation;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.client.renderer.LevelRenderer;
|
||||
import net.minecraft.client.renderer.blockentity.BlockEntityRenderDispatcher;
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.level.block.Rotation;
|
||||
import net.minecraft.util.Mth;
|
||||
|
||||
public class CastIronFlywheelRenderer extends KineticTileEntityRenderer {
|
||||
public CastIronFlywheelRenderer(TileEntityRendererDispatcher dispatcher) {
|
||||
public CastIronFlywheelRenderer(BlockEntityRenderDispatcher dispatcher) {
|
||||
super(dispatcher);
|
||||
}
|
||||
|
||||
protected void renderSafe(KineticTileEntity te, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffer, int light, int overlay) {
|
||||
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light, int overlay) {
|
||||
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
||||
if (!Backend.getInstance().canUseInstancing(te.getLevel())) {
|
||||
BlockState blockState = te.getBlockState();
|
||||
|
@ -58,10 +58,10 @@ public class CastIronFlywheelRenderer extends KineticTileEntityRenderer {
|
|||
float speed = access.getVisualSpeed().get(partialTicks) * 3.0F / 10.0F;
|
||||
float angle = access.getAngle() + speed * partialTicks;
|
||||
// Mixin ends
|
||||
IVertexBuilder vb = buffer.getBuffer(RenderType.solid());
|
||||
VertexConsumer vb = buffer.getBuffer(RenderType.solid());
|
||||
if (FlywheelBlock.isConnected(blockState)) {
|
||||
Direction connection = FlywheelBlock.getConnection(blockState);
|
||||
light = WorldRenderer.getLightColor(te.getLevel(), blockState, te.getBlockPos().relative(connection));
|
||||
light = LevelRenderer.getLightColor(te.getLevel(), blockState, te.getBlockPos().relative(connection));
|
||||
float rotation = connection.getAxis() == Direction.Axis.X ^ connection.getAxisDirection() == Direction.AxisDirection.NEGATIVE ? -angle : angle;
|
||||
boolean flip = blockState.getValue(FlywheelBlock.CONNECTION) == FlywheelBlock.ConnectionState.LEFT;
|
||||
this.transformConnector(this.rotateToFacing(PartialBufferer.get(SPBlockPartials.CAST_IRON_FLYWHEEL_UPPER_ROTATING, blockState), connection), true, true, rotation, flip).light(light).renderInto(ms, vb);
|
||||
|
@ -74,7 +74,7 @@ public class CastIronFlywheelRenderer extends KineticTileEntityRenderer {
|
|||
}
|
||||
}
|
||||
|
||||
private void renderFlywheel(KineticTileEntity te, MatrixStack ms, int light, BlockState blockState, float angle, IVertexBuilder vb) {
|
||||
private void renderFlywheel(KineticTileEntity te, PoseStack ms, int light, BlockState blockState, float angle, VertexConsumer vb) {
|
||||
BlockState referenceState = blockState.rotate(Rotation.CLOCKWISE_90);
|
||||
Direction facing = (Direction) referenceState.getValue(BlockStateProperties.HORIZONTAL_FACING);
|
||||
SuperByteBuffer wheel = PartialBufferer.getFacing(SPBlockPartials.CAST_IRON_FLYWHEEL, referenceState, facing);
|
||||
|
@ -90,12 +90,12 @@ public class CastIronFlywheelRenderer extends KineticTileEntityRenderer {
|
|||
float shift = upper ? 0.25F : -0.125F;
|
||||
float offset = upper ? 0.25F : 0.25F;
|
||||
float radians = (float) ((double) (angle / 180.0F) * 3.141592653589793D);
|
||||
float shifting = MathHelper.sin(radians) * shift + offset;
|
||||
float shifting = Mth.sin(radians) * shift + offset;
|
||||
float maxAngle = upper ? -5.0F : -15.0F;
|
||||
float minAngle = upper ? -45.0F : 5.0F;
|
||||
float barAngle = 0.0F;
|
||||
if (rotating) {
|
||||
barAngle = MathHelper.lerp((MathHelper.sin((float) ((double) radians + 1.5707963267948966D)) + 1.0F) / 2.0F, minAngle, maxAngle);
|
||||
barAngle = Mth.lerp((Mth.sin((float) ((double) radians + 1.5707963267948966D)) + 1.0F) / 2.0F, minAngle, maxAngle);
|
||||
}
|
||||
|
||||
float pivotX = (upper ? 8.0F : 3.0F) / 16.0F;
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
package com.teammoeg.steampowered.client.render;
|
||||
|
||||
import com.jozufozu.flywheel.backend.Backend;
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.vertex.IVertexBuilder;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.content.contraptions.base.HorizontalKineticBlock;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||
|
@ -33,22 +33,22 @@ import com.simibubi.create.foundation.utility.AngleHelper;
|
|||
import com.teammoeg.steampowered.block.SPBlockPartials;
|
||||
import com.teammoeg.steampowered.mixin.FlywheelTileEntityAccess;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.client.renderer.MultiBufferSource;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Rotation;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.client.renderer.LevelRenderer;
|
||||
import net.minecraft.client.renderer.blockentity.BlockEntityRenderDispatcher;
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.level.block.Rotation;
|
||||
import net.minecraft.util.Mth;
|
||||
|
||||
public class SteelFlywheelRenderer extends KineticTileEntityRenderer {
|
||||
public SteelFlywheelRenderer(TileEntityRendererDispatcher dispatcher) {
|
||||
public SteelFlywheelRenderer(BlockEntityRenderDispatcher dispatcher) {
|
||||
super(dispatcher);
|
||||
}
|
||||
|
||||
protected void renderSafe(KineticTileEntity te, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffer, int light, int overlay) {
|
||||
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light, int overlay) {
|
||||
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
||||
if (!Backend.getInstance().canUseInstancing(te.getLevel())) {
|
||||
BlockState blockState = te.getBlockState();
|
||||
|
@ -58,10 +58,10 @@ public class SteelFlywheelRenderer extends KineticTileEntityRenderer {
|
|||
float speed = access.getVisualSpeed().get(partialTicks) * 3.0F / 10.0F;
|
||||
float angle = access.getAngle() + speed * partialTicks;
|
||||
// Mixin ends
|
||||
IVertexBuilder vb = buffer.getBuffer(RenderType.solid());
|
||||
VertexConsumer vb = buffer.getBuffer(RenderType.solid());
|
||||
if (FlywheelBlock.isConnected(blockState)) {
|
||||
Direction connection = FlywheelBlock.getConnection(blockState);
|
||||
light = WorldRenderer.getLightColor(te.getLevel(), blockState, te.getBlockPos().relative(connection));
|
||||
light = LevelRenderer.getLightColor(te.getLevel(), blockState, te.getBlockPos().relative(connection));
|
||||
float rotation = connection.getAxis() == Direction.Axis.X ^ connection.getAxisDirection() == Direction.AxisDirection.NEGATIVE ? -angle : angle;
|
||||
boolean flip = blockState.getValue(FlywheelBlock.CONNECTION) == FlywheelBlock.ConnectionState.LEFT;
|
||||
this.transformConnector(this.rotateToFacing(PartialBufferer.get(SPBlockPartials.STEEL_FLYWHEEL_UPPER_ROTATING, blockState), connection), true, true, rotation, flip).light(light).renderInto(ms, vb);
|
||||
|
@ -74,7 +74,7 @@ public class SteelFlywheelRenderer extends KineticTileEntityRenderer {
|
|||
}
|
||||
}
|
||||
|
||||
private void renderFlywheel(KineticTileEntity te, MatrixStack ms, int light, BlockState blockState, float angle, IVertexBuilder vb) {
|
||||
private void renderFlywheel(KineticTileEntity te, PoseStack ms, int light, BlockState blockState, float angle, VertexConsumer vb) {
|
||||
BlockState referenceState = blockState.rotate(Rotation.CLOCKWISE_90);
|
||||
Direction facing = (Direction) referenceState.getValue(BlockStateProperties.HORIZONTAL_FACING);
|
||||
SuperByteBuffer wheel = PartialBufferer.getFacing(SPBlockPartials.STEEL_FLYWHEEL, referenceState, facing);
|
||||
|
@ -90,12 +90,12 @@ public class SteelFlywheelRenderer extends KineticTileEntityRenderer {
|
|||
float shift = upper ? 0.25F : -0.125F;
|
||||
float offset = upper ? 0.25F : 0.25F;
|
||||
float radians = (float) ((double) (angle / 180.0F) * 3.141592653589793D);
|
||||
float shifting = MathHelper.sin(radians) * shift + offset;
|
||||
float shifting = Mth.sin(radians) * shift + offset;
|
||||
float maxAngle = upper ? -5.0F : -15.0F;
|
||||
float minAngle = upper ? -45.0F : 5.0F;
|
||||
float barAngle = 0.0F;
|
||||
if (rotating) {
|
||||
barAngle = MathHelper.lerp((MathHelper.sin((float) ((double) radians + 1.5707963267948966D)) + 1.0F) / 2.0F, minAngle, maxAngle);
|
||||
barAngle = Mth.lerp((Mth.sin((float) ((double) radians + 1.5707963267948966D)) + 1.0F) / 2.0F, minAngle, maxAngle);
|
||||
}
|
||||
|
||||
float pivotX = (upper ? 8.0F : 3.0F) / 16.0F;
|
||||
|
|
|
@ -32,28 +32,31 @@ import com.simibubi.create.foundation.utility.VoxelShaper;
|
|||
import com.teammoeg.steampowered.block.SPShapes;
|
||||
import com.teammoeg.steampowered.registrate.SPTiles;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
import net.minecraft.state.Property;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction.Axis;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.core.Direction.Axis;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
|
||||
import com.simibubi.create.content.contraptions.base.IRotate.SpeedLevel;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
|
||||
|
||||
/**
|
||||
* Adapted from: Create: Crafts & Additions
|
||||
|
@ -70,12 +73,12 @@ public class DynamoBlock extends DirectionalKineticBlock implements ITE<DynamoTi
|
|||
.forDirectional();
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
|
||||
public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context) {
|
||||
return DYNAMO_SHAPE.get(state.getValue(FACING).getOpposite());
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockItemUseContext context) {
|
||||
public BlockState getStateForPlacement(BlockPlaceContext context) {
|
||||
Direction preferred = getPreferredFacing(context);
|
||||
if ((context.getPlayer() != null && context.getPlayer().isShiftKeyDown()) || preferred == null) {
|
||||
return super.getStateForPlacement(context).setValue(REDSTONE_LOCKED, context.getLevel().hasNeighborSignal(context.getClickedPos()));
|
||||
|
@ -88,12 +91,12 @@ public class DynamoBlock extends DirectionalKineticBlock implements ITE<DynamoTi
|
|||
this.registerDefaultState(this.stateDefinition.any().setValue(REDSTONE_LOCKED, false));
|
||||
}
|
||||
|
||||
protected void createBlockStateDefinition(StateContainer.Builder<Block, BlockState> builder) {
|
||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
||||
super.createBlockStateDefinition(builder.add(REDSTONE_LOCKED));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasShaftTowards(IWorldReader world, BlockPos pos, BlockState state, Direction face) {
|
||||
public boolean hasShaftTowards(LevelReader world, BlockPos pos, BlockState state, Direction face) {
|
||||
return face == state.getValue(FACING).getOpposite();
|
||||
}
|
||||
|
||||
|
@ -109,7 +112,7 @@ public class DynamoBlock extends DirectionalKineticBlock implements ITE<DynamoTi
|
|||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
public BlockEntity createTileEntity(BlockState state, BlockGetter world) {
|
||||
return SPTiles.DYNAMO.create();
|
||||
}
|
||||
|
||||
|
@ -128,19 +131,19 @@ public class DynamoBlock extends DirectionalKineticBlock implements ITE<DynamoTi
|
|||
}*/
|
||||
|
||||
@Override
|
||||
public void appendHoverText(ItemStack i, IBlockReader w, List<ITextComponent> t, ITooltipFlag f) {
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.alternator").withStyle(TextFormatting.GRAY));
|
||||
public void appendHoverText(ItemStack i, BlockGetter w, List<Component> t, TooltipFlag f) {
|
||||
t.add(new TranslatableComponent("tooltip.steampowered.alternator").withStyle(ChatFormatting.GRAY));
|
||||
if(Screen.hasShiftDown()) {
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.alternator.thanks").withStyle(TextFormatting.GOLD));
|
||||
t.add(new TranslatableComponent("tooltip.steampowered.alternator.thanks").withStyle(ChatFormatting.GOLD));
|
||||
}else {
|
||||
t.add(TooltipHelper.holdShift(Palette.Gray,false));
|
||||
}
|
||||
if(Screen.hasControlDown()) {
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.alternator.redstone").withStyle(TextFormatting.RED));
|
||||
t.add(new TranslatableComponent("tooltip.steampowered.alternator.redstone").withStyle(ChatFormatting.RED));
|
||||
}else {
|
||||
t.add(Lang.translate("tooltip.holdForControls", Lang.translate("tooltip.keyCtrl")
|
||||
.withStyle(TextFormatting.GRAY))
|
||||
.withStyle(TextFormatting.DARK_GRAY));
|
||||
.withStyle(ChatFormatting.GRAY))
|
||||
.withStyle(ChatFormatting.DARK_GRAY));
|
||||
}
|
||||
/*if (ModList.get().isLoaded("createaddition")) {
|
||||
if (SPConfig.SERVER.disableDynamo.get()) {
|
||||
|
@ -151,7 +154,7 @@ public class DynamoBlock extends DirectionalKineticBlock implements ITE<DynamoTi
|
|||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean flag) {
|
||||
public void neighborChanged(BlockState state, Level world, BlockPos pos, Block block, BlockPos fromPos, boolean flag) {
|
||||
if (!world.isClientSide) {
|
||||
boolean isLocked = state.getValue(REDSTONE_LOCKED);
|
||||
if (isLocked != world.hasNeighborSignal(pos)) {
|
||||
|
@ -166,7 +169,7 @@ public class DynamoBlock extends DirectionalKineticBlock implements ITE<DynamoTi
|
|||
}
|
||||
|
||||
@Override
|
||||
public void tick(BlockState state, ServerWorld serverworld, BlockPos pos, Random random) {
|
||||
public void tick(BlockState state, ServerLevel serverworld, BlockPos pos, Random random) {
|
||||
if (state.getValue(REDSTONE_LOCKED) && !serverworld.hasNeighborSignal(pos)) {
|
||||
serverworld.setBlock(pos, state.cycle(REDSTONE_LOCKED), 2);
|
||||
}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
package com.teammoeg.steampowered.content.alternator;
|
||||
|
||||
import com.jozufozu.flywheel.backend.material.MaterialManager;
|
||||
import com.jozufozu.flywheel.api.MaterialManager;
|
||||
import com.simibubi.create.content.contraptions.base.HalfShaftInstance;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.core.Direction;
|
||||
|
||||
public class DynamoShaftInstance extends HalfShaftInstance {
|
||||
|
||||
public DynamoShaftInstance(MaterialManager<?> modelManager, KineticTileEntity tile) {
|
||||
public DynamoShaftInstance(MaterialManager modelManager, KineticTileEntity tile) {
|
||||
super(modelManager, tile);
|
||||
}
|
||||
@Override
|
||||
|
|
|
@ -24,16 +24,16 @@ import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
|||
import com.simibubi.create.foundation.utility.Lang;
|
||||
import com.teammoeg.steampowered.SPConfig;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.energy.CapabilityEnergy;
|
||||
|
@ -55,21 +55,21 @@ public class DynamoTileEntity extends KineticTileEntity {
|
|||
public static final int IMPACT = SPConfig.COMMON.dynamoImpact.get(); // Impact on network
|
||||
public static final double EFFICIENCY = SPConfig.COMMON.dynamoEfficiency.get(); // Efficiency
|
||||
|
||||
public DynamoTileEntity(TileEntityType<?> typeIn) {
|
||||
public DynamoTileEntity(BlockEntityType<?> typeIn) {
|
||||
super(typeIn);
|
||||
energy = new InternalEnergyStorage(FE_CAPACITY, 0, MAX_FE_OUT);
|
||||
lazyEnergy = LazyOptional.of(() -> energy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addToGoggleTooltip(List<ITextComponent> tooltip, boolean isPlayerSneaking) {
|
||||
public boolean addToGoggleTooltip(List<Component> tooltip, boolean isPlayerSneaking) {
|
||||
if (this.getBlockState().getValue(DynamoBlock.REDSTONE_LOCKED)) {
|
||||
tooltip.add(new StringTextComponent(spacing).append(new TranslationTextComponent("tooltip.steampowered.dynamo.locked").withStyle(TextFormatting.RED)));
|
||||
tooltip.add(new TextComponent(spacing).append(new TranslatableComponent("tooltip.steampowered.dynamo.locked").withStyle(ChatFormatting.RED)));
|
||||
return true;
|
||||
}
|
||||
tooltip.add(new StringTextComponent(spacing).append(new TranslationTextComponent("tooltip.steampowered.energy.production").withStyle(TextFormatting.GRAY)));
|
||||
tooltip.add(new StringTextComponent(spacing).append(new StringTextComponent(" " + format(getEnergyProductionRate((int) (isSpeedRequirementFulfilled() ? getSpeed() : 0))) + "fe/t ") // fix
|
||||
.withStyle(TextFormatting.AQUA)).append(Lang.translate("gui.goggles.at_current_speed").withStyle(TextFormatting.DARK_GRAY)));
|
||||
tooltip.add(new TextComponent(spacing).append(new TranslatableComponent("tooltip.steampowered.energy.production").withStyle(ChatFormatting.GRAY)));
|
||||
tooltip.add(new TextComponent(spacing).append(new TextComponent(" " + format(getEnergyProductionRate((int) (isSpeedRequirementFulfilled() ? getSpeed() : 0))) + "fe/t ") // fix
|
||||
.withStyle(ChatFormatting.AQUA)).append(Lang.translate("gui.goggles.at_current_speed").withStyle(ChatFormatting.DARK_GRAY)));
|
||||
return super.addToGoggleTooltip(tooltip, isPlayerSneaking);
|
||||
}
|
||||
|
||||
|
@ -97,15 +97,15 @@ public class DynamoTileEntity extends KineticTileEntity {
|
|||
return lazyEnergy.cast();
|
||||
return super.getCapability(cap, side);
|
||||
}
|
||||
@Override
|
||||
public void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||
|
||||
public void fromTag(BlockState state, CompoundTag compound, boolean clientPacket) {
|
||||
super.fromTag(state, compound, clientPacket);
|
||||
energy.read(compound);
|
||||
redstoneLocked = compound.getBoolean("redstonelocked");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(CompoundNBT compound, boolean clientPacket) {
|
||||
public void write(CompoundTag compound, boolean clientPacket) {
|
||||
super.write(compound, clientPacket);
|
||||
energy.write(compound);
|
||||
compound.putBoolean("redstonelocked", redstoneLocked);
|
||||
|
@ -122,7 +122,7 @@ public class DynamoTileEntity extends KineticTileEntity {
|
|||
if (Math.abs(getSpeed()) > 0 && isSpeedRequirementFulfilled())
|
||||
energy.internalProduceEnergy(getEnergyProductionRate((int) getSpeed()));
|
||||
Direction side=this.getBlockState().getValue(DynamoBlock.FACING);
|
||||
TileEntity te = level.getBlockEntity(worldPosition.relative(side));
|
||||
BlockEntity te = level.getBlockEntity(worldPosition.relative(side));
|
||||
if (te != null) {
|
||||
te.getCapability(CapabilityEnergy.ENERGY, side.getOpposite())
|
||||
.ifPresent(ies->ies.receiveEnergy(energy.extractEnergy(ies.receiveEnergy(MAX_FE_OUT, true), false), false));
|
||||
|
@ -139,8 +139,8 @@ public class DynamoTileEntity extends KineticTileEntity {
|
|||
super.setRemoved();
|
||||
lazyEnergy.invalidate();
|
||||
}
|
||||
@Override
|
||||
public World getWorld() {
|
||||
|
||||
public Level getWorld() {
|
||||
return getLevel();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,11 +27,11 @@
|
|||
|
||||
package com.teammoeg.steampowered.content.alternator;
|
||||
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.energy.CapabilityEnergy;
|
||||
import net.minecraftforge.energy.EnergyStorage;
|
||||
|
@ -58,21 +58,21 @@ public class InternalEnergyStorage extends EnergyStorage {
|
|||
super(capacity, maxReceive, maxExtract, energy);
|
||||
}
|
||||
|
||||
public CompoundNBT write(CompoundNBT nbt) {
|
||||
public CompoundTag write(CompoundTag nbt) {
|
||||
nbt.putInt("energy", energy);
|
||||
return nbt;
|
||||
}
|
||||
|
||||
public void read(CompoundNBT nbt) {
|
||||
public void read(CompoundTag nbt) {
|
||||
setEnergy(nbt.getInt("energy"));
|
||||
}
|
||||
|
||||
public CompoundNBT write(CompoundNBT nbt, String name) {
|
||||
public CompoundTag write(CompoundTag nbt, String name) {
|
||||
nbt.putInt("energy_" + name, energy);
|
||||
return nbt;
|
||||
}
|
||||
|
||||
public void read(CompoundNBT nbt, String name) {
|
||||
public void read(CompoundTag nbt, String name) {
|
||||
setEnergy(nbt.getInt("energy_" + name));
|
||||
}
|
||||
|
||||
|
@ -103,8 +103,8 @@ public class InternalEnergyStorage extends EnergyStorage {
|
|||
}
|
||||
|
||||
@Deprecated
|
||||
public void outputToSide(World world, BlockPos pos, Direction side, int max) {
|
||||
TileEntity te = world.getBlockEntity(pos.relative(side));
|
||||
public void outputToSide(Level world, BlockPos pos, Direction side, int max) {
|
||||
BlockEntity te = world.getBlockEntity(pos.relative(side));
|
||||
if (te == null)
|
||||
return;
|
||||
LazyOptional<IEnergyStorage> opt = te.getCapability(CapabilityEnergy.ENERGY, side.getOpposite());
|
||||
|
|
|
@ -27,34 +27,36 @@ import com.simibubi.create.foundation.utility.Lang;
|
|||
import com.teammoeg.steampowered.client.ClientUtils;
|
||||
import com.teammoeg.steampowered.client.Particles;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ILiquidContainer;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.LiquidBlockContainer;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.level.material.Fluid;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.damagesource.DamageSource;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.LevelAccessor;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction;
|
||||
|
||||
public abstract class BoilerBlock extends Block implements ILiquidContainer {
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
|
||||
|
||||
public abstract class BoilerBlock extends Block implements LiquidBlockContainer {
|
||||
@Override
|
||||
public boolean canPlaceLiquid(IBlockReader w, BlockPos p, BlockState s, Fluid f) {
|
||||
TileEntity te = w.getBlockEntity(p);
|
||||
public boolean canPlaceLiquid(BlockGetter w, BlockPos p, BlockState s, Fluid f) {
|
||||
BlockEntity te = w.getBlockEntity(p);
|
||||
if (te instanceof BoilerTileEntity) {
|
||||
BoilerTileEntity boiler = (BoilerTileEntity) te;
|
||||
if (boiler.input.fill(new FluidStack(f, 1000), FluidAction.SIMULATE) == 1000)
|
||||
|
@ -64,8 +66,8 @@ public abstract class BoilerBlock extends Block implements ILiquidContainer {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean placeLiquid(IWorld w, BlockPos p, BlockState s, FluidState f) {
|
||||
TileEntity te = w.getBlockEntity(p);
|
||||
public boolean placeLiquid(LevelAccessor w, BlockPos p, BlockState s, FluidState f) {
|
||||
BlockEntity te = w.getBlockEntity(p);
|
||||
if (te instanceof BoilerTileEntity) {
|
||||
BoilerTileEntity boiler = (BoilerTileEntity) te;
|
||||
if (boiler.input.fill(new FluidStack(f.getType(), 1000), FluidAction.SIMULATE) == 1000) {
|
||||
|
@ -77,8 +79,8 @@ public abstract class BoilerBlock extends Block implements ILiquidContainer {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void animateTick(BlockState p_180655_1_, World p_180655_2_, BlockPos p_180655_3_, Random p_180655_4_) {
|
||||
TileEntity te = p_180655_2_.getBlockEntity(p_180655_3_);
|
||||
public void animateTick(BlockState p_180655_1_, Level p_180655_2_, BlockPos p_180655_3_, Random p_180655_4_) {
|
||||
BlockEntity te = p_180655_2_.getBlockEntity(p_180655_3_);
|
||||
if (te instanceof BoilerTileEntity) {
|
||||
BoilerTileEntity boiler = (BoilerTileEntity) te;
|
||||
if (boiler.output.getFluidAmount()>=10000&&boiler.lastheat!=0) {//steam leaking
|
||||
|
@ -86,7 +88,7 @@ public abstract class BoilerBlock extends Block implements ILiquidContainer {
|
|||
double d1 = p_180655_3_.getY() + 1;
|
||||
double d2 = p_180655_3_.getZ();
|
||||
//if(p_180655_4_.nextDouble()<0.5D) {
|
||||
p_180655_2_.playLocalSound(d0, d1, d2, SoundEvents.FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.25F, 0.25F, false);
|
||||
p_180655_2_.playLocalSound(d0, d1, d2, SoundEvents.FIRE_EXTINGUISH, SoundSource.BLOCKS, 0.25F, 0.25F, false);
|
||||
int count=4;
|
||||
while(--count!=0)
|
||||
p_180655_2_.addParticle(Particles.STEAM.get(), d0+p_180655_4_.nextFloat(), d1, d2+p_180655_4_.nextFloat(), 0.0D, 0.0D, 0.0D);
|
||||
|
@ -105,8 +107,8 @@ public abstract class BoilerBlock extends Block implements ILiquidContainer {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getAnalogOutputSignal(BlockState b, World w, BlockPos p) {
|
||||
TileEntity te = w.getBlockEntity(p);
|
||||
public int getAnalogOutputSignal(BlockState b, Level w, BlockPos p) {
|
||||
BlockEntity te = w.getBlockEntity(p);
|
||||
if (te instanceof BoilerTileEntity) {
|
||||
BoilerTileEntity boiler = (BoilerTileEntity) te;
|
||||
return boiler.output.getFluidAmount() * 15 / boiler.output.getCapacity();
|
||||
|
@ -114,7 +116,7 @@ public abstract class BoilerBlock extends Block implements ILiquidContainer {
|
|||
return super.getAnalogOutputSignal(b, w, p);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
@ -122,35 +124,35 @@ public abstract class BoilerBlock extends Block implements ILiquidContainer {
|
|||
public abstract int getHuConsume();
|
||||
|
||||
@Override
|
||||
public void appendHoverText(ItemStack i, IBlockReader w, List<ITextComponent> t, ITooltipFlag f) {
|
||||
public void appendHoverText(ItemStack i, BlockGetter w, List<Component> t, TooltipFlag f) {
|
||||
if (Screen.hasShiftDown()) {
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.boiler.brief").withStyle(TextFormatting.GOLD));
|
||||
t.add(new TranslatableComponent("tooltip.steampowered.boiler.brief").withStyle(ChatFormatting.GOLD));
|
||||
if (ClientUtils.hasGoggles()) {
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.boiler.danger").withStyle(TextFormatting.RED));
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.boiler.huconsume", this.getHuConsume())
|
||||
.withStyle(TextFormatting.GOLD));
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.boiler.waterconsume",
|
||||
((int) Math.ceil(this.getHuConsume() / 120.0))).withStyle(TextFormatting.AQUA));
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.boiler.steamproduce", this.getHuConsume() / 10)
|
||||
.withStyle(TextFormatting.GOLD));
|
||||
t.add(new TranslatableComponent("tooltip.steampowered.boiler.danger").withStyle(ChatFormatting.RED));
|
||||
t.add(new TranslatableComponent("tooltip.steampowered.boiler.huconsume", this.getHuConsume())
|
||||
.withStyle(ChatFormatting.GOLD));
|
||||
t.add(new TranslatableComponent("tooltip.steampowered.boiler.waterconsume",
|
||||
((int) Math.ceil(this.getHuConsume() / 120.0))).withStyle(ChatFormatting.AQUA));
|
||||
t.add(new TranslatableComponent("tooltip.steampowered.boiler.steamproduce", this.getHuConsume() / 10)
|
||||
.withStyle(ChatFormatting.GOLD));
|
||||
}
|
||||
} else {
|
||||
t.add(TooltipHelper.holdShift(Palette.Gray, false));
|
||||
}
|
||||
if (Screen.hasControlDown()) {
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.boiler.redstone").withStyle(TextFormatting.RED));
|
||||
t.add(new TranslatableComponent("tooltip.steampowered.boiler.redstone").withStyle(ChatFormatting.RED));
|
||||
} else {
|
||||
t.add(Lang
|
||||
.translate("tooltip.holdForControls",
|
||||
Lang.translate("tooltip.keyCtrl").withStyle(TextFormatting.GRAY))
|
||||
.withStyle(TextFormatting.DARK_GRAY));
|
||||
Lang.translate("tooltip.keyCtrl").withStyle(ChatFormatting.GRAY))
|
||||
.withStyle(ChatFormatting.DARK_GRAY));
|
||||
}
|
||||
super.appendHoverText(i, w, t, f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stepOn(World w, BlockPos bp, Entity e) {
|
||||
TileEntity te = w.getBlockEntity(bp);
|
||||
|
||||
public void stepOn(Level w, BlockPos bp, Entity e) {
|
||||
BlockEntity te = w.getBlockEntity(bp);
|
||||
if (te instanceof BoilerTileEntity && e instanceof LivingEntity) {
|
||||
if (((BoilerTileEntity) te).lastheat > 0 || (!((BoilerTileEntity) te).output.isEmpty())) {
|
||||
e.hurt(DamageSource.HOT_FLOOR, 2);
|
||||
|
|
|
@ -25,16 +25,16 @@ import com.teammoeg.steampowered.FluidRegistry;
|
|||
import com.teammoeg.steampowered.SPConfig;
|
||||
import com.teammoeg.steampowered.content.burner.IHeatReceiver;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.play.server.SUpdateTileEntityPacket;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.Connection;
|
||||
import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket;
|
||||
import net.minecraft.world.level.block.entity.TickableBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
@ -43,7 +43,7 @@ import net.minecraftforge.fluids.capability.IFluidHandler;
|
|||
import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction;
|
||||
import net.minecraftforge.fluids.capability.templates.FluidTank;
|
||||
|
||||
public abstract class BoilerTileEntity extends TileEntity implements IHeatReceiver, ITickableTileEntity, IHaveGoggleInformation {
|
||||
public abstract class BoilerTileEntity extends BlockEntity implements IHeatReceiver, TickableBlockEntity, IHaveGoggleInformation {
|
||||
FluidTank input = new FluidTank(10000,s->s.getFluid() == Fluids.WATER);
|
||||
FluidTank output = new FluidTank(10000);
|
||||
private IFluidHandler ft = new IFluidHandler() {
|
||||
|
@ -95,12 +95,12 @@ public abstract class BoilerTileEntity extends TileEntity implements IHeatReceiv
|
|||
int lastheat;
|
||||
private LazyOptional<IFluidHandler> holder = LazyOptional.of(() -> ft);
|
||||
|
||||
public BoilerTileEntity(TileEntityType<?> p_i48289_1_) {
|
||||
public BoilerTileEntity(BlockEntityType<?> p_i48289_1_) {
|
||||
super(p_i48289_1_);
|
||||
}
|
||||
|
||||
// Easy, easy
|
||||
public void readCustomNBT(CompoundNBT nbt) {
|
||||
public void readCustomNBT(CompoundTag nbt) {
|
||||
input.readFromNBT(nbt.getCompound("in"));
|
||||
output.readFromNBT(nbt.getCompound("out"));
|
||||
heatreceived = nbt.getInt("hu");
|
||||
|
@ -108,41 +108,41 @@ public abstract class BoilerTileEntity extends TileEntity implements IHeatReceiv
|
|||
}
|
||||
|
||||
// Easy, easy
|
||||
public void writeCustomNBT(CompoundNBT nbt) {
|
||||
nbt.put("in", input.writeToNBT(new CompoundNBT()));
|
||||
nbt.put("out", output.writeToNBT(new CompoundNBT()));
|
||||
public void writeCustomNBT(CompoundTag nbt) {
|
||||
nbt.put("in", input.writeToNBT(new CompoundTag()));
|
||||
nbt.put("out", output.writeToNBT(new CompoundTag()));
|
||||
nbt.putInt("hu", heatreceived);
|
||||
nbt.putInt("lasthu", lastheat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(BlockState state, CompoundNBT nbt) {
|
||||
public void load(BlockState state, CompoundTag nbt) {
|
||||
super.load(state, nbt);
|
||||
readCustomNBT(nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundNBT save(CompoundNBT nbt) {
|
||||
public CompoundTag save(CompoundTag nbt) {
|
||||
super.save(nbt);
|
||||
writeCustomNBT(nbt);
|
||||
return nbt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SUpdateTileEntityPacket getUpdatePacket() {
|
||||
CompoundNBT nbt = new CompoundNBT();
|
||||
public ClientboundBlockEntityDataPacket getUpdatePacket() {
|
||||
CompoundTag nbt = new CompoundTag();
|
||||
this.writeCustomNBT(nbt);
|
||||
return new SUpdateTileEntityPacket(this.getBlockPos(), 3, nbt);
|
||||
return new ClientboundBlockEntityDataPacket(this.getBlockPos(), 3, nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) {
|
||||
public void onDataPacket(Connection net, ClientboundBlockEntityDataPacket pkt) {
|
||||
this.readCustomNBT(pkt.getTag());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundNBT getUpdateTag() {
|
||||
CompoundNBT nbt = super.getUpdateTag();
|
||||
public CompoundTag getUpdateTag() {
|
||||
CompoundTag nbt = super.getUpdateTag();
|
||||
writeCustomNBT(nbt);
|
||||
return nbt;
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ public abstract class BoilerTileEntity extends TileEntity implements IHeatReceiv
|
|||
|
||||
}
|
||||
|
||||
public boolean addToGoggleTooltip(List<ITextComponent> tooltip, boolean isPlayerSneaking) {
|
||||
public boolean addToGoggleTooltip(List<Component> tooltip, boolean isPlayerSneaking) {
|
||||
this.containedFluidTooltip(tooltip, isPlayerSneaking, LazyOptional.of(() -> input));
|
||||
this.containedFluidTooltip(tooltip, isPlayerSneaking, LazyOptional.of(() -> output));
|
||||
return true;
|
||||
|
|
|
@ -21,9 +21,11 @@ package com.teammoeg.steampowered.content.boiler;
|
|||
import com.teammoeg.steampowered.SPConfig;
|
||||
import com.teammoeg.steampowered.registrate.SPTiles;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
|
||||
|
||||
public class BronzeBoilerBlock extends BoilerBlock {
|
||||
public BronzeBoilerBlock(Properties properties) {
|
||||
|
@ -31,7 +33,7 @@ public class BronzeBoilerBlock extends BoilerBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
public BlockEntity createTileEntity(BlockState state, BlockGetter world) {
|
||||
return SPTiles.BRONZE_BOILER.create();
|
||||
}
|
||||
|
||||
|
|
|
@ -20,11 +20,11 @@ package com.teammoeg.steampowered.content.boiler;
|
|||
|
||||
import com.teammoeg.steampowered.SPConfig;
|
||||
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
|
||||
public class BronzeBoilerTileEntity extends BoilerTileEntity {
|
||||
|
||||
public BronzeBoilerTileEntity(TileEntityType<?> type) {
|
||||
public BronzeBoilerTileEntity(BlockEntityType<?> type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,17 +21,19 @@ package com.teammoeg.steampowered.content.boiler;
|
|||
import com.teammoeg.steampowered.SPConfig;
|
||||
import com.teammoeg.steampowered.registrate.SPTiles;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
|
||||
|
||||
public class CastIronBoilerBlock extends BoilerBlock {
|
||||
public CastIronBoilerBlock(Properties properties) {
|
||||
super(properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
|
||||
public BlockEntity createTileEntity(BlockState state, BlockGetter world) {
|
||||
return SPTiles.CAST_IRON_BOILER.create();
|
||||
}
|
||||
|
||||
|
|
|
@ -20,11 +20,11 @@ package com.teammoeg.steampowered.content.boiler;
|
|||
|
||||
import com.teammoeg.steampowered.SPConfig;
|
||||
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
|
||||
public class CastIronBoilerTileEntity extends BoilerTileEntity {
|
||||
|
||||
public CastIronBoilerTileEntity(TileEntityType<?> type) {
|
||||
public CastIronBoilerTileEntity(BlockEntityType<?> type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,17 +21,19 @@ package com.teammoeg.steampowered.content.boiler;
|
|||
import com.teammoeg.steampowered.SPConfig;
|
||||
import com.teammoeg.steampowered.registrate.SPTiles;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
|
||||
|
||||
public class SteelBoilerBlock extends BoilerBlock {
|
||||
public SteelBoilerBlock(Properties properties) {
|
||||
super(properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
|
||||
public BlockEntity createTileEntity(BlockState state, BlockGetter world) {
|
||||
return SPTiles.STEEL_BOILER.create();
|
||||
}
|
||||
|
||||
|
|
|
@ -20,11 +20,11 @@ package com.teammoeg.steampowered.content.boiler;
|
|||
|
||||
import com.teammoeg.steampowered.SPConfig;
|
||||
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
|
||||
public class SteelBoilerTileEntity extends BoilerTileEntity {
|
||||
|
||||
public SteelBoilerTileEntity(TileEntityType<?> type) {
|
||||
public SteelBoilerTileEntity(BlockEntityType<?> type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,17 +21,18 @@ package com.teammoeg.steampowered.content.burner;
|
|||
import com.teammoeg.steampowered.SPConfig;
|
||||
import com.teammoeg.steampowered.registrate.SPTiles;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
|
||||
|
||||
public class BronzeBurnerBlock extends BurnerBlock {
|
||||
public BronzeBurnerBlock(Properties properties) {
|
||||
super(properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
|
||||
public BlockEntity createBlockEntity(BlockState state, BlockGetter world) {
|
||||
return SPTiles.BRONZE_BURNER.create();
|
||||
}
|
||||
|
||||
|
|
|
@ -20,11 +20,11 @@ package com.teammoeg.steampowered.content.burner;
|
|||
|
||||
import com.teammoeg.steampowered.SPConfig;
|
||||
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
|
||||
public class BronzeBurnerTileEntity extends BurnerTileEntity {
|
||||
|
||||
public BronzeBurnerTileEntity(TileEntityType<?> type) {
|
||||
public BronzeBurnerTileEntity(BlockEntityType<?> type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,38 +25,40 @@ import com.simibubi.create.foundation.item.ItemDescription.Palette;
|
|||
import com.simibubi.create.foundation.item.TooltipHelper;
|
||||
import com.simibubi.create.foundation.utility.Lang;
|
||||
import com.teammoeg.steampowered.client.ClientUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.particles.ParticleTypes;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.DirectionProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
import net.minecraft.world.level.block.state.properties.DirectionProperty;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
import net.minecraft.world.InteractionResult;
|
||||
import net.minecraft.world.damagesource.DamageSource;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
|
||||
|
||||
public abstract class BurnerBlock extends Block {
|
||||
public static final BooleanProperty LIT = BlockStateProperties.LIT;
|
||||
public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
|
||||
|
@ -66,14 +68,14 @@ public abstract class BurnerBlock extends Block {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void animateTick(BlockState bs, World w, BlockPos bp, Random r) {
|
||||
public void animateTick(BlockState bs, Level w, BlockPos bp, Random r) {
|
||||
super.animateTick(bs, w, bp, r);
|
||||
if (bs.getValue(BurnerBlock.LIT)) {
|
||||
double d0 = bp.getX() + 0.5D;
|
||||
double d1 = bp.getY();
|
||||
double d2 = bp.getZ() + 0.5D;
|
||||
if (r.nextDouble() < 0.2D) {
|
||||
w.playLocalSound(d0, d1, d2, SoundEvents.FURNACE_FIRE_CRACKLE, SoundCategory.BLOCKS, 1.0F, 1.0F, false);
|
||||
w.playLocalSound(d0, d1, d2, SoundEvents.FURNACE_FIRE_CRACKLE, SoundSource.BLOCKS, 1.0F, 1.0F, false);
|
||||
}
|
||||
if (r.nextDouble() < 0.5D) {
|
||||
Direction direction = bs.getValue(BurnerBlock.FACING);
|
||||
|
@ -89,7 +91,7 @@ public abstract class BurnerBlock extends Block {
|
|||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockItemUseContext context) {
|
||||
public BlockState getStateForPlacement(BlockPlaceContext context) {
|
||||
Direction facing = context.getClickedFace();
|
||||
return this.defaultBlockState().setValue(FACING, facing.getAxis().isVertical() ? context.getHorizontalDirection().getOpposite() : facing).setValue(LIT, Boolean.valueOf(false)).setValue(REDSTONE_LOCKED,false);
|
||||
}
|
||||
|
@ -100,7 +102,7 @@ public abstract class BurnerBlock extends Block {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void stepOn(World w, BlockPos p, Entity e) {
|
||||
public void stepOn(Level w, BlockPos p, Entity e) {
|
||||
if (w.getBlockState(p).getValue(LIT) == true)
|
||||
if (e instanceof LivingEntity)
|
||||
e.hurt(DamageSource.HOT_FLOOR, 2);
|
||||
|
@ -110,52 +112,52 @@ public abstract class BurnerBlock extends Block {
|
|||
public String getEfficiencyString() {
|
||||
return ((int)(this.getEfficiency()*1000))/10F+"%";
|
||||
}
|
||||
protected void createBlockStateDefinition(StateContainer.Builder<Block, BlockState> builder) {
|
||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
||||
super.createBlockStateDefinition(builder.add(LIT).add(FACING).add(REDSTONE_LOCKED));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendHoverText(ItemStack i, IBlockReader w, List<ITextComponent> t,
|
||||
ITooltipFlag f) {
|
||||
public void appendHoverText(ItemStack i, BlockGetter w, List<Component> t,
|
||||
TooltipFlag f) {
|
||||
|
||||
if(Screen.hasShiftDown()) {
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.burner.brief").withStyle(TextFormatting.GOLD));
|
||||
t.add(new TranslatableComponent("tooltip.steampowered.burner.brief").withStyle(ChatFormatting.GOLD));
|
||||
if(ClientUtils.hasGoggles()) {
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.burner.efficiency",getEfficiencyString()).withStyle(TextFormatting.RED));
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.burner.huproduce",this.getHuProduce()).withStyle(TextFormatting.GOLD));
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.burner.danger").withStyle(TextFormatting.RED));
|
||||
t.add(new TranslatableComponent("tooltip.steampowered.burner.efficiency",getEfficiencyString()).withStyle(ChatFormatting.RED));
|
||||
t.add(new TranslatableComponent("tooltip.steampowered.burner.huproduce",this.getHuProduce()).withStyle(ChatFormatting.GOLD));
|
||||
t.add(new TranslatableComponent("tooltip.steampowered.burner.danger").withStyle(ChatFormatting.RED));
|
||||
}
|
||||
}else {
|
||||
t.add(TooltipHelper.holdShift(Palette.Gray,false));
|
||||
}
|
||||
if(Screen.hasControlDown()) {
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.burner.redstone").withStyle(TextFormatting.RED));
|
||||
t.add(new TranslatableComponent("tooltip.steampowered.burner.redstone").withStyle(ChatFormatting.RED));
|
||||
}else {
|
||||
t.add(Lang.translate("tooltip.holdForControls", Lang.translate("tooltip.keyCtrl")
|
||||
.withStyle(TextFormatting.GRAY))
|
||||
.withStyle(TextFormatting.DARK_GRAY));
|
||||
.withStyle(ChatFormatting.GRAY))
|
||||
.withStyle(ChatFormatting.DARK_GRAY));
|
||||
}
|
||||
super.appendHoverText(i,w,t,f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResultType use(BlockState bs, World w, BlockPos bp, PlayerEntity pe, Hand h, BlockRayTraceResult br) {
|
||||
public InteractionResult use(BlockState bs, Level w, BlockPos bp, Player pe, InteractionHand h, BlockHitResult br) {
|
||||
if (pe.getItemInHand(h).isEmpty()) {
|
||||
IItemHandler cap = w.getBlockEntity(bp).getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).resolve().get();
|
||||
ItemStack is = cap.getStackInSlot(0);
|
||||
if (!is.isEmpty()) {
|
||||
pe.setItemInHand(h, cap.extractItem(0, is.getCount(), false));
|
||||
return ActionResultType.SUCCESS;
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
} else if (ForgeHooks.getBurnTime(pe.getItemInHand(h)) != 0 && pe.getItemInHand(h).getContainerItem().isEmpty()) {
|
||||
IItemHandler cap = w.getBlockEntity(bp).getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).resolve().get();
|
||||
pe.setItemInHand(h, cap.insertItem(0, pe.getItemInHand(h), false));
|
||||
return ActionResultType.SUCCESS;
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
return ActionResultType.PASS;
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean flag) {
|
||||
public void neighborChanged(BlockState state, Level world, BlockPos pos, Block block, BlockPos fromPos, boolean flag) {
|
||||
if (!world.isClientSide) {
|
||||
boolean isLocked = state.getValue(REDSTONE_LOCKED);
|
||||
if (isLocked != world.hasNeighborSignal(pos)) {
|
||||
|
@ -170,7 +172,7 @@ public abstract class BurnerBlock extends Block {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void tick(BlockState state, ServerWorld serverworld, BlockPos pos, Random random) {
|
||||
public void tick(BlockState state, ServerLevel serverworld, BlockPos pos, Random random) {
|
||||
if (state.getValue(REDSTONE_LOCKED) && !serverworld.hasNeighborSignal(pos)) {
|
||||
serverworld.setBlock(pos, state.cycle(REDSTONE_LOCKED), 2);
|
||||
}
|
||||
|
|
|
@ -23,19 +23,19 @@ import java.util.List;
|
|||
import com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation;
|
||||
import com.teammoeg.steampowered.SPConfig;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipeType;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.play.server.SUpdateTileEntityPacket;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.RecipeType;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.Connection;
|
||||
import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket;
|
||||
import net.minecraft.world.level.block.entity.TickableBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
|
@ -43,7 +43,7 @@ import net.minecraftforge.items.CapabilityItemHandler;
|
|||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.ItemStackHandler;
|
||||
|
||||
public abstract class BurnerTileEntity extends TileEntity implements ITickableTileEntity, IHaveGoggleInformation {
|
||||
public abstract class BurnerTileEntity extends BlockEntity implements TickableBlockEntity, IHaveGoggleInformation {
|
||||
private ItemStackHandler inv = new ItemStackHandler() {
|
||||
|
||||
@Override
|
||||
|
@ -56,50 +56,50 @@ public abstract class BurnerTileEntity extends TileEntity implements ITickableTi
|
|||
int HURemain;
|
||||
private LazyOptional<IItemHandler> holder = LazyOptional.of(() -> inv);
|
||||
|
||||
public BurnerTileEntity(TileEntityType<?> p_i48289_1_) {
|
||||
public BurnerTileEntity(BlockEntityType<?> p_i48289_1_) {
|
||||
super(p_i48289_1_);
|
||||
}
|
||||
|
||||
// Easy, easy
|
||||
public void readCustomNBT(CompoundNBT nbt) {
|
||||
public void readCustomNBT(CompoundTag nbt) {
|
||||
inv.deserializeNBT(nbt.getCompound("inv"));
|
||||
HURemain = nbt.getInt("hu");
|
||||
}
|
||||
|
||||
// Easy, easy
|
||||
public void writeCustomNBT(CompoundNBT nbt) {
|
||||
public void writeCustomNBT(CompoundTag nbt) {
|
||||
nbt.put("inv", inv.serializeNBT());
|
||||
nbt.putInt("hu", HURemain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(BlockState state, CompoundNBT nbt) {
|
||||
public void load(BlockState state, CompoundTag nbt) {
|
||||
super.load(state, nbt);
|
||||
readCustomNBT(nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundNBT save(CompoundNBT nbt) {
|
||||
public CompoundTag save(CompoundTag nbt) {
|
||||
super.save(nbt);
|
||||
writeCustomNBT(nbt);
|
||||
return nbt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SUpdateTileEntityPacket getUpdatePacket() {
|
||||
CompoundNBT nbt = new CompoundNBT();
|
||||
public ClientboundBlockEntityDataPacket getUpdatePacket() {
|
||||
CompoundTag nbt = new CompoundTag();
|
||||
this.writeCustomNBT(nbt);
|
||||
return new SUpdateTileEntityPacket(this.getBlockPos(), 3, nbt);
|
||||
return new ClientboundBlockEntityDataPacket(this.getBlockPos(), 3, nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) {
|
||||
public void onDataPacket(Connection net, ClientboundBlockEntityDataPacket pkt) {
|
||||
this.readCustomNBT(pkt.getTag());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundNBT getUpdateTag() {
|
||||
CompoundNBT nbt = super.getUpdateTag();
|
||||
public CompoundTag getUpdateTag() {
|
||||
CompoundTag nbt = super.getUpdateTag();
|
||||
writeCustomNBT(nbt);
|
||||
return nbt;
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ public abstract class BurnerTileEntity extends TileEntity implements ITickableTi
|
|||
|
||||
private boolean consumeFuel() {
|
||||
if(this.getBlockState().getValue(BurnerBlock.REDSTONE_LOCKED))return false;
|
||||
int time = ForgeHooks.getBurnTime(inv.getStackInSlot(0), IRecipeType.SMELTING);
|
||||
int time = ForgeHooks.getBurnTime(inv.getStackInSlot(0), RecipeType.SMELTING);
|
||||
if (time <= 0) return false;
|
||||
inv.getStackInSlot(0).shrink(1);
|
||||
HURemain += time * SPConfig.COMMON.HUPerFuelTick.get()*getEfficiency();//2.4HU/t
|
||||
|
@ -153,17 +153,17 @@ public abstract class BurnerTileEntity extends TileEntity implements ITickableTi
|
|||
}
|
||||
|
||||
protected void emitHeat(float value) {
|
||||
TileEntity receiver = level.getBlockEntity(this.getBlockPos().above());
|
||||
BlockEntity receiver = level.getBlockEntity(this.getBlockPos().above());
|
||||
if (receiver instanceof IHeatReceiver) {
|
||||
((IHeatReceiver) receiver).commitHeat(value);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addToGoggleTooltip(List<ITextComponent> tooltip, boolean isPlayerSneaking) {
|
||||
tooltip.add(componentSpacing.plainCopy().append(new TranslationTextComponent("tooltip.steampowered.burner.hu", HURemain).withStyle(TextFormatting.GOLD)));
|
||||
public boolean addToGoggleTooltip(List<Component> tooltip, boolean isPlayerSneaking) {
|
||||
tooltip.add(componentSpacing.plainCopy().append(new TranslatableComponent("tooltip.steampowered.burner.hu", HURemain).withStyle(ChatFormatting.GOLD)));
|
||||
if(!inv.getStackInSlot(0).isEmpty())
|
||||
tooltip.add(componentSpacing.plainCopy().append(new TranslationTextComponent("tooltip.steampowered.burner.item", inv.getStackInSlot(0).getCount(), inv.getStackInSlot(0).getItem().getName(inv.getStackInSlot(0))).withStyle(TextFormatting.GRAY)));
|
||||
tooltip.add(componentSpacing.plainCopy().append(new TranslatableComponent("tooltip.steampowered.burner.item", inv.getStackInSlot(0).getCount(), inv.getStackInSlot(0).getItem().getName(inv.getStackInSlot(0))).withStyle(ChatFormatting.GRAY)));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,9 +21,11 @@ package com.teammoeg.steampowered.content.burner;
|
|||
import com.teammoeg.steampowered.SPConfig;
|
||||
import com.teammoeg.steampowered.registrate.SPTiles;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
|
||||
|
||||
public class CastIronBurnerBlock extends BurnerBlock {
|
||||
public CastIronBurnerBlock(Properties properties) {
|
||||
|
@ -31,7 +33,7 @@ public class CastIronBurnerBlock extends BurnerBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
public BlockEntity createTileEntity(BlockState state, BlockGetter world) {
|
||||
return SPTiles.CAST_IRON_BURNER.create();
|
||||
}
|
||||
|
||||
|
|
|
@ -20,11 +20,11 @@ package com.teammoeg.steampowered.content.burner;
|
|||
|
||||
import com.teammoeg.steampowered.SPConfig;
|
||||
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
|
||||
public class CastIronBurnerTileEntity extends BurnerTileEntity {
|
||||
|
||||
public CastIronBurnerTileEntity(TileEntityType<?> type) {
|
||||
public CastIronBurnerTileEntity(BlockEntityType<?> type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,9 +21,11 @@ package com.teammoeg.steampowered.content.burner;
|
|||
import com.teammoeg.steampowered.SPConfig;
|
||||
import com.teammoeg.steampowered.registrate.SPTiles;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
|
||||
|
||||
public class SteelBurnerBlock extends BurnerBlock {
|
||||
public SteelBurnerBlock(Properties properties) {
|
||||
|
@ -31,7 +33,7 @@ public class SteelBurnerBlock extends BurnerBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
public BlockEntity createTileEntity(BlockState state, BlockGetter world) {
|
||||
return SPTiles.STEEL_BURNER.create();
|
||||
}
|
||||
|
||||
|
|
|
@ -20,11 +20,11 @@ package com.teammoeg.steampowered.content.burner;
|
|||
|
||||
import com.teammoeg.steampowered.SPConfig;
|
||||
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
|
||||
public class SteelBurnerTileEntity extends BurnerTileEntity {
|
||||
|
||||
public SteelBurnerTileEntity(TileEntityType<?> type) {
|
||||
public SteelBurnerTileEntity(BlockEntityType<?> type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,17 +21,17 @@ package com.teammoeg.steampowered.content.cogwheel;
|
|||
import com.simibubi.create.content.contraptions.relays.elementary.CogWheelBlock;
|
||||
import com.teammoeg.steampowered.registrate.SPTiles;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
|
||||
|
||||
public class MetalCogwheelBlock extends CogWheelBlock {
|
||||
protected MetalCogwheelBlock(boolean large, Properties properties) {
|
||||
super(large, properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
public MetalCogwheelTileEntity createTileEntity(BlockState state, BlockGetter world) {
|
||||
return SPTiles.METAL_COGWHEEL.create();
|
||||
}
|
||||
|
||||
|
|
|
@ -20,10 +20,10 @@ package com.teammoeg.steampowered.content.cogwheel;
|
|||
|
||||
import com.simibubi.create.content.contraptions.relays.elementary.SimpleKineticTileEntity;
|
||||
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
|
||||
public class MetalCogwheelTileEntity extends SimpleKineticTileEntity {
|
||||
public MetalCogwheelTileEntity(TileEntityType<? extends MetalCogwheelTileEntity> type) {
|
||||
public MetalCogwheelTileEntity(BlockEntityType<? extends MetalCogwheelTileEntity> type) {
|
||||
super(type);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,15 +27,17 @@ import com.teammoeg.steampowered.SPConfig;
|
|||
import com.teammoeg.steampowered.client.ClientUtils;
|
||||
import com.teammoeg.steampowered.registrate.SPTiles;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
|
||||
|
||||
public class BronzeSteamEngineBlock extends SteamEngineBlock implements ITE<BronzeSteamEngineTileEntity> {
|
||||
public BronzeSteamEngineBlock(Properties builder) {
|
||||
|
@ -43,7 +45,7 @@ public class BronzeSteamEngineBlock extends SteamEngineBlock implements ITE<Bron
|
|||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
public BlockEntity createTileEntity(BlockState state, BlockGetter world) {
|
||||
return SPTiles.BRONZE_STEAM_ENGINE.create();
|
||||
}
|
||||
|
||||
|
@ -52,12 +54,12 @@ public class BronzeSteamEngineBlock extends SteamEngineBlock implements ITE<Bron
|
|||
return BronzeSteamEngineTileEntity.class;
|
||||
}
|
||||
@Override
|
||||
public void appendHoverText(ItemStack i, IBlockReader w, List<ITextComponent> t,
|
||||
ITooltipFlag f) {
|
||||
public void appendHoverText(ItemStack i, BlockGetter w, List<Component> t,
|
||||
TooltipFlag f) {
|
||||
if(Screen.hasShiftDown()) {
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.engine.brief").withStyle(TextFormatting.GOLD));
|
||||
t.add(new TranslatableComponent("tooltip.steampowered.engine.brief").withStyle(ChatFormatting.GOLD));
|
||||
if(ClientUtils.hasGoggles())
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.engine.steamconsume",SPConfig.COMMON.bronzeFlywheelSteamConsumptionPerTick.get()).withStyle(TextFormatting.GOLD));
|
||||
t.add(new TranslatableComponent("tooltip.steampowered.engine.steamconsume",SPConfig.COMMON.bronzeFlywheelSteamConsumptionPerTick.get()).withStyle(ChatFormatting.GOLD));
|
||||
}else {
|
||||
t.add(TooltipHelper.holdShift(Palette.Gray,false));
|
||||
}
|
||||
|
|
|
@ -21,11 +21,11 @@ package com.teammoeg.steampowered.content.engine;
|
|||
import com.teammoeg.steampowered.SPConfig;
|
||||
import com.teammoeg.steampowered.registrate.SPBlocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
|
||||
public class BronzeSteamEngineTileEntity extends SteamEngineTileEntity {
|
||||
public BronzeSteamEngineTileEntity(TileEntityType<? extends SteamEngineTileEntity> type) {
|
||||
public BronzeSteamEngineTileEntity(BlockEntityType<? extends SteamEngineTileEntity> type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
|
|
|
@ -27,15 +27,17 @@ import com.teammoeg.steampowered.SPConfig;
|
|||
import com.teammoeg.steampowered.client.ClientUtils;
|
||||
import com.teammoeg.steampowered.registrate.SPTiles;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
|
||||
|
||||
public class CastIronSteamEngineBlock extends SteamEngineBlock implements ITE<CastIronSteamEngineTileEntity> {
|
||||
public CastIronSteamEngineBlock(Properties builder) {
|
||||
|
@ -43,16 +45,16 @@ public class CastIronSteamEngineBlock extends SteamEngineBlock implements ITE<Ca
|
|||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
public BlockEntity createTileEntity(BlockState state, BlockGetter world) {
|
||||
return SPTiles.CAST_IRON_STEAM_ENGINE.create();
|
||||
}
|
||||
@Override
|
||||
public void appendHoverText(ItemStack i, IBlockReader w, List<ITextComponent> t,
|
||||
ITooltipFlag f) {
|
||||
public void appendHoverText(ItemStack i, BlockGetter w, List<Component> t,
|
||||
TooltipFlag f) {
|
||||
if(Screen.hasShiftDown()) {
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.engine.brief").withStyle(TextFormatting.GOLD));
|
||||
t.add(new TranslatableComponent("tooltip.steampowered.engine.brief").withStyle(ChatFormatting.GOLD));
|
||||
if(ClientUtils.hasGoggles())
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.engine.steamconsume",SPConfig.COMMON.castIronFlywheelSteamConsumptionPerTick.get()).withStyle(TextFormatting.GOLD));
|
||||
t.add(new TranslatableComponent("tooltip.steampowered.engine.steamconsume",SPConfig.COMMON.castIronFlywheelSteamConsumptionPerTick.get()).withStyle(ChatFormatting.GOLD));
|
||||
}else {
|
||||
t.add(TooltipHelper.holdShift(Palette.Gray,false));
|
||||
}
|
||||
|
|
|
@ -21,11 +21,11 @@ package com.teammoeg.steampowered.content.engine;
|
|||
import com.teammoeg.steampowered.SPConfig;
|
||||
import com.teammoeg.steampowered.registrate.SPBlocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
|
||||
public class CastIronSteamEngineTileEntity extends SteamEngineTileEntity {
|
||||
public CastIronSteamEngineTileEntity(TileEntityType<? extends SteamEngineTileEntity> type) {
|
||||
public CastIronSteamEngineTileEntity(BlockEntityType<? extends SteamEngineTileEntity> type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,33 +31,35 @@ import com.teammoeg.steampowered.ItemRegistry;
|
|||
import com.teammoeg.steampowered.client.Particles;
|
||||
import com.teammoeg.steampowered.registrate.SPTiles;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.entity.item.ItemEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.InteractionResult;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
|
||||
|
||||
public class SteamEngineBlock extends EngineBlock {
|
||||
public static final BooleanProperty LIT = BlockStateProperties.LIT;
|
||||
|
||||
|
@ -66,22 +68,22 @@ public class SteamEngineBlock extends EngineBlock {
|
|||
this.registerDefaultState(this.stateDefinition.any().setValue(LIT, Boolean.valueOf(false)));
|
||||
}
|
||||
|
||||
public BlockState getStateForPlacement(BlockItemUseContext context) {
|
||||
public BlockState getStateForPlacement(BlockPlaceContext context) {
|
||||
Direction facing = context.getClickedFace();
|
||||
return this.defaultBlockState().setValue(FACING, facing.getAxis().isVertical() ? context.getHorizontalDirection().getOpposite() : facing).setValue(LIT, Boolean.valueOf(false));
|
||||
}
|
||||
|
||||
protected void createBlockStateDefinition(StateContainer.Builder<Block, BlockState> builder) {
|
||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
||||
super.createBlockStateDefinition(builder.add(LIT));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
public BlockEntity createTileEntity(BlockState state, BlockGetter world) {
|
||||
return SPTiles.BRONZE_STEAM_ENGINE.create();
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
|
||||
public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context) {
|
||||
return AllShapes.FURNACE_ENGINE.get(state.getValue(FACING));
|
||||
}
|
||||
|
||||
|
@ -92,18 +94,18 @@ public class SteamEngineBlock extends EngineBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean isValidBaseBlock(BlockState baseBlock, IBlockReader world, BlockPos pos) {
|
||||
protected boolean isValidBaseBlock(BlockState baseBlock, BlockGetter world, BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void animateTick(BlockState p_180655_1_, World p_180655_2_, BlockPos p_180655_3_, Random p_180655_4_) {
|
||||
public void animateTick(BlockState p_180655_1_, Level p_180655_2_, BlockPos p_180655_3_, Random p_180655_4_) {
|
||||
if (p_180655_1_.getValue(LIT)) {
|
||||
double d0 = p_180655_3_.getX() + 0.5D;
|
||||
double d1 = p_180655_3_.getY();
|
||||
double d2 = p_180655_3_.getZ() + 0.5D;
|
||||
if (p_180655_4_.nextDouble() < 0.1D) {
|
||||
p_180655_2_.playLocalSound(d0, d1, d2, SoundEvents.BLASTFURNACE_FIRE_CRACKLE, SoundCategory.BLOCKS, 1.0F, 1.0F, false);
|
||||
p_180655_2_.playLocalSound(d0, d1, d2, SoundEvents.BLASTFURNACE_FIRE_CRACKLE, SoundSource.BLOCKS, 1.0F, 1.0F, false);
|
||||
}
|
||||
|
||||
Direction direction = p_180655_1_.getValue(FACING);
|
||||
|
@ -118,9 +120,9 @@ public class SteamEngineBlock extends EngineBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionResultType use(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult blockRayTraceResult) {
|
||||
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult blockRayTraceResult) {
|
||||
if (player.getItemInHand(hand).getItem() == ItemRegistry.pressurizedSteamContainer.get()) {
|
||||
TileEntity te = world.getBlockEntity(pos);
|
||||
BlockEntity te = world.getBlockEntity(pos);
|
||||
if (te instanceof SteamEngineTileEntity) {
|
||||
SteamEngineTileEntity steamEngine = (SteamEngineTileEntity) te;
|
||||
IFluidHandler cap = steamEngine.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY).resolve().get();
|
||||
|
@ -129,9 +131,9 @@ public class SteamEngineBlock extends EngineBlock {
|
|||
ItemStack ret=new ItemStack(ItemRegistry.pressurizedGasContainer.get());
|
||||
if(!player.addItem(ret))
|
||||
world.addFreshEntity(new ItemEntity(world, pos.getX(),pos.getY(),pos.getZ(),ret));
|
||||
return ActionResultType.SUCCESS;
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
return ActionResultType.PASS;
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
return super.use(state, world, pos, player, hand, blockRayTraceResult);
|
||||
}
|
||||
|
|
|
@ -30,20 +30,20 @@ import com.simibubi.create.content.contraptions.components.flywheel.engine.Engin
|
|||
import com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation;
|
||||
import com.teammoeg.steampowered.FluidRegistry;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Fluid;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.tags.FluidTags;
|
||||
import net.minecraft.tags.ITag;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.tags.Tag;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
|
@ -57,11 +57,11 @@ public abstract class SteamEngineTileEntity extends EngineTileEntity implements
|
|||
private LazyOptional<IFluidHandler> holder = LazyOptional.of(() -> tank);
|
||||
private int heatup = 0;
|
||||
|
||||
public SteamEngineTileEntity(TileEntityType<? extends SteamEngineTileEntity> type) {
|
||||
public SteamEngineTileEntity(BlockEntityType<? extends SteamEngineTileEntity> type) {
|
||||
super(type);
|
||||
this.refreshCapability();
|
||||
this.tank = new FluidTank(this.getSteamStorage(), fluidStack -> {
|
||||
ITag<Fluid> steamTag = FluidTags.getAllTags().getTag(new ResourceLocation("forge", "steam"));
|
||||
Tag<Fluid> steamTag = FluidTags.getAllTags().getTag(new ResourceLocation("forge", "steam"));
|
||||
if (steamTag != null)
|
||||
return fluidStack.getFluid().is(steamTag);
|
||||
else
|
||||
|
@ -103,33 +103,33 @@ public abstract class SteamEngineTileEntity extends EngineTileEntity implements
|
|||
}
|
||||
}
|
||||
|
||||
public boolean addToGoggleTooltip(List<ITextComponent> tooltip, boolean isPlayerSneaking) {
|
||||
public boolean addToGoggleTooltip(List<Component> tooltip, boolean isPlayerSneaking) {
|
||||
if (!this.getBlockState().getValue(SteamEngineBlock.LIT)) {
|
||||
tooltip.add(componentSpacing.plainCopy()
|
||||
.append(new TranslationTextComponent("tooltip.steampowered.steam_engine.not_enough_steam")
|
||||
.withStyle(TextFormatting.RED)));
|
||||
.append(new TranslatableComponent("tooltip.steampowered.steam_engine.not_enough_steam")
|
||||
.withStyle(ChatFormatting.RED)));
|
||||
} else if (heatup < 60) {
|
||||
tooltip.add(componentSpacing.plainCopy()
|
||||
.append(new TranslationTextComponent("tooltip.steampowered.steam_engine.heating")
|
||||
.withStyle(TextFormatting.YELLOW)));
|
||||
.append(new TranslatableComponent("tooltip.steampowered.steam_engine.heating")
|
||||
.withStyle(ChatFormatting.YELLOW)));
|
||||
} else {
|
||||
tooltip.add(componentSpacing.plainCopy()
|
||||
.append(new TranslationTextComponent("tooltip.steampowered.steam_engine.running")
|
||||
.withStyle(TextFormatting.GREEN)));
|
||||
.append(new TranslatableComponent("tooltip.steampowered.steam_engine.running")
|
||||
.withStyle(ChatFormatting.GREEN)));
|
||||
}
|
||||
return this.containedFluidTooltip(tooltip, isPlayerSneaking,
|
||||
getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY));
|
||||
}
|
||||
|
||||
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||
protected void fromTag(BlockState state, CompoundTag compound, boolean clientPacket) {
|
||||
super.fromTag(state, compound, clientPacket);
|
||||
tank.readFromNBT(compound.getCompound("TankContent"));
|
||||
heatup = compound.getInt("heatup");
|
||||
}
|
||||
|
||||
public void write(CompoundNBT compound, boolean clientPacket) {
|
||||
public void write(CompoundTag compound, boolean clientPacket) {
|
||||
super.write(compound, clientPacket);
|
||||
compound.put("TankContent", tank.writeToNBT(new CompoundNBT()));
|
||||
compound.put("TankContent", tank.writeToNBT(new CompoundTag()));
|
||||
compound.putInt("heatup", heatup);
|
||||
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ public abstract class SteamEngineTileEntity extends EngineTileEntity implements
|
|||
if (wheelFacing.getAxis() == engineFacing.getClockWise().getAxis()) {
|
||||
if (!FlywheelBlock.isConnected(wheelState)
|
||||
|| FlywheelBlock.getConnection(wheelState) == engineFacing.getOpposite()) {
|
||||
TileEntity te = this.level.getBlockEntity(wheelPos);
|
||||
BlockEntity te = this.level.getBlockEntity(wheelPos);
|
||||
if (!te.isRemoved()) {
|
||||
if (te instanceof FlywheelTileEntity) {
|
||||
if (!FlywheelBlock.isConnected(wheelState)) {
|
||||
|
|
|
@ -27,15 +27,17 @@ import com.teammoeg.steampowered.SPConfig;
|
|||
import com.teammoeg.steampowered.client.ClientUtils;
|
||||
import com.teammoeg.steampowered.registrate.SPTiles;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
|
||||
|
||||
public class SteelSteamEngineBlock extends SteamEngineBlock implements ITE<SteelSteamEngineTileEntity> {
|
||||
public SteelSteamEngineBlock(Properties builder) {
|
||||
|
@ -43,16 +45,16 @@ public class SteelSteamEngineBlock extends SteamEngineBlock implements ITE<Steel
|
|||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
public BlockEntity createTileEntity(BlockState state, BlockGetter world) {
|
||||
return SPTiles.STEEL_STEAM_ENGINE.create();
|
||||
}
|
||||
@Override
|
||||
public void appendHoverText(ItemStack i, IBlockReader w, List<ITextComponent> t,
|
||||
ITooltipFlag f) {
|
||||
public void appendHoverText(ItemStack i, BlockGetter w, List<Component> t,
|
||||
TooltipFlag f) {
|
||||
if(Screen.hasShiftDown()) {
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.engine.brief").withStyle(TextFormatting.GOLD));
|
||||
t.add(new TranslatableComponent("tooltip.steampowered.engine.brief").withStyle(ChatFormatting.GOLD));
|
||||
if(ClientUtils.hasGoggles())
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.engine.steamconsume",SPConfig.COMMON.steelFlywheelSteamConsumptionPerTick.get()).withStyle(TextFormatting.GOLD));
|
||||
t.add(new TranslatableComponent("tooltip.steampowered.engine.steamconsume",SPConfig.COMMON.steelFlywheelSteamConsumptionPerTick.get()).withStyle(ChatFormatting.GOLD));
|
||||
}else {
|
||||
t.add(TooltipHelper.holdShift(Palette.Gray,false));
|
||||
}
|
||||
|
|
|
@ -21,11 +21,11 @@ package com.teammoeg.steampowered.content.engine;
|
|||
import com.teammoeg.steampowered.SPConfig;
|
||||
import com.teammoeg.steampowered.registrate.SPBlocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
|
||||
public class SteelSteamEngineTileEntity extends SteamEngineTileEntity {
|
||||
public SteelSteamEngineTileEntity(TileEntityType<? extends SteamEngineTileEntity> type) {
|
||||
public SteelSteamEngineTileEntity(BlockEntityType<? extends SteamEngineTileEntity> type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,9 +21,11 @@ package com.teammoeg.steampowered.content.flywheel;
|
|||
import com.simibubi.create.content.contraptions.components.flywheel.FlywheelBlock;
|
||||
import com.teammoeg.steampowered.registrate.SPTiles;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
|
||||
|
||||
public class BronzeSteamFlywheelBlock extends FlywheelBlock {
|
||||
public BronzeSteamFlywheelBlock(Properties properties) {
|
||||
|
@ -31,7 +33,7 @@ public class BronzeSteamFlywheelBlock extends FlywheelBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
public BlockEntity createTileEntity(BlockState state, BlockGetter world) {
|
||||
return SPTiles.BRONZE_STEAM_FLYWHEEL.create();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,9 +21,11 @@ package com.teammoeg.steampowered.content.flywheel;
|
|||
import com.simibubi.create.content.contraptions.components.flywheel.FlywheelBlock;
|
||||
import com.teammoeg.steampowered.registrate.SPTiles;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
|
||||
|
||||
public class CastIronSteamFlywheelBlock extends FlywheelBlock {
|
||||
public CastIronSteamFlywheelBlock(Properties properties) {
|
||||
|
@ -31,7 +33,7 @@ public class CastIronSteamFlywheelBlock extends FlywheelBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
public BlockEntity createTileEntity(BlockState state, BlockGetter world) {
|
||||
return SPTiles.CAST_IRON_STEAM_FLYWHEEL.create();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,9 +21,11 @@ package com.teammoeg.steampowered.content.flywheel;
|
|||
import com.simibubi.create.content.contraptions.components.flywheel.FlywheelBlock;
|
||||
import com.teammoeg.steampowered.registrate.SPTiles;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
|
||||
|
||||
public class SteelSteamFlywheelBlock extends FlywheelBlock {
|
||||
public SteelSteamFlywheelBlock(Properties properties) {
|
||||
|
@ -31,7 +33,7 @@ public class SteelSteamFlywheelBlock extends FlywheelBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
public BlockEntity createTileEntity(BlockState state, BlockGetter world) {
|
||||
return SPTiles.STEEL_STEAM_FLYWHEEL.create();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,6 +24,8 @@ import org.spongepowered.asm.mixin.gen.Accessor;
|
|||
import com.simibubi.create.content.contraptions.components.flywheel.FlywheelTileEntity;
|
||||
import com.simibubi.create.foundation.gui.widgets.InterpolatedChasingValue;
|
||||
|
||||
import InterpolatedChasingValue;
|
||||
|
||||
@Mixin(FlywheelTileEntity.class)
|
||||
public interface FlywheelTileEntityAccess {
|
||||
@Accessor(remap = false)
|
||||
|
|
|
@ -14,15 +14,15 @@ import com.simibubi.create.content.contraptions.components.flywheel.engine.Engin
|
|||
import com.simibubi.create.content.contraptions.components.flywheel.engine.EngineTileEntity;
|
||||
import com.teammoeg.steampowered.content.engine.SteamEngineTileEntity;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.core.BlockPos;
|
||||
|
||||
@Mixin(FlywheelTileEntity.class)
|
||||
public abstract class MixinFlywheel extends GeneratingKineticTileEntity{
|
||||
public MixinFlywheel(TileEntityType<?> typeIn) {
|
||||
public MixinFlywheel(BlockEntityType<?> typeIn) {
|
||||
super(typeIn);
|
||||
}
|
||||
@Shadow(remap=false)
|
||||
|
@ -37,7 +37,7 @@ public abstract class MixinFlywheel extends GeneratingKineticTileEntity{
|
|||
FlywheelBlock.setConnection(getWorld(),getBlockPos(),getBlockState(),null);
|
||||
this.setRotation(0,0);
|
||||
}else {
|
||||
TileEntity te=this.getWorld().getBlockEntity(eng);
|
||||
BlockEntity te=this.getWorld().getBlockEntity(eng);
|
||||
if(te instanceof EngineTileEntity) {
|
||||
if(te instanceof SteamEngineTileEntity) {
|
||||
SteamEngineTileEntity ete=(SteamEngineTileEntity) te;
|
||||
|
|
|
@ -20,9 +20,10 @@ package com.teammoeg.steampowered.network;
|
|||
|
||||
import com.teammoeg.steampowered.SteamPowered;
|
||||
|
||||
import net.minecraftforge.fml.network.NetworkRegistry;
|
||||
import net.minecraftforge.fml.network.PacketDistributor;
|
||||
import net.minecraftforge.fml.network.simple.SimpleChannel;
|
||||
|
||||
import net.minecraftforge.network.NetworkRegistry;
|
||||
import net.minecraftforge.network.PacketDistributor;
|
||||
import net.minecraftforge.network.simple.SimpleChannel;
|
||||
|
||||
public class PacketHandler {
|
||||
private static final String VERSION = Integer.toString(1);
|
||||
|
|
|
@ -20,12 +20,13 @@ package com.teammoeg.steampowered.ponder;
|
|||
|
||||
import com.simibubi.create.Create;
|
||||
import com.simibubi.create.foundation.ponder.PonderRegistrationHelper;
|
||||
import com.simibubi.create.foundation.ponder.PonderTag;
|
||||
import com.simibubi.create.foundation.ponder.content.KineticsScenes;
|
||||
import com.simibubi.create.foundation.ponder.content.PonderTag;
|
||||
import com.teammoeg.steampowered.SteamPowered;
|
||||
import com.teammoeg.steampowered.registrate.SPBlocks;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
|
||||
public class SPPonderIndex {
|
||||
static final PonderRegistrationHelper CREATE_HELPER = new PonderRegistrationHelper(Create.ID);
|
||||
|
|
|
@ -20,11 +20,11 @@ package com.teammoeg.steampowered.ponder;
|
|||
|
||||
import com.simibubi.create.content.contraptions.components.flywheel.FlywheelBlock;
|
||||
import com.simibubi.create.content.contraptions.components.flywheel.FlywheelBlock.ConnectionState;
|
||||
import com.simibubi.create.foundation.ponder.PonderPalette;
|
||||
import com.simibubi.create.foundation.ponder.SceneBuilder;
|
||||
import com.simibubi.create.foundation.ponder.SceneBuildingUtil;
|
||||
import com.simibubi.create.foundation.ponder.Selection;
|
||||
import com.simibubi.create.foundation.ponder.content.PonderPalette;
|
||||
import com.simibubi.create.foundation.ponder.elements.InputWindowElement;
|
||||
import com.simibubi.create.foundation.ponder.element.InputWindowElement;
|
||||
import com.simibubi.create.foundation.utility.Pointing;
|
||||
import com.teammoeg.steampowered.SPConfig;
|
||||
import com.teammoeg.steampowered.content.alternator.DynamoBlock;
|
||||
|
@ -32,12 +32,12 @@ import com.teammoeg.steampowered.content.burner.BurnerBlock;
|
|||
import com.teammoeg.steampowered.content.engine.SteamEngineBlock;
|
||||
import com.teammoeg.steampowered.registrate.SPBlocks;
|
||||
|
||||
import net.minecraft.block.LeverBlock;
|
||||
import net.minecraft.block.RedstoneWireBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.level.block.LeverBlock;
|
||||
import net.minecraft.world.level.block.RedStoneWireBlock;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.core.BlockPos;
|
||||
|
||||
public class SPScenes {
|
||||
|
||||
|
@ -270,7 +270,7 @@ public class SPScenes {
|
|||
scene.idle(60);
|
||||
|
||||
scene.world.modifyBlock(lever, s -> s.setValue(LeverBlock.POWERED, true), false);
|
||||
scene.world.modifyBlock(redstone, s -> s.setValue(RedstoneWireBlock.POWER, 15), false);
|
||||
scene.world.modifyBlock(redstone, s -> s.setValue(RedStoneWireBlock.POWER, 15), false);
|
||||
scene.world.modifyBlock(generator, s -> s.setValue(DynamoBlock.REDSTONE_LOCKED, true), false);
|
||||
scene.idle(60);
|
||||
}
|
||||
|
|
|
@ -49,14 +49,14 @@ import com.teammoeg.steampowered.content.flywheel.BronzeSteamFlywheelBlock;
|
|||
import com.teammoeg.steampowered.content.flywheel.CastIronSteamFlywheelBlock;
|
||||
import com.teammoeg.steampowered.content.flywheel.SteelSteamFlywheelBlock;
|
||||
|
||||
import net.minecraft.block.AbstractBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
|
||||
public class SPBlocks {
|
||||
private static final CreateRegistrate REGISTRATE = SteamPowered.registrate.get()
|
||||
.itemGroup(() -> SteamPowered.itemGroup);
|
||||
.creativeModeTab(() -> SteamPowered.itemGroup);
|
||||
|
||||
public static final BlockEntry<BronzeBurnerBlock> BRONZE_BURNER = REGISTRATE.block("bronze_burner", BronzeBurnerBlock::new)
|
||||
.initialProperties(SharedProperties::softMetal)
|
||||
|
@ -182,7 +182,7 @@ public class SPBlocks {
|
|||
|
||||
public static final BlockEntry<BronzeSteamFlywheelBlock> BRONZE_FLYWHEEL = REGISTRATE.block("bronze_flywheel", BronzeSteamFlywheelBlock::new)
|
||||
.initialProperties(SharedProperties::softMetal)
|
||||
.properties(AbstractBlock.Properties::noOcclusion)
|
||||
.properties(BlockBehaviour.Properties::noOcclusion)
|
||||
.transform(BlockStressDefaults.setNoImpact())
|
||||
.blockstate(new FlywheelGenerator()::generate)
|
||||
.item()
|
||||
|
@ -191,7 +191,7 @@ public class SPBlocks {
|
|||
|
||||
public static final BlockEntry<CastIronSteamFlywheelBlock> CAST_IRON_FLYWHEEL = REGISTRATE.block("cast_iron_flywheel", CastIronSteamFlywheelBlock::new)
|
||||
.initialProperties(SPBlocks::hardMetal)
|
||||
.properties(AbstractBlock.Properties::noOcclusion)
|
||||
.properties(BlockBehaviour.Properties::noOcclusion)
|
||||
.transform(BlockStressDefaults.setNoImpact())
|
||||
.blockstate(new FlywheelGenerator()::generate)
|
||||
.item()
|
||||
|
@ -200,7 +200,7 @@ public class SPBlocks {
|
|||
|
||||
public static final BlockEntry<SteelSteamFlywheelBlock> STEEL_FLYWHEEL = REGISTRATE.block("steel_flywheel", SteelSteamFlywheelBlock::new)
|
||||
.initialProperties(SPBlocks::hardMetal)
|
||||
.properties(AbstractBlock.Properties::noOcclusion)
|
||||
.properties(BlockBehaviour.Properties::noOcclusion)
|
||||
.transform(BlockStressDefaults.setNoImpact())
|
||||
.blockstate(new FlywheelGenerator()::generate)
|
||||
.item()
|
||||
|
|
|
@ -22,12 +22,12 @@ import com.simibubi.create.foundation.data.CreateRegistrate;
|
|||
import com.simibubi.create.repack.registrate.util.entry.ItemEntry;
|
||||
import com.teammoeg.steampowered.SteamPowered;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.world.item.Item;
|
||||
|
||||
public class SPItems {
|
||||
|
||||
private static final CreateRegistrate REGISTRATE = SteamPowered.registrate.get()
|
||||
.itemGroup(() -> SteamPowered.itemGroup);
|
||||
.creativeModeTab(() -> SteamPowered.itemGroup);
|
||||
|
||||
public static final ItemEntry<Item> BRONZE_SHEET =
|
||||
REGISTRATE.item("bronze_sheet", Item::new)
|
||||
|
|
|
@ -22,7 +22,7 @@ import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
|
|||
import com.simibubi.create.content.contraptions.base.SingleRotatingInstance;
|
||||
import com.simibubi.create.content.contraptions.components.flywheel.FlywheelTileEntity;
|
||||
import com.simibubi.create.foundation.data.CreateRegistrate;
|
||||
import com.simibubi.create.repack.registrate.util.entry.TileEntityEntry;
|
||||
import com.simibubi.create.repack.registrate.util.entry.BlockEntityEntry;
|
||||
import com.teammoeg.steampowered.SteamPowered;
|
||||
import com.teammoeg.steampowered.client.instance.BronzeFlywheelInstance;
|
||||
import com.teammoeg.steampowered.client.instance.CastIronFlywheelInstance;
|
||||
|
@ -42,83 +42,84 @@ import com.teammoeg.steampowered.content.engine.BronzeSteamEngineTileEntity;
|
|||
import com.teammoeg.steampowered.content.engine.CastIronSteamEngineTileEntity;
|
||||
import com.teammoeg.steampowered.content.engine.SteelSteamEngineTileEntity;
|
||||
|
||||
|
||||
public class SPTiles {
|
||||
private static final CreateRegistrate REGISTRATE = SteamPowered.registrate.get()
|
||||
.itemGroup(() -> SteamPowered.itemGroup);
|
||||
.creativeModeTab(() -> SteamPowered.itemGroup);
|
||||
|
||||
public static final TileEntityEntry<BronzeBurnerTileEntity> BRONZE_BURNER = REGISTRATE
|
||||
public static final BlockEntityEntry<BronzeBurnerTileEntity> BRONZE_BURNER = REGISTRATE
|
||||
.tileEntity("bronze_burner", BronzeBurnerTileEntity::new)
|
||||
.validBlocks(SPBlocks.BRONZE_BURNER)
|
||||
.register();
|
||||
|
||||
public static final TileEntityEntry<CastIronBurnerTileEntity> CAST_IRON_BURNER = REGISTRATE
|
||||
public static final BlockEntityEntry<CastIronBurnerTileEntity> CAST_IRON_BURNER = REGISTRATE
|
||||
.tileEntity("cast_iron_burner", CastIronBurnerTileEntity::new)
|
||||
.validBlocks(SPBlocks.CAST_IRON_BURNER)
|
||||
.register();
|
||||
|
||||
public static final TileEntityEntry<SteelBurnerTileEntity> STEEL_BURNER = REGISTRATE
|
||||
public static final BlockEntityEntry<SteelBurnerTileEntity> STEEL_BURNER = REGISTRATE
|
||||
.tileEntity("steel_burner", SteelBurnerTileEntity::new)
|
||||
.validBlocks(SPBlocks.STEEL_BURNER)
|
||||
.register();
|
||||
|
||||
public static final TileEntityEntry<BronzeBoilerTileEntity> BRONZE_BOILER = REGISTRATE
|
||||
public static final BlockEntityEntry<BronzeBoilerTileEntity> BRONZE_BOILER = REGISTRATE
|
||||
.tileEntity("bronze_boiler", BronzeBoilerTileEntity::new)
|
||||
.validBlocks(SPBlocks.BRONZE_BOILER)
|
||||
.register();
|
||||
|
||||
public static final TileEntityEntry<CastIronBoilerTileEntity> CAST_IRON_BOILER = REGISTRATE
|
||||
public static final BlockEntityEntry<CastIronBoilerTileEntity> CAST_IRON_BOILER = REGISTRATE
|
||||
.tileEntity("cast_iron_boiler", CastIronBoilerTileEntity::new)
|
||||
.validBlocks(SPBlocks.CAST_IRON_BOILER)
|
||||
.register();
|
||||
|
||||
public static final TileEntityEntry<SteelBoilerTileEntity> STEEL_BOILER = REGISTRATE
|
||||
public static final BlockEntityEntry<SteelBoilerTileEntity> STEEL_BOILER = REGISTRATE
|
||||
.tileEntity("steel_boiler", SteelBoilerTileEntity::new)
|
||||
.validBlocks(SPBlocks.STEEL_BOILER)
|
||||
.register();
|
||||
|
||||
public static final TileEntityEntry<BronzeSteamEngineTileEntity> BRONZE_STEAM_ENGINE = REGISTRATE
|
||||
public static final BlockEntityEntry<BronzeSteamEngineTileEntity> BRONZE_STEAM_ENGINE = REGISTRATE
|
||||
.tileEntity("bronze_steam_engine", BronzeSteamEngineTileEntity::new)
|
||||
.validBlocks(SPBlocks.BRONZE_STEAM_ENGINE)
|
||||
.register();
|
||||
|
||||
public static final TileEntityEntry<CastIronSteamEngineTileEntity> CAST_IRON_STEAM_ENGINE = REGISTRATE
|
||||
public static final BlockEntityEntry<CastIronSteamEngineTileEntity> CAST_IRON_STEAM_ENGINE = REGISTRATE
|
||||
.tileEntity("cast_iron_steam_engine", CastIronSteamEngineTileEntity::new)
|
||||
.validBlocks(SPBlocks.CAST_IRON_STEAM_ENGINE)
|
||||
.register();
|
||||
|
||||
public static final TileEntityEntry<SteelSteamEngineTileEntity> STEEL_STEAM_ENGINE = REGISTRATE
|
||||
public static final BlockEntityEntry<SteelSteamEngineTileEntity> STEEL_STEAM_ENGINE = REGISTRATE
|
||||
.tileEntity("steel_steam_engine", SteelSteamEngineTileEntity::new)
|
||||
.validBlocks(SPBlocks.STEEL_STEAM_ENGINE)
|
||||
.register();
|
||||
|
||||
public static final TileEntityEntry<MetalCogwheelTileEntity> METAL_COGWHEEL = REGISTRATE
|
||||
public static final BlockEntityEntry<MetalCogwheelTileEntity> METAL_COGWHEEL = REGISTRATE
|
||||
.tileEntity("metal_cogwheel", MetalCogwheelTileEntity::new)
|
||||
.instance(() -> SingleRotatingInstance::new)
|
||||
.validBlocks(SPBlocks.STEEL_COGWHEEL, SPBlocks.STEEL_LARGE_COGWHEEL, SPBlocks.CAST_IRON_COGWHEEL, SPBlocks.CAST_IRON_LARGE_COGWHEEL, SPBlocks.BRONZE_COGWHEEL, SPBlocks.BRONZE_LARGE_COGWHEEL)
|
||||
.renderer(() -> KineticTileEntityRenderer::new)
|
||||
.register();
|
||||
|
||||
public static final TileEntityEntry<DynamoTileEntity> DYNAMO = REGISTRATE
|
||||
public static final BlockEntityEntry<DynamoTileEntity> DYNAMO = REGISTRATE
|
||||
.tileEntity("alternator", DynamoTileEntity::new)
|
||||
.instance(() -> com.teammoeg.steampowered.content.alternator.DynamoShaftInstance::new)
|
||||
.validBlocks(SPBlocks.DYNAMO)
|
||||
.register();
|
||||
|
||||
public static final TileEntityEntry<FlywheelTileEntity> BRONZE_STEAM_FLYWHEEL = REGISTRATE
|
||||
public static final BlockEntityEntry<FlywheelTileEntity> BRONZE_STEAM_FLYWHEEL = REGISTRATE
|
||||
.tileEntity("bronze_steam_flywheel", FlywheelTileEntity::new)
|
||||
.instance(() -> BronzeFlywheelInstance::new)
|
||||
.validBlocks(SPBlocks.BRONZE_FLYWHEEL)
|
||||
.renderer(() -> BronzeFlywheelRenderer::new)
|
||||
.register();
|
||||
|
||||
public static final TileEntityEntry<FlywheelTileEntity> CAST_IRON_STEAM_FLYWHEEL = REGISTRATE
|
||||
public static final BlockEntityEntry<FlywheelTileEntity> CAST_IRON_STEAM_FLYWHEEL = REGISTRATE
|
||||
.tileEntity("cast_iron_steam_flywheel", FlywheelTileEntity::new)
|
||||
.instance(() -> CastIronFlywheelInstance::new)
|
||||
.validBlocks(SPBlocks.CAST_IRON_FLYWHEEL)
|
||||
.renderer(() -> CastIronFlywheelRenderer::new)
|
||||
.register();
|
||||
|
||||
public static final TileEntityEntry<FlywheelTileEntity> STEEL_STEAM_FLYWHEEL = REGISTRATE
|
||||
public static final BlockEntityEntry<FlywheelTileEntity> STEEL_STEAM_FLYWHEEL = REGISTRATE
|
||||
.tileEntity("steel_steam_flywheel", FlywheelTileEntity::new)
|
||||
.instance(() -> SteelFlywheelInstance::new)
|
||||
.validBlocks(SPBlocks.STEEL_FLYWHEEL)
|
||||
|
|
Loading…
Reference in New Issue