Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use phantom ink instead of managlass to make abstruse platforms invisible #4628

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import net.minecraft.world.level.BlockAndTintGetter;
import net.minecraft.world.level.block.state.BlockState;

import vazkii.botania.common.block.BotaniaBlocks;
import vazkii.botania.common.block.PlatformBlock;
import vazkii.botania.common.block.block_entity.PlatformBlockEntity;

Expand Down Expand Up @@ -50,11 +49,6 @@ public void emitBlockQuads(BlockAndTintGetter blockView, BlockState state, Block
// No camo
super.emitBlockQuads(blockView, state, pos, randomSupplier, context);
} else {
// Some people used this to get an invisible block in the past, accommodate that.
if (heldState.is(BotaniaBlocks.manaGlass)) {
return;
}

BakedModel model = Minecraft.getInstance().getBlockRenderer()
.getBlockModelShaper().getBlockModel(heldState);
// Steal camo's model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import vazkii.botania.common.block.BotaniaBlocks;
import vazkii.botania.common.block.PlatformBlock;
import vazkii.botania.common.block.block_entity.PlatformBlockEntity;

import java.util.Collections;
import java.util.List;

public class ForgePlatformModel extends BakedModelWrapper<BakedModel> {
Expand Down Expand Up @@ -57,11 +55,6 @@ public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction
// No camo
return super.getQuads(state, side, rand, extraData, renderType);
} else {
// Some people used this to get an invisible block in the past, accommodate that.
if (heldState.is(BotaniaBlocks.manaGlass)) {
return Collections.emptyList();
}

BakedModel model = Minecraft.getInstance().getBlockRenderer()
.getBlockModelShaper().getBlockModel(heldState);
return model.getQuads(heldState, side, rand, ModelData.EMPTY, renderType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

import vazkii.botania.api.mana.ManaCollisionGhost;
import vazkii.botania.common.block.block_entity.PlatformBlockEntity;
import vazkii.botania.common.item.BotaniaItems;

import java.util.List;
import java.util.function.BiPredicate;
Expand Down Expand Up @@ -156,6 +157,14 @@ public InteractionResult use(BlockState state, Level world, BlockPos pos, Player

return InteractionResult.sidedSuccess(world.isClientSide());
}
} else if (!currentStack.isEmpty()
&& currentStack.is(BotaniaItems.phantomInk)
&& tile instanceof PlatformBlockEntity camo) {
if (!world.isClientSide) {
camo.setCamoState(Blocks.BARRIER.defaultBlockState()); //Barrier block is being used as a sentinel value here
}

return InteractionResult.sidedSuccess(world.isClientSide());
}

return InteractionResult.PASS;
Expand Down
1 change: 1 addition & 0 deletions web/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ and start a new "Upcoming" section.
* Unlock conditions for slab recombination recipes now require the slab, not the full block
* Change: Recipe displays for Petal Apothecary and Runic Altar show required reagents (e.g. seeds, livingrock)
* Change: Recipe display for Terrestrial Agglomeration Plate in EMI looks more like it does on JEI or REI now
* Change: Phantom ink is now used to hide abstruse and spectral platforms instead of managlass. (zacharybarbanell)
* Fix: Corporea Crystal Cube and Abstruse/Spectral Platform no longer forget their internal state after unloading
* Fix: Quick-moving (shift+click) Botania pattern items in the loom UI properly puts them in the pattern slot
* Fix: Animated Torch powers blocks consistently, and properly updates necessary blocks when placed, rotated, or removed
Expand Down
Loading