mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-28 16:06:48 +01:00
The meaning of null
- Fixed Client-side TileEntities ignoring data packets with empty compound tags - Fixed Stickers not visually updating when powered - Fixed Cocoa pods colliding with piston/pulley/gantry harvesters - Fixed Bulk Smoking using Haunting particles - Unified particle emission locations between depot and belt fan processing - Updated Haunting recipes
This commit is contained in:
parent
b4641675f1
commit
04c76bb6f0
24 changed files with 2789 additions and 110 deletions
|
@ -542,6 +542,7 @@ b44cb66962677538209a02fdafc2e62541542d64 assets/create/lang/unfinished/es_cl.jso
|
|||
6c7f81042ee0cc25e0ababea6cc254b72557aac9 assets/create/lang/unfinished/nl_nl.json
|
||||
7a3670aa1d488f637a4787c37419a25ace4813bc assets/create/lang/unfinished/pl_pl.json
|
||||
2c30f012946ab67f44514e987e9be87535eb5c5d assets/create/lang/unfinished/pt_br.json
|
||||
d466d2f81d81296313375de4766d4e36d7a5e3e4 assets/create/lang/unfinished/pt_pt.json
|
||||
516e0f0149f814ceec3b15cfb2d46c3c4c8a877c assets/create/lang/unfinished/ru_ru.json
|
||||
d9b421597a5b0b3ae662a12a94c833d853b24fe5 assets/create/lang/unfinished/zh_cn.json
|
||||
68b91bb8f3822d2b0798a6ec8a85d7d188c5c4d1 assets/create/lang/unfinished/zh_tw.json
|
||||
|
@ -2125,7 +2126,7 @@ d080b1b25e5bc8baf5aee68691b08c7f12ece3b0 assets/create/models/item/windmill_bear
|
|||
a80fb25a0b655e76be986b5b49fcb0f03461a1ab assets/create/models/item/zinc_nugget.json
|
||||
b1689617190c05ef34bd18456b0c7ae09bb3210f assets/create/models/item/zinc_ore.json
|
||||
5049f72c327a88f175f6f9425909e098fc711100 assets/create/sounds.json
|
||||
0f1b4b980afba9bf2caf583b88e261bba8b10313 data/create/advancements/aesthetics.json
|
||||
5d0cc4c0255dc241e61c173b31ddca70c88d08e4 data/create/advancements/aesthetics.json
|
||||
613e64b44bed959da899fdd54c1cacb227fb33f2 data/create/advancements/andesite_alloy.json
|
||||
81885c6bfb85792c88aaa7c9b70f58832945d31f data/create/advancements/andesite_casing.json
|
||||
83c046bd200623933545c9e4326f782fb02c87fa data/create/advancements/arm_blaze_burner.json
|
||||
|
@ -4569,12 +4570,24 @@ d0c541bbefb9f3f861ae5751645493c8e1687b5c data/create/recipes/granite_pillar_from
|
|||
dc3a5cc1a91cd35051b9e0f701e9fb44600a7dfb data/create/recipes/granite_pillar_from_stone_types_granite_stonecutting.json
|
||||
4e6283794e3b99043e92465d55440ad607d30965 data/create/recipes/haunting/blackstone.json
|
||||
b0ebe3a1a7f2b9f3fd446f9639a7b6b20b9f726d data/create/recipes/haunting/crimson_fungus.json
|
||||
60be487d3fef64e3457f5a95bd3d0aac4574e24c data/create/recipes/haunting/crimson_nylium.json
|
||||
18a730b19a44869b034cd0b991538b56eddaee54 data/create/recipes/haunting/glow_berries.json
|
||||
53e5be55e26a70a7961306ff1dff8989ae511c10 data/create/recipes/haunting/glow_ink_sac.json
|
||||
f1a2b5d5bd8dfd9c6ab4c40dc4e99cbabba06e84 data/create/recipes/haunting/haunted_bell.json
|
||||
e4357d04f9ded16aa6517c25b87b471009e68a1f data/create/recipes/haunting/infested_chiseled_stone_bricks.json
|
||||
aae84905211c980bd4ebef8ccb140c4a3b83346b data/create/recipes/haunting/infested_cracked_stone_bricks.json
|
||||
b30b718b5dd040cd12cf555b5320cbde610456d7 data/create/recipes/haunting/infested_deepslate.json
|
||||
3ad01318e43b43fed8da14f215596c61af0aaa06 data/create/recipes/haunting/infested_mossy_stone_bricks.json
|
||||
e3459905e0b93a003b49e5d0ddab03f22093ef08 data/create/recipes/haunting/infested_stone.json
|
||||
fc4218386a97ff4512fcb899eaba283d13d011b9 data/create/recipes/haunting/infested_stone_bricks.json
|
||||
0b0197fdbe9e7f5e642a0167a5ccb7fab3d4d67d data/create/recipes/haunting/lapis_recycling.json
|
||||
272eb0ffe124c11bea614143d80da373696dd703 data/create/recipes/haunting/nether_brick.json
|
||||
fc5ec1cd344c4903b6c0337921f1bce36f9caa9a data/create/recipes/haunting/poisonous_potato.json
|
||||
c0551bf5c928ec3fa1c5bddccaff28e4584ec664 data/create/recipes/haunting/soul_campfire.json
|
||||
35efd3abfba3b77c8a3076b626b852cd5d1698ff data/create/recipes/haunting/soul_lantern.json
|
||||
d34fe1f6d1eccc9f40ede3bd11e879140014401e data/create/recipes/haunting/soul_sand.json
|
||||
c0aab10c6c323b92931e8b59bf9902a47165b263 data/create/recipes/haunting/soul_soil.json
|
||||
890f23b77e2c51c60ffa4c04dd6ee53db504b5f6 data/create/recipes/haunting/soul_torch.json
|
||||
a6c387d19c357d7c89aa44a10b9deb9e93b6c614 data/create/recipes/haunting/warped_fungus.json
|
||||
80e2ae7d41c3a75423112e67b11718194de722cb data/create/recipes/haunting/warped_nylium.json
|
||||
05908d48b6ac0c117da0b4b9ae4ae5e933ed900e data/create/recipes/horizontal_framed_glass_from_glass_colorless_stonecutting.json
|
||||
4e8d49934f9899f788d45d4347bfc085b2836699 data/create/recipes/horizontal_framed_glass_pane.json
|
||||
c3ccd16b7fe9878cc734d699b4c8b219ad556f46 data/create/recipes/jungle_window.json
|
||||
|
|
2446
src/generated/resources/assets/create/lang/unfinished/pt_pt.json
Normal file
2446
src/generated/resources/assets/create/lang/unfinished/pt_pt.json
Normal file
File diff suppressed because it is too large
Load diff
|
@ -28,8 +28,8 @@
|
|||
"trigger": "create:bracket_apply",
|
||||
"conditions": {
|
||||
"accepted_entries": [
|
||||
"create:cogwheel",
|
||||
"create:large_cogwheel"
|
||||
"create:large_cogwheel",
|
||||
"create:cogwheel"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"type": "create:haunting",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:sweet_berries"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:glow_berries"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -2,12 +2,12 @@
|
|||
"type": "create:haunting",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:podzol"
|
||||
"item": "minecraft:ink_sac"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:warped_nylium"
|
||||
"item": "minecraft:glow_ink_sac"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"type": "create:haunting",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:chiseled_stone_bricks"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:infested_chiseled_stone_bricks"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"type": "create:haunting",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:cracked_stone_bricks"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:infested_cracked_stone_bricks"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"type": "create:haunting",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:deepslate"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:infested_deepslate"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"type": "create:haunting",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:mossy_stone_bricks"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:infested_mossy_stone_bricks"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -2,12 +2,12 @@
|
|||
"type": "create:haunting",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:mycelium"
|
||||
"item": "minecraft:stone"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:crimson_nylium"
|
||||
"item": "minecraft:infested_stone"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"type": "create:haunting",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:stone_bricks"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:infested_stone_bricks"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"type": "create:haunting",
|
||||
"ingredients": [
|
||||
{
|
||||
"tag": "forge:gems/lapis"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:prismarine_shard",
|
||||
"chance": 0.75
|
||||
},
|
||||
{
|
||||
"item": "minecraft:prismarine_crystals",
|
||||
"chance": 0.125
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"type": "create:haunting",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:brick"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:nether_brick"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"type": "create:haunting",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:potato"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:poisonous_potato"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"type": "create:haunting",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:campfire"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:soul_campfire"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"type": "create:haunting",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:lantern"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:soul_lantern"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"type": "create:haunting",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:torch"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:soul_torch"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -148,9 +148,11 @@ public class HarvesterMovementBehaviour extends MovementBehaviour {
|
|||
return true;
|
||||
if (state.is(BlockTags.LEAVES))
|
||||
return true;
|
||||
if (state.getBlock() instanceof CocoaBlock)
|
||||
return true;
|
||||
|
||||
if (state.getCollisionShape(world, pos)
|
||||
.isEmpty() || state.getBlock() instanceof CocoaBlock) {
|
||||
.isEmpty()) {
|
||||
if (state.getBlock() instanceof GrowingPlantBlock)
|
||||
return true;
|
||||
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package com.simibubi.create.content.contraptions.components.fan;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import com.simibubi.create.AllTags;
|
||||
import com.simibubi.create.content.contraptions.particle.AirFlowParticleData;
|
||||
import com.simibubi.create.content.contraptions.processing.InWorldProcessing;
|
||||
|
@ -16,6 +22,8 @@ import net.minecraft.client.Minecraft;
|
|||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.core.Vec3i;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
|
@ -26,6 +34,8 @@ import net.minecraft.world.effect.MobEffects;
|
|||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.animal.horse.Horse;
|
||||
import net.minecraft.world.entity.animal.horse.SkeletonHorse;
|
||||
import net.minecraft.world.entity.item.ItemEntity;
|
||||
import net.minecraft.world.entity.monster.EnderMan;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
|
@ -41,12 +51,6 @@ import net.minecraftforge.api.distmarker.Dist;
|
|||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class AirCurrent {
|
||||
|
||||
private static final DamageSource damageSourceFire = new DamageSource("create.fan_fire").setScalesWithDifficulty()
|
||||
|
@ -90,9 +94,10 @@ public class AirCurrent {
|
|||
}
|
||||
|
||||
protected void tickAffectedEntities(Level world, Direction facing) {
|
||||
for (Iterator<Entity> iterator = caughtEntities.iterator(); iterator.hasNext(); ) {
|
||||
for (Iterator<Entity> iterator = caughtEntities.iterator(); iterator.hasNext();) {
|
||||
Entity entity = iterator.next();
|
||||
if (!entity.isAlive() || !entity.getBoundingBox().intersects(bounds) || isPlayerCreativeFlying(entity)) {
|
||||
if (!entity.isAlive() || !entity.getBoundingBox()
|
||||
.intersects(bounds) || isPlayerCreativeFlying(entity)) {
|
||||
iterator.remove();
|
||||
continue;
|
||||
}
|
||||
|
@ -108,12 +113,9 @@ public class AirCurrent {
|
|||
Vec3 previousMotion = entity.getDeltaMovement();
|
||||
float maxAcceleration = 5;
|
||||
|
||||
double xIn =
|
||||
Mth.clamp(flow.getX() * acceleration - previousMotion.x, -maxAcceleration, maxAcceleration);
|
||||
double yIn =
|
||||
Mth.clamp(flow.getY() * acceleration - previousMotion.y, -maxAcceleration, maxAcceleration);
|
||||
double zIn =
|
||||
Mth.clamp(flow.getZ() * acceleration - previousMotion.z, -maxAcceleration, maxAcceleration);
|
||||
double xIn = Mth.clamp(flow.getX() * acceleration - previousMotion.x, -maxAcceleration, maxAcceleration);
|
||||
double yIn = Mth.clamp(flow.getY() * acceleration - previousMotion.y, -maxAcceleration, maxAcceleration);
|
||||
double zIn = Mth.clamp(flow.getZ() * acceleration - previousMotion.z, -maxAcceleration, maxAcceleration);
|
||||
|
||||
entity.setDeltaMovement(previousMotion.add(new Vec3(xIn, yIn, zIn).scale(1 / 8f)));
|
||||
entity.fallDistance = 0;
|
||||
|
@ -126,8 +128,7 @@ public class AirCurrent {
|
|||
entityDistance -= .5f;
|
||||
InWorldProcessing.Type processingType = getSegmentAt((float) entityDistance);
|
||||
if (entity instanceof ServerPlayer)
|
||||
AllTriggers.triggerFor(AllTriggers.FAN_PROCESSING.constructTriggerFor(processingType),
|
||||
(Player) entity);
|
||||
AllTriggers.triggerFor(AllTriggers.FAN_PROCESSING.constructTriggerFor(processingType), (Player) entity);
|
||||
|
||||
if (processingType == null || processingType == Type.NONE) {
|
||||
continue;
|
||||
|
@ -143,6 +144,19 @@ public class AirCurrent {
|
|||
continue;
|
||||
}
|
||||
|
||||
if (entity instanceof Horse && world.isClientSide) {
|
||||
Vec3 p = entity.getPosition(0);
|
||||
Vec3 v = p.add(0, 0.5f, 0)
|
||||
.add(VecHelper.offsetRandomly(Vec3.ZERO, world.random, 1)
|
||||
.multiply(1, 0.2f, 1)
|
||||
.normalize()
|
||||
.scale(1f));
|
||||
world.addParticle(ParticleTypes.SOUL_FIRE_FLAME, v.x, v.y, v.z, 0, 0.1f, 0);
|
||||
if (world.random.nextInt(3) == 0)
|
||||
world.addParticle(ParticleTypes.LARGE_SMOKE, p.x, p.y + .5f, p.z,
|
||||
(world.random.nextFloat() - .5f) * .5f, 0.1f, (world.random.nextFloat() - .5f) * .5f);
|
||||
}
|
||||
|
||||
if (world.isClientSide)
|
||||
continue;
|
||||
|
||||
|
@ -164,6 +178,34 @@ public class AirCurrent {
|
|||
livingEntity.addEffect(new MobEffectInstance(MobEffects.BLINDNESS, 30, 0, false, false));
|
||||
livingEntity.addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SLOWDOWN, 20, 1, false, false));
|
||||
}
|
||||
if (entity instanceof Horse horse) {
|
||||
int progress = horse.getPersistentData()
|
||||
.getInt("CreateHaunting");
|
||||
if (progress < 100) {
|
||||
if (progress % 10 == 0) {
|
||||
world.playSound(null, entity.blockPosition(), SoundEvents.SOUL_ESCAPE, SoundSource.NEUTRAL,
|
||||
1f, 1.5f * progress / 100f);
|
||||
}
|
||||
horse.getPersistentData()
|
||||
.putInt("CreateHaunting", progress + 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
world.playSound(null, entity.blockPosition(), SoundEvents.GENERIC_EXTINGUISH_FIRE,
|
||||
SoundSource.NEUTRAL, 1.25f, 0.65f);
|
||||
|
||||
SkeletonHorse skeletonHorse = EntityType.SKELETON_HORSE.create(world);
|
||||
CompoundTag serializeNBT = horse.saveWithoutId(new CompoundTag());
|
||||
serializeNBT.remove("UUID");
|
||||
if (!horse.getArmor()
|
||||
.isEmpty())
|
||||
horse.spawnAtLocation(horse.getArmor());
|
||||
|
||||
skeletonHorse.deserializeNBT(serializeNBT);
|
||||
skeletonHorse.setPos(horse.getPosition(0));
|
||||
world.addFreshEntity(skeletonHorse);
|
||||
horse.discard();
|
||||
}
|
||||
break;
|
||||
case SPLASHING:
|
||||
if (entity instanceof EnderMan || entity.getType() == EntityType.SNOW_GOLEM
|
||||
|
@ -173,8 +215,8 @@ public class AirCurrent {
|
|||
if (!entity.isOnFire())
|
||||
break;
|
||||
entity.clearFire();
|
||||
world.playSound(null, entity.blockPosition(), SoundEvents.GENERIC_EXTINGUISH_FIRE,
|
||||
SoundSource.NEUTRAL, 0.7F, 1.6F + (world.random.nextFloat() - world.random.nextFloat()) * 0.4F);
|
||||
world.playSound(null, entity.blockPosition(), SoundEvents.GENERIC_EXTINGUISH_FIRE, SoundSource.NEUTRAL,
|
||||
0.7F, 1.6F + (world.random.nextFloat() - world.random.nextFloat()) * 0.4F);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -252,16 +294,15 @@ public class AirCurrent {
|
|||
|
||||
// 4 Rays test for holes in the shapes blocking the flow
|
||||
float offsetDistance = .25f;
|
||||
Vec3[] offsets = new Vec3[]{planeVec.multiply(offsetDistance, offsetDistance, offsetDistance),
|
||||
Vec3[] offsets = new Vec3[] { planeVec.multiply(offsetDistance, offsetDistance, offsetDistance),
|
||||
planeVec.multiply(-offsetDistance, -offsetDistance, offsetDistance),
|
||||
planeVec.multiply(offsetDistance, -offsetDistance, -offsetDistance),
|
||||
planeVec.multiply(-offsetDistance, offsetDistance, -offsetDistance),};
|
||||
planeVec.multiply(-offsetDistance, offsetDistance, -offsetDistance), };
|
||||
|
||||
float limitedDistance = 0;
|
||||
|
||||
// Determine the distance of the air flow
|
||||
Outer:
|
||||
for (int i = 1; i <= max; i++) {
|
||||
Outer: for (int i = 1; i <= max; i++) {
|
||||
BlockPos currentPos = start.relative(facing, i);
|
||||
if (!world.isLoaded(currentPos))
|
||||
break;
|
||||
|
|
|
@ -81,6 +81,11 @@ public class StickerTileEntity extends SmartTileEntity {
|
|||
return SuperGlueEntity.isValidFace(level, worldPosition.relative(direction), direction.getOpposite());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void write(CompoundTag tag, boolean clientPacket) {
|
||||
super.write(tag, clientPacket);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void read(CompoundTag compound, boolean clientPacket) {
|
||||
super.read(compound, clientPacket);
|
||||
|
|
|
@ -324,6 +324,8 @@ public class InWorldProcessing {
|
|||
world.addParticle(ParticleTypes.LARGE_SMOKE, vec.x, vec.y + .25f, vec.z, 0, 1 / 16f, 0);
|
||||
break;
|
||||
case SMOKING:
|
||||
world.addParticle(ParticleTypes.POOF, vec.x, vec.y + .25f, vec.z, 0, 1 / 16f, 0);
|
||||
break;
|
||||
case HAUNTING:
|
||||
vec = vec.add(VecHelper.offsetRandomly(Vec3.ZERO, world.random, 1)
|
||||
.multiply(1, 0.05f, 1)
|
||||
|
|
|
@ -377,8 +377,7 @@ public class DepotBehaviour extends TileEntityBehaviour {
|
|||
}
|
||||
|
||||
private Vec3 getWorldPositionOf(TransportedItemStack transported) {
|
||||
Vec3 offsetVec = new Vec3(.5f, 14 / 16f, .5f);
|
||||
return offsetVec.add(Vec3.atLowerCornerOf(tileEntity.getBlockPos()));
|
||||
return VecHelper.getCenterOf(tileEntity.getBlockPos());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -5,9 +5,6 @@ import java.util.function.Supplier;
|
|||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.AllRecipeTypes;
|
||||
import com.simibubi.create.Create;
|
||||
import com.simibubi.create.content.contraptions.components.fan.HauntingRecipe;
|
||||
import com.simibubi.create.content.contraptions.processing.ProcessingRecipeBuilder;
|
||||
import com.simibubi.create.content.contraptions.processing.ProcessingRecipeSerializer;
|
||||
|
||||
import net.minecraft.data.DataGenerator;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
@ -22,30 +19,45 @@ public class HauntingRecipeGen extends ProcessingRecipeGen {
|
|||
|
||||
GeneratedRecipe
|
||||
|
||||
BRASS_BELL = convert(AllBlocks.HAUNTED_BELL::get, () -> Ingredient.of(AllBlocks.PECULIAR_BELL.get())),
|
||||
SOUL_SAND = convert(() -> Blocks.SOUL_SAND, () -> Ingredient.of(ItemTags.SAND)),
|
||||
SOUL_DIRT = convert(() -> Blocks.SOUL_SOIL, () -> Ingredient.of(ItemTags.DIRT)),
|
||||
BLACK_STONE = convert(() -> Blocks.BLACKSTONE, () -> Ingredient.of(Tags.Items.COBBLESTONE)),
|
||||
CRIMSON_FUNGUS = convert(Items.CRIMSON_FUNGUS, Items.RED_MUSHROOM),
|
||||
WARPED_FUNGUS = convert(Items.WARPED_FUNGUS, Items.BROWN_MUSHROOM),
|
||||
CRIMSON_NYLIUM = convert(Blocks.CRIMSON_NYLIUM, Blocks.MYCELIUM),
|
||||
WARPED_NYLIUM = convert(Blocks.WARPED_NYLIUM, Blocks.PODZOL);
|
||||
BRASS_BELL = convert(() -> Ingredient.of(AllBlocks.PECULIAR_BELL.get()), AllBlocks.HAUNTED_BELL::get),
|
||||
|
||||
public GeneratedRecipe convert(ItemLike result, ItemLike input) {
|
||||
return convert(() -> result, () -> Ingredient.of(input));
|
||||
HAUNT_STONE = convert(Items.STONE, Items.INFESTED_STONE),
|
||||
HAUNT_DEEPSLATE = convert(Items.DEEPSLATE, Items.INFESTED_DEEPSLATE),
|
||||
HAUNT_STONE_BRICKS = convert(Items.STONE_BRICKS, Items.INFESTED_STONE_BRICKS),
|
||||
HAUNT_MOSSY_STONE_BRICKS = convert(Items.MOSSY_STONE_BRICKS, Items.INFESTED_MOSSY_STONE_BRICKS),
|
||||
HAUNT_CRACKED_STONE_BRICKS = convert(Items.CRACKED_STONE_BRICKS, Items.INFESTED_CRACKED_STONE_BRICKS),
|
||||
HAUNT_CHISELED_STONE_BRICKS = convert(Items.CHISELED_STONE_BRICKS, Items.INFESTED_CHISELED_STONE_BRICKS),
|
||||
|
||||
SOUL_TORCH = convert(Items.TORCH, Items.SOUL_TORCH),
|
||||
SOUL_CAMPFIRE = convert(Items.CAMPFIRE, Items.SOUL_CAMPFIRE),
|
||||
SOUL_LANTERN = convert(Items.LANTERN, Items.SOUL_LANTERN),
|
||||
|
||||
POISON_POTATO = convert(Items.POTATO, Items.POISONOUS_POTATO),
|
||||
GLOW_INK = convert(Items.INK_SAC, Items.GLOW_INK_SAC),
|
||||
GLOW_BERRIES = convert(Items.SWEET_BERRIES, Items.GLOW_BERRIES),
|
||||
NETHER_BRICK = convert(Items.BRICK, Items.NETHER_BRICK),
|
||||
|
||||
PRISMARINE = create(Create.asResource("lapis_recycling"), b -> b.require(Tags.Items.GEMS_LAPIS)
|
||||
.output(.75f, Items.PRISMARINE_SHARD)
|
||||
.output(.125f, Items.PRISMARINE_CRYSTALS)),
|
||||
|
||||
SOUL_SAND = convert(() -> Ingredient.of(ItemTags.SAND), () -> Blocks.SOUL_SAND),
|
||||
SOUL_DIRT = convert(() -> Ingredient.of(ItemTags.DIRT), () -> Blocks.SOUL_SOIL),
|
||||
BLACK_STONE = convert(() -> Ingredient.of(Tags.Items.COBBLESTONE), () -> Blocks.BLACKSTONE),
|
||||
CRIMSON_FUNGUS = convert(Items.RED_MUSHROOM, Items.CRIMSON_FUNGUS),
|
||||
WARPED_FUNGUS = convert(Items.BROWN_MUSHROOM, Items.WARPED_FUNGUS);
|
||||
|
||||
public GeneratedRecipe convert(ItemLike input, ItemLike result) {
|
||||
return convert(() -> Ingredient.of(input), () -> result);
|
||||
}
|
||||
|
||||
public GeneratedRecipe convert(Supplier<ItemLike> result, Supplier<Ingredient> input) {
|
||||
ProcessingRecipeSerializer<HauntingRecipe> serializer = getSerializer();
|
||||
GeneratedRecipe generatedRecipe = c -> new ProcessingRecipeBuilder<>(serializer.getFactory(),
|
||||
new ResourceLocation(Create.ID, result.get()
|
||||
public GeneratedRecipe convert(Supplier<Ingredient> input, Supplier<ItemLike> result) {
|
||||
return create(new ResourceLocation(Create.ID, result.get()
|
||||
.asItem()
|
||||
.getRegistryName()
|
||||
.getPath())).withItemIngredients(input.get())
|
||||
.output(result.get())
|
||||
.build(c);
|
||||
all.add(generatedRecipe);
|
||||
return generatedRecipe;
|
||||
.getPath()),
|
||||
p -> p.withItemIngredients(input.get())
|
||||
.output(result.get()));
|
||||
}
|
||||
|
||||
public HauntingRecipeGen(DataGenerator p_i48262_1_) {
|
||||
|
|
|
@ -46,9 +46,7 @@ public abstract class SyncedTileEntity extends BlockEntity {
|
|||
@Override
|
||||
public void onDataPacket(Connection connection, ClientboundBlockEntityDataPacket packet) {
|
||||
CompoundTag tag = packet.getTag();
|
||||
if (tag != null) {
|
||||
readClient(tag);
|
||||
}
|
||||
readClient(tag == null ? new CompoundTag() : tag);
|
||||
}
|
||||
|
||||
// Special handling for client update packets
|
||||
|
|
Loading…
Reference in a new issue