code optimization & retextures

This commit is contained in:
DrMangoTea
2025-08-09 21:53:15 +02:00
parent 80f59a270c
commit 7fd177a039
64 changed files with 450 additions and 1215 deletions

View File

@@ -4,7 +4,6 @@ import com.tterrag.registrate.util.entry.BlockEntry;
public class MaterialSet { public class MaterialSet {
public BlockEntry<?> block; public BlockEntry<?> block;
public BlockEntry<?> slab; public BlockEntry<?> slab;
public BlockEntry<?> stairs; public BlockEntry<?> stairs;

View File

@@ -8,9 +8,9 @@ import com.drmangotea.tfmg.config.TFMGStress;
import com.drmangotea.tfmg.content.decoration.FrameBlock; import com.drmangotea.tfmg.content.decoration.FrameBlock;
import com.drmangotea.tfmg.content.decoration.TrussBlock; import com.drmangotea.tfmg.content.decoration.TrussBlock;
import com.drmangotea.tfmg.content.decoration.doors.TFMGSlidingDoorBlock; import com.drmangotea.tfmg.content.decoration.doors.TFMGSlidingDoorBlock;
import com.drmangotea.tfmg.content.decoration.encased.TFMGEncasedCogwheelBlock; import com.drmangotea.tfmg.content.decoration.kinetics.encased.TFMGEncasedCogwheelBlock;
import com.drmangotea.tfmg.content.decoration.encased.TFMGEncasedShaftBlock; import com.drmangotea.tfmg.content.decoration.kinetics.encased.TFMGEncasedShaftBlock;
import com.drmangotea.tfmg.content.decoration.flywheels.TFMGFlywheelBlock; import com.drmangotea.tfmg.content.decoration.kinetics.flywheels.TFMGFlywheelBlock;
import com.drmangotea.tfmg.content.electricity.connection.copycat_cable.CopycatCableBlock; import com.drmangotea.tfmg.content.electricity.connection.copycat_cable.CopycatCableBlock;
import com.drmangotea.tfmg.content.electricity.lights.neon_tube.NeonTubeBlock; import com.drmangotea.tfmg.content.electricity.lights.neon_tube.NeonTubeBlock;
import com.drmangotea.tfmg.registry.TFMGBlocks; import com.drmangotea.tfmg.registry.TFMGBlocks;

View File

@@ -1,50 +1,26 @@
package com.drmangotea.tfmg.base; package com.drmangotea.tfmg.base;
import com.drmangotea.tfmg.TFMG; import com.drmangotea.tfmg.content.decoration.kinetics.encased.TFMGEncasedCogwheelBlock;
import com.drmangotea.tfmg.content.decoration.encased.TFMGEncasedCogwheelBlock;
import com.drmangotea.tfmg.content.machinery.misc.winding_machine.SpoolItem; import com.drmangotea.tfmg.content.machinery.misc.winding_machine.SpoolItem;
import com.drmangotea.tfmg.registry.TFMGBlocks; import com.drmangotea.tfmg.registry.TFMGBlocks;
import com.drmangotea.tfmg.registry.TFMGDataComponents; import com.drmangotea.tfmg.registry.TFMGDataComponents;
import com.drmangotea.tfmg.registry.TFMGEncasedBlocks;
import com.drmangotea.tfmg.registry.TFMGItems; import com.drmangotea.tfmg.registry.TFMGItems;
import com.simibubi.create.*; import com.simibubi.create.*;
import com.simibubi.create.content.contraptions.actors.seat.SeatBlock;
import com.simibubi.create.content.equipment.armor.BacktankUtil;
import com.simibubi.create.content.equipment.toolbox.ToolboxBlock;
import com.simibubi.create.content.kinetics.crank.ValveHandleBlock;
import com.simibubi.create.content.logistics.box.PackageStyles;
import com.simibubi.create.content.logistics.packagePort.postbox.PostboxBlock;
import com.simibubi.create.content.logistics.tableCloth.TableClothBlock;
import com.simibubi.create.content.processing.sequenced.SequencedAssemblyItem; import com.simibubi.create.content.processing.sequenced.SequencedAssemblyItem;
import com.simibubi.create.foundation.data.CreateRegistrate; import com.simibubi.create.foundation.data.CreateRegistrate;
import com.simibubi.create.foundation.item.TagDependentIngredientItem;
import com.tterrag.registrate.util.entry.BlockEntry;
import com.tterrag.registrate.util.entry.ItemEntry;
import com.tterrag.registrate.util.entry.ItemProviderEntry;
import com.tterrag.registrate.util.entry.RegistryEntry; import com.tterrag.registrate.util.entry.RegistryEntry;
import it.unimi.dsi.fastutil.objects.*;
import net.createmod.catnip.platform.CatnipServices;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.ItemRenderer;
import net.minecraft.client.resources.model.BakedModel;
import net.minecraft.core.registries.Registries; import net.minecraft.core.registries.Registries;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraft.world.item.*; import net.minecraft.world.item.*;
import net.minecraft.world.level.block.Block;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.api.distmarker.OnlyIn;
import net.neoforged.bus.api.IEventBus; import net.neoforged.bus.api.IEventBus;
import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent; import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent;
import net.neoforged.neoforge.registries.DeferredHolder; import net.neoforged.neoforge.registries.DeferredHolder;
import net.neoforged.neoforge.registries.DeferredRegister; import net.neoforged.neoforge.registries.DeferredRegister;
import org.apache.commons.lang3.mutable.MutableObject;
import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.ApiStatus;
import java.util.*; import java.util.*;
import java.util.function.Function;
import java.util.function.Predicate;
import static com.drmangotea.tfmg.TFMG.MOD_ID; import static com.drmangotea.tfmg.TFMG.MOD_ID;
import static com.drmangotea.tfmg.TFMG.REGISTRATE; import static com.drmangotea.tfmg.TFMG.REGISTRATE;

View File

@@ -1,120 +1,29 @@
package com.drmangotea.tfmg.base.spark; package com.drmangotea.tfmg.base.spark;
import com.drmangotea.tfmg.content.items.weapons.explosives.thermite_grenades.fire.BlueFireBlock; import com.drmangotea.tfmg.content.items.weapons.explosives.thermite_grenades.fire.BlueFireBlock;
import com.drmangotea.tfmg.registry.TFMGEntityTypes;
import com.drmangotea.tfmg.registry.TFMGItems;
import com.simibubi.create.content.trains.CubeParticleData;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.ParticleOptions;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.network.syncher.SynchedEntityData;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.projectile.ThrowableProjectile;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.EntityHitResult;
import net.minecraft.world.phys.HitResult;
public class BlueSpark extends ThrowableProjectile { import java.util.Optional;
public BlueSpark(EntityType<? extends BlueSpark> p_37391_, Level p_37392_) {
public class BlueSpark extends Spark{
public BlueSpark(EntityType<? extends Spark> p_37391_, Level p_37392_) {
super(p_37391_, p_37392_); super(p_37391_, p_37392_);
} }
public BlueSpark(Level p_37399_, LivingEntity p_37400_) { @Override
super(TFMGEntityTypes.SPARK.get(), p_37400_, p_37399_); public int getColor() {
return 0x00FFFF;
} }
public BlueSpark(Level p_37394_, double p_37395_, double p_37396_, double p_37397_) { public float[] getCustomParticleTrail() {
super(TFMGEntityTypes.BLUE_SPARK.get(), p_37395_, p_37396_, p_37397_, p_37394_); return new float[]{4.1f, 60.2f, 100.3f};
} }
@Override @Override
protected double getDefaultGravity() { public Optional<BlockState> getFireState(BlockPos pos) {
return 0.02f; return Optional.of(BlueFireBlock.getState(this.level(),pos));
}
@Override
protected void defineSynchedData(SynchedEntityData.Builder builder) {
}
public void tick(){
super.tick();
if (this.isInWaterOrRain()) {
this.discard();
}
if(this.level().isClientSide) {
CubeParticleData data =
new CubeParticleData(4.1f, 60.2f, 100.3f, .0125f + .0625f * random.nextFloat(), 30, false);
level().addParticle(data, this.getX(), this.getY(), this.getZ(), this.random.nextGaussian() * 0.05D, -this.getDeltaMovement().y * 0.5D, this.random.nextGaussian() * 0.05D);
}
}
private ParticleOptions getParticle() {
return ParticleTypes.FLAME;
}
public void handleEntityEvent(byte p_37402_) {
if (p_37402_ == 3) {
ParticleOptions particleoptions = this.getParticle();
for(int i = 0; i < 8; ++i) {
this.level().addParticle(particleoptions, this.getX(), this.getY(), this.getZ(), 0.0D, 0.0D, 0.0D);
}
}
}
protected void onHitBlock(BlockHitResult p_37384_) {
super.onHitBlock(p_37384_);
if (!this.level().isClientSide) {
Entity entity = this.getOwner();
if (!(entity instanceof Mob)) {
BlockPos blockpos = p_37384_.getBlockPos().relative(p_37384_.getDirection());
if (this.level().isEmptyBlock(blockpos)) {
this.level().setBlockAndUpdate(blockpos, BlueFireBlock.getState(this.level(), blockpos));
}
}
}
}
protected void onHitEntity(EntityHitResult p_37386_) {
super.onHitEntity(p_37386_);
if (!this.level().isClientSide) {
Entity entity = p_37386_.getEntity();
Entity entity1 = this.getOwner();
int i = entity.getRemainingFireTicks();
entity.setRemainingFireTicks(10);
}
}
protected void onHit(HitResult p_37406_) {
super.onHit(p_37406_);
if (!this.level().isClientSide) {
this.level().broadcastEntityEvent(this, (byte)3);
//this.level.explode(this, this.getX(), this.getY(0.0625D), this.getZ(), 2.0F, Explosion.BlockInteraction.NONE);
this.discard();
}
}
@SuppressWarnings("unchecked")
public static EntityType.Builder<?> build(EntityType.Builder<?> builder) {
EntityType.Builder<BlueSpark> entityBuilder = (EntityType.Builder<BlueSpark>) builder;
return entityBuilder.sized(.25f, .25f);
} }
} }

View File

@@ -1,58 +0,0 @@
package com.drmangotea.tfmg.base.spark;
import com.drmangotea.tfmg.TFMG;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.math.Axis;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.api.distmarker.OnlyIn;
import org.joml.Matrix3f;
import org.joml.Matrix4f;
@OnlyIn(Dist.CLIENT)
public class BlueSparkRenderer extends EntityRenderer<BlueSpark> {
private static final ResourceLocation TEXTURE_LOCATION = TFMG.asResource("textures/entity/blue_spark.png");
private static final RenderType RENDER_TYPE = RenderType.entityCutoutNoCull(TEXTURE_LOCATION);
public BlueSparkRenderer(EntityRendererProvider.Context p_173962_) {
super(p_173962_);
}
protected int getBlockLightLevel(BlueSpark p_114087_, BlockPos p_114088_) {
return 15;
}
public void render(BlueSpark p_114080_, float p_114081_, float p_114082_, PoseStack p_114083_, MultiBufferSource p_114084_, int p_114085_) {
p_114083_.pushPose();
p_114083_.scale(0.5F, 0.5F, 0.5F);
p_114083_.mulPose(this.entityRenderDispatcher.cameraOrientation());
p_114083_.mulPose(Axis.YP.rotationDegrees(180.0F));
PoseStack.Pose posestack$pose = p_114083_.last();
Matrix4f matrix4f = posestack$pose.pose();
Matrix3f matrix3f = posestack$pose.normal();
VertexConsumer vertexconsumer = p_114084_.getBuffer(RENDER_TYPE);
vertex(vertexconsumer, matrix4f, matrix3f, p_114085_, 0.0F, 0, 0, 1);
vertex(vertexconsumer, matrix4f, matrix3f, p_114085_, 1.0F, 0, 1, 1);
vertex(vertexconsumer, matrix4f, matrix3f, p_114085_, 1.0F, 1, 1, 0);
vertex(vertexconsumer, matrix4f, matrix3f, p_114085_, 0.0F, 1, 0, 0);
p_114083_.popPose();
super.render(p_114080_, p_114081_, p_114082_, p_114083_, p_114084_, p_114085_);
}
private static void vertex(VertexConsumer p_114090_, Matrix4f p_114091_, Matrix3f p_114092_, int p_114093_, float p_114094_, int p_114095_, int p_114096_, int p_114097_) {
p_114090_.addVertex(p_114091_, p_114094_ - 0.5F, (float)p_114095_ - 0.25F, 0.0F).setColor(255, 255, 255, 255).setUv((float)p_114096_, (float)p_114097_).setOverlay(OverlayTexture.NO_OVERLAY).setUv2(p_114093_,p_114093_).setNormal( 0.0F, 1.0F, 0.0F);
}
public ResourceLocation getTextureLocation(BlueSpark p_114078_) {
return TEXTURE_LOCATION;
}
}

View File

@@ -20,6 +20,8 @@ public class ElectricSparkParticle extends CustomRotationParticle {
protected int endFrames = 20; protected int endFrames = 20;
protected int totalFrames = 53; protected int totalFrames = 53;
public ElectricSparkParticle(ClientLevel worldIn, double x, double y, double z, double vx, double vy, double vz, public ElectricSparkParticle(ClientLevel worldIn, double x, double y, double z, double vx, double vy, double vz,
SpriteSet spriteSet, ParticleOptions data) { SpriteSet spriteSet, ParticleOptions data) {
super(worldIn, x, y, z, spriteSet, 0); super(worldIn, x, y, z, spriteSet, 0);

View File

@@ -1,108 +1,33 @@
package com.drmangotea.tfmg.base.spark; package com.drmangotea.tfmg.base.spark;
import com.drmangotea.tfmg.content.items.weapons.explosives.thermite_grenades.fire.BlueFireBlock;
import com.drmangotea.tfmg.content.items.weapons.explosives.thermite_grenades.fire.GreenFireBlock; import com.drmangotea.tfmg.content.items.weapons.explosives.thermite_grenades.fire.GreenFireBlock;
import com.drmangotea.tfmg.registry.TFMGEntityTypes;
import com.drmangotea.tfmg.registry.TFMGItems;
import com.simibubi.create.content.trains.CubeParticleData;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.ParticleOptions;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.network.syncher.SynchedEntityData;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.projectile.ThrowableProjectile;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.EntityHitResult;
import net.minecraft.world.phys.HitResult;
public class GreenSpark extends ThrowableProjectile { import java.util.Optional;
public GreenSpark(EntityType<? extends GreenSpark> p_37391_, Level p_37392_) {
public class GreenSpark extends Spark{
public GreenSpark(EntityType<? extends Spark> p_37391_, Level p_37392_) {
super(p_37391_, p_37392_); super(p_37391_, p_37392_);
} }
public GreenSpark(Level p_37399_, LivingEntity p_37400_) {
super(TFMGEntityTypes.SPARK.get(), p_37400_, p_37399_);
public float[] getCustomParticleTrail() {
return new float[]{0.01f, 100.25f, 20.1f};
} }
public GreenSpark(Level level, double p_37395_, double p_37396_, double p_37397_) {
super(TFMGEntityTypes.SPARK.get(), p_37395_, p_37396_, p_37397_, level); @Override
public int getColor() {
return 0x4CFF00;
} }
@Override @Override
protected double getDefaultGravity() { public Optional<BlockState> getFireState(BlockPos pos) {
return 0.02f; return Optional.of(GreenFireBlock.getState(this.level(),pos));
}
@Override
protected void defineSynchedData(SynchedEntityData.Builder builder) {
}
public void tick(){
super.tick();
if (this.isInWaterOrRain()) {
this.discard();
}
if(this.level().isClientSide) {
CubeParticleData data =
new CubeParticleData(0.01f, 100.25f, 20.1f, .0125f + .0625f * random.nextFloat(), 30, true);
level().addParticle(data, this.getX(), this.getY(), this.getZ(), this.random.nextGaussian() * 0.05D, -this.getDeltaMovement().y * 0.5D, this.random.nextGaussian() * 0.05D);
}
}
private ParticleOptions getParticle() {
return ParticleTypes.FLAME;
}
public void handleEntityEvent(byte p_37402_) {
if (p_37402_ == 3) {
ParticleOptions particleoptions = this.getParticle();
for(int i = 0; i < 8; ++i) {
this.level().addParticle(particleoptions, this.getX(), this.getY(), this.getZ(), 0.0D, 0.0D, 0.0D);
}
}
}
protected void onHitBlock(BlockHitResult p_37384_) {
super.onHitBlock(p_37384_);
if (!this.level().isClientSide) {
Entity entity = this.getOwner();
if (!(entity instanceof Mob)) {
BlockPos blockpos = p_37384_.getBlockPos().relative(p_37384_.getDirection());
if (this.level().isEmptyBlock(blockpos)) {
this.level().setBlockAndUpdate(blockpos, GreenFireBlock.getState(this.level(), blockpos));
}
}
}
}
protected void onHitEntity(EntityHitResult p_37386_) {
super.onHitEntity(p_37386_);
if (!this.level().isClientSide) {
Entity entity = p_37386_.getEntity();
entity.setRemainingFireTicks(10);
}
}
protected void onHit(HitResult p_37406_) {
super.onHit(p_37406_);
if (!this.level().isClientSide) {
this.level().broadcastEntityEvent(this, (byte)3);
this.discard();
}
}
@SuppressWarnings("unchecked")
public static EntityType.Builder<?> build(EntityType.Builder<?> builder) {
EntityType.Builder<GreenSpark> entityBuilder = (EntityType.Builder<GreenSpark>) builder;
return entityBuilder.sized(.25f, .25f);
} }
} }

View File

@@ -1,58 +0,0 @@
package com.drmangotea.tfmg.base.spark;
import com.drmangotea.tfmg.TFMG;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.math.Axis;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.api.distmarker.OnlyIn;
import org.joml.Matrix3f;
import org.joml.Matrix4f;
@OnlyIn(Dist.CLIENT)
public class GreenSparkRenderer extends EntityRenderer<GreenSpark> {
private static final ResourceLocation TEXTURE_LOCATION = TFMG.asResource("textures/entity/green_spark.png");
private static final RenderType RENDER_TYPE = RenderType.entityCutoutNoCull(TEXTURE_LOCATION);
public GreenSparkRenderer(EntityRendererProvider.Context p_173962_) {
super(p_173962_);
}
protected int getBlockLightLevel(GreenSpark p_114087_, BlockPos p_114088_) {
return 15;
}
public void render(GreenSpark p_114080_, float p_114081_, float p_114082_, PoseStack p_114083_, MultiBufferSource p_114084_, int p_114085_) {
p_114083_.pushPose();
p_114083_.scale(0.5F, 0.5F, 0.5F);
p_114083_.mulPose(this.entityRenderDispatcher.cameraOrientation());
p_114083_.mulPose(Axis.YP.rotationDegrees(180.0F));
PoseStack.Pose posestack$pose = p_114083_.last();
Matrix4f matrix4f = posestack$pose.pose();
Matrix3f matrix3f = posestack$pose.normal();
VertexConsumer vertexconsumer = p_114084_.getBuffer(RENDER_TYPE);
vertex(vertexconsumer, matrix4f, matrix3f, p_114085_, 0.0F, 0, 0, 1);
vertex(vertexconsumer, matrix4f, matrix3f, p_114085_, 1.0F, 0, 1, 1);
vertex(vertexconsumer, matrix4f, matrix3f, p_114085_, 1.0F, 1, 1, 0);
vertex(vertexconsumer, matrix4f, matrix3f, p_114085_, 0.0F, 1, 0, 0);
p_114083_.popPose();
super.render(p_114080_, p_114081_, p_114082_, p_114083_, p_114084_, p_114085_);
}
private static void vertex(VertexConsumer p_114090_, Matrix4f p_114091_, Matrix3f p_114092_, int p_114093_, float p_114094_, int p_114095_, int p_114096_, int p_114097_) {
p_114090_.addVertex(p_114091_, p_114094_ - 0.5F, (float)p_114095_ - 0.25F, 0.0F).setColor(255, 255, 255, 255).setUv((float)p_114096_, (float)p_114097_).setOverlay(OverlayTexture.NO_OVERLAY).setUv2(p_114093_,p_114093_).setNormal( 0.0F, 1.0F, 0.0F);
}
public ResourceLocation getTextureLocation(GreenSpark p_114078_) {
return TEXTURE_LOCATION;
}
}

View File

@@ -0,0 +1,33 @@
package com.drmangotea.tfmg.base.spark;
import com.drmangotea.tfmg.content.items.weapons.explosives.thermite_grenades.fire.GreenFireBlock;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;
import java.util.Optional;
public class LithiumSpark extends Spark{
public LithiumSpark(EntityType<? extends Spark> p_37391_, Level p_37392_) {
super(p_37391_, p_37392_);
}
public float[] getCustomParticleTrail() {
return new float[]{100, 0, 0};
}
@Override
public int getColor() {
return 0xCC0000;
}
@Override
public Optional<BlockState> getFireState(BlockPos pos) {
return Optional.empty();
}
}

View File

@@ -1,39 +1,56 @@
package com.drmangotea.tfmg.base.spark; package com.drmangotea.tfmg.base.spark;
import com.drmangotea.tfmg.registry.TFMGEntityTypes; import com.drmangotea.tfmg.registry.TFMGMobEffects;
import com.drmangotea.tfmg.registry.TFMGItems; import com.simibubi.create.content.trains.CubeParticleData;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.ParticleOptions; import net.minecraft.core.particles.ParticleOptions;
import net.minecraft.core.particles.ParticleTypes; import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.network.syncher.SynchedEntityData;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.projectile.ThrowableProjectile; import net.minecraft.world.entity.projectile.ThrowableProjectile;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.BaseFireBlock; import net.minecraft.world.level.block.BaseFireBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.EntityHitResult; import net.minecraft.world.phys.EntityHitResult;
import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
import java.util.Optional;
public class Spark extends ThrowableProjectile { public class Spark extends ThrowableProjectile {
public float gravity = 0.02f;
public Spark(EntityType<? extends Spark> p_37391_, Level p_37392_) { public Spark(EntityType<? extends Spark> p_37391_, Level p_37392_) {
super(p_37391_, p_37392_); super(p_37391_, p_37392_);
} }
public Spark(Level p_37399_, LivingEntity p_37400_) {
super(TFMGEntityTypes.SPARK.get(), p_37400_, p_37399_);
}
public Spark(Level p_37394_, double p_37395_, double p_37396_, double p_37397_) {
super(TFMGEntityTypes.SPARK.get(), p_37395_, p_37396_, p_37397_, p_37394_);
}
@Override @Override
protected double getDefaultGravity() { protected double getDefaultGravity() {
return 0.02f; return gravity;
}
public Optional<BlockState> getFireState(BlockPos pos){
return Optional.of(BaseFireBlock.getState(this.level(), pos));
}
public float[] getCustomParticleTrail() {
return new float[]{0,0,0};
}
public ParticleOptions getTrailParticle(){
return ParticleTypes.FLAME;
} }
@Override @Override
@@ -41,45 +58,71 @@ public class Spark extends ThrowableProjectile {
} }
public void tick(){ public void burst(double pX, double pY, double pZ, float pVelocity, float pInaccuracy) {
Vec3 vec3 = (new Vec3(pX, pY, pZ)).normalize().add(this.random.triangle(0.0D, 0.0172275D * (double) pInaccuracy), 0, this.random.triangle(0.0D, 0.0172275D * (double) pInaccuracy)).scale((double) pVelocity);
this.setDeltaMovement(vec3);
double d0 = vec3.horizontalDistance();
this.setYRot((float) (Mth.atan2(vec3.x, vec3.z) * (double) (180F / (float) Math.PI)));
this.setXRot((float) (Mth.atan2(vec3.y, d0) * (double) (180F / (float) Math.PI)));
this.yRotO = this.getYRot();
this.xRotO = this.getXRot();
}
public void setGravity(float gravity) {
this.gravity = gravity;
}
public void tick() {
super.tick(); super.tick();
if (this.isInWaterOrRain()) { if (this.isInWaterOrRain()) {
this.discard(); this.discard();
} }
if(this.level().isClientSide) {
this.level().addParticle(ParticleTypes.FLAME, this.getX(), this.getY(), this.getZ(), this.random.nextGaussian() * 0.05D, -this.getDeltaMovement().y * 0.5D, this.random.nextGaussian() * 0.05D); if (level().isClientSide) {
if (getCustomParticleTrail()[0] == 0 && getCustomParticleTrail()[1] == 0 && getCustomParticleTrail()[2] == 0) {
this.level().addParticle(getTrailParticle(), this.getX(), this.getY(), this.getZ(), this.random.nextGaussian() * 0.05D, -this.getDeltaMovement().y * 0.5D, this.random.nextGaussian() * 0.05D);
} else {
CubeParticleData data =
new CubeParticleData(getCustomParticleTrail()[0], getCustomParticleTrail()[1], getCustomParticleTrail()[2], .0125f + .0625f * random.nextFloat(), 30, true);
level().addParticle(data, this.getX(), this.getY(), this.getZ(), this.random.nextGaussian() * 0.05D, -this.getDeltaMovement().y * 0.5D, this.random.nextGaussian() * 0.05D);
} }
} }
protected Item getDefaultItem() {
return TFMGItems.THERMITE_GRENADE.get();
} }
private ParticleOptions getParticle() { private ParticleOptions getParticle() {
return ParticleTypes.FLAME; return getTrailParticle();
} }
public void handleEntityEvent(byte p_37402_) { public void handleEntityEvent(byte p_37402_) {
if (p_37402_ == 3) { if (p_37402_ == 3) {
ParticleOptions particleoptions = this.getParticle(); ParticleOptions particleoptions = this.getParticle();
for(int i = 0; i < 8; ++i) { for (int i = 0; i < 8; ++i) {
this.level().addParticle(particleoptions, this.getX(), this.getY(), this.getZ(), 0.0D, 0.0D, 0.0D); this.level().addParticle(particleoptions, this.getX(), this.getY(), this.getZ(), 0.0D, 0.0D, 0.0D);
} }
} }
} }
protected void onHitBlock(BlockHitResult hitResult) { protected void onHitBlock(BlockHitResult hitResult) {
super.onHitBlock(hitResult); super.onHitBlock(hitResult);
if (!this.level().isClientSide) { if (!this.level().isClientSide) {
Entity entity = this.getOwner(); Entity entity = this.getOwner();
if (!(entity instanceof Mob) ) { if (!(entity instanceof Mob)) {
BlockPos blockpos = hitResult.getBlockPos().relative(hitResult.getDirection()); BlockPos blockpos = hitResult.getBlockPos().relative(hitResult.getDirection());
if (this.level().isEmptyBlock(blockpos)) { if (this.level().isEmptyBlock(blockpos)&&getFireState(blockpos).isPresent()) {
this.level().setBlockAndUpdate(blockpos, BaseFireBlock.getState(this.level(), blockpos)); this.level().setBlockAndUpdate(blockpos, getFireState(blockpos).get());
} }
} }
} }
} }
public int getColor(){
return 0xFFFF8C;
}
protected void onHitEntity(EntityHitResult p_37386_) { protected void onHitEntity(EntityHitResult p_37386_) {
super.onHitEntity(p_37386_); super.onHitEntity(p_37386_);
if (!this.level().isClientSide) { if (!this.level().isClientSide) {
@@ -88,6 +131,13 @@ public class Spark extends ThrowableProjectile {
if (entity.getRemainingFireTicks() > 0 && !entity.fireImmune()) { if (entity.getRemainingFireTicks() > 0 && !entity.fireImmune()) {
entity.hurt(this.damageSources().onFire(), 1.0F); entity.hurt(this.damageSources().onFire(), 1.0F);
} }
if (this instanceof LithiumSpark)
if (entity instanceof LivingEntity) {
((LivingEntity) entity).addEffect(new MobEffectInstance(TFMGMobEffects.HELLFIRE, 60));
}
} }
} }
@@ -95,7 +145,7 @@ public class Spark extends ThrowableProjectile {
super.onHit(p_37406_); super.onHit(p_37406_);
if (!this.level().isClientSide) { if (!this.level().isClientSide) {
this.level().broadcastEntityEvent(this, (byte)3); this.level().broadcastEntityEvent(this, (byte) 3);
this.discard(); this.discard();
} }
} }
@@ -105,4 +155,7 @@ public class Spark extends ThrowableProjectile {
EntityType.Builder<Spark> entityBuilder = (EntityType.Builder<Spark>) builder; EntityType.Builder<Spark> entityBuilder = (EntityType.Builder<Spark>) builder;
return entityBuilder.sized(.25f, .25f); return entityBuilder.sized(.25f, .25f);
} }
} }

View File

@@ -1,5 +1,6 @@
package com.drmangotea.tfmg.base.spark; package com.drmangotea.tfmg.base.spark;
import com.drmangotea.tfmg.TFMG;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.math.Axis; import com.mojang.math.Axis;
@@ -19,36 +20,48 @@ import org.joml.Matrix4f;
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
public class SparkRenderer extends EntityRenderer<Spark> { public class SparkRenderer extends EntityRenderer<Spark> {
private static final ResourceLocation TEXTURE_LOCATION = ResourceLocation.withDefaultNamespace("textures/particle/lava.png");
public int color = 0xFFD600;
private static final ResourceLocation TEXTURE_LOCATION = TFMG.asResource("textures/entity/spark.png");
private static final RenderType RENDER_TYPE = RenderType.entityCutoutNoCull(TEXTURE_LOCATION); private static final RenderType RENDER_TYPE = RenderType.entityCutoutNoCull(TEXTURE_LOCATION);
public SparkRenderer(EntityRendererProvider.Context p_173962_) { public SparkRenderer(EntityRendererProvider.Context p_173962_) {
super(p_173962_); super(p_173962_);
} }
protected int getBlockLightLevel(Spark p_114087_, BlockPos p_114088_) { protected int getBlockLightLevel(Spark spark, BlockPos pos) {
return 15; return 15;
} }
public void render(Spark p_114080_, float p_114081_, float p_114082_, PoseStack p_114083_, MultiBufferSource p_114084_, int p_114085_) { public void render(Spark spark, float p_114081_, float p_114082_, PoseStack poseStack, MultiBufferSource bufferSource, int p_114085_) {
p_114083_.pushPose(); poseStack.pushPose();
p_114083_.scale(0.5F, 0.5F, 0.5F); poseStack.scale(0.5F, 0.5F, 0.5F);
p_114083_.mulPose(this.entityRenderDispatcher.cameraOrientation()); poseStack.mulPose(this.entityRenderDispatcher.cameraOrientation());
p_114083_.mulPose(Axis.YP.rotationDegrees(180.0F)); poseStack.mulPose(Axis.YP.rotationDegrees(180.0F));
PoseStack.Pose posestack$pose = p_114083_.last(); PoseStack.Pose posestack$pose = poseStack.last();
Matrix4f matrix4f = posestack$pose.pose(); Matrix4f matrix4f = posestack$pose.pose();
Matrix3f matrix3f = posestack$pose.normal(); Matrix3f matrix3f = posestack$pose.normal();
VertexConsumer vertexconsumer = p_114084_.getBuffer(RENDER_TYPE); VertexConsumer vertexconsumer = bufferSource.getBuffer(RENDER_TYPE);
vertex(vertexconsumer, matrix4f, matrix3f, p_114085_, 0.0F, 0, 0, 1);
vertex(vertexconsumer, matrix4f, matrix3f, p_114085_, 1.0F, 0, 1, 1);
vertex(vertexconsumer, matrix4f, matrix3f, p_114085_, 1.0F, 1, 1, 0);
vertex(vertexconsumer, matrix4f, matrix3f, p_114085_, 0.0F, 1, 0, 0); vertex(vertexconsumer, matrix4f, matrix3f, p_114085_, 0.0F, 0, 0, 1,spark.getColor());
p_114083_.popPose(); vertex(vertexconsumer, matrix4f, matrix3f, p_114085_, 1.0F, 0, 1, 1,spark.getColor());
super.render(p_114080_, p_114081_, p_114082_, p_114083_, p_114084_, p_114085_); vertex(vertexconsumer, matrix4f, matrix3f, p_114085_, 1.0F, 1, 1, 0,spark.getColor());
vertex(vertexconsumer, matrix4f, matrix3f, p_114085_, 0.0F, 1, 0, 0,spark.getColor());
poseStack.popPose();
super.render(spark, p_114081_, p_114082_, poseStack, bufferSource, p_114085_);
} }
private static void vertex(VertexConsumer p_114090_, Matrix4f p_114091_, Matrix3f p_114092_, int p_114093_, float p_114094_, int p_114095_, int p_114096_, int p_114097_) { private void vertex(VertexConsumer vertexConsumer, Matrix4f matrix4f, Matrix3f matrix3f, int p_114093_, float p_114094_, int p_114095_, int p_114096_, int p_114097_,int color) {
p_114090_.addVertex(p_114091_, p_114094_ - 0.5F, (float)p_114095_ - 0.25F, 0.0F).setColor(255, 255, 255, 255).setUv((float)p_114096_, (float)p_114097_).setOverlay(OverlayTexture.NO_OVERLAY).setUv2(p_114093_,p_114093_).setNormal( 0.0F, 1.0F, 0.0F); vertexConsumer.addVertex(matrix4f, p_114094_ - 0.5F, (float)p_114095_ - 0.25F, 0.0F).setColor(color).setUv((float)p_114096_, (float)p_114097_).setOverlay(OverlayTexture.NO_OVERLAY).setLight(15728880).setUv2(p_114093_,p_114093_).setNormal( 0.0F, 1.0F, 0.0F);
} }
public ResourceLocation getTextureLocation(Spark p_114078_) { public ResourceLocation getTextureLocation(Spark p_114078_) {
return TEXTURE_LOCATION; return TEXTURE_LOCATION;
} }
} }

View File

@@ -1,6 +1,5 @@
package com.drmangotea.tfmg.content.decoration; package com.drmangotea.tfmg.content.decoration;
import com.drmangotea.tfmg.content.items.weapons.lithium_blade.LithiumSpark;
import com.drmangotea.tfmg.registry.TFMGEntityTypes; import com.drmangotea.tfmg.registry.TFMGEntityTypes;
import com.simibubi.create.Create; import com.simibubi.create.Create;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
@@ -27,28 +26,6 @@ public class LithiumBlock extends Block {
public void randomTick(BlockState blockState, ServerLevel level, BlockPos pos, RandomSource randomSource) { public void randomTick(BlockState blockState, ServerLevel level, BlockPos pos, RandomSource randomSource) {
super.randomTick(blockState, level, pos, randomSource); super.randomTick(blockState, level, pos, randomSource);
for(Direction direction : Direction.values()){
if(level.getFluidState(pos.relative(direction)).is(Fluids.WATER)){
for (int i = 0; i < 12; i++) {
float x = Create.RANDOM.nextFloat(360);
float y = Create.RANDOM.nextFloat(360);
float z = Create.RANDOM.nextFloat(360);
LithiumSpark spark = TFMGEntityTypes.LITHIUM_SPARK.create(level);
spark.moveTo(pos.getX(), pos.getY() + 0.5, pos.getZ());
float f = -Mth.sin(y * ((float) Math.PI / 180F)) * Mth.cos(x * ((float) Math.PI / 180F));
float f1 = -Mth.sin((x + z) * ((float) Math.PI / 180F));
float f2 = Mth.cos(y * ((float) Math.PI / 180F)) * Mth.cos(x * ((float) Math.PI / 180F));
spark.shoot(f, f1, f2, 0.3f, 1);
level.addFreshEntity(spark);
}
level.explode(null, pos.getX(), pos.getY(), pos.getZ(), 1, Level.ExplosionInteraction.NONE);
level.destroyBlock(pos,false);
break;
}
}
} }

View File

@@ -1,8 +1,12 @@
package com.drmangotea.tfmg.content.decoration.doors; package com.drmangotea.tfmg.content.decoration.doors;
import com.drmangotea.tfmg.mixin.accessor.SlidingDoorBlockEntityAccessor;
import com.drmangotea.tfmg.registry.TFMGBlockEntities; import com.drmangotea.tfmg.registry.TFMGBlockEntities;
import com.simibubi.create.AllBlockEntityTypes;
import com.simibubi.create.content.contraptions.ContraptionWorld; import com.simibubi.create.content.contraptions.ContraptionWorld;
import com.simibubi.create.content.decoration.slidingDoor.SlidingDoorBlock;
import com.simibubi.create.content.decoration.slidingDoor.SlidingDoorBlockEntity;
import com.simibubi.create.content.decoration.slidingDoor.SlidingDoorShapes; import com.simibubi.create.content.decoration.slidingDoor.SlidingDoorShapes;
import com.simibubi.create.content.equipment.wrench.IWrenchable; import com.simibubi.create.content.equipment.wrench.IWrenchable;
import com.simibubi.create.foundation.block.IBE; import com.simibubi.create.foundation.block.IBE;
@@ -40,219 +44,19 @@ import javax.annotation.Nullable;
import static com.simibubi.create.content.decoration.slidingDoor.SlidingDoorBlock.TRAIN_SET_TYPE; import static com.simibubi.create.content.decoration.slidingDoor.SlidingDoorBlock.TRAIN_SET_TYPE;
public class TFMGSlidingDoorBlock extends DoorBlock implements IWrenchable, IBE<TFMGSlidingDoorBlockEntity> { public class TFMGSlidingDoorBlock extends SlidingDoorBlock implements IWrenchable, IBE<SlidingDoorBlockEntity> {
public static final BooleanProperty VISIBLE = BooleanProperty.create("visible"); public TFMGSlidingDoorBlock(Properties properties, BlockSetType type, boolean folds) {
private boolean folds; super(properties, type, folds);
public static TFMGSlidingDoorBlock metal(Properties p_52737_, boolean folds) {
return new TFMGSlidingDoorBlock(p_52737_, TRAIN_SET_TYPE.get(), folds);
}
public TFMGSlidingDoorBlock(Properties p_52737_, BlockSetType type, boolean folds) {
super(type,p_52737_ );
this.folds = folds;
}
public boolean isFoldingDoor() {
return folds;
} }
@Override @Override
protected void createBlockStateDefinition(Builder<Block, BlockState> pBuilder) { public Class<SlidingDoorBlockEntity> getBlockEntityClass() {
super.createBlockStateDefinition(pBuilder.add(VISIBLE)); return SlidingDoorBlockEntity.class;
} }
@Override @Override
public VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) { public BlockEntityType<? extends SlidingDoorBlockEntity> getBlockEntityType() {
if (!pState.getValue(OPEN) && (pState.getValue(VISIBLE) || pLevel instanceof ContraptionWorld))
return super.getShape(pState, pLevel, pPos, pContext);
Direction direction = pState.getValue(FACING);
boolean hinge = pState.getValue(HINGE) == DoorHingeSide.RIGHT;
return SlidingDoorShapes.get(direction, hinge, isFoldingDoor());
}
@Override
public boolean canSurvive(BlockState pState, LevelReader pLevel, BlockPos pPos) {
return pState.getValue(HALF) == DoubleBlockHalf.LOWER || pLevel.getBlockState(pPos.below())
.is(this);
}
@Override
public VoxelShape getInteractionShape(BlockState pState, BlockGetter pLevel, BlockPos pPos) {
return getShape(pState, pLevel, pPos, CollisionContext.empty());
}
@Override
public BlockState getStateForPlacement(BlockPlaceContext pContext) {
BlockState stateForPlacement = super.getStateForPlacement(pContext);
if (stateForPlacement != null && stateForPlacement.getValue(OPEN))
return stateForPlacement.setValue(OPEN, false)
.setValue(POWERED, false);
return stateForPlacement;
}
@Override
public void onPlace(BlockState pState, Level pLevel, BlockPos pPos, BlockState pOldState, boolean pIsMoving) {
if (!pOldState.is(this))
deferUpdate(pLevel, pPos);
}
@Override
public BlockState updateShape(BlockState pState, Direction pFacing, BlockState pFacingState, LevelAccessor pLevel,
BlockPos pCurrentPos, BlockPos pFacingPos) {
BlockState blockState = super.updateShape(pState, pFacing, pFacingState, pLevel, pCurrentPos, pFacingPos);
if (blockState.isAir())
return blockState;
DoubleBlockHalf doubleblockhalf = blockState.getValue(HALF);
if (pFacing.getAxis() == Direction.Axis.Y
&& doubleblockhalf == DoubleBlockHalf.LOWER == (pFacing == Direction.UP)) {
return pFacingState.is(this) && pFacingState.getValue(HALF) != doubleblockhalf
? blockState.setValue(VISIBLE, pFacingState.getValue(VISIBLE))
: Blocks.AIR.defaultBlockState();
}
return blockState;
}
@Override
public void setOpen(@Nullable Entity entity, Level level, BlockState state, BlockPos pos, boolean open) {
if (!state.is(this))
return;
if (state.getValue(OPEN) == open)
return;
BlockState changedState = state.setValue(OPEN, open);
if (open)
changedState = changedState.setValue(VISIBLE, false);
level.setBlock(pos, changedState, 10);
DoorHingeSide hinge = changedState.getValue(HINGE);
Direction facing = changedState.getValue(FACING);
BlockPos otherPos =
pos.relative(hinge == DoorHingeSide.LEFT ? facing.getClockWise() : facing.getCounterClockWise());
BlockState otherDoor = level.getBlockState(otherPos);
if (isDoubleDoor(changedState, hinge, facing, otherDoor))
setOpen(entity, level, otherDoor, otherPos, open);
this.playSound(level, pos, open);
level.gameEvent(entity, open ? GameEvent.BLOCK_OPEN : GameEvent.BLOCK_CLOSE, pos);
}
@Override
public void neighborChanged(BlockState pState, Level pLevel, BlockPos pPos, Block pBlock, BlockPos pFromPos,
boolean pIsMoving) {
boolean lower = pState.getValue(HALF) == DoubleBlockHalf.LOWER;
boolean isPowered = isDoorPowered(pLevel, pPos, pState);
if (defaultBlockState().is(pBlock))
return;
if (isPowered == pState.getValue(POWERED))
return;
TFMGSlidingDoorBlockEntity be = getBlockEntity(pLevel, lower ? pPos : pPos.below());
if (be != null && be.deferUpdate)
return;
BlockState changedState = pState.setValue(POWERED, Boolean.valueOf(isPowered))
.setValue(OPEN, Boolean.valueOf(isPowered));
if (isPowered)
changedState = changedState.setValue(VISIBLE, false);
if (isPowered != pState.getValue(OPEN)) {
this.playSound(pLevel, pPos, isPowered);
pLevel.gameEvent(null, isPowered ? GameEvent.BLOCK_OPEN : GameEvent.BLOCK_CLOSE, pPos);
DoorHingeSide hinge = changedState.getValue(HINGE);
Direction facing = changedState.getValue(FACING);
BlockPos otherPos =
pPos.relative(hinge == DoorHingeSide.LEFT ? facing.getClockWise() : facing.getCounterClockWise());
BlockState otherDoor = pLevel.getBlockState(otherPos);
if (isDoubleDoor(changedState, hinge, facing, otherDoor)) {
otherDoor = otherDoor.setValue(POWERED, Boolean.valueOf(isPowered))
.setValue(OPEN, Boolean.valueOf(isPowered));
if (isPowered)
otherDoor = otherDoor.setValue(VISIBLE, false);
pLevel.setBlock(otherPos, otherDoor, 2);
}
}
pLevel.setBlock(pPos, changedState, 2);
}
public static boolean isDoorPowered(Level pLevel, BlockPos pPos, BlockState state) {
boolean lower = state.getValue(HALF) == DoubleBlockHalf.LOWER;
DoorHingeSide hinge = state.getValue(HINGE);
Direction facing = state.getValue(FACING);
BlockPos otherPos =
pPos.relative(hinge == DoorHingeSide.LEFT ? facing.getClockWise() : facing.getCounterClockWise());
BlockState otherDoor = pLevel.getBlockState(otherPos);
if (isDoubleDoor(state.cycle(OPEN), hinge, facing, otherDoor) && (pLevel.hasNeighborSignal(otherPos)
|| pLevel.hasNeighborSignal(otherPos.relative(lower ? Direction.UP : Direction.DOWN))))
return true;
return pLevel.hasNeighborSignal(pPos)
|| pLevel.hasNeighborSignal(pPos.relative(lower ? Direction.UP : Direction.DOWN));
}
@Override
protected InteractionResult useWithoutItem(BlockState pState, Level pLevel, BlockPos pPos, Player pPlayer, BlockHitResult pHit) {
pState = pState.cycle(OPEN);
if (pState.getValue(OPEN))
pState = pState.setValue(VISIBLE, false);
pLevel.setBlock(pPos, pState, 10);
pLevel.gameEvent(pPlayer, isOpen(pState) ? GameEvent.BLOCK_OPEN : GameEvent.BLOCK_CLOSE, pPos);
DoorHingeSide hinge = pState.getValue(HINGE);
Direction facing = pState.getValue(FACING);
BlockPos otherPos =
pPos.relative(hinge == DoorHingeSide.LEFT ? facing.getClockWise() : facing.getCounterClockWise());
BlockState otherDoor = pLevel.getBlockState(otherPos);
if (isDoubleDoor(pState, hinge, facing, otherDoor))
useWithoutItem(otherDoor, pLevel, otherPos, pPlayer, pHit);
else if (pState.getValue(OPEN))
pLevel.levelEvent(pPlayer, getOpenSound(), pPos, 0);
return InteractionResult.sidedSuccess(pLevel.isClientSide);
}
public void deferUpdate(LevelAccessor level, BlockPos pos) {
withBlockEntityDo(level, pos, sdte -> sdte.deferUpdate = true);
}
public static boolean isDoubleDoor(BlockState pState, DoorHingeSide hinge, Direction facing, BlockState otherDoor) {
return otherDoor.getBlock() == pState.getBlock() && otherDoor.getValue(HINGE) != hinge
&& otherDoor.getValue(FACING) == facing && otherDoor.getValue(OPEN) != pState.getValue(OPEN)
&& otherDoor.getValue(HALF) == pState.getValue(HALF);
}
@Override
public RenderShape getRenderShape(BlockState pState) {
return pState.getValue(VISIBLE) ? RenderShape.MODEL : RenderShape.ENTITYBLOCK_ANIMATED;
}
private void playSound(Level pLevel, BlockPos pPos, boolean pIsOpening) {
if (pIsOpening)
pLevel.levelEvent((Player) null, this.getOpenSound(), pPos, 0);
}
private int getOpenSound() {
return 1005;
}
@Nullable
@Override
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
if (state.getValue(HALF) == DoubleBlockHalf.UPPER)
return null;
return IBE.super.newBlockEntity(pos, state);
}
@Override
public Class<TFMGSlidingDoorBlockEntity> getBlockEntityClass() {
return TFMGSlidingDoorBlockEntity.class;
}
@Override
public BlockEntityType<? extends TFMGSlidingDoorBlockEntity> getBlockEntityType() {
return TFMGBlockEntities.TFMG_SLIDING_DOOR.get(); return TFMGBlockEntities.TFMG_SLIDING_DOOR.get();
} }

View File

@@ -1,80 +0,0 @@
package com.drmangotea.tfmg.content.decoration.doors;
import com.simibubi.create.content.decoration.slidingDoor.SlidingDoorBlockEntity;
import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour;
import net.createmod.catnip.animation.LerpedFloat;
import net.minecraft.core.BlockPos;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.DoorBlock;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.AABB;
import java.util.List;
public class TFMGSlidingDoorBlockEntity extends SlidingDoorBlockEntity {
LerpedFloat animation;
int bridgeTicks;
boolean deferUpdate;
public TFMGSlidingDoorBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) {
super(type, pos, state);
animation = LerpedFloat.linear()
.startWithValue(isOpen(state) ? 1 : 0);
}
@Override
public void tick() {
if (deferUpdate && !level.isClientSide()) {
deferUpdate = false;
BlockState blockState = getBlockState();
blockState.handleNeighborChanged(level, worldPosition, Blocks.AIR, worldPosition, false);
}
super.tick();
boolean open = isOpen(getBlockState());
boolean wasSettled = animation.settled();
animation.chase(open ? 1 : 0, .15f, LerpedFloat.Chaser.LINEAR);
animation.tickChaser();
if (level.isClientSide()) {
if (bridgeTicks < 2 && open)
bridgeTicks++;
else if (bridgeTicks > 0 && !open && isVisible(getBlockState()))
bridgeTicks--;
return;
}
if (!open && !wasSettled && animation.settled() && !isVisible(getBlockState()))
showBlockModel();
}
@Override
protected AABB createRenderBoundingBox() {
return super.createRenderBoundingBox().inflate(1);
}
protected boolean isVisible(BlockState state) {
return state.getOptionalValue(TFMGSlidingDoorBlock.VISIBLE)
.orElse(true);
}
protected boolean shouldRenderSpecial(BlockState state) {
return !isVisible(state) || bridgeTicks != 0;
}
protected void showBlockModel() {
level.setBlock(worldPosition, getBlockState().setValue(TFMGSlidingDoorBlock.VISIBLE, true), 3);
level.playSound(null, worldPosition, SoundEvents.IRON_DOOR_CLOSE, SoundSource.BLOCKS, .5f, 1);
}
@Override
public void addBehaviours(List<BlockEntityBehaviour> behaviours) {}
public static boolean isOpen(BlockState state) {
return state.getOptionalValue(DoorBlock.OPEN)
.orElse(false);
}
}

View File

@@ -2,6 +2,7 @@ package com.drmangotea.tfmg.content.decoration.doors;
import com.drmangotea.tfmg.mixin.accessor.SlidingDoorBlockEntityAccessor;
import com.drmangotea.tfmg.registry.TFMGPartialModels; import com.drmangotea.tfmg.registry.TFMGPartialModels;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.blaze3d.vertex.VertexConsumer;
@@ -30,15 +31,15 @@ import net.minecraft.world.phys.Vec3;
public class TFMGSlidingDoorRenderer extends SafeBlockEntityRenderer<TFMGSlidingDoorBlockEntity> { public class TFMGSlidingDoorRenderer extends SafeBlockEntityRenderer<SlidingDoorBlockEntity> {
public TFMGSlidingDoorRenderer(Context context) {} public TFMGSlidingDoorRenderer(Context context) {}
@Override @Override
protected void renderSafe(TFMGSlidingDoorBlockEntity be, float partialTicks, PoseStack ms, MultiBufferSource buffer, protected void renderSafe(SlidingDoorBlockEntity be, float partialTicks, PoseStack ms, MultiBufferSource buffer,
int light, int overlay) { int light, int overlay) {
BlockState blockState = be.getBlockState(); BlockState blockState = be.getBlockState();
if (!be.shouldRenderSpecial(blockState)) if (!((SlidingDoorBlockEntityAccessor)be).i_architecture$shouldRenderSpecial(blockState))
return; return;
Direction facing = blockState.getValue(DoorBlock.FACING); Direction facing = blockState.getValue(DoorBlock.FACING);
@@ -47,7 +48,7 @@ public class TFMGSlidingDoorRenderer extends SafeBlockEntityRenderer<TFMGSliding
if (blockState.getValue(DoorBlock.HINGE) == DoorHingeSide.LEFT) if (blockState.getValue(DoorBlock.HINGE) == DoorHingeSide.LEFT)
movementDirection = movementDirection.getOpposite(); movementDirection = movementDirection.getOpposite();
float value = be.animation.getValue(partialTicks); float value = ((SlidingDoorBlockEntityAccessor)be).i_architecture$getAnimation().getValue(partialTicks);
float value2 = Mth.clamp(value * 10, 0, 1); float value2 = Mth.clamp(value * 10, 0, 1);
VertexConsumer vb = buffer.getBuffer(RenderType.cutoutMipped()); VertexConsumer vb = buffer.getBuffer(RenderType.cutoutMipped());

View File

@@ -1,56 +0,0 @@
package com.drmangotea.tfmg.content.decoration.flywheels;
import com.simibubi.create.content.kinetics.base.KineticBlockEntity;
import dev.engine_room.flywheel.lib.model.baked.PartialModel;
import net.createmod.catnip.animation.LerpedFloat;
import net.minecraft.core.BlockPos;
import net.minecraft.core.HolderLookup;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.AABB;
public class TFMGFlywheelBlockEntity extends KineticBlockEntity {
LerpedFloat visualSpeed = LerpedFloat.linear();
float angle;
public TFMGFlywheelBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) {
super(type, pos, state);
}
@Override
protected AABB createRenderBoundingBox() {
return super.createRenderBoundingBox().inflate(2);
}
@Override
public void write(CompoundTag compound, HolderLookup.Provider registries, boolean clientPacket) {
super.write(compound,registries , clientPacket);
}
@Override
protected void read(CompoundTag compound, HolderLookup.Provider registries, boolean clientPacket) {
super.read(compound,registries , clientPacket);
if (clientPacket)
visualSpeed.chase(getGeneratedSpeed(), 1 / 64f, LerpedFloat.Chaser.EXP);
}
@Override
public void tick() {
super.tick();
if (!level.isClientSide)
return;
float targetSpeed = getSpeed();
visualSpeed.updateChaseTarget(targetSpeed);
visualSpeed.tickChaser();
angle += visualSpeed.getValue() * 3 / 10f;
angle %= 360;
}
}

View File

@@ -1,4 +1,4 @@
package com.drmangotea.tfmg.content.decoration.cogs; package com.drmangotea.tfmg.content.decoration.kinetics.cogs;
import com.drmangotea.tfmg.registry.TFMGBlockEntities; import com.drmangotea.tfmg.registry.TFMGBlockEntities;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
@@ -15,7 +15,6 @@ import net.minecraft.MethodsReturnNonnullByDefault;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.ItemInteractionResult; import net.minecraft.world.ItemInteractionResult;
import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;

View File

@@ -1,4 +1,4 @@
package com.drmangotea.tfmg.content.decoration.cogs; package com.drmangotea.tfmg.content.decoration.kinetics.cogs;
import com.simibubi.create.AllShapes; import com.simibubi.create.AllShapes;
import com.simibubi.create.content.kinetics.base.DirectionalKineticBlock; import com.simibubi.create.content.kinetics.base.DirectionalKineticBlock;

View File

@@ -1,4 +1,4 @@
package com.drmangotea.tfmg.content.decoration.cogs; package com.drmangotea.tfmg.content.decoration.kinetics.cogs;
import com.drmangotea.tfmg.registry.TFMGBlocks; import com.drmangotea.tfmg.registry.TFMGBlocks;
import com.drmangotea.tfmg.registry.TFMGPartialModels; import com.drmangotea.tfmg.registry.TFMGPartialModels;

View File

@@ -1,8 +1,7 @@
package com.drmangotea.tfmg.content.decoration.cogs; package com.drmangotea.tfmg.content.decoration.kinetics.cogs;
import com.drmangotea.tfmg.registry.TFMGBlocks; import com.drmangotea.tfmg.registry.TFMGBlocks;
import com.drmangotea.tfmg.registry.TFMGPartialModels; import com.drmangotea.tfmg.registry.TFMGPartialModels;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllPartialModels; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.kinetics.base.KineticBlockEntityRenderer; import com.simibubi.create.content.kinetics.base.KineticBlockEntityRenderer;
import com.simibubi.create.content.kinetics.base.RotatingInstance; import com.simibubi.create.content.kinetics.base.RotatingInstance;
@@ -12,11 +11,9 @@ import com.simibubi.create.content.kinetics.simpleRelays.BracketedKineticBlockEn
import com.simibubi.create.content.kinetics.simpleRelays.ICogWheel; import com.simibubi.create.content.kinetics.simpleRelays.ICogWheel;
import com.simibubi.create.foundation.render.AllInstanceTypes; import com.simibubi.create.foundation.render.AllInstanceTypes;
import dev.engine_room.flywheel.api.instance.Instance; import dev.engine_room.flywheel.api.instance.Instance;
import dev.engine_room.flywheel.api.material.Material;
import dev.engine_room.flywheel.api.model.Model; import dev.engine_room.flywheel.api.model.Model;
import dev.engine_room.flywheel.api.visual.BlockEntityVisual; import dev.engine_room.flywheel.api.visual.BlockEntityVisual;
import dev.engine_room.flywheel.api.visualization.VisualizationContext; import dev.engine_room.flywheel.api.visualization.VisualizationContext;
import dev.engine_room.flywheel.lib.material.Materials;
import dev.engine_room.flywheel.lib.model.Models; import dev.engine_room.flywheel.lib.model.Models;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;

View File

@@ -1,4 +1,4 @@
package com.drmangotea.tfmg.content.decoration.cogs; package com.drmangotea.tfmg.content.decoration.kinetics.cogs;
import com.drmangotea.tfmg.registry.TFMGPartialModels; import com.drmangotea.tfmg.registry.TFMGPartialModels;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
@@ -9,7 +9,6 @@ import com.simibubi.create.content.kinetics.simpleRelays.BracketedKineticBlockEn
import com.simibubi.create.content.kinetics.simpleRelays.SimpleKineticBlockEntity; import com.simibubi.create.content.kinetics.simpleRelays.SimpleKineticBlockEntity;
import com.simibubi.create.content.kinetics.simpleRelays.encased.EncasedCogwheelBlock; import com.simibubi.create.content.kinetics.simpleRelays.encased.EncasedCogwheelBlock;
import dev.engine_room.flywheel.api.visualization.VisualizationManager; import dev.engine_room.flywheel.api.visualization.VisualizationManager;
import dev.engine_room.flywheel.lib.model.baked.PartialModel;
import net.createmod.catnip.data.Iterate; import net.createmod.catnip.data.Iterate;
import net.createmod.catnip.render.CachedBuffers; import net.createmod.catnip.render.CachedBuffers;
import net.createmod.catnip.render.SuperByteBuffer; import net.createmod.catnip.render.SuperByteBuffer;

View File

@@ -1,4 +1,4 @@
package com.drmangotea.tfmg.content.decoration.cogs; package com.drmangotea.tfmg.content.decoration.kinetics.cogs;
import com.drmangotea.tfmg.registry.TFMGPartialModels; import com.drmangotea.tfmg.registry.TFMGPartialModels;
import com.simibubi.create.AllPartialModels; import com.simibubi.create.AllPartialModels;

View File

@@ -1,4 +1,4 @@
package com.drmangotea.tfmg.content.decoration.encased; package com.drmangotea.tfmg.content.decoration.kinetics.encased;
import com.drmangotea.tfmg.registry.TFMGBlockEntities; import com.drmangotea.tfmg.registry.TFMGBlockEntities;
@@ -29,7 +29,6 @@ import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
@@ -41,7 +40,6 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;
import java.util.function.Supplier; import java.util.function.Supplier;

View File

@@ -1,4 +1,4 @@
package com.drmangotea.tfmg.content.decoration.encased; package com.drmangotea.tfmg.content.decoration.kinetics.encased;
import com.drmangotea.tfmg.registry.TFMGBlockEntities; import com.drmangotea.tfmg.registry.TFMGBlockEntities;
@@ -16,14 +16,12 @@ import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;
import java.util.function.Supplier; import java.util.function.Supplier;

View File

@@ -1,10 +1,11 @@
package com.drmangotea.tfmg.content.decoration.flywheels; package com.drmangotea.tfmg.content.decoration.kinetics.flywheels;
import com.drmangotea.tfmg.registry.TFMGBlockEntities; import com.drmangotea.tfmg.registry.TFMGBlockEntities;
import com.drmangotea.tfmg.registry.TFMGPartialModels; import com.drmangotea.tfmg.registry.TFMGPartialModels;
import com.simibubi.create.AllShapes; import com.simibubi.create.AllShapes;
import com.simibubi.create.content.kinetics.base.RotatedPillarKineticBlock; import com.simibubi.create.content.kinetics.base.RotatedPillarKineticBlock;
import com.simibubi.create.content.kinetics.flywheel.FlywheelBlockEntity;
import com.simibubi.create.foundation.block.IBE; import com.simibubi.create.foundation.block.IBE;
import dev.engine_room.flywheel.lib.model.baked.PartialModel; import dev.engine_room.flywheel.lib.model.baked.PartialModel;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
@@ -18,7 +19,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
public class TFMGFlywheelBlock extends RotatedPillarKineticBlock implements IBE<TFMGFlywheelBlockEntity> { public class TFMGFlywheelBlock extends RotatedPillarKineticBlock implements IBE<FlywheelBlockEntity> {
public final PartialModel model; public final PartialModel model;
@@ -46,8 +47,8 @@ public class TFMGFlywheelBlock extends RotatedPillarKineticBlock implements IBE<
} }
@Override @Override
public Class<TFMGFlywheelBlockEntity> getBlockEntityClass() { public Class<FlywheelBlockEntity> getBlockEntityClass() {
return TFMGFlywheelBlockEntity.class; return FlywheelBlockEntity.class;
} }
@Override @Override
@@ -61,7 +62,7 @@ public class TFMGFlywheelBlock extends RotatedPillarKineticBlock implements IBE<
} }
@Override @Override
public BlockEntityType<? extends TFMGFlywheelBlockEntity> getBlockEntityType() { public BlockEntityType<? extends FlywheelBlockEntity> getBlockEntityType() {
return TFMGBlockEntities.TFMG_FLYWHEEL.get(); return TFMGBlockEntities.TFMG_FLYWHEEL.get();
} }

View File

@@ -1,8 +1,10 @@
package com.drmangotea.tfmg.content.decoration.flywheels; package com.drmangotea.tfmg.content.decoration.kinetics.flywheels;
import com.drmangotea.tfmg.mixin.accessor.FlywheelBlockEntityMixin;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.blaze3d.vertex.VertexConsumer;
import com.simibubi.create.content.kinetics.base.KineticBlockEntityRenderer; import com.simibubi.create.content.kinetics.base.KineticBlockEntityRenderer;
import com.simibubi.create.content.kinetics.flywheel.FlywheelBlockEntity;
import dev.engine_room.flywheel.api.visualization.VisualizationManager; import dev.engine_room.flywheel.api.visualization.VisualizationManager;
import net.createmod.catnip.math.AngleHelper; import net.createmod.catnip.math.AngleHelper;
import net.createmod.catnip.render.CachedBuffers; import net.createmod.catnip.render.CachedBuffers;
@@ -12,14 +14,14 @@ import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
public class TFMGFlywheelRenderer extends KineticBlockEntityRenderer<TFMGFlywheelBlockEntity> { public class TFMGFlywheelRenderer extends KineticBlockEntityRenderer<FlywheelBlockEntity> {
public TFMGFlywheelRenderer(BlockEntityRendererProvider.Context context) { public TFMGFlywheelRenderer(BlockEntityRendererProvider.Context context) {
super(context); super(context);
} }
@Override @Override
protected void renderSafe(TFMGFlywheelBlockEntity be, float partialTicks, PoseStack ms, MultiBufferSource buffer, protected void renderSafe(FlywheelBlockEntity be, float partialTicks, PoseStack ms, MultiBufferSource buffer,
int light, int overlay) { int light, int overlay) {
super.renderSafe(be, partialTicks, ms, buffer, light, overlay); super.renderSafe(be, partialTicks, ms, buffer, light, overlay);
@@ -28,14 +30,14 @@ public class TFMGFlywheelRenderer extends KineticBlockEntityRenderer<TFMGFlywhee
BlockState blockState = be.getBlockState(); BlockState blockState = be.getBlockState();
float speed = be.visualSpeed.getValue(partialTicks) * 3 / 10f; float speed = ((FlywheelBlockEntityMixin)be).tfmg$visualSpeed().getValue(partialTicks) * 3 / 10f;
float angle = be.angle + speed * partialTicks; float angle = ((FlywheelBlockEntityMixin)be).tfmg$angle() + speed * partialTicks;
VertexConsumer vb = buffer.getBuffer(RenderType.solid()); VertexConsumer vb = buffer.getBuffer(RenderType.solid());
renderFlywheel(be, ms, light, blockState, angle, vb); renderFlywheel(be, ms, light, blockState, angle, vb);
} }
private void renderFlywheel(TFMGFlywheelBlockEntity be, PoseStack ms, int light, BlockState blockState, float angle, private void renderFlywheel(FlywheelBlockEntity be, PoseStack ms, int light, BlockState blockState, float angle,
VertexConsumer vb) { VertexConsumer vb) {
SuperByteBuffer wheel = CachedBuffers.block(blockState); SuperByteBuffer wheel = CachedBuffers.block(blockState);
kineticRotationTransform(wheel, be, getRotationAxisOf(be), AngleHelper.rad(angle), light); kineticRotationTransform(wheel, be, getRotationAxisOf(be), AngleHelper.rad(angle), light);
@@ -43,7 +45,7 @@ public class TFMGFlywheelRenderer extends KineticBlockEntityRenderer<TFMGFlywhee
} }
@Override @Override
protected BlockState getRenderedBlockState(TFMGFlywheelBlockEntity be) { protected BlockState getRenderedBlockState(FlywheelBlockEntity be) {
return shaft(getRotationAxisOf(be)); return shaft(getRotationAxisOf(be));
} }

View File

@@ -1,6 +1,6 @@
package com.drmangotea.tfmg.content.decoration.flywheels; package com.drmangotea.tfmg.content.decoration.kinetics.flywheels;
import com.drmangotea.tfmg.registry.TFMGPartialModels; import com.drmangotea.tfmg.mixin.accessor.FlywheelBlockEntityMixin;
import com.simibubi.create.AllPartialModels; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.kinetics.base.KineticBlockEntityVisual; import com.simibubi.create.content.kinetics.base.KineticBlockEntityVisual;
import com.simibubi.create.content.kinetics.base.RotatingInstance; import com.simibubi.create.content.kinetics.base.RotatingInstance;
@@ -11,7 +11,6 @@ import dev.engine_room.flywheel.api.visualization.VisualizationContext;
import dev.engine_room.flywheel.lib.instance.InstanceTypes; import dev.engine_room.flywheel.lib.instance.InstanceTypes;
import dev.engine_room.flywheel.lib.instance.TransformedInstance; import dev.engine_room.flywheel.lib.instance.TransformedInstance;
import dev.engine_room.flywheel.lib.model.Models; import dev.engine_room.flywheel.lib.model.Models;
import dev.engine_room.flywheel.lib.model.baked.PartialModel;
import dev.engine_room.flywheel.lib.visual.SimpleDynamicVisual; import dev.engine_room.flywheel.lib.visual.SimpleDynamicVisual;
import net.createmod.catnip.math.AngleHelper; import net.createmod.catnip.math.AngleHelper;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
@@ -20,7 +19,7 @@ import org.joml.Quaternionf;
import java.util.function.Consumer; import java.util.function.Consumer;
public class TFMGFlywheelVisual extends KineticBlockEntityVisual<TFMGFlywheelBlockEntity> implements SimpleDynamicVisual { public class TFMGFlywheelVisual extends KineticBlockEntityVisual<FlywheelBlockEntity> implements SimpleDynamicVisual {
protected final RotatingInstance shaft; protected final RotatingInstance shaft;
protected final TransformedInstance wheel; protected final TransformedInstance wheel;
@@ -32,7 +31,7 @@ public class TFMGFlywheelVisual extends KineticBlockEntityVisual<TFMGFlywheelBlo
public TFMGFlywheelVisual(VisualizationContext context, TFMGFlywheelBlockEntity blockEntity, float partialTick) { public TFMGFlywheelVisual(VisualizationContext context, FlywheelBlockEntity blockEntity, float partialTick) {
super(context, blockEntity, partialTick); super(context, blockEntity, partialTick);
var axis = rotationAxis(); var axis = rotationAxis();
@@ -56,7 +55,7 @@ public class TFMGFlywheelVisual extends KineticBlockEntityVisual<TFMGFlywheelBlo
baseTransform.set(wheel.pose); baseTransform.set(wheel.pose);
animate(blockEntity.angle); animate(((FlywheelBlockEntityMixin)blockEntity).tfmg$angle());
} }
@Override @Override
@@ -64,8 +63,8 @@ public class TFMGFlywheelVisual extends KineticBlockEntityVisual<TFMGFlywheelBlo
float partialTicks = ctx.partialTick(); float partialTicks = ctx.partialTick();
float speed = blockEntity.visualSpeed.getValue(partialTicks) * 3 / 10f; float speed = ((FlywheelBlockEntityMixin)blockEntity).tfmg$visualSpeed().getValue(partialTicks) * 3 / 10f;
float angle = blockEntity.angle + speed * partialTicks; float angle = ((FlywheelBlockEntityMixin)blockEntity).tfmg$angle() + speed * partialTicks;
if (Math.abs(angle - lastAngle) < 0.001) if (Math.abs(angle - lastAngle) < 0.001)
return; return;

View File

@@ -1,23 +1,18 @@
package com.drmangotea.tfmg.content.decoration.gearbox; package com.drmangotea.tfmg.content.decoration.kinetics.gearbox;
import com.drmangotea.tfmg.registry.TFMGBlockEntities; import com.drmangotea.tfmg.registry.TFMGBlockEntities;
import com.drmangotea.tfmg.registry.TFMGItems;
import com.simibubi.create.content.kinetics.base.RotatedPillarKineticBlock; import com.simibubi.create.content.kinetics.base.RotatedPillarKineticBlock;
import com.simibubi.create.content.kinetics.gearbox.GearboxBlockEntity; import com.simibubi.create.content.kinetics.gearbox.GearboxBlockEntity;
import com.simibubi.create.foundation.block.IBE; import com.simibubi.create.foundation.block.IBE;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.core.Direction.Axis; import net.minecraft.core.Direction.Axis;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.PushReaction; import net.minecraft.world.level.material.PushReaction;
import net.minecraft.world.phys.HitResult;
public class SteelGearboxBlock extends RotatedPillarKineticBlock implements IBE<GearboxBlockEntity> { public class SteelGearboxBlock extends RotatedPillarKineticBlock implements IBE<GearboxBlockEntity> {

View File

@@ -1,4 +1,4 @@
package com.drmangotea.tfmg.content.decoration.gearbox; package com.drmangotea.tfmg.content.decoration.kinetics.gearbox;
import com.drmangotea.tfmg.registry.TFMGBlocks; import com.drmangotea.tfmg.registry.TFMGBlocks;

View File

@@ -1,7 +1,5 @@
package com.drmangotea.tfmg.content.electricity.generators.large_generator; package com.drmangotea.tfmg.content.electricity.generators.large_generator;
import com.drmangotea.tfmg.content.decoration.flywheels.TFMGFlywheelBlock;
import com.drmangotea.tfmg.content.decoration.flywheels.TFMGFlywheelBlockEntity;
import com.drmangotea.tfmg.registry.TFMGPartialModels; import com.drmangotea.tfmg.registry.TFMGPartialModels;
import com.simibubi.create.AllPartialModels; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.kinetics.base.KineticBlockEntityVisual; import com.simibubi.create.content.kinetics.base.KineticBlockEntityVisual;

View File

@@ -1,5 +1,6 @@
package com.drmangotea.tfmg.content.items.weapons.explosives.thermite_grenades; package com.drmangotea.tfmg.content.items.weapons.explosives.thermite_grenades;
import com.drmangotea.tfmg.TFMG;
import com.drmangotea.tfmg.base.spark.BlueSpark; import com.drmangotea.tfmg.base.spark.BlueSpark;
import com.drmangotea.tfmg.base.spark.GreenSpark; import com.drmangotea.tfmg.base.spark.GreenSpark;
import com.drmangotea.tfmg.base.spark.Spark; import com.drmangotea.tfmg.base.spark.Spark;
@@ -25,20 +26,11 @@ public class ThermiteGrenade extends ThrowableItemProjectile {
this.flameColor =ChemicalColor.BLUE; this.flameColor =ChemicalColor.BLUE;
} }
public ThermiteGrenade(Level p_37399_, LivingEntity p_37400_, ChemicalColor color,EntityType grenade) { public ThermiteGrenade(Level p_37399_, LivingEntity p_37400_, ChemicalColor color,EntityType grenade) {
super(grenade, p_37400_, p_37399_); super(grenade, p_37400_, p_37399_);
this.flameColor = color; this.flameColor = color;
} }
public ThermiteGrenade(Level p_37394_, double p_37395_, double p_37396_, double p_37397_) {
super(TFMGEntityTypes.THERMITE_GRENADE.get(), p_37395_, p_37396_, p_37397_, p_37394_);
this.flameColor =ChemicalColor.BLUE;
}
protected Item getDefaultItem() { protected Item getDefaultItem() {
return TFMGItems.THERMITE_GRENADE.get(); return TFMGItems.THERMITE_GRENADE.get();
} }
@@ -65,10 +57,11 @@ public class ThermiteGrenade extends ThrowableItemProjectile {
} }
protected void onHit(HitResult p_37406_) { protected void onHit(HitResult hitResult) {
super.onHit(p_37406_); super.onHit(hitResult);
if (!this.level().isClientSide) {
this.level().broadcastEntityEvent(this, (byte) 3); this.level().broadcastEntityEvent(this, (byte) 3);
for (int i=0; i<20;i++){ for (int i=0; i<20;i++){
@@ -78,16 +71,22 @@ public class ThermiteGrenade extends ThrowableItemProjectile {
if(flameColor==ChemicalColor.GREEN){ if(flameColor==ChemicalColor.GREEN){
GreenSpark spark = TFMGEntityTypes.GREEN_SPARK.create(level()); GreenSpark spark = TFMGEntityTypes.GREEN_SPARK.create(level());
spark.moveTo(this.getX(), this.getY()+1, this.getZ()); spark.moveTo(this.getX(), this.getY()+1, this.getZ());
spark.shootFromRotation( this,x,y,z,0.2f,1); spark.shootFromRotation( this,x,y,z,0.2f,1);
this.level().addFreshEntity(spark); this.level().addFreshEntity(spark);
}else }else
if(flameColor==ChemicalColor.BLUE){ if(flameColor==ChemicalColor.BLUE){
BlueSpark spark = TFMGEntityTypes.BLUE_SPARK.create(level()); BlueSpark spark = TFMGEntityTypes.BLUE_SPARK.create(level());
spark.moveTo(this.getX(), this.getY()+1, this.getZ()); spark.moveTo(this.getX(), this.getY()+1, this.getZ());
spark.shootFromRotation( this,x,y,z,0.2f,1); spark.shootFromRotation( this,x,y,z,0.2f,1);
this.level().addFreshEntity(spark); this.level().addFreshEntity(spark);
} else { Spark spark = TFMGEntityTypes.SPARK.create(level()); } else {
Spark spark = TFMGEntityTypes.SPARK.create(level());
spark.moveTo(this.getX(), this.getY()+1, this.getZ()); spark.moveTo(this.getX(), this.getY()+1, this.getZ());
spark.shootFromRotation( this,x,y,z,0.2f,1); spark.shootFromRotation( this,x,y,z,0.2f,1);
this.level().addFreshEntity(spark);} this.level().addFreshEntity(spark);}
@@ -103,7 +102,7 @@ public class ThermiteGrenade extends ThrowableItemProjectile {
this.level().explode(this, this.getX(), this.getY(0.0625D), this.getZ(), 2.0F, Level.ExplosionInteraction.NONE); this.level().explode(this, this.getX(), this.getY(0.0625D), this.getZ(), 2.0F, Level.ExplosionInteraction.NONE);
this.discard(); this.discard();
}
} }

View File

@@ -24,7 +24,7 @@ public class ThermiteGrenadeItem extends Item {
ItemStack itemstack = p_43143_.getItemInHand(p_43144_); ItemStack itemstack = p_43143_.getItemInHand(p_43144_);
p_43143_.getCooldowns().addCooldown(this, 60); p_43143_.getCooldowns().addCooldown(this, 60);
p_43142_.playSound((Player)null, p_43143_.getX(), p_43143_.getY(), p_43143_.getZ(), SoundEvents.EGG_THROW, SoundSource.NEUTRAL, 0.5F, 0.4F / (p_43142_.getRandom().nextFloat() * 0.4F + 0.8F)); p_43142_.playSound((Player)null, p_43143_.getX(), p_43143_.getY(), p_43143_.getZ(), SoundEvents.EGG_THROW, SoundSource.NEUTRAL, 0.5F, 0.4F / (p_43142_.getRandom().nextFloat() * 0.4F + 0.8F));
if (!p_43142_.isClientSide) {
ThermiteGrenade grenade; ThermiteGrenade grenade;
if(flameColor== ThermiteGrenade.ChemicalColor.GREEN) { if(flameColor== ThermiteGrenade.ChemicalColor.GREEN) {
grenade = new ThermiteGrenade(p_43142_, p_43143_, flameColor, TFMGEntityTypes.ZINC_GRENADE.get()); grenade = new ThermiteGrenade(p_43142_, p_43143_, flameColor, TFMGEntityTypes.ZINC_GRENADE.get());
@@ -36,7 +36,7 @@ public class ThermiteGrenadeItem extends Item {
grenade.setItem(itemstack); grenade.setItem(itemstack);
grenade.shootFromRotation(p_43143_, p_43143_.getXRot(), p_43143_.getYRot(), 0.0F, 0.5F, 1.0F); grenade.shootFromRotation(p_43143_, p_43143_.getXRot(), p_43143_.getYRot(), 0.0F, 0.5F, 1.0F);
p_43142_.addFreshEntity(grenade); p_43142_.addFreshEntity(grenade);
}
p_43143_.awardStat(Stats.ITEM_USED.get(this)); p_43143_.awardStat(Stats.ITEM_USED.get(this));
if (!p_43143_.getAbilities().instabuild) { if (!p_43143_.getAbilities().instabuild) {

View File

@@ -1,6 +1,8 @@
package com.drmangotea.tfmg.content.items.weapons.lithium_blade; package com.drmangotea.tfmg.content.items.weapons.lithium_blade;
import com.drmangotea.tfmg.base.spark.LithiumSpark;
import com.drmangotea.tfmg.base.spark.Spark;
import com.drmangotea.tfmg.registry.TFMGDataComponents; import com.drmangotea.tfmg.registry.TFMGDataComponents;
import com.drmangotea.tfmg.registry.TFMGEntityTypes; import com.drmangotea.tfmg.registry.TFMGEntityTypes;
import com.drmangotea.tfmg.registry.TFMGItems; import com.drmangotea.tfmg.registry.TFMGItems;
@@ -61,6 +63,8 @@ public class LitLithiumBladeItem extends SwordItem {
LithiumSpark spark = TFMGEntityTypes.LITHIUM_SPARK.create(level); LithiumSpark spark = TFMGEntityTypes.LITHIUM_SPARK.create(level);
spark.setPos(player.getX(), player.getY() + 1.3, player.getZ()); spark.setPos(player.getX(), player.getY() + 1.3, player.getZ());

View File

@@ -1,128 +0,0 @@
package com.drmangotea.tfmg.content.items.weapons.lithium_blade;
import com.drmangotea.tfmg.registry.TFMGEntityTypes;
import com.drmangotea.tfmg.registry.TFMGMobEffects;
import com.simibubi.create.content.trains.CubeParticleData;
import net.minecraft.core.particles.ParticleOptions;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.network.syncher.SynchedEntityData;
import net.minecraft.util.Mth;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.projectile.ThrowableProjectile;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.EntityHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
public class LithiumSpark extends ThrowableProjectile {
public LithiumSpark(EntityType<? extends LithiumSpark> p_37391_, Level p_37392_) {
super(p_37391_, p_37392_);
}
public LithiumSpark(Level p_37399_, LivingEntity p_37400_) {
super(TFMGEntityTypes.LITHIUM_SPARK.get(), p_37400_, p_37399_);
}
public LithiumSpark(Level p_37394_, double p_37395_, double p_37396_, double p_37397_) {
super(TFMGEntityTypes.LITHIUM_SPARK.get(), p_37395_, p_37396_, p_37397_, p_37394_);
}
@Override
protected double getDefaultGravity() {
return 0.02f;
}
@Override
protected void defineSynchedData(SynchedEntityData.Builder builder) {
}
public void tick(){
super.tick();
// if (this.isInWaterOrRain()) {
// this.discard();
// }
if(this.level().isClientSide) {
CubeParticleData data =
new CubeParticleData(100, 0, 0, .0125f + .0625f * random.nextFloat(), 30, false);
level().addParticle(data, this.getX(), this.getY(), this.getZ(), this.random.nextGaussian() * 0.05D, -this.getDeltaMovement().y * 0.5D, this.random.nextGaussian() * 0.05D);
}
}
private ParticleOptions getParticle() {
return ParticleTypes.FLAME;
}
public void burst(double pX, double pY, double pZ, float pVelocity, float pInaccuracy) {
Vec3 vec3 = (new Vec3(pX, pY, pZ)).normalize().add(this.random.triangle(0.0D, 0.0172275D * (double)pInaccuracy), 0, this.random.triangle(0.0D, 0.0172275D * (double)pInaccuracy)).scale((double)pVelocity);
this.setDeltaMovement(vec3);
double d0 = vec3.horizontalDistance();
this.setYRot((float)(Mth.atan2(vec3.x, vec3.z) * (double)(180F / (float)Math.PI)));
this.setXRot((float)(Mth.atan2(vec3.y, d0) * (double)(180F / (float)Math.PI)));
this.yRotO = this.getYRot();
this.xRotO = this.getXRot();
}
public void handleEntityEvent(byte p_37402_) {
if (p_37402_ == 3) {
ParticleOptions particleoptions = this.getParticle();
for(int i = 0; i < 8; ++i) {
this.level().addParticle(particleoptions, this.getX(), this.getY(), this.getZ(), 0.0D, 0.0D, 0.0D);
}
}
}
protected void onHitBlock(BlockHitResult p_37384_) {
super.onHitBlock(p_37384_);
}
protected void onHitEntity(EntityHitResult p_37386_) {
super.onHitEntity(p_37386_);
if (!this.level().isClientSide) {
Entity entity = p_37386_.getEntity();
Entity entity1 = this.getOwner();
if(entity instanceof LivingEntity){
((LivingEntity)entity).addEffect(new MobEffectInstance(TFMGMobEffects.HELLFIRE,60));
}
}
}
protected void onHit(HitResult p_37406_) {
super.onHit(p_37406_);
if (!this.level().isClientSide) {
this.level().broadcastEntityEvent(this, (byte)3);
//this.level.explode(this, this.getX(), this.getY(0.0625D), this.getZ(), 2.0F, Explosion.BlockInteraction.NONE);
this.discard();
}
}
@SuppressWarnings("unchecked")
public static EntityType.Builder<?> build(EntityType.Builder<?> builder) {
EntityType.Builder<LithiumSpark> entityBuilder = (EntityType.Builder<LithiumSpark>) builder;
return entityBuilder.sized(.25f, .25f);
}
}

View File

@@ -1,61 +0,0 @@
package com.drmangotea.tfmg.content.items.weapons.lithium_blade;
import com.drmangotea.tfmg.TFMG;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.math.Axis;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.api.distmarker.OnlyIn;
import org.joml.Matrix3f;
import org.joml.Matrix4f;
@OnlyIn(Dist.CLIENT)
public class LithiumSparkRenderer extends EntityRenderer<LithiumSpark> {
private static final ResourceLocation TEXTURE_LOCATION = TFMG.asResource("textures/entity/lithium_spark.png");
private static final RenderType RENDER_TYPE = RenderType.entityCutoutNoCull(TEXTURE_LOCATION);
public LithiumSparkRenderer(EntityRendererProvider.Context p_173962_) {
super(p_173962_);
}
protected int getBlockLightLevel(LithiumSpark p_114087_, BlockPos p_114088_) {
return 15;
}
public void render(LithiumSpark p_114080_, float p_114081_, float p_114082_, PoseStack p_114083_, MultiBufferSource p_114084_, int p_114085_) {
p_114083_.pushPose();
p_114083_.scale(0.5F, 0.5F, 0.5F);
p_114083_.mulPose(this.entityRenderDispatcher.cameraOrientation());
p_114083_.mulPose(Axis.YP.rotationDegrees(180.0F));
PoseStack.Pose posestack$pose = p_114083_.last();
Matrix4f matrix4f = posestack$pose.pose();
Matrix3f matrix3f = posestack$pose.normal();
VertexConsumer vertexconsumer = p_114084_.getBuffer(RENDER_TYPE);
vertex(vertexconsumer, matrix4f, matrix3f, p_114085_, 0.0F, 0, 0, 1);
vertex(vertexconsumer, matrix4f, matrix3f, p_114085_, 1.0F, 0, 1, 1);
vertex(vertexconsumer, matrix4f, matrix3f, p_114085_, 1.0F, 1, 1, 0);
vertex(vertexconsumer, matrix4f, matrix3f, p_114085_, 0.0F, 1, 0, 0);
p_114083_.popPose();
super.render(p_114080_, p_114081_, p_114082_, p_114083_, p_114084_, p_114085_);
}
private static void vertex(VertexConsumer p_114090_, Matrix4f p_114091_, Matrix3f p_114092_, int p_114093_, float p_114094_, int p_114095_, int p_114096_, int p_114097_) {
p_114090_.addVertex(p_114091_, p_114094_ - 0.5F, (float)p_114095_ - 0.25F, 0.0F).setColor(255, 255, 255, 255).setUv((float)p_114096_, (float)p_114097_).setOverlay(OverlayTexture.NO_OVERLAY).setUv2(p_114093_,p_114093_).setNormal( 0.0F, 1.0F, 0.0F);
}
public ResourceLocation getTextureLocation(LithiumSpark p_114078_) {
return TEXTURE_LOCATION;
}
}

View File

@@ -0,0 +1,18 @@
package com.drmangotea.tfmg.mixin.accessor;
import com.simibubi.create.content.kinetics.flywheel.FlywheelBlockEntity;
import net.createmod.catnip.animation.LerpedFloat;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(FlywheelBlockEntity.class)
public interface FlywheelBlockEntityMixin {
@Accessor("angle")
float tfmg$angle();
@Accessor("visualSpeed")
LerpedFloat tfmg$visualSpeed();
}

View File

@@ -0,0 +1,18 @@
package com.drmangotea.tfmg.mixin.accessor;
import com.simibubi.create.content.decoration.slidingDoor.SlidingDoorBlockEntity;
import net.createmod.catnip.animation.LerpedFloat;
import net.minecraft.world.level.block.state.BlockState;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.asm.mixin.gen.Invoker;
@Mixin(SlidingDoorBlockEntity.class)
public interface SlidingDoorBlockEntityAccessor {
@Accessor("animation")
LerpedFloat i_architecture$getAnimation();
@Invoker("shouldRenderSpecial")
boolean i_architecture$shouldRenderSpecial(BlockState state);
}

View File

@@ -1,12 +1,10 @@
package com.drmangotea.tfmg.registry; package com.drmangotea.tfmg.registry;
import com.drmangotea.tfmg.base.HalfShaftRenderer; import com.drmangotea.tfmg.base.HalfShaftRenderer;
import com.drmangotea.tfmg.content.decoration.cogs.*; import com.drmangotea.tfmg.content.decoration.kinetics.cogs.*;
import com.drmangotea.tfmg.content.decoration.doors.TFMGSlidingDoorBlockEntity;
import com.drmangotea.tfmg.content.decoration.doors.TFMGSlidingDoorRenderer; import com.drmangotea.tfmg.content.decoration.doors.TFMGSlidingDoorRenderer;
import com.drmangotea.tfmg.content.decoration.flywheels.TFMGFlywheelBlockEntity; import com.drmangotea.tfmg.content.decoration.kinetics.flywheels.TFMGFlywheelRenderer;
import com.drmangotea.tfmg.content.decoration.flywheels.TFMGFlywheelRenderer; import com.drmangotea.tfmg.content.decoration.kinetics.flywheels.TFMGFlywheelVisual;
import com.drmangotea.tfmg.content.decoration.flywheels.TFMGFlywheelVisual;
import com.drmangotea.tfmg.content.decoration.pipes.TFMGPipeBlockEntity; import com.drmangotea.tfmg.content.decoration.pipes.TFMGPipeBlockEntity;
import com.drmangotea.tfmg.content.decoration.pipes.TFMGPipes; import com.drmangotea.tfmg.content.decoration.pipes.TFMGPipes;
import com.drmangotea.tfmg.content.decoration.tanks.TFMGFluidTankBlockEntity; import com.drmangotea.tfmg.content.decoration.tanks.TFMGFluidTankBlockEntity;
@@ -47,8 +45,6 @@ import com.drmangotea.tfmg.content.electricity.utilities.potentiometer.Potentiom
import com.drmangotea.tfmg.content.electricity.utilities.resistor.ResistorBlockEntity; import com.drmangotea.tfmg.content.electricity.utilities.resistor.ResistorBlockEntity;
import com.drmangotea.tfmg.content.electricity.utilities.segmented_display.SegmentedDisplayBlockEntity; import com.drmangotea.tfmg.content.electricity.utilities.segmented_display.SegmentedDisplayBlockEntity;
import com.drmangotea.tfmg.content.electricity.utilities.segmented_display.SegmentedDisplayRenderer; import com.drmangotea.tfmg.content.electricity.utilities.segmented_display.SegmentedDisplayRenderer;
import com.drmangotea.tfmg.content.electricity.utilities.segmented_display.SegmentedDisplaySource;
import com.drmangotea.tfmg.content.electricity.utilities.segmented_display.SegmentedDisplayTarget;
import com.drmangotea.tfmg.content.electricity.utilities.traffic_light.TrafficLightBlockEntity; import com.drmangotea.tfmg.content.electricity.utilities.traffic_light.TrafficLightBlockEntity;
import com.drmangotea.tfmg.content.electricity.utilities.traffic_light.TrafficLightRenderer; import com.drmangotea.tfmg.content.electricity.utilities.traffic_light.TrafficLightRenderer;
import com.drmangotea.tfmg.content.electricity.utilities.transformer.TransformerBlockEntity; import com.drmangotea.tfmg.content.electricity.utilities.transformer.TransformerBlockEntity;
@@ -103,6 +99,7 @@ import com.drmangotea.tfmg.content.machinery.vat.industrial_mixer.IndustrialMixe
import com.drmangotea.tfmg.content.machinery.vat.industrial_mixer.IndustrialMixerRenderer; import com.drmangotea.tfmg.content.machinery.vat.industrial_mixer.IndustrialMixerRenderer;
import com.drmangotea.tfmg.content.machinery.vat.industrial_mixer.IndustrialMixerVisual; import com.drmangotea.tfmg.content.machinery.vat.industrial_mixer.IndustrialMixerVisual;
import com.simibubi.create.AllPartialModels; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.decoration.slidingDoor.SlidingDoorBlockEntity;
import com.simibubi.create.content.fluids.pipes.FluidPipeBlockEntity; import com.simibubi.create.content.fluids.pipes.FluidPipeBlockEntity;
import com.simibubi.create.content.fluids.pipes.SmartFluidPipeBlockEntity; import com.simibubi.create.content.fluids.pipes.SmartFluidPipeBlockEntity;
import com.simibubi.create.content.fluids.pipes.StraightPipeBlockEntity; import com.simibubi.create.content.fluids.pipes.StraightPipeBlockEntity;
@@ -113,6 +110,7 @@ import com.simibubi.create.content.fluids.pipes.valve.FluidValveVisual;
import com.simibubi.create.content.fluids.pump.PumpBlockEntity; import com.simibubi.create.content.fluids.pump.PumpBlockEntity;
import com.simibubi.create.content.fluids.pump.PumpRenderer; import com.simibubi.create.content.fluids.pump.PumpRenderer;
import com.simibubi.create.content.kinetics.base.*; import com.simibubi.create.content.kinetics.base.*;
import com.simibubi.create.content.kinetics.flywheel.FlywheelBlockEntity;
import com.simibubi.create.content.kinetics.gearbox.GearboxBlockEntity; import com.simibubi.create.content.kinetics.gearbox.GearboxBlockEntity;
import com.simibubi.create.content.kinetics.gearbox.GearboxRenderer; import com.simibubi.create.content.kinetics.gearbox.GearboxRenderer;
import com.simibubi.create.content.kinetics.gearbox.GearboxVisual; import com.simibubi.create.content.kinetics.gearbox.GearboxVisual;
@@ -299,8 +297,8 @@ public class TFMGBlockEntities {
.validBlocks(TFMGBlocks.POTENTIOMETER, TFMGBlocks.ENCASED_POTENTIOMETER) .validBlocks(TFMGBlocks.POTENTIOMETER, TFMGBlocks.ENCASED_POTENTIOMETER)
.register(); .register();
public static final BlockEntityEntry<TFMGSlidingDoorBlockEntity> TFMG_SLIDING_DOOR = public static final BlockEntityEntry<SlidingDoorBlockEntity> TFMG_SLIDING_DOOR =
REGISTRATE.blockEntity("tfmg_sliding_door", TFMGSlidingDoorBlockEntity::new) REGISTRATE.blockEntity("tfmg_sliding_door", SlidingDoorBlockEntity::new)
.renderer(() -> TFMGSlidingDoorRenderer::new) .renderer(() -> TFMGSlidingDoorRenderer::new)
.validBlocks(TFMGBlocks.HEAVY_CASING_DOOR, TFMGBlocks.STEEL_CASING_DOOR, TFMGBlocks.HEAVY_PLATED_DOOR, TFMGBlocks.ALUMINUM_DOOR) .validBlocks(TFMGBlocks.HEAVY_CASING_DOOR, TFMGBlocks.STEEL_CASING_DOOR, TFMGBlocks.HEAVY_PLATED_DOOR, TFMGBlocks.ALUMINUM_DOOR)
.register(); .register();
@@ -456,8 +454,8 @@ public class TFMGBlockEntities {
.renderer(() -> GearboxRenderer::new) .renderer(() -> GearboxRenderer::new)
.register(); .register();
public static final BlockEntityEntry<TFMGFlywheelBlockEntity> TFMG_FLYWHEEL = REGISTRATE public static final BlockEntityEntry<FlywheelBlockEntity> TFMG_FLYWHEEL = REGISTRATE
.blockEntity("steel_flywheel", TFMGFlywheelBlockEntity::new) .blockEntity("steel_flywheel", FlywheelBlockEntity::new)
.visual(() -> TFMGFlywheelVisual::new, false) .visual(() -> TFMGFlywheelVisual::new, false)
.validBlocks( .validBlocks(
TFMGBlocks.STEEL_FLYWHEEL, TFMGBlocks.STEEL_FLYWHEEL,

View File

@@ -6,12 +6,13 @@ import com.drmangotea.tfmg.base.blocks.TFMGDirectionalBlock;
import com.drmangotea.tfmg.base.blocks.TFMGVanillaBlockStates; import com.drmangotea.tfmg.base.blocks.TFMGVanillaBlockStates;
import com.drmangotea.tfmg.config.TFMGStress; import com.drmangotea.tfmg.config.TFMGStress;
import com.drmangotea.tfmg.content.decoration.*; import com.drmangotea.tfmg.content.decoration.*;
import com.drmangotea.tfmg.content.decoration.cogs.TFMGCogWheelBlock; import com.drmangotea.tfmg.content.decoration.kinetics.cogs.TFMGCogWheelBlock;
import com.drmangotea.tfmg.content.decoration.cogs.TFMGCogwheelBlockItem; import com.drmangotea.tfmg.content.decoration.kinetics.cogs.TFMGCogwheelBlockItem;
import com.drmangotea.tfmg.content.decoration.concrete.*; import com.drmangotea.tfmg.content.decoration.concrete.*;
import com.drmangotea.tfmg.content.decoration.doors.TFMGSlidingDoorBlock; import com.drmangotea.tfmg.content.decoration.doors.TFMGSlidingDoorBlock;
import com.drmangotea.tfmg.content.decoration.flywheels.TFMGFlywheelBlock; import com.drmangotea.tfmg.content.decoration.kinetics.flywheels.TFMGFlywheelBlock;
import com.drmangotea.tfmg.content.decoration.gearbox.SteelGearboxBlock; import com.drmangotea.tfmg.content.decoration.kinetics.gearbox.SteelGearboxBlock;
import com.drmangotea.tfmg.content.decoration.tanks.TFMGTankGenerator;
import com.drmangotea.tfmg.content.decoration.tanks.aluminum.AluminumFluidTankModel; import com.drmangotea.tfmg.content.decoration.tanks.aluminum.AluminumFluidTankModel;
import com.drmangotea.tfmg.content.decoration.tanks.aluminum.AluminumTankBlock; import com.drmangotea.tfmg.content.decoration.tanks.aluminum.AluminumTankBlock;
import com.drmangotea.tfmg.content.decoration.tanks.aluminum.AluminumTankItem; import com.drmangotea.tfmg.content.decoration.tanks.aluminum.AluminumTankItem;
@@ -20,7 +21,6 @@ import com.drmangotea.tfmg.content.decoration.tanks.cast_iron.CastIronTankBlock;
import com.drmangotea.tfmg.content.decoration.tanks.cast_iron.CastIronTankItem; import com.drmangotea.tfmg.content.decoration.tanks.cast_iron.CastIronTankItem;
import com.drmangotea.tfmg.content.decoration.tanks.steel.SteelFluidTankModel; import com.drmangotea.tfmg.content.decoration.tanks.steel.SteelFluidTankModel;
import com.drmangotea.tfmg.content.decoration.tanks.steel.SteelTankBlock; import com.drmangotea.tfmg.content.decoration.tanks.steel.SteelTankBlock;
import com.drmangotea.tfmg.content.decoration.tanks.TFMGTankGenerator;
import com.drmangotea.tfmg.content.decoration.tanks.steel.SteelTankItem; import com.drmangotea.tfmg.content.decoration.tanks.steel.SteelTankItem;
import com.drmangotea.tfmg.content.electricity.connection.CableHubBlock; import com.drmangotea.tfmg.content.electricity.connection.CableHubBlock;
import com.drmangotea.tfmg.content.electricity.connection.cables.CableConnectorBlock; import com.drmangotea.tfmg.content.electricity.connection.cables.CableConnectorBlock;
@@ -50,8 +50,8 @@ import com.drmangotea.tfmg.content.electricity.utilities.electric_motor.Electric
import com.drmangotea.tfmg.content.electricity.utilities.electric_pump.ElectricPumpBlock; import com.drmangotea.tfmg.content.electricity.utilities.electric_pump.ElectricPumpBlock;
import com.drmangotea.tfmg.content.electricity.utilities.electric_switch.ElectricSwitchBlock; import com.drmangotea.tfmg.content.electricity.utilities.electric_switch.ElectricSwitchBlock;
import com.drmangotea.tfmg.content.electricity.utilities.polarizer.PolarizerBlock; import com.drmangotea.tfmg.content.electricity.utilities.polarizer.PolarizerBlock;
import com.drmangotea.tfmg.content.electricity.utilities.potentiometer.PotentiometerBlock;
import com.drmangotea.tfmg.content.electricity.utilities.potentiometer.EncasedPotentiometerBlock; import com.drmangotea.tfmg.content.electricity.utilities.potentiometer.EncasedPotentiometerBlock;
import com.drmangotea.tfmg.content.electricity.utilities.potentiometer.PotentiometerBlock;
import com.drmangotea.tfmg.content.electricity.utilities.resistor.ResistorBlock; import com.drmangotea.tfmg.content.electricity.utilities.resistor.ResistorBlock;
import com.drmangotea.tfmg.content.electricity.utilities.resistor.ResistorBlockItem; import com.drmangotea.tfmg.content.electricity.utilities.resistor.ResistorBlockItem;
import com.drmangotea.tfmg.content.electricity.utilities.segmented_display.SegmentedDisplayBlock; import com.drmangotea.tfmg.content.electricity.utilities.segmented_display.SegmentedDisplayBlock;
@@ -111,7 +111,6 @@ import com.drmangotea.tfmg.content.machinery.vat.base.VatBlock;
import com.drmangotea.tfmg.content.machinery.vat.base.VatGenerator; import com.drmangotea.tfmg.content.machinery.vat.base.VatGenerator;
import com.drmangotea.tfmg.content.machinery.vat.electrode_holder.ElectrodeHolderBlock; import com.drmangotea.tfmg.content.machinery.vat.electrode_holder.ElectrodeHolderBlock;
import com.drmangotea.tfmg.content.machinery.vat.industrial_mixer.IndustrialMixerBlock; import com.drmangotea.tfmg.content.machinery.vat.industrial_mixer.IndustrialMixerBlock;
import com.simibubi.create.AllDisplaySources;
import com.simibubi.create.AllTags; import com.simibubi.create.AllTags;
import com.simibubi.create.api.stress.BlockStressValues; import com.simibubi.create.api.stress.BlockStressValues;
import com.simibubi.create.content.contraptions.bearing.StabilizedBearingMovementBehaviour; import com.simibubi.create.content.contraptions.bearing.StabilizedBearingMovementBehaviour;
@@ -161,7 +160,6 @@ import static com.simibubi.create.foundation.data.CreateRegistrate.casingConnect
import static com.simibubi.create.foundation.data.CreateRegistrate.connectedTextures; import static com.simibubi.create.foundation.data.CreateRegistrate.connectedTextures;
import static com.simibubi.create.foundation.data.ModelGen.customItemModel; import static com.simibubi.create.foundation.data.ModelGen.customItemModel;
import static com.simibubi.create.foundation.data.TagGen.*; import static com.simibubi.create.foundation.data.TagGen.*;
import static com.simibubi.create.foundation.data.TagGen.tagBlockAndItem;
@SuppressWarnings("removal") @SuppressWarnings("removal")
public class TFMGBlocks { public class TFMGBlocks {
@@ -207,7 +205,7 @@ public class TFMGBlocks {
.transform(customItemModel()) .transform(customItemModel())
.register(); .register();
public static final BlockEntry<LargeEngineBlock> LARGE_ENGINE = REGISTRATE.block("large_engine", LargeEngineBlock::new) public static final BlockEntry<LargeEngineBlock> LARGE_ENGINE = REGISTRATE.block("large_engine", LargeEngineBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK)) .properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
.transform(TFMGStress.setCapacity(55)) .transform(TFMGStress.setCapacity(55))
@@ -216,7 +214,7 @@ public class TFMGBlocks {
.transform(customItemModel()) .transform(customItemModel())
.register(); .register();
public static final BlockEntry<LargeEngineBlock> SIMPLE_LARGE_ENGINE = REGISTRATE.block("simple_large_engine", LargeEngineBlock::new) public static final BlockEntry<LargeEngineBlock> SIMPLE_LARGE_ENGINE = REGISTRATE.block("simple_large_engine", LargeEngineBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK)) .properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
.transform(TFMGStress.setCapacity(40)) .transform(TFMGStress.setCapacity(40))
@@ -226,7 +224,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<EngineGearboxBlock> ENGINE_GEARBOX = REGISTRATE.block("engine_gearbox", EngineGearboxBlock::new) public static final BlockEntry<EngineGearboxBlock> ENGINE_GEARBOX = REGISTRATE.block("engine_gearbox", EngineGearboxBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK)) .properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
.blockstate(BlockStateGen.horizontalBlockProvider(true)) .blockstate(BlockStateGen.horizontalBlockProvider(true))
@@ -235,7 +233,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<EngineControllerBlock> ENGINE_CONTROLLER = REGISTRATE.block("engine_controller", EngineControllerBlock::new) public static final BlockEntry<EngineControllerBlock> ENGINE_CONTROLLER = REGISTRATE.block("engine_controller", EngineControllerBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK)) .properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
.blockstate(BlockStateGen.horizontalBlockProvider(true)) .blockstate(BlockStateGen.horizontalBlockProvider(true))
@@ -245,7 +243,7 @@ public class TFMGBlocks {
//------------------TANKS------------------// //------------------TANKS------------------//
public static final BlockEntry<AluminumTankBlock> ALUMINUM_FLUID_TANK = public static final BlockEntry<AluminumTankBlock> ALUMINUM_FLUID_TANK =
REGISTRATE.block("aluminum_fluid_tank", AluminumTankBlock::regular) REGISTRATE.block("aluminum_fluid_tank", AluminumTankBlock::regular)
.initialProperties(SharedProperties::copperMetal) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.sound(SoundType.COPPER)) .properties(p -> p.sound(SoundType.COPPER))
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
.properties(p -> p.isRedstoneConductor((p1, p2, p3) -> true)) .properties(p -> p.isRedstoneConductor((p1, p2, p3) -> true))
@@ -261,7 +259,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<CastIronTankBlock> CAST_IRON_FLUID_TANK = public static final BlockEntry<CastIronTankBlock> CAST_IRON_FLUID_TANK =
REGISTRATE.block("cast_iron_fluid_tank", CastIronTankBlock::regular) REGISTRATE.block("cast_iron_fluid_tank", CastIronTankBlock::regular)
.initialProperties(SharedProperties::copperMetal) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.sound(SoundType.METAL)) .properties(p -> p.sound(SoundType.METAL))
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
.transform(mountedFluidStorage(TFMGMountedStorageTypes.TFMG_FLUID_TANK)) .transform(mountedFluidStorage(TFMGMountedStorageTypes.TFMG_FLUID_TANK))
@@ -279,7 +277,7 @@ public class TFMGBlocks {
//------------------DISTILLATION_TOWER------------------// //------------------DISTILLATION_TOWER------------------//
public static final BlockEntry<SteelTankBlock> STEEL_FLUID_TANK = public static final BlockEntry<SteelTankBlock> STEEL_FLUID_TANK =
REGISTRATE.block("steel_fluid_tank", SteelTankBlock::regular) REGISTRATE.block("steel_fluid_tank", SteelTankBlock::regular)
.initialProperties(SharedProperties::copperMetal) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK)) .properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
.properties(p -> p.isRedstoneConductor((p1, p2, p3) -> true)) .properties(p -> p.isRedstoneConductor((p1, p2, p3) -> true))
@@ -296,7 +294,7 @@ public class TFMGBlocks {
public static final BlockEntry<DistillationOutputBlock> STEEL_DISTILLATION_OUTPUT = public static final BlockEntry<DistillationOutputBlock> STEEL_DISTILLATION_OUTPUT =
REGISTRATE.block("steel_distillation_output", DistillationOutputBlock::new) REGISTRATE.block("steel_distillation_output", DistillationOutputBlock::new)
.initialProperties(SharedProperties::copperMetal) .initialProperties(SharedProperties::softMetal)
.blockstate((ctx, prov) -> prov.simpleBlock(ctx.getEntry(), AssetLookup.partialBaseModel(ctx, prov))) .blockstate((ctx, prov) -> prov.simpleBlock(ctx.getEntry(), AssetLookup.partialBaseModel(ctx, prov)))
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK)) .properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
@@ -306,7 +304,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<DistillationControllerBlock> STEEL_DISTILLATION_CONTROLLER = public static final BlockEntry<DistillationControllerBlock> STEEL_DISTILLATION_CONTROLLER =
REGISTRATE.block("steel_distillation_controller", DistillationControllerBlock::new) REGISTRATE.block("steel_distillation_controller", DistillationControllerBlock::new)
.initialProperties(SharedProperties::copperMetal) .initialProperties(SharedProperties::softMetal)
.blockstate(BlockStateGen.horizontalBlockProvider(true)) .blockstate(BlockStateGen.horizontalBlockProvider(true))
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK)) .properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
@@ -314,18 +312,17 @@ public class TFMGBlocks {
.build() .build()
.register(); .register();
public static final BlockEntry<IndustrialPipeBlock> INDUSTRIAL_PIPE = REGISTRATE.block("industrial_pipe", IndustrialPipeBlock::new) public static final BlockEntry<IndustrialPipeBlock> INDUSTRIAL_PIPE = REGISTRATE.block("industrial_pipe", IndustrialPipeBlock::new)
.initialProperties(() -> Blocks.STONE) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.requiresCorrectToolForDrops()) .properties(p -> p.requiresCorrectToolForDrops())
.properties(p -> p.sound(SoundType.STONE)) .properties(p -> p.sound(SoundType.STONE))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.tag(TFMGTags.TFMGBlockTags.INDUSTRIAL_PIPE.tag) .tag(TFMGTags.TFMGBlockTags.INDUSTRIAL_PIPE.tag)
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.commonItemTag("ingots/steel")), RecipeCategory.BUILDING_BLOCKS, c::get, 8)) .recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.commonItemTag("ingots/steel")), RecipeCategory.BUILDING_BLOCKS, c::get, 8))
.blockstate((ctx, prov) -> prov.simpleBlock(ctx.getEntry(), AssetLookup.partialBaseModel(ctx, prov))) .blockstate((ctx, prov) -> prov.simpleBlock(ctx.getEntry(), AssetLookup.partialBaseModel(ctx, prov)))
.item() .simpleItem()
.build()
.register(); .register();
public static final BlockEntry<Block> CONCRETE_ENCASED_INDUSTRIAL_PIPE = REGISTRATE.block("concrete_encased_industrial_pipe", Block::new) public static final BlockEntry<Block> CONCRETE_ENCASED_INDUSTRIAL_PIPE = REGISTRATE.block("concrete_encased_industrial_pipe", Block::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.requiresCorrectToolForDrops().noOcclusion()) .properties(p -> p.requiresCorrectToolForDrops().noOcclusion())
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK)) .properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
@@ -351,7 +348,7 @@ public class TFMGBlocks {
public static final BlockEntry<PumpjackCrankBlock> PUMPJACK_CRANK = public static final BlockEntry<PumpjackCrankBlock> PUMPJACK_CRANK =
REGISTRATE.block("pumpjack_crank", PumpjackCrankBlock::new) REGISTRATE.block("pumpjack_crank", PumpjackCrankBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate(BlockStateGen.horizontalBlockProvider(true)) .blockstate(BlockStateGen.horizontalBlockProvider(true))
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
@@ -361,72 +358,62 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<PumpjackHammerPartBlock> PUMPJACK_HAMMER_PART = REGISTRATE.block("pumpjack_hammer_part", PumpjackHammerPartBlock::new) public static final BlockEntry<PumpjackHammerPartBlock> PUMPJACK_HAMMER_PART = REGISTRATE.block("pumpjack_hammer_part", PumpjackHammerPartBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
.blockstate(BlockStateGen.horizontalBlockProvider(false)) .blockstate(BlockStateGen.horizontalBlockProvider(false))
.tag(TFMGTags.TFMGBlockTags.PUMPJACK_SMALL_PART.tag) .tag(TFMGTags.TFMGBlockTags.PUMPJACK_SMALL_PART.tag)
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.commonItemTag("storage_blocks/steel")), .recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.commonItemTag("storage_blocks/steel")),
RecipeCategory.DECORATIONS, c::get, 2)) RecipeCategory.DECORATIONS, c::get, 2))
.item() .simpleItem()
.build()
.register(); .register();
public static final BlockEntry<PumpjackHammerHeadBlock> PUMPJACK_HAMMER_HEAD = REGISTRATE.block("pumpjack_hammer_head", PumpjackHammerHeadBlock::new) public static final BlockEntry<PumpjackHammerHeadBlock> PUMPJACK_HAMMER_HEAD = REGISTRATE.block("pumpjack_hammer_head", PumpjackHammerHeadBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
.blockstate(BlockStateGen.horizontalBlockProvider(false)) .blockstate(BlockStateGen.horizontalBlockProvider(false))
.tag(TFMGTags.TFMGBlockTags.PUMPJACK_HEAD.tag) .tag(TFMGTags.TFMGBlockTags.PUMPJACK_HEAD.tag)
.simpleItem()
.item()
.build()
.register(); .register();
public static final BlockEntry<PumpjackHammerConnectorBlock> PUMPJACK_HAMMER_CONNECTOR = REGISTRATE.block("pumpjack_hammer_connector", PumpjackHammerConnectorBlock::new) public static final BlockEntry<PumpjackHammerConnectorBlock> PUMPJACK_HAMMER_CONNECTOR = REGISTRATE.block("pumpjack_hammer_connector", PumpjackHammerConnectorBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
.blockstate(BlockStateGen.horizontalBlockProvider(false)) .blockstate(BlockStateGen.horizontalBlockProvider(false))
.tag(TFMGTags.TFMGBlockTags.PUMPJACK_CONNECTOR.tag) .tag(TFMGTags.TFMGBlockTags.PUMPJACK_CONNECTOR.tag)
.item() .simpleItem()
.build()
.register(); .register();
public static final BlockEntry<LargePumpjackHammerPartBlock> LARGE_PUMPJACK_HAMMER_PART = REGISTRATE.block("large_pumpjack_hammer_part", LargePumpjackHammerPartBlock::new) public static final BlockEntry<LargePumpjackHammerPartBlock> LARGE_PUMPJACK_HAMMER_PART = REGISTRATE.block("large_pumpjack_hammer_part", LargePumpjackHammerPartBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate(BlockStateGen.horizontalBlockProvider(false)) .blockstate(BlockStateGen.horizontalBlockProvider(false))
.tag(TFMGTags.TFMGBlockTags.PUMPJACK_PART.tag) .tag(TFMGTags.TFMGBlockTags.PUMPJACK_PART.tag)
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.commonItemTag("storage_blocks/steel")), .recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.commonItemTag("storage_blocks/steel")),
RecipeCategory.DECORATIONS, c::get, 2)) RecipeCategory.DECORATIONS, c::get, 2))
.item() .simpleItem()
.build()
.register(); .register();
public static final BlockEntry<LargePumpjackHammerHeadBlock> LARGE_PUMPJACK_HAMMER_HEAD = REGISTRATE.block("large_pumpjack_hammer_head", LargePumpjackHammerHeadBlock::new) public static final BlockEntry<LargePumpjackHammerHeadBlock> LARGE_PUMPJACK_HAMMER_HEAD = REGISTRATE.block("large_pumpjack_hammer_head", LargePumpjackHammerHeadBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate(BlockStateGen.horizontalBlockProvider(false)) .blockstate(BlockStateGen.horizontalBlockProvider(false))
.tag(TFMGTags.TFMGBlockTags.PUMPJACK_HEAD.tag) .tag(TFMGTags.TFMGBlockTags.PUMPJACK_HEAD.tag)
.item() .simpleItem()
.build()
.register(); .register();
public static final BlockEntry<LargePumpjackHammerConnectorBlock> LARGE_PUMPJACK_HAMMER_CONNECTOR = REGISTRATE.block("large_pumpjack_hammer_connector", LargePumpjackHammerConnectorBlock::new) public static final BlockEntry<LargePumpjackHammerConnectorBlock> LARGE_PUMPJACK_HAMMER_CONNECTOR = REGISTRATE.block("large_pumpjack_hammer_connector", LargePumpjackHammerConnectorBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate(BlockStateGen.horizontalBlockProvider(false)) .blockstate(BlockStateGen.horizontalBlockProvider(false))
.tag(TFMGTags.TFMGBlockTags.PUMPJACK_CONNECTOR.tag) .tag(TFMGTags.TFMGBlockTags.PUMPJACK_CONNECTOR.tag)
.item() .simpleItem()
.build()
.register(); .register();
public static final BlockEntry<PumpjackBaseBlock> PUMPJACK_BASE = REGISTRATE.block("pumpjack_base", PumpjackBaseBlock::new) public static final BlockEntry<PumpjackBaseBlock> PUMPJACK_BASE = REGISTRATE.block("pumpjack_base", PumpjackBaseBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
.blockstate((ctx, prov) -> prov.simpleBlock(ctx.getEntry(), AssetLookup.partialBaseModel(ctx, prov))) .blockstate((ctx, prov) -> prov.simpleBlock(ctx.getEntry(), AssetLookup.partialBaseModel(ctx, prov)))
.item() .simpleItem()
.build()
.register(); .register();
public static final BlockEntry<Block> OIL_DEPOSIT = REGISTRATE.block("oil_deposit", Block::new) public static final BlockEntry<Block> OIL_DEPOSIT = REGISTRATE.block("oil_deposit", Block::new)
.initialProperties(() -> Blocks.BEDROCK) .initialProperties(() -> Blocks.BEDROCK)
@@ -440,8 +427,7 @@ public class TFMGBlocks {
.tag(BlockTags.INFINIBURN_OVERWORLD) .tag(BlockTags.INFINIBURN_OVERWORLD)
.tag(BlockTags.FEATURES_CANNOT_REPLACE) .tag(BlockTags.FEATURES_CANNOT_REPLACE)
.tag(AllTags.AllBlockTags.NON_MOVABLE.tag) .tag(AllTags.AllBlockTags.NON_MOVABLE.tag)
.item() .simpleItem()
.build()
.register(); .register();
//------------------VAT_MACHINES------------------// //------------------VAT_MACHINES------------------//
@SuppressWarnings("'addLayer(java.util.function.Supplier<java.util.function.Supplier<net.minecraft.client.renderer.RenderType>>)' is deprecated and marked for removal ") @SuppressWarnings("'addLayer(java.util.function.Supplier<java.util.function.Supplier<net.minecraft.client.renderer.RenderType>>)' is deprecated and marked for removal ")
@@ -514,7 +500,6 @@ public class TFMGBlocks {
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.loot((lt, b) -> { .loot((lt, b) -> {
HolderLookup.RegistryLookup<Enchantment> enchantmentRegistryLookup = lt.getRegistries().lookupOrThrow(Registries.ENCHANTMENT); HolderLookup.RegistryLookup<Enchantment> enchantmentRegistryLookup = lt.getRegistries().lookupOrThrow(Registries.ENCHANTMENT);
lt.add(b, lt.add(b,
lt.createSilkTouchDispatchTable(b, lt.createSilkTouchDispatchTable(b,
lt.applyExplosionDecay(b, LootItem.lootTableItem(TFMGItems.RAW_LEAD.get()) lt.applyExplosionDecay(b, LootItem.lootTableItem(TFMGItems.RAW_LEAD.get())
@@ -634,14 +619,12 @@ public class TFMGBlocks {
public static final BlockEntry<Block> SULFUR = REGISTRATE.block("sulfur", Block::new) public static final BlockEntry<Block> SULFUR = REGISTRATE.block("sulfur", Block::new)
.initialProperties(() -> Blocks.CALCITE) .initialProperties(() -> Blocks.CALCITE)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.item() .simpleItem()
.build()
.register(); .register();
public static final BlockEntry<Block> LIGNITE = REGISTRATE.block("lignite", Block::new) public static final BlockEntry<Block> LIGNITE = REGISTRATE.block("lignite", Block::new)
.initialProperties(() -> Blocks.CALCITE) .initialProperties(() -> Blocks.CALCITE)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.item() .simpleItem()
.build()
.register(); .register();
public static final BlockEntry<Block> FIRECLAY = REGISTRATE.block("fireclay", Block::new) public static final BlockEntry<Block> FIRECLAY = REGISTRATE.block("fireclay", Block::new)
.initialProperties(() -> Blocks.CLAY) .initialProperties(() -> Blocks.CLAY)
@@ -656,9 +639,7 @@ public class TFMGBlocks {
.properties(p -> p.strength(100f, 1200f)) .properties(p -> p.strength(100f, 1200f))
.properties(p -> p.requiresCorrectToolForDrops()) .properties(p -> p.requiresCorrectToolForDrops())
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.item() .simpleItem()
.build()
.lang("Fossilstone")
.register(); .register();
public static final BlockEntry<Block> SLAG_BLOCK = public static final BlockEntry<Block> SLAG_BLOCK =
REGISTRATE.block("slag_block", Block::new) REGISTRATE.block("slag_block", Block::new)
@@ -795,8 +776,7 @@ public class TFMGBlocks {
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.tag(TFMGTags.TFMGBlockTags.BLAST_FURNACE_WALL.tag) .tag(TFMGTags.TFMGBlockTags.BLAST_FURNACE_WALL.tag)
.tag(BlockTags.NEEDS_STONE_TOOL) .tag(BlockTags.NEEDS_STONE_TOOL)
.item() .simpleItem()
.build()
.register(); .register();
public static final BlockEntry<Block> REINFORCED_FIREPROOF_BRICKS = REGISTRATE.block("reinforced_fireproof_bricks", Block::new) public static final BlockEntry<Block> REINFORCED_FIREPROOF_BRICKS = REGISTRATE.block("reinforced_fireproof_bricks", Block::new)
@@ -810,7 +790,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<Block> BLAST_FURNACE_REINFORCEMENT = REGISTRATE.block("blast_furnace_reinforcement", Block::new) public static final BlockEntry<Block> BLAST_FURNACE_REINFORCEMENT = REGISTRATE.block("blast_furnace_reinforcement", Block::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(BlockBehaviour.Properties::requiresCorrectToolForDrops) .properties(BlockBehaviour.Properties::requiresCorrectToolForDrops)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.onRegister(connectedTextures(() -> new HorizontalCTBehaviour(TFMGSpriteShifts.BLAST_FURNACE_REINFORCEMENT))) .onRegister(connectedTextures(() -> new HorizontalCTBehaviour(TFMGSpriteShifts.BLAST_FURNACE_REINFORCEMENT)))
@@ -821,7 +801,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<BlastFurnaceReinforcementWallBlock> BLAST_FURNACE_REINFORCEMENT_WALL = REGISTRATE.block("blast_furnace_reinforcement_wall", BlastFurnaceReinforcementWallBlock::new) public static final BlockEntry<BlastFurnaceReinforcementWallBlock> BLAST_FURNACE_REINFORCEMENT_WALL = REGISTRATE.block("blast_furnace_reinforcement_wall", BlastFurnaceReinforcementWallBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(BlockBehaviour.Properties::requiresCorrectToolForDrops) .properties(BlockBehaviour.Properties::requiresCorrectToolForDrops)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
@@ -832,7 +812,7 @@ public class TFMGBlocks {
.register(); .register();
// //
public static final BlockEntry<Block> RUSTED_BLAST_FURNACE_REINFORCEMENT = REGISTRATE.block("rusted_blast_furnace_reinforcement", Block::new) public static final BlockEntry<Block> RUSTED_BLAST_FURNACE_REINFORCEMENT = REGISTRATE.block("rusted_blast_furnace_reinforcement", Block::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(BlockBehaviour.Properties::requiresCorrectToolForDrops) .properties(BlockBehaviour.Properties::requiresCorrectToolForDrops)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.onRegister(connectedTextures(() -> new HorizontalCTBehaviour(TFMGSpriteShifts.RUSTED_BLAST_FURNACE_REINFORCEMENT))) .onRegister(connectedTextures(() -> new HorizontalCTBehaviour(TFMGSpriteShifts.RUSTED_BLAST_FURNACE_REINFORCEMENT)))
@@ -843,7 +823,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<BlastFurnaceReinforcementWallBlock> RUSTED_BLAST_FURNACE_REINFORCEMENT_WALL = REGISTRATE.block("rusted_blast_furnace_reinforcement_wall", BlastFurnaceReinforcementWallBlock::new) public static final BlockEntry<BlastFurnaceReinforcementWallBlock> RUSTED_BLAST_FURNACE_REINFORCEMENT_WALL = REGISTRATE.block("rusted_blast_furnace_reinforcement_wall", BlastFurnaceReinforcementWallBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(BlockBehaviour.Properties::requiresCorrectToolForDrops) .properties(BlockBehaviour.Properties::requiresCorrectToolForDrops)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
@@ -866,7 +846,6 @@ public class TFMGBlocks {
.build() .build()
.register(); .register();
public static final BlockEntry<CokeOvenBlock> COKE_OVEN = REGISTRATE.block("coke_oven", CokeOvenBlock::new) public static final BlockEntry<CokeOvenBlock> COKE_OVEN = REGISTRATE.block("coke_oven", CokeOvenBlock::new)
.initialProperties(() -> Blocks.BRICKS) .initialProperties(() -> Blocks.BRICKS)
.properties(p -> p.requiresCorrectToolForDrops()) .properties(p -> p.requiresCorrectToolForDrops())
@@ -889,7 +868,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<CastingBasinBlock> CASTING_BASIN = REGISTRATE.block("casting_basin", CastingBasinBlock::new) public static final BlockEntry<CastingBasinBlock> CASTING_BASIN = REGISTRATE.block("casting_basin", CastingBasinBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.requiresCorrectToolForDrops().noOcclusion()) .properties(p -> p.requiresCorrectToolForDrops().noOcclusion())
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate(BlockStateGen.horizontalBlockProvider(true)) .blockstate(BlockStateGen.horizontalBlockProvider(true))
@@ -901,7 +880,7 @@ public class TFMGBlocks {
//------------------GADGETS------------------// //------------------GADGETS------------------//
public static final BlockEntry<NapalmBombBlock> NAPALM_BOMB = REGISTRATE.block("napalm_bomb", NapalmBombBlock::new) public static final BlockEntry<NapalmBombBlock> NAPALM_BOMB = REGISTRATE.block("napalm_bomb", NapalmBombBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.requiresCorrectToolForDrops()) .properties(p -> p.requiresCorrectToolForDrops())
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
@@ -913,7 +892,7 @@ public class TFMGBlocks {
public static final BlockEntry<GeneratorBlock> GENERATOR = public static final BlockEntry<GeneratorBlock> GENERATOR =
REGISTRATE.block("generator", GeneratorBlock::new) REGISTRATE.block("generator", GeneratorBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
.transform(TFMGStress.setImpact(50.0f)) .transform(TFMGStress.setImpact(50.0f))
@@ -947,7 +926,7 @@ public class TFMGBlocks {
public static final BlockEntry<ResistorBlock> RESISTOR = public static final BlockEntry<ResistorBlock> RESISTOR =
REGISTRATE.block("resistor", ResistorBlock::new) REGISTRATE.block("resistor", ResistorBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
@@ -973,7 +952,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<CableHubBlock> BRASS_CABLE_HUB = public static final BlockEntry<CableHubBlock> BRASS_CABLE_HUB =
REGISTRATE.block("brass_cable_hub", CableHubBlock::new) REGISTRATE.block("brass_cable_hub", CableHubBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.item() .item()
.build() .build()
@@ -988,28 +967,28 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<CableHubBlock> STEEL_CABLE_HUB = public static final BlockEntry<CableHubBlock> STEEL_CABLE_HUB =
REGISTRATE.block("steel_cable_hub", CableHubBlock::new) REGISTRATE.block("steel_cable_hub", CableHubBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.item() .item()
.build() .build()
.register(); .register();
public static final BlockEntry<CableHubBlock> ALUMINUM_CABLE_HUB = public static final BlockEntry<CableHubBlock> ALUMINUM_CABLE_HUB =
REGISTRATE.block("aluminum_cable_hub", CableHubBlock::new) REGISTRATE.block("aluminum_cable_hub", CableHubBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.item() .item()
.build() .build()
.register(); .register();
public static final BlockEntry<CableHubBlock> STEEL_CASING_CABLE_HUB = public static final BlockEntry<CableHubBlock> STEEL_CASING_CABLE_HUB =
REGISTRATE.block("steel_casing_cable_hub", CableHubBlock::new) REGISTRATE.block("steel_casing_cable_hub", CableHubBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.item() .item()
.build() .build()
.register(); .register();
public static final BlockEntry<CableHubBlock> HEAVY_CABLE_HUB = public static final BlockEntry<CableHubBlock> HEAVY_CABLE_HUB =
REGISTRATE.block("heavy_cable_hub", CableHubBlock::new) REGISTRATE.block("heavy_cable_hub", CableHubBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.item() .item()
.build() .build()
@@ -1017,7 +996,7 @@ public class TFMGBlocks {
public static final BlockEntry<CableTubeBlock> CABLE_TUBE = public static final BlockEntry<CableTubeBlock> CABLE_TUBE =
REGISTRATE.block("cable_tube", p -> new CableTubeBlock(p, false)) REGISTRATE.block("cable_tube", p -> new CableTubeBlock(p, false))
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.properties(p -> p.noOcclusion()) .properties(p -> p.noOcclusion())
.blockstate(BlockStateGen.axisBlockProvider(false)) .blockstate(BlockStateGen.axisBlockProvider(false))
@@ -1035,7 +1014,7 @@ public class TFMGBlocks {
public static final BlockEntry<CableTubeBlock> ELECTRIC_POST = public static final BlockEntry<CableTubeBlock> ELECTRIC_POST =
REGISTRATE.block("electric_post", p -> new CableTubeBlock(p, false)) REGISTRATE.block("electric_post", p -> new CableTubeBlock(p, false))
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.blockstate(BlockStateGen.axisBlockProvider(false)) .blockstate(BlockStateGen.axisBlockProvider(false))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.item() .item()
@@ -1052,7 +1031,7 @@ public class TFMGBlocks {
public static final BlockEntry<DiagonalCableBlock> DIAGONAL_CABLE_BLOCK = public static final BlockEntry<DiagonalCableBlock> DIAGONAL_CABLE_BLOCK =
REGISTRATE.block("diagonal_cable_block", DiagonalCableBlock::new) REGISTRATE.block("diagonal_cable_block", DiagonalCableBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
.blockstate(new DiagonalCableGenerator()::generate) .blockstate(new DiagonalCableGenerator()::generate)
@@ -1063,7 +1042,7 @@ public class TFMGBlocks {
public static final BlockEntry<ElectricMotorBlock> ELECTRIC_MOTOR = public static final BlockEntry<ElectricMotorBlock> ELECTRIC_MOTOR =
REGISTRATE.block("electric_motor", ElectricMotorBlock::new) REGISTRATE.block("electric_motor", ElectricMotorBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
.blockstate(new CreativeMotorGenerator()::generate) .blockstate(new CreativeMotorGenerator()::generate)
@@ -1074,7 +1053,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<CreativeGeneratorBlock> CREATIVE_GENERATOR = REGISTRATE.block("creative_generator", CreativeGeneratorBlock::new) public static final BlockEntry<CreativeGeneratorBlock> CREATIVE_GENERATOR = REGISTRATE.block("creative_generator", CreativeGeneratorBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.requiresCorrectToolForDrops()) .properties(p -> p.requiresCorrectToolForDrops())
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.simpleItem() .simpleItem()
@@ -1082,7 +1061,7 @@ public class TFMGBlocks {
public static final BlockEntry<AccumulatorBlock> ACCUMULATOR = public static final BlockEntry<AccumulatorBlock> ACCUMULATOR =
REGISTRATE.block("accumulator", AccumulatorBlock::new) REGISTRATE.block("accumulator", AccumulatorBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.onRegister(connectedTextures(() -> new CapacitorCTBehavior(TFMGSpriteShifts.ACCUMULATOR))) .onRegister(connectedTextures(() -> new CapacitorCTBehavior(TFMGSpriteShifts.ACCUMULATOR)))
.blockstate(BlockStateGen.directionalBlockProvider(true)) .blockstate(BlockStateGen.directionalBlockProvider(true))
@@ -1092,7 +1071,7 @@ public class TFMGBlocks {
; ;
public static final BlockEntry<LightBulbBlock> LIGHT_BULB = public static final BlockEntry<LightBulbBlock> LIGHT_BULB =
REGISTRATE.block("light_bulb", p -> new LightBulbBlock(p, TFMGBlockEntities.LIGHT_BULB, TFMGShapes.LIGHT_BULB)) REGISTRATE.block("light_bulb", p -> new LightBulbBlock(p, TFMGBlockEntities.LIGHT_BULB, TFMGShapes.LIGHT_BULB))
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.lightLevel(s -> s.getValue(LIGHT))) .properties(p -> p.lightLevel(s -> s.getValue(LIGHT)))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
@@ -1103,7 +1082,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<LightBulbBlock> CIRCULAR_LIGHT = public static final BlockEntry<LightBulbBlock> CIRCULAR_LIGHT =
REGISTRATE.block("circular_light", p -> new LightBulbBlock(p, TFMGBlockEntities.CIRCULAR_LIGHT, TFMGShapes.CIRCULAR_LIGHT)) REGISTRATE.block("circular_light", p -> new LightBulbBlock(p, TFMGBlockEntities.CIRCULAR_LIGHT, TFMGShapes.CIRCULAR_LIGHT))
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.lightLevel(s -> s.getValue(LIGHT))) .properties(p -> p.lightLevel(s -> s.getValue(LIGHT)))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
@@ -1115,7 +1094,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<LightBulbBlock> MODERN_LIGHT = public static final BlockEntry<LightBulbBlock> MODERN_LIGHT =
REGISTRATE.block("modern_light", p -> new LightBulbBlock(p, TFMGBlockEntities.MODERN_LIGHT, TFMGShapes.MODERN_LIGHT)) REGISTRATE.block("modern_light", p -> new LightBulbBlock(p, TFMGBlockEntities.MODERN_LIGHT, TFMGShapes.MODERN_LIGHT))
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.lightLevel(s -> s.getValue(LIGHT))) .properties(p -> p.lightLevel(s -> s.getValue(LIGHT)))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
@@ -1127,7 +1106,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<LightBulbBlock> ALUMINUM_LAMP = public static final BlockEntry<LightBulbBlock> ALUMINUM_LAMP =
REGISTRATE.block("aluminum_lamp", p -> new LightBulbBlock(p, TFMGBlockEntities.ALUMINUM_LAMP, TFMGShapes.ALUMINUM_LAMP)) REGISTRATE.block("aluminum_lamp", p -> new LightBulbBlock(p, TFMGBlockEntities.ALUMINUM_LAMP, TFMGShapes.ALUMINUM_LAMP))
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.lightLevel(s -> s.getValue(LIGHT))) .properties(p -> p.lightLevel(s -> s.getValue(LIGHT)))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
@@ -1152,7 +1131,7 @@ public class TFMGBlocks {
public static final BlockEntry<ElectricDiodeBlock> DIODE = public static final BlockEntry<ElectricDiodeBlock> DIODE =
REGISTRATE.block("electric_diode", ElectricDiodeBlock::new) REGISTRATE.block("electric_diode", ElectricDiodeBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
.blockstate(new CreativeMotorGenerator()::generate) .blockstate(new CreativeMotorGenerator()::generate)
@@ -1162,7 +1141,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<EncasedDiodeBlock> ENCASED_DIODE = public static final BlockEntry<EncasedDiodeBlock> ENCASED_DIODE =
REGISTRATE.block("encased_diode", EncasedDiodeBlock::new) REGISTRATE.block("encased_diode", EncasedDiodeBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.transform(EncasingRegistry.addVariantTo(DIODE)) .transform(EncasingRegistry.addVariantTo(DIODE))
.blockstate(BlockStateGen.directionalBlockProvider(false)) .blockstate(BlockStateGen.directionalBlockProvider(false))
@@ -1170,7 +1149,7 @@ public class TFMGBlocks {
public static final BlockEntry<PotentiometerBlock> POTENTIOMETER = public static final BlockEntry<PotentiometerBlock> POTENTIOMETER =
REGISTRATE.block("potentiometer", PotentiometerBlock::new) REGISTRATE.block("potentiometer", PotentiometerBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
.blockstate(new CreativeMotorGenerator()::generate) .blockstate(new CreativeMotorGenerator()::generate)
@@ -1179,7 +1158,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<ElectricSwitchBlock> ELECTRICAL_SWITCH = public static final BlockEntry<ElectricSwitchBlock> ELECTRICAL_SWITCH =
REGISTRATE.block("electrical_switch", ElectricSwitchBlock::new) REGISTRATE.block("electrical_switch", ElectricSwitchBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate(BlockStateGen.directionalBlockProvider(true)) .blockstate(BlockStateGen.directionalBlockProvider(true))
.lang("Electric Switch") .lang("Electric Switch")
@@ -1188,14 +1167,14 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<EncasedPotentiometerBlock> ENCASED_POTENTIOMETER = public static final BlockEntry<EncasedPotentiometerBlock> ENCASED_POTENTIOMETER =
REGISTRATE.block("encased_potentiometer", EncasedPotentiometerBlock::new) REGISTRATE.block("encased_potentiometer", EncasedPotentiometerBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.transform(EncasingRegistry.addVariantTo(POTENTIOMETER)) .transform(EncasingRegistry.addVariantTo(POTENTIOMETER))
.blockstate(BlockStateGen.directionalBlockProvider(false)) .blockstate(BlockStateGen.directionalBlockProvider(false))
.register(); .register();
public static final BlockEntry<ElectricPumpBlock> ELECTRIC_PUMP = public static final BlockEntry<ElectricPumpBlock> ELECTRIC_PUMP =
REGISTRATE.block("electric_pump", ElectricPumpBlock::new) REGISTRATE.block("electric_pump", ElectricPumpBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
.blockstate(BlockStateGen.directionalBlockProvider(true)) .blockstate(BlockStateGen.directionalBlockProvider(true))
@@ -1204,7 +1183,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<VoltageObserverBlock> VOLTAGE_OBSERVER = public static final BlockEntry<VoltageObserverBlock> VOLTAGE_OBSERVER =
REGISTRATE.block("voltage_observer", VoltageObserverBlock::new) REGISTRATE.block("voltage_observer", VoltageObserverBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
.blockstate(new VoltageObserverGenerator()::generate) .blockstate(new VoltageObserverGenerator()::generate)
@@ -1223,7 +1202,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<VoltMeterBlock> VOLTMETER = public static final BlockEntry<VoltMeterBlock> VOLTMETER =
REGISTRATE.block("voltmeter", VoltMeterBlock::new) REGISTRATE.block("voltmeter", VoltMeterBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
.blockstate(BlockStateGen.horizontalBlockProvider(true)) .blockstate(BlockStateGen.horizontalBlockProvider(true))
@@ -1233,7 +1212,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<PolarizerBlock> POLARIZER = public static final BlockEntry<PolarizerBlock> POLARIZER =
REGISTRATE.block("polarizer", PolarizerBlock::new) REGISTRATE.block("polarizer", PolarizerBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
@@ -1243,7 +1222,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<RotorBlock> ROTOR = public static final BlockEntry<RotorBlock> ROTOR =
REGISTRATE.block("rotor", RotorBlock::new) REGISTRATE.block("rotor", RotorBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
.blockstate(BlockStateGen.axisBlockProvider(true)) .blockstate(BlockStateGen.axisBlockProvider(true))
@@ -1254,7 +1233,7 @@ public class TFMGBlocks {
public static final BlockEntry<StatorBlock> STATOR = public static final BlockEntry<StatorBlock> STATOR =
REGISTRATE.block("stator", StatorBlock::new) REGISTRATE.block("stator", StatorBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
@@ -1264,7 +1243,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<TrafficLightBlock> TRAFFIC_LIGHT = public static final BlockEntry<TrafficLightBlock> TRAFFIC_LIGHT =
REGISTRATE.block("traffic_light", TrafficLightBlock::new) REGISTRATE.block("traffic_light", TrafficLightBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
@@ -1274,7 +1253,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<SegmentedDisplayBlock> SEGMENTED_DISPLAY = public static final BlockEntry<SegmentedDisplayBlock> SEGMENTED_DISPLAY =
REGISTRATE.block("segmented_display", SegmentedDisplayBlock::new) REGISTRATE.block("segmented_display", SegmentedDisplayBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.onRegister(connectedTextures(SegmentedDisplayCTBehavior::new)) .onRegister(connectedTextures(SegmentedDisplayCTBehavior::new))
.blockstate(BlockStateGen.horizontalBlockProvider(true)) .blockstate(BlockStateGen.horizontalBlockProvider(true))
@@ -1284,7 +1263,7 @@ public class TFMGBlocks {
public static final BlockEntry<TransformerBlock> TRANSFORMER = public static final BlockEntry<TransformerBlock> TRANSFORMER =
REGISTRATE.block("transformer", TransformerBlock::new) REGISTRATE.block("transformer", TransformerBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate(BlockStateGen.horizontalBlockProvider(true)) .blockstate(BlockStateGen.horizontalBlockProvider(true))
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
@@ -1295,7 +1274,7 @@ public class TFMGBlocks {
public static final BlockEntry<ConverterBlock> CONVERTER = public static final BlockEntry<ConverterBlock> CONVERTER =
REGISTRATE.block("converter", ConverterBlock::new) REGISTRATE.block("converter", ConverterBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate(new ConverterGenerator()::generate) .blockstate(new ConverterGenerator()::generate)
.properties(BlockBehaviour.Properties::noOcclusion) .properties(BlockBehaviour.Properties::noOcclusion)
@@ -1305,7 +1284,7 @@ public class TFMGBlocks {
//public static final BlockEntry<FuseBlock> FUSE_BLOCK = //public static final BlockEntry<FuseBlock> FUSE_BLOCK =
// REGISTRATE.block("fuse_block", FuseBlock::new) // REGISTRATE.block("fuse_block", FuseBlock::new)
// .initialProperties(() -> Blocks.IRON_BLOCK) // .initialProperties(SharedProperties::softMetal)
// .transform(pickaxeOnly()) // .transform(pickaxeOnly())
// .properties(BlockBehaviour.Properties::noOcclusion) // .properties(BlockBehaviour.Properties::noOcclusion)
// .addLayer(() -> RenderType::cutoutMipped) // .addLayer(() -> RenderType::cutoutMipped)
@@ -1326,7 +1305,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<SmokestackBlock> METAL_SMOKESTACK = REGISTRATE.block("metal_smokestack", SmokestackBlock::new) public static final BlockEntry<SmokestackBlock> METAL_SMOKESTACK = REGISTRATE.block("metal_smokestack", SmokestackBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.requiresCorrectToolForDrops()) .properties(p -> p.requiresCorrectToolForDrops())
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate(new SmokestackGenerator()::generate) .blockstate(new SmokestackGenerator()::generate)
@@ -1345,7 +1324,7 @@ public class TFMGBlocks {
public static final BlockEntry<ExhaustBlock> EXHAUST = public static final BlockEntry<ExhaustBlock> EXHAUST =
REGISTRATE.block("exhaust", ExhaustBlock::new) REGISTRATE.block("exhaust", ExhaustBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK)) .properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.blockstate(BlockStateGen.directionalBlockProvider(false)) .blockstate(BlockStateGen.directionalBlockProvider(false))
@@ -1439,7 +1418,7 @@ public class TFMGBlocks {
.register(); .register();
//------------------STORAGE_BLOCKS------------------// //------------------STORAGE_BLOCKS------------------//
public static final BlockEntry<Block> STEEL_BLOCK = REGISTRATE.block("steel_block", Block::new) public static final BlockEntry<Block> STEEL_BLOCK = REGISTRATE.block("steel_block", Block::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.requiresCorrectToolForDrops()) .properties(p -> p.requiresCorrectToolForDrops())
.onRegister(connectedTextures(() -> new EncasedCTBehaviour(TFMGSpriteShifts.STEEL_BLOCK))) .onRegister(connectedTextures(() -> new EncasedCTBehaviour(TFMGSpriteShifts.STEEL_BLOCK)))
@@ -1457,7 +1436,7 @@ public class TFMGBlocks {
.lang("Block of Steel") .lang("Block of Steel")
.register(); .register();
public static final BlockEntry<Block> CAST_IRON_BLOCK = REGISTRATE.block("cast_iron_block", Block::new) public static final BlockEntry<Block> CAST_IRON_BLOCK = REGISTRATE.block("cast_iron_block", Block::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.requiresCorrectToolForDrops()) .properties(p -> p.requiresCorrectToolForDrops())
.onRegister(connectedTextures(() -> new EncasedCTBehaviour(TFMGSpriteShifts.CAST_IRON_BLOCK))) .onRegister(connectedTextures(() -> new EncasedCTBehaviour(TFMGSpriteShifts.CAST_IRON_BLOCK)))
@@ -1474,7 +1453,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<Block> ALUMINUM_BLOCK = REGISTRATE.block("aluminum_block", Block::new) public static final BlockEntry<Block> ALUMINUM_BLOCK = REGISTRATE.block("aluminum_block", Block::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.requiresCorrectToolForDrops()) .properties(p -> p.requiresCorrectToolForDrops())
.onRegister(connectedTextures(() -> new EncasedCTBehaviour(TFMGSpriteShifts.CAST_IRON_BLOCK))) .onRegister(connectedTextures(() -> new EncasedCTBehaviour(TFMGSpriteShifts.CAST_IRON_BLOCK)))
@@ -1504,7 +1483,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<Block> LEAD_BLOCK = REGISTRATE.block("lead_block", Block::new) public static final BlockEntry<Block> LEAD_BLOCK = REGISTRATE.block("lead_block", Block::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.requiresCorrectToolForDrops()) .properties(p -> p.requiresCorrectToolForDrops())
.onRegister(connectedTextures(() -> new EncasedCTBehaviour(TFMGSpriteShifts.LEAD_BLOCK))) .onRegister(connectedTextures(() -> new EncasedCTBehaviour(TFMGSpriteShifts.LEAD_BLOCK)))
.onRegister(casingConnectivity((block, cc) -> cc.makeCasing(block, TFMGSpriteShifts.LEAD_BLOCK))) .onRegister(casingConnectivity((block, cc) -> cc.makeCasing(block, TFMGSpriteShifts.LEAD_BLOCK)))
@@ -1520,7 +1499,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<Block> CONSTANTAN_BLOCK = REGISTRATE.block("constantan_block", Block::new) public static final BlockEntry<Block> CONSTANTAN_BLOCK = REGISTRATE.block("constantan_block", Block::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.requiresCorrectToolForDrops()) .properties(p -> p.requiresCorrectToolForDrops())
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate(simpleCubeAll("constantan_block")) .blockstate(simpleCubeAll("constantan_block"))
@@ -1534,7 +1513,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<Block> NICKEL_BLOCK = REGISTRATE.block("nickel_block", Block::new) public static final BlockEntry<Block> NICKEL_BLOCK = REGISTRATE.block("nickel_block", Block::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.requiresCorrectToolForDrops()) .properties(p -> p.requiresCorrectToolForDrops())
.onRegister(connectedTextures(() -> new EncasedCTBehaviour(TFMGSpriteShifts.LEAD_BLOCK))) .onRegister(connectedTextures(() -> new EncasedCTBehaviour(TFMGSpriteShifts.LEAD_BLOCK)))
.onRegister(casingConnectivity((block, cc) -> cc.makeCasing(block, TFMGSpriteShifts.LEAD_BLOCK))) .onRegister(casingConnectivity((block, cc) -> cc.makeCasing(block, TFMGSpriteShifts.LEAD_BLOCK)))
@@ -1549,7 +1528,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<LithiumBlock> LITHIUM_BLOCK = REGISTRATE.block("lithium_block", LithiumBlock::new) public static final BlockEntry<LithiumBlock> LITHIUM_BLOCK = REGISTRATE.block("lithium_block", LithiumBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.requiresCorrectToolForDrops()) .properties(p -> p.requiresCorrectToolForDrops())
.onRegister(connectedTextures(() -> new EncasedCTBehaviour(TFMGSpriteShifts.LEAD_BLOCK))) .onRegister(connectedTextures(() -> new EncasedCTBehaviour(TFMGSpriteShifts.LEAD_BLOCK)))
.onRegister(casingConnectivity((block, cc) -> cc.makeCasing(block, TFMGSpriteShifts.LEAD_BLOCK))) .onRegister(casingConnectivity((block, cc) -> cc.makeCasing(block, TFMGSpriteShifts.LEAD_BLOCK)))
@@ -1568,7 +1547,7 @@ public class TFMGBlocks {
public static final BlockEntry<Block> COAL_COKE_BLOCK = REGISTRATE.block("coal_coke_block", Block::new) public static final BlockEntry<Block> COAL_COKE_BLOCK = REGISTRATE.block("coal_coke_block", Block::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.requiresCorrectToolForDrops()) .properties(p -> p.requiresCorrectToolForDrops())
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate(simpleCubeAll("coal_coke_block")) .blockstate(simpleCubeAll("coal_coke_block"))
@@ -1582,11 +1561,10 @@ public class TFMGBlocks {
.lang("Block of Coal Coke") .lang("Block of Coal Coke")
.register(); .register();
public static final BlockEntry<ColoredFallingBlock> CEMENT = REGISTRATE.block("cement", p->new ColoredFallingBlock(new ColorRGBA(-8356741),p)) public static final BlockEntry<ColoredFallingBlock> CEMENT = REGISTRATE.block("cement", p -> new ColoredFallingBlock(new ColorRGBA(-8356741), p))
.initialProperties(() -> Blocks.CLAY) .initialProperties(() -> Blocks.CLAY)
.tag(BlockTags.MINEABLE_WITH_SHOVEL) .tag(BlockTags.MINEABLE_WITH_SHOVEL)
.item() .simpleItem()
.build()
.register(); .register();
//------------------DOOR------------------// //------------------DOOR------------------//
@@ -1621,9 +1599,6 @@ public class TFMGBlocks {
.register(); .register();
static { static {
REGISTRATE.setCreativeTab(TFMGCreativeTabs.TFMG_DECORATION); REGISTRATE.setCreativeTab(TFMGCreativeTabs.TFMG_DECORATION);
} }
@@ -1762,7 +1737,7 @@ public class TFMGBlocks {
public static final BlockEntry<Block> FACTORY_FLOOR = public static final BlockEntry<Block> FACTORY_FLOOR =
REGISTRATE.block("factory_floor", Block::new) REGISTRATE.block("factory_floor", Block::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p .properties(p -> p
.strength(3.0F) .strength(3.0F)
.requiresCorrectToolForDrops() .requiresCorrectToolForDrops()
@@ -1823,7 +1798,7 @@ public class TFMGBlocks {
//------------------CONCRETE------------------// //------------------CONCRETE------------------//
public static final BlockEntry<SimpleConcreteloggedBlock> REBAR_BLOCK = public static final BlockEntry<SimpleConcreteloggedBlock> REBAR_BLOCK =
REGISTRATE.block("rebar_block", SimpleConcreteloggedBlock::new) REGISTRATE.block("rebar_block", SimpleConcreteloggedBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.noOcclusion()) .properties(p -> p.noOcclusion())
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK)) .properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
@@ -1833,7 +1808,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<RebarFloorBlock> REBAR_FLOOR = public static final BlockEntry<RebarFloorBlock> REBAR_FLOOR =
REGISTRATE.block("rebar_floor", RebarFloorBlock::new) REGISTRATE.block("rebar_floor", RebarFloorBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.noOcclusion()) .properties(p -> p.noOcclusion())
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK)) .properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
@@ -1843,7 +1818,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<RebarWallBlock> REBAR_WALL = public static final BlockEntry<RebarWallBlock> REBAR_WALL =
REGISTRATE.block("rebar_wall", RebarWallBlock::new) REGISTRATE.block("rebar_wall", RebarWallBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.noOcclusion()) .properties(p -> p.noOcclusion())
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK)) .properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
@@ -1853,7 +1828,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<TFMGDirectionalBlock> REBAR_PILE = public static final BlockEntry<TFMGDirectionalBlock> REBAR_PILE =
REGISTRATE.block("rebar_pile", TFMGDirectionalBlock::new) REGISTRATE.block("rebar_pile", TFMGDirectionalBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK)) .properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
.blockstate(BlockStateGen.directionalBlockProvider(true)) .blockstate(BlockStateGen.directionalBlockProvider(true))
@@ -1862,7 +1837,7 @@ public class TFMGBlocks {
.register(); .register();
public static final BlockEntry<RebarStairsBlock> REBAR_STAIRS = public static final BlockEntry<RebarStairsBlock> REBAR_STAIRS =
REGISTRATE.block("rebar_stairs", p -> new RebarStairsBlock(REBAR_PILE.getDefaultState(), p)) REGISTRATE.block("rebar_stairs", p -> new RebarStairsBlock(REBAR_PILE.getDefaultState(), p))
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.noOcclusion()) .properties(p -> p.noOcclusion())
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK)) .properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
@@ -1873,7 +1848,7 @@ public class TFMGBlocks {
public static final BlockEntry<RebarPillarBlock> REBAR_PILLAR = public static final BlockEntry<RebarPillarBlock> REBAR_PILLAR =
REGISTRATE.block("rebar_pillar", RebarPillarBlock::new) REGISTRATE.block("rebar_pillar", RebarPillarBlock::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.noOcclusion()) .properties(p -> p.noOcclusion())
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK)) .properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
@@ -1896,8 +1871,7 @@ public class TFMGBlocks {
.properties(p -> p.requiresCorrectToolForDrops()) .properties(p -> p.requiresCorrectToolForDrops())
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.tag(BlockTags.NEEDS_STONE_TOOL) .tag(BlockTags.NEEDS_STONE_TOOL)
.item() .simpleItem()
.build()
.register(); .register();
public static final MaterialSet ASPHALT_SET = makeVariants(ASPHALT); public static final MaterialSet ASPHALT_SET = makeVariants(ASPHALT);

View File

@@ -1,40 +1,28 @@
package com.drmangotea.tfmg.registry; package com.drmangotea.tfmg.registry;
import com.drmangotea.tfmg.TFMG;
import com.drmangotea.tfmg.TFMGRegistries;
import com.drmangotea.tfmg.config.TFMGResistivity; import com.drmangotea.tfmg.config.TFMGResistivity;
import com.drmangotea.tfmg.content.electricity.connection.cable_type.CableType; import com.drmangotea.tfmg.content.electricity.connection.cable_type.CableType;
import com.drmangotea.tfmg.content.electricity.connection.cable_type.CableTypeEntry; import com.drmangotea.tfmg.content.electricity.connection.cable_type.CableTypeEntry;
import com.simibubi.create.api.contraption.ContraptionType;
import com.simibubi.create.api.registry.CreateBuiltInRegistries;
import com.simibubi.create.content.contraptions.Contraption;
import com.tterrag.registrate.util.entry.ItemEntry;
import net.minecraft.core.Holder;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import java.util.function.Supplier;
import static com.drmangotea.tfmg.TFMG.REGISTRATE; import static com.drmangotea.tfmg.TFMG.REGISTRATE;
import static com.simibubi.create.AllContraptionTypes.BY_LEGACY_NAME;
public class TFMGCableTypes { public class TFMGCableTypes {
public static final CableTypeEntry<CableType> empty = REGISTRATE.cableType("empty", CableType::new) public static final CableTypeEntry<CableType> EMPTY = REGISTRATE.cableType("empty", CableType::new)
.properties((p) -> p.spool(TFMGItems.COPPER_SPOOL)) .properties((p) -> p.spool(TFMGItems.COPPER_SPOOL))
.register(); .register();
public static final CableTypeEntry<CableType> copper = REGISTRATE.cableType("copper", CableType::new) public static final CableTypeEntry<CableType> COPPER = REGISTRATE.cableType("copper", CableType::new)
.properties((p) -> p.color(0xD8735A).spool(TFMGItems.COPPER_SPOOL)) .properties((p) -> p.color(0xD8735A).spool(TFMGItems.COPPER_SPOOL))
.transform(TFMGResistivity.setResistivity(0.00188f)) .transform(TFMGResistivity.setResistivity(0.00188f))
.register(); .register();
public static final CableTypeEntry<CableType> aluminum = REGISTRATE.cableType("aluminum", CableType::new) public static final CableTypeEntry<CableType> ALUMINUM = REGISTRATE.cableType("aluminum", CableType::new)
.properties((p) -> p.color(0xEDEFEF).spool(TFMGItems.ALUMINUM_SPOOL)) .properties((p) -> p.color(0xEDEFEF).spool(TFMGItems.ALUMINUM_SPOOL))
.transform(TFMGResistivity.setResistivity(0.0027f)) .transform(TFMGResistivity.setResistivity(0.0027f))
.register(); .register();
public static final CableTypeEntry<CableType> constantan = REGISTRATE.cableType("constantan", CableType::new) public static final CableTypeEntry<CableType> CONSTANTAN = REGISTRATE.cableType("constantan", CableType::new)
.properties((p) -> p.color(0xCFC2A8).spool(TFMGItems.CONSTANTAN_SPOOL)) .properties((p) -> p.color(0xCFC2A8).spool(TFMGItems.CONSTANTAN_SPOOL))
.transform(TFMGResistivity.setResistivity(1f)) .transform(TFMGResistivity.setResistivity(1f))
.register(); .register();

View File

@@ -2,9 +2,8 @@ package com.drmangotea.tfmg.registry;
import com.drmangotea.tfmg.base.TFMGBuilderTransformers; import com.drmangotea.tfmg.base.TFMGBuilderTransformers;
import com.drmangotea.tfmg.base.TFMGSpriteShifts; import com.drmangotea.tfmg.base.TFMGSpriteShifts;
import com.drmangotea.tfmg.content.decoration.encased.TFMGEncasedCogwheelBlock; import com.drmangotea.tfmg.content.decoration.kinetics.encased.TFMGEncasedCogwheelBlock;
import com.drmangotea.tfmg.content.decoration.encased.TFMGEncasedShaftBlock; import com.drmangotea.tfmg.content.decoration.kinetics.encased.TFMGEncasedShaftBlock;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.content.decoration.encasing.EncasingRegistry; import com.simibubi.create.content.decoration.encasing.EncasingRegistry;
import com.simibubi.create.content.kinetics.simpleRelays.encased.EncasedCogCTBehaviour; import com.simibubi.create.content.kinetics.simpleRelays.encased.EncasedCogCTBehaviour;
import com.simibubi.create.foundation.data.CreateRegistrate; import com.simibubi.create.foundation.data.CreateRegistrate;
@@ -12,8 +11,8 @@ import com.tterrag.registrate.util.entry.BlockEntry;
import net.createmod.catnip.data.Couple; import net.createmod.catnip.data.Couple;
import static com.drmangotea.tfmg.TFMG.REGISTRATE; import static com.drmangotea.tfmg.TFMG.REGISTRATE;
import static com.drmangotea.tfmg.content.decoration.encased.TFMGEncasedCogwheelBlock.aluminum; import static com.drmangotea.tfmg.content.decoration.kinetics.encased.TFMGEncasedCogwheelBlock.aluminum;
import static com.drmangotea.tfmg.content.decoration.encased.TFMGEncasedCogwheelBlock.steel; import static com.drmangotea.tfmg.content.decoration.kinetics.encased.TFMGEncasedCogwheelBlock.steel;
import static com.simibubi.create.foundation.data.TagGen.axeOrPickaxe; import static com.simibubi.create.foundation.data.TagGen.axeOrPickaxe;
public class TFMGEncasedBlocks { public class TFMGEncasedBlocks {

View File

@@ -11,10 +11,7 @@ import com.drmangotea.tfmg.content.items.weapons.explosives.pipe_bomb.PipeBomb;
import com.drmangotea.tfmg.content.items.weapons.explosives.pipe_bomb.PipeBombRenderer; import com.drmangotea.tfmg.content.items.weapons.explosives.pipe_bomb.PipeBombRenderer;
import com.drmangotea.tfmg.content.items.weapons.explosives.thermite_grenades.ThermiteGrenade; import com.drmangotea.tfmg.content.items.weapons.explosives.thermite_grenades.ThermiteGrenade;
import com.drmangotea.tfmg.content.items.weapons.explosives.thermite_grenades.ThermiteGrenadeRenderer; import com.drmangotea.tfmg.content.items.weapons.explosives.thermite_grenades.ThermiteGrenadeRenderer;
import com.drmangotea.tfmg.content.items.weapons.lithium_blade.LithiumSpark;
import com.drmangotea.tfmg.content.items.weapons.lithium_blade.LithiumSparkRenderer;
import com.simibubi.create.foundation.data.CreateEntityBuilder; import com.simibubi.create.foundation.data.CreateEntityBuilder;
import com.simibubi.create.foundation.utility.CreateLang; import com.simibubi.create.foundation.utility.CreateLang;
import com.tterrag.registrate.util.entry.EntityEntry; import com.tterrag.registrate.util.entry.EntityEntry;
import com.tterrag.registrate.util.nullness.NonNullConsumer; import com.tterrag.registrate.util.nullness.NonNullConsumer;
@@ -22,7 +19,6 @@ import com.tterrag.registrate.util.nullness.NonNullFunction;
import com.tterrag.registrate.util.nullness.NonNullSupplier; import com.tterrag.registrate.util.nullness.NonNullSupplier;
import net.minecraft.client.renderer.entity.EntityRenderer; import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRendererProvider; import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.entity.ItemEntityRenderer;
import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MobCategory; import net.minecraft.world.entity.MobCategory;
@@ -54,15 +50,16 @@ public class TFMGEntityTypes {
register("spark", Spark::new, () -> SparkRenderer::new, register("spark", Spark::new, () -> SparkRenderer::new,
MobCategory.MISC, 4, 20, true, true, Spark::build).register(); MobCategory.MISC, 4, 20, true, true, Spark::build).register();
public static final EntityEntry<GreenSpark> GREEN_SPARK = public static final EntityEntry<GreenSpark> GREEN_SPARK =
register("green_spark", GreenSpark::new, () -> GreenSparkRenderer::new, register("green_spark", GreenSpark::new, () -> SparkRenderer::new,
MobCategory.MISC, 4, 20, true, true, GreenSpark::build).register(); MobCategory.MISC, 4, 20, true, true, Spark::build).register();
public static final EntityEntry<BlueSpark> BLUE_SPARK = public static final EntityEntry<BlueSpark> BLUE_SPARK =
register("blue_spark", BlueSpark::new, () -> BlueSparkRenderer::new, register("blue_spark", BlueSpark::new, () -> SparkRenderer::new,
MobCategory.MISC, 4, 20, true, true, BlueSpark::build).register(); MobCategory.MISC, 4, 20, true, true, Spark::build).register();
public static final EntityEntry<LithiumSpark> LITHIUM_SPARK = public static final EntityEntry<LithiumSpark> LITHIUM_SPARK =
register("lithium_spark", LithiumSpark::new, () -> LithiumSparkRenderer::new, register("lithium_spark", LithiumSpark::new, () -> SparkRenderer::new,
MobCategory.MISC, 80, 20, true, true, LithiumSpark::build).register(); MobCategory.MISC, 4, 20, true, true, Spark::build).register();
private static <T extends Entity> CreateEntityBuilder<T, ?> register(String name, EntityType.EntityFactory<T> factory, private static <T extends Entity> CreateEntityBuilder<T, ?> register(String name, EntityType.EntityFactory<T> factory,
@@ -83,7 +80,7 @@ public class TFMGEntityTypes {
.renderer(renderer); .renderer(renderer);
} }
public static void init(){ public static void init() {
} }
} }

View File

@@ -4,7 +4,7 @@ import com.drmangotea.tfmg.TFMG;
import com.drmangotea.tfmg.base.TFMGCreativeTabs; import com.drmangotea.tfmg.base.TFMGCreativeTabs;
import com.drmangotea.tfmg.base.TFMGRegistrate; import com.drmangotea.tfmg.base.TFMGRegistrate;
import com.drmangotea.tfmg.base.TFMGTiers; import com.drmangotea.tfmg.base.TFMGTiers;
import com.drmangotea.tfmg.content.decoration.gearbox.SteelVerticalGearboxItem; import com.drmangotea.tfmg.content.decoration.kinetics.gearbox.SteelVerticalGearboxItem;
import com.drmangotea.tfmg.content.electricity.configuration_wrench.ElectriciansWrenchItem; import com.drmangotea.tfmg.content.electricity.configuration_wrench.ElectriciansWrenchItem;
import com.drmangotea.tfmg.base.debug.DebugCinderBlockItem; import com.drmangotea.tfmg.base.debug.DebugCinderBlockItem;
import com.drmangotea.tfmg.content.electricity.measurement.MultimeterItem; import com.drmangotea.tfmg.content.electricity.measurement.MultimeterItem;

View File

@@ -23,6 +23,8 @@ import static com.drmangotea.tfmg.base.palettes.TFMGPaletteBlockPattern.STANDARD
public enum TFMGPaletteStoneTypes { public enum TFMGPaletteStoneTypes {
BAUXITE(STANDARD_RANGE, r -> r.paletteStoneBlock("bauxite", () -> Blocks.DEEPSLATE, true, true) BAUXITE(STANDARD_RANGE, r -> r.paletteStoneBlock("bauxite", () -> Blocks.DEEPSLATE, true, true)
.properties(p -> p.destroyTime(1.25f)) .properties(p -> p.destroyTime(1.25f))
.register()), .register()),
@@ -41,7 +43,7 @@ public enum TFMGPaletteStoneTypes {
public TFMGPaletteBlockPattern[] variantTypes; public TFMGPaletteBlockPattern[] variantTypes;
public TagKey<Item> materialTag; public TagKey<Item> materialTag;
private TFMGPaletteStoneTypes(TFMGPaletteBlockPattern[] variantTypes, TFMGPaletteStoneTypes(TFMGPaletteBlockPattern[] variantTypes,
Function<CreateRegistrate, NonNullSupplier<Block>> factory) { Function<CreateRegistrate, NonNullSupplier<Block>> factory) {
this.factory = factory; this.factory = factory;
this.variantTypes = variantTypes; this.variantTypes = variantTypes;

View File

@@ -3,7 +3,6 @@ package com.drmangotea.tfmg.registry;
import com.drmangotea.tfmg.TFMG; import com.drmangotea.tfmg.TFMG;
import com.google.gson.JsonArray; import com.google.gson.JsonArray;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import net.minecraft.core.Holder; import net.minecraft.core.Holder;
import net.minecraft.core.Vec3i; import net.minecraft.core.Vec3i;
import net.minecraft.core.registries.Registries; import net.minecraft.core.registries.Registries;
@@ -37,8 +36,6 @@ public class TFMGSoundEvents {
public static final Map<ResourceLocation, SoundEntry> ALL = new HashMap<>(); public static final Map<ResourceLocation, SoundEntry> ALL = new HashMap<>();
public static final SoundEntry public static final SoundEntry
ENGINE = create("engine") ENGINE = create("engine")
.subtitle("Engine Sounds") .subtitle("Engine Sounds")
.category(SoundSource.BLOCKS) .category(SoundSource.BLOCKS)
@@ -130,7 +127,8 @@ public class TFMGSoundEvents {
} }
public record ConfiguredSoundEvent(Supplier<SoundEvent> event, float volume, float pitch) {} public record ConfiguredSoundEvent(Supplier<SoundEvent> event, float volume, float pitch) {
}
public static class SoundEntryBuilder { public static class SoundEntryBuilder {

View File

@@ -1,4 +1,5 @@
{ {
"format_version": "1.21.6",
"credit": "Made with Blockbench", "credit": "Made with Blockbench",
"parent": "create:block/large_wheels", "parent": "create:block/large_wheels",
"texture_size": [32, 32], "texture_size": [32, 32],
@@ -19,8 +20,8 @@
"east": {"uv": [0, 10, 10, 11.5], "texture": "#0"}, "east": {"uv": [0, 10, 10, 11.5], "texture": "#0"},
"south": {"uv": [0, 10, 10, 11.5], "texture": "#0"}, "south": {"uv": [0, 10, 10, 11.5], "texture": "#0"},
"west": {"uv": [0, 10, 10, 11.5], "texture": "#0"}, "west": {"uv": [0, 10, 10, 11.5], "texture": "#0"},
"up": {"uv": [0, 0, 10, 10], "texture": "#0"}, "up": {"uv": [0, 0.5, 10, 10.5], "texture": "#0"},
"down": {"uv": [0, 0, 10, 10], "texture": "#0"} "down": {"uv": [0, 0.5, 10, 10.5], "texture": "#0"}
} }
}, },
{ {
@@ -33,8 +34,8 @@
"east": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"}, "east": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"},
"south": {"uv": [0, 13, 15, 14.5], "texture": "#0"}, "south": {"uv": [0, 13, 15, 14.5], "texture": "#0"},
"west": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"}, "west": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"},
"up": {"uv": [0, 11.5, 15, 13], "texture": "#0"}, "up": {"uv": [0, 13, 15, 14.5], "texture": "#0"},
"down": {"uv": [0, 11.5, 15, 13], "texture": "#0"} "down": {"uv": [0, 13, 15, 14.5], "texture": "#0"}
} }
}, },
{ {
@@ -47,8 +48,8 @@
"east": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"}, "east": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"},
"south": {"uv": [0, 13, 15, 14.5], "texture": "#0"}, "south": {"uv": [0, 13, 15, 14.5], "texture": "#0"},
"west": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"}, "west": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"},
"up": {"uv": [0, 11.5, 15, 13], "texture": "#0"}, "up": {"uv": [0, 13, 15, 14.5], "texture": "#0"},
"down": {"uv": [0, 11.5, 15, 13], "texture": "#0"} "down": {"uv": [0, 13, 15, 14.5], "texture": "#0"}
} }
}, },
{ {
@@ -61,8 +62,8 @@
"east": {"uv": [0, 13, 15, 14.5], "texture": "#0"}, "east": {"uv": [0, 13, 15, 14.5], "texture": "#0"},
"south": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"}, "south": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"},
"west": {"uv": [0, 13, 15, 14.5], "texture": "#0"}, "west": {"uv": [0, 13, 15, 14.5], "texture": "#0"},
"up": {"uv": [0, 11.5, 15, 13], "rotation": 90, "texture": "#0"}, "up": {"uv": [0, 13, 15, 14.5], "rotation": 90, "texture": "#0"},
"down": {"uv": [0, 11.5, 15, 13], "rotation": 90, "texture": "#0"} "down": {"uv": [0, 13, 15, 14.5], "rotation": 90, "texture": "#0"}
} }
}, },
{ {
@@ -70,12 +71,12 @@
"from": [-2, 6.6, -2], "from": [-2, 6.6, -2],
"to": [18, 9.4, 18], "to": [18, 9.4, 18],
"faces": { "faces": {
"north": {"uv": [0, 10, 10, 11.5], "texture": "#0"}, "north": {"uv": [0, 11, 10, 12.5], "texture": "#0"},
"east": {"uv": [0, 10, 10, 11.5], "texture": "#0"}, "east": {"uv": [0, 11, 10, 12.5], "texture": "#0"},
"south": {"uv": [0, 10, 10, 11.5], "texture": "#0"}, "south": {"uv": [0, 11, 10, 12.5], "texture": "#0"},
"west": {"uv": [0, 10, 10, 11.5], "texture": "#0"}, "west": {"uv": [0, 11, 10, 12.5], "texture": "#0"},
"up": {"uv": [0, 0, 10, 10], "texture": "#0"}, "up": {"uv": [0, 0.5, 10, 10.5], "texture": "#0"},
"down": {"uv": [0, 0, 10, 10], "texture": "#0"} "down": {"uv": [0, 0.5, 10, 10.5], "texture": "#0"}
} }
}, },
{ {
@@ -83,12 +84,12 @@
"from": [0, 4.975, 0], "from": [0, 4.975, 0],
"to": [16, 11.025, 16], "to": [16, 11.025, 16],
"faces": { "faces": {
"north": {"uv": [10, 0, 12.5, 8], "rotation": 90, "texture": "#0"}, "north": {"uv": [10.5, 0.5, 13.525, 8.5], "rotation": 90, "texture": "#0"},
"east": {"uv": [10, 0, 12.5, 8], "rotation": 90, "texture": "#0"}, "east": {"uv": [10.5, 0.5, 13.525, 8.5], "rotation": 90, "texture": "#0"},
"south": {"uv": [10, 0, 12.5, 8], "rotation": 90, "texture": "#0"}, "south": {"uv": [10.5, 0.5, 13.525, 8.5], "rotation": 90, "texture": "#0"},
"west": {"uv": [10, 0, 12.5, 8], "rotation": 90, "texture": "#0"}, "west": {"uv": [10.5, 0.5, 13.525, 8.5], "rotation": 90, "texture": "#0"},
"up": {"uv": [1, 1, 9, 9], "texture": "#0"}, "up": {"uv": [1, 1.5, 9, 9.5], "texture": "#0"},
"down": {"uv": [1, 1, 9, 9], "texture": "#0"} "down": {"uv": [1, 1.5, 9, 9.5], "texture": "#0"}
} }
}, },
{ {
@@ -101,8 +102,8 @@
"east": {"uv": [0, 13, 15, 14.5], "texture": "#0"}, "east": {"uv": [0, 13, 15, 14.5], "texture": "#0"},
"south": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"}, "south": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"},
"west": {"uv": [0, 13, 15, 14.5], "texture": "#0"}, "west": {"uv": [0, 13, 15, 14.5], "texture": "#0"},
"up": {"uv": [0, 11.5, 15, 13], "rotation": 90, "texture": "#0"}, "up": {"uv": [0, 13, 15, 14.5], "rotation": 90, "texture": "#0"},
"down": {"uv": [0, 11.5, 15, 13], "rotation": 90, "texture": "#0"} "down": {"uv": [0, 13, 15, 14.5], "rotation": 90, "texture": "#0"}
} }
}, },
{ {
@@ -115,8 +116,8 @@
"east": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"}, "east": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"},
"south": {"uv": [0, 13, 15, 14.5], "texture": "#0"}, "south": {"uv": [0, 13, 15, 14.5], "texture": "#0"},
"west": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"}, "west": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"},
"up": {"uv": [0, 11.5, 15, 13], "texture": "#0"}, "up": {"uv": [0, 13, 15, 14.5], "texture": "#0"},
"down": {"uv": [0, 11.5, 15, 13], "texture": "#0"} "down": {"uv": [0, 13, 15, 14.5], "texture": "#0"}
} }
}, },
{ {
@@ -129,8 +130,8 @@
"east": {"uv": [0, 13, 15, 14.5], "texture": "#0"}, "east": {"uv": [0, 13, 15, 14.5], "texture": "#0"},
"south": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"}, "south": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"},
"west": {"uv": [0, 13, 15, 14.5], "texture": "#0"}, "west": {"uv": [0, 13, 15, 14.5], "texture": "#0"},
"up": {"uv": [0, 11.5, 15, 13], "rotation": 90, "texture": "#0"}, "up": {"uv": [0, 13, 15, 14.5], "rotation": 90, "texture": "#0"},
"down": {"uv": [0, 11.5, 15, 13], "rotation": 90, "texture": "#0"} "down": {"uv": [0, 13, 15, 14.5], "rotation": 90, "texture": "#0"}
} }
}, },
{ {
@@ -142,8 +143,8 @@
"east": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"}, "east": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"},
"south": {"uv": [0, 13, 15, 14.5], "texture": "#0"}, "south": {"uv": [0, 13, 15, 14.5], "texture": "#0"},
"west": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"}, "west": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"},
"up": {"uv": [0, 11.5, 15, 13], "texture": "#0"}, "up": {"uv": [0, 13, 15, 14.5], "texture": "#0"},
"down": {"uv": [0, 11.5, 15, 13], "texture": "#0"} "down": {"uv": [0, 13, 15, 14.5], "texture": "#0"}
} }
}, },
{ {
@@ -155,8 +156,8 @@
"east": {"uv": [0, 13, 15, 14.5], "texture": "#0"}, "east": {"uv": [0, 13, 15, 14.5], "texture": "#0"},
"south": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"}, "south": {"uv": [10, 9.5, 11.5, 11], "texture": "#0"},
"west": {"uv": [0, 13, 15, 14.5], "texture": "#0"}, "west": {"uv": [0, 13, 15, 14.5], "texture": "#0"},
"up": {"uv": [0, 11.5, 15, 13], "rotation": 90, "texture": "#0"}, "up": {"uv": [0, 13, 15, 14.5], "rotation": 90, "texture": "#0"},
"down": {"uv": [0, 11.5, 15, 13], "rotation": 90, "texture": "#0"} "down": {"uv": [0, 13, 15, 14.5], "rotation": 90, "texture": "#0"}
} }
}, },
{ {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 B

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 456 B

After

Width:  |  Height:  |  Size: 669 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 248 B

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 430 B

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 B

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 356 B

After

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 322 B

After

Width:  |  Height:  |  Size: 605 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

View File

@@ -13,8 +13,10 @@
"PipeAttachmentModelMixin", "PipeAttachmentModelMixin",
"RecipeProviderMixin", "RecipeProviderMixin",
"accessor.FluidTankBlockEntityAccessor", "accessor.FluidTankBlockEntityAccessor",
"accessor.FlywheelBlockEntityMixin",
"accessor.ProcessingRecipeAccessor", "accessor.ProcessingRecipeAccessor",
"accessor.SequencedAssemblyRecipeAccessor", "accessor.SequencedAssemblyRecipeAccessor",
"accessor.SlidingDoorBlockEntityAccessor",
"accessor.TankSegmentAccessor" "accessor.TankSegmentAccessor"
], ],
"client": [ "client": [