Bugs and things

- Recipes for the diving gear
- Idle Windmill Bearings now attach their structure when moved as part of another contraption
- Fixed pumps not updating transfer speed when directly between containers
- Fixed Multiblock Fluid tanks showing inconsistent information on their goggle overlay
- Creative Fluid tanks no longer show a goggle overlay
- Fixed Funnels and other interfaces not updating properly when affected chunks are unloaded and reloaded
- Fixed tooltips rendering behind item icon in the filter screens
This commit is contained in:
simibubi 2021-05-08 18:37:30 +02:00
parent 39fb642fd9
commit ca5b9b4fb9
14 changed files with 231 additions and 21 deletions

View file

@ -1773,6 +1773,9 @@ c33e122c534a7a134f69faa36446ce7564d8a705 data/create/advancements/recipes/buildi
c368cadffa9177fefb9e92ff4453b40bc8dd670d data/create/advancements/recipes/create.base/blasting/copper_ingot_from_ore.json
8fffce2a5c5dd88d52e3b006fa92fb18cf2f1571 data/create/advancements/recipes/create.base/blasting/zinc_ingot_from_crushed.json
4bb60ef5e186f12a9d52e61319db8c78300c64ab data/create/advancements/recipes/create.base/blasting/zinc_ingot_from_ore.json
d1d8cf6e1c95b7d99bf873fa6fee033103f995fd data/create/advancements/recipes/create.base/crafting/appliances/copper_backtank.json
46c04e685ab345a80598176f7ac68a044a76cd76 data/create/advancements/recipes/create.base/crafting/appliances/diving_boots.json
5f06b7dcf2af11f30c2e10ade4ac3fd172bc04df data/create/advancements/recipes/create.base/crafting/appliances/diving_helmet.json
dd487f98c411f1ff22cb7fc208b8cc24b27deb2f data/create/advancements/recipes/create.base/crafting/appliances/dough.json
51cdcf168087f47e4458eed7543d227da1ee5ca0 data/create/advancements/recipes/create.base/crafting/appliances/tree_fertilizer.json
d531f87f425d199aee4777a588c1cd6cab6f5173 data/create/advancements/recipes/create.base/crafting/curiosities/minecart_coupling.json
@ -2842,6 +2845,9 @@ f7879d404d7a848d818278b4e788f285a9087e63 data/create/recipes/compacting/blaze_ca
27c23592d8fec03072a04544d3598ca9b1c798ff data/create/recipes/compacting/chocolate.json
7b2ef15dd28d1d8a450ea49a82dfb361d1adde4c data/create/recipes/compacting/diorite_from_flint.json
7657603e95ccf83dd0d4b104635db66e531d092a data/create/recipes/compacting/granite_from_flint.json
30030b15caa11b3a7c0104adb62fe74e8c7c0df1 data/create/recipes/crafting/appliances/copper_backtank.json
9ad82ac5ce02654b7af7f1a570a6b2c01e140da3 data/create/recipes/crafting/appliances/diving_boots.json
813081c6421b34e161ec44e8e470994c282f76be data/create/recipes/crafting/appliances/diving_helmet.json
19526da3a59fc136654ff1bc93c0251581f397a9 data/create/recipes/crafting/appliances/dough.json
7b5f863dda3d05a79cb85943a178eba0bd8a7dc7 data/create/recipes/crafting/appliances/slime_ball.json
b159ba84428eee6ef6e23df1766f2a18f2c8a63e data/create/recipes/crafting/appliances/tree_fertilizer.json

View file

@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/appliances/copper_backtank"
]
},
"criteria": {
"has_item": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "forge:ingots/copper"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/appliances/copper_backtank"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
]
}

View file

@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/appliances/diving_boots"
]
},
"criteria": {
"has_item": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "forge:ingots/copper"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/appliances/diving_boots"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
]
}

View file

@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/appliances/diving_helmet"
]
},
"criteria": {
"has_item": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "forge:ingots/copper"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/appliances/diving_helmet"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
]
}

View file

@ -0,0 +1,22 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"AGA",
"PPP",
" P "
],
"key": {
"G": {
"item": "create:shaft"
},
"A": {
"item": "create:andesite_alloy"
},
"P": {
"tag": "forge:ingots/copper"
}
},
"result": {
"item": "create:copper_backtank"
}
}

View file

@ -0,0 +1,19 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"P P",
"P P",
"G G"
],
"key": {
"G": {
"item": "create:andesite_alloy"
},
"P": {
"tag": "forge:ingots/copper"
}
},
"result": {
"item": "create:diving_boots"
}
}

View file

@ -0,0 +1,18 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"PPP",
"PGP"
],
"key": {
"G": {
"tag": "forge:glass"
},
"P": {
"tag": "forge:ingots/copper"
}
},
"result": {
"item": "create:diving_helmet"
}
}

View file

@ -33,6 +33,7 @@ import com.simibubi.create.content.contraptions.components.actors.SeatBlock;
import com.simibubi.create.content.contraptions.components.actors.SeatEntity;
import com.simibubi.create.content.contraptions.components.structureMovement.bearing.MechanicalBearingBlock;
import com.simibubi.create.content.contraptions.components.structureMovement.bearing.StabilizedContraption;
import com.simibubi.create.content.contraptions.components.structureMovement.bearing.WindmillBearingBlock;
import com.simibubi.create.content.contraptions.components.structureMovement.chassis.AbstractChassisBlock;
import com.simibubi.create.content.contraptions.components.structureMovement.chassis.ChassisTileEntity;
import com.simibubi.create.content.contraptions.components.structureMovement.chassis.StickerBlock;
@ -343,6 +344,10 @@ public abstract class Contraption {
if (AllBlocks.MECHANICAL_BEARING.has(state))
moveBearing(pos, frontier, visited, state);
// WM Bearings attach their structure when moved
if (AllBlocks.WINDMILL_BEARING.has(state))
moveWindmillBearing(pos, frontier, visited, state);
// Seats transfer their passenger to the contraption
if (state.getBlock() instanceof SeatBlock)
moveSeat(world, pos);
@ -497,6 +502,13 @@ public abstract class Contraption {
}
}
private void moveWindmillBearing(BlockPos pos, Queue<BlockPos> frontier, Set<BlockPos> visited, BlockState state) {
Direction facing = state.get(WindmillBearingBlock.FACING);
BlockPos offset = pos.offset(facing);
if (!visited.contains(offset))
frontier.add(offset);
}
private void moveBearing(BlockPos pos, Queue<BlockPos> frontier, Set<BlockPos> visited, BlockState state) {
Direction facing = state.get(MechanicalBearingBlock.FACING);
if (!canBeStabilized(facing, pos.subtract(anchor))) {
@ -701,8 +713,8 @@ public abstract class Contraption {
c -> seatMapping.put(NBTUtil.readUniqueId(NBTHelper.getINBT(c, "Id")), c.getInt("Seat")));
stabilizedSubContraptions.clear();
NBTHelper.iterateCompoundList(nbt.getList("SubContraptions", NBT.TAG_COMPOUND), c -> stabilizedSubContraptions
.put(c.getUniqueId("Id"), BlockFace.fromNBT(c.getCompound("Location"))));
NBTHelper.iterateCompoundList(nbt.getList("SubContraptions", NBT.TAG_COMPOUND),
c -> stabilizedSubContraptions.put(c.getUniqueId("Id"), BlockFace.fromNBT(c.getCompound("Location"))));
storage.clear();
NBTHelper.iterateCompoundList(nbt.getList("Storage", NBT.TAG_COMPOUND), c -> storage
@ -831,7 +843,9 @@ public abstract class Contraption {
private CompoundNBT writeBlocksCompound() {
CompoundNBT compound = new CompoundNBT();
HashMapPalette<BlockState> palette = new HashMapPalette<>(GameData.getBlockStateIDMap(), 16, (i, s) -> {throw new IllegalStateException("Palette Map index exceeded maximum");}, NBTUtil::readBlockState, NBTUtil::writeBlockState);
HashMapPalette<BlockState> palette = new HashMapPalette<>(GameData.getBlockStateIDMap(), 16, (i, s) -> {
throw new IllegalStateException("Palette Map index exceeded maximum");
}, NBTUtil::readBlockState, NBTUtil::writeBlockState);
ListNBT blockList = new ListNBT();
for (BlockInfo block : this.blocks.values()) {
@ -857,7 +871,9 @@ public abstract class Contraption {
ListNBT blockList;
if (usePalettedDeserialization) {
CompoundNBT c = ((CompoundNBT) compound);
palette = new HashMapPalette<>(GameData.getBlockStateIDMap(), 16, (i, s) -> {throw new IllegalStateException("Palette Map index exceeded maximum");}, NBTUtil::readBlockState, NBTUtil::writeBlockState);
palette = new HashMapPalette<>(GameData.getBlockStateIDMap(), 16, (i, s) -> {
throw new IllegalStateException("Palette Map index exceeded maximum");
}, NBTUtil::readBlockState, NBTUtil::writeBlockState);
palette.read(c.getList("Palette", 10));
blockList = c.getList("BlockList", 10);
@ -906,19 +922,15 @@ public abstract class Contraption {
}
private static BlockInfo readBlockInfo(CompoundNBT blockListEntry, HashMapPalette<BlockState> palette) {
return new BlockInfo(
BlockPos.fromLong(blockListEntry.getLong("Pos")),
return new BlockInfo(BlockPos.fromLong(blockListEntry.getLong("Pos")),
Objects.requireNonNull(palette.get(blockListEntry.getInt("State"))),
blockListEntry.contains("Data") ? blockListEntry.getCompound("Data") : null
);
blockListEntry.contains("Data") ? blockListEntry.getCompound("Data") : null);
}
private static BlockInfo legacyReadBlockInfo(CompoundNBT blockListEntry) {
return new BlockInfo(
NBTUtil.readBlockPos(blockListEntry.getCompound("Pos")),
return new BlockInfo(NBTUtil.readBlockPos(blockListEntry.getCompound("Pos")),
NBTUtil.readBlockState(blockListEntry.getCompound("Block")),
blockListEntry.contains("Data") ? blockListEntry.getCompound("Data") : null
);
blockListEntry.contains("Data") ? blockListEntry.getCompound("Data") : null);
}
public void removeBlocksFromWorld(World world, BlockPos offset) {
@ -999,8 +1011,7 @@ public abstract class Contraption {
}
if (state.getBlock() instanceof IWaterLoggable && state.contains(BlockStateProperties.WATERLOGGED)) {
FluidState FluidState = world.getFluidState(targetPos);
state = state.with(BlockStateProperties.WATERLOGGED,
FluidState.getFluid() == Fluids.WATER);
state = state.with(BlockStateProperties.WATERLOGGED, FluidState.getFluid() == Fluids.WATER);
}
world.destroyBlock(targetPos, true);
@ -1232,8 +1243,8 @@ public abstract class Contraption {
float distSq = a * a + b * b;
if (distSq > maxDistSq) maxDistSq = distSq;
if (distSq > maxDistSq)
maxDistSq = distSq;
}
return maxDistSq;

View file

@ -103,6 +103,11 @@ public class PumpTileEntity extends KineticTileEntity {
BlockPos backPos = pos.offset(getFront().getOpposite());
FluidPropagator.propagateChangedPipe(world, frontPos, world.getBlockState(frontPos));
FluidPropagator.propagateChangedPipe(world, backPos, world.getBlockState(backPos));
FluidTransportBehaviour behaviour = getBehaviour(FluidTransportBehaviour.TYPE);
if (behaviour != null)
behaviour.wipePressure();
sidesToUpdate.forEach(MutableBoolean::setTrue);
}
protected void distributePressureTo(Direction side) {

View file

@ -1,10 +1,12 @@
package com.simibubi.create.content.contraptions.fluids.tank;
import java.util.List;
import java.util.function.Consumer;
import com.simibubi.create.foundation.fluid.SmartFluidTank;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fluids.FluidStack;
public class CreativeFluidTankTileEntity extends FluidTankTileEntity {
@ -18,6 +20,11 @@ public class CreativeFluidTankTileEntity extends FluidTankTileEntity {
return new CreativeSmartFluidTank(getCapacityMultiplier(), this::onFluidStackChanged);
}
@Override
public boolean addToGoggleTooltip(List<ITextComponent> tooltip, boolean isPlayerSneaking) {
return false;
}
public static class CreativeSmartFluidTank extends SmartFluidTank {
public CreativeSmartFluidTank(int capacity, Consumer<FluidStack> updateCallback) {

View file

@ -141,6 +141,8 @@ public class FluidTankTileEntity extends SmartTileEntity implements IHaveGoggleI
FluidTankTileEntity tankAt = FluidTankConnectivityHandler.anyTankAt(world, pos);
if (tankAt == null)
continue;
world.updateComparatorOutputLevel(pos, tankAt.getBlockState()
.getBlock());
if (tankAt.luminosity == actualLuminosity)
continue;
tankAt.setLuminosity(actualLuminosity);
@ -315,8 +317,11 @@ public class FluidTankTileEntity extends SmartTileEntity implements IHaveGoggleI
@Override
public boolean addToGoggleTooltip(List<ITextComponent> tooltip, boolean isPlayerSneaking) {
FluidTankTileEntity controllerTE = getControllerTE();
if (controllerTE == null)
return false;
return containedFluidTooltip(tooltip, isPlayerSneaking,
getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY));
controllerTE.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY));
}
@Override

View file

@ -69,7 +69,7 @@ public abstract class AbstractFilterScreen<F extends AbstractFilterContainer> ex
textRenderer.draw(ms, I18n.format(container.filterItem.getTranslationKey()), x + 15, y + 3, 0xdedede);
GuiGameElement.of(container.filterItem)
.<GuiGameElement.GuiRenderBuilder>at(x + background.width, guiTop + background.height - 60)
.<GuiGameElement.GuiRenderBuilder>at(x + background.width, guiTop + background.height - 60, -200)
.scale(5)
.render(ms);

View file

@ -948,6 +948,27 @@ public class StandardRecipeGen extends CreateRecipeProvider {
.viaShapeless(b -> b.addIngredient(AllItems.WHEAT_FLOUR.get())
.addIngredient(Items.WATER_BUCKET)),
DIVING_HELMET = create(AllItems.DIVING_HELMET).unlockedByTag(I::copper)
.viaShaped(b -> b.key('G', Tags.Items.GLASS)
.key('P', I.copper())
.patternLine("PPP")
.patternLine("PGP")),
COPPER_BACKTANK = create(AllItems.COPPER_BACKTANK).unlockedByTag(I::copper)
.viaShaped(b -> b.key('G', I.shaft())
.key('A', I.andesite())
.key('P', I.copper())
.patternLine("AGA")
.patternLine("PPP")
.patternLine(" P ")),
DIVING_BOOTS = create(AllItems.DIVING_BOOTS).unlockedByTag(I::copper)
.viaShaped(b -> b.key('G', I.andesite())
.key('P', I.copper())
.patternLine("P P")
.patternLine("P P")
.patternLine("G G")),
SLIME_BALL = create(() -> Items.SLIME_BALL).unlockedBy(AllItems.DOUGH::get)
.viaShapeless(b -> b.addIngredient(AllItems.DOUGH.get())
.addIngredient(Tags.Items.DYES_LIME)),

View file

@ -160,7 +160,7 @@ public class InvManipulationBehaviour extends TileEntityBehaviour {
@Override
public void tick() {
super.tick();
if (findNewNextTick) {
if (findNewNextTick || getWorld().getGameTime() % 64 == 0) {
findNewNextTick = false;
findNewCapability();
}