Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Electro593 committed Nov 17, 2024
2 parents 1b540f3 + f5e0847 commit 07cba9d
Show file tree
Hide file tree
Showing 600 changed files with 5,663 additions and 3,560 deletions.
2 changes: 1 addition & 1 deletion raw/Generate-GuidebookTranslations.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $RecipeTypes =
'spectrum:liquid_crystal_converting',
'spectrum:midnight_solution_converting',
'spectrum:dragonrot_converting',
'spectrum:mud_converting',
'spectrum:goo_converting',
'spectrum:crystallarieum_growing',
'spectrum:cinderhearth_smelting',
'spectrum:titration_barrel_fermenting',
Expand Down
156 changes: 78 additions & 78 deletions raw/Generate-Shimmer.ps1

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion raw/Generate-StoneCuttingRecipes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $entries = @(
[Template]::new("spectrum:pyrite", "spectrum:pyrite_tubing", 1),
[Template]::new("spectrum:pyrite", "spectrum:pyrite_relief", 1),
[Template]::new("spectrum:pyrite", "spectrum:pyrite_stack", 1),
[Template]::new("spectrum:pyrite", "spectrum:pyrite_panneling", 1),
[Template]::new("spectrum:pyrite", "spectrum:pyrite_paneling", 1),
[Template]::new("spectrum:pyrite", "spectrum:pyrite_vent", 1)
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package de.dafuqs.spectrum.blocks.chests;

import com.mojang.serialization.MapCodec;
import de.dafuqs.spectrum.registries.*;
import net.minecraft.block.*;
import net.minecraft.block.entity.*;
Expand All @@ -11,13 +10,13 @@
import net.minecraft.world.*;
import org.jetbrains.annotations.*;

public class RestockingChestBlock extends SpectrumChestBlock {
public class FabricationChestBlock extends SpectrumChestBlock {

public static final MapCodec<RestockingChestBlock> CODEC = createCodec(RestockingChestBlock::new);

protected static final VoxelShape CHEST_SHAPE = Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 12.0D, 16.0D);

public RestockingChestBlock(Settings settings) {
public FabricationChestBlock(Settings settings) {
super(settings);
}

Expand All @@ -29,19 +28,19 @@ protected MapCodec<? extends BlockWithEntity> getCodec() {
@Override
@Nullable
public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
return new RestockingChestBlockEntity(pos, state);
return new FabricationChestBlockEntity(pos, state);
}

@Override
@Nullable
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state, BlockEntityType<T> type) {
return validateTicker(type, SpectrumBlockEntities.RESTOCKING_CHEST, RestockingChestBlockEntity::tick);
return validateTicker(type, SpectrumBlockEntities.FABRICATION_CHEST, RestockingChestBlockEntity::tick);
}

@Override
public void openScreen(World world, BlockPos pos, PlayerEntity player) {
BlockEntity blockEntity = world.getBlockEntity(pos);
if (blockEntity instanceof RestockingChestBlockEntity) {
if (blockEntity instanceof FabricationChestBlockEntity) {
if (!isChestBlocked(world, pos)) {
player.openHandledScreen((NamedScreenHandlerFactory) blockEntity);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import net.minecraft.item.*;
import net.minecraft.nbt.*;
import net.minecraft.recipe.*;
import net.minecraft.registry.RegistryWrapper;
import net.minecraft.registry.*;
import net.minecraft.screen.*;
import net.minecraft.text.*;
import net.minecraft.util.collection.*;
Expand All @@ -22,7 +22,7 @@
import java.util.*;
import java.util.stream.*;

public class RestockingChestBlockEntity extends SpectrumChestBlockEntity implements SidedInventory {
public class FabricationChestBlockEntity extends SpectrumChestBlockEntity implements SidedInventory {

public static final int INVENTORY_SIZE = 27 + 4 + 4; // 27 items, 4 crafting tablets, 4 result slots
public static final int[] CHEST_SLOTS = IntStream.rangeClosed(0, 26).toArray();
Expand All @@ -35,11 +35,11 @@ public class RestockingChestBlockEntity extends SpectrumChestBlockEntity impleme
float rimTarget, rimPos, lastRimTarget, tabletTarget, tabletPos, lastTabletTarget,assemblyTarget, assemblyPos, lastAssemblyTarget, ringTarget, ringPos, lastRingTarget, itemTarget, itemPos, lastItemTarget, alphaTarget, alphaValue, lastAlphaTarget, yawModTarget, yawMod, lastYawModTarget, yaw, lastYaw;
long interpTicks, interpLength = 1, age;

public RestockingChestBlockEntity(BlockPos blockPos, BlockState blockState) {
super(SpectrumBlockEntities.RESTOCKING_CHEST, blockPos, blockState);
public FabricationChestBlockEntity(BlockPos blockPos, BlockState blockState) {
super(SpectrumBlockEntities.FABRICATION_CHEST, blockPos, blockState);
}

public static void tick(World world, BlockPos pos, BlockState state, RestockingChestBlockEntity chest) {
public static void tick(World world, BlockPos pos, BlockState state, FabricationChestBlockEntity chest) {
chest.age++;

if (world.isClient) {
Expand Down Expand Up @@ -119,12 +119,12 @@ public boolean onSyncedBlockEvent(int type, int data) {
return super.onSyncedBlockEvent(type, data);
}

private static boolean tickCooldown(RestockingChestBlockEntity restockingChestBlockEntity) {
restockingChestBlockEntity.coolDownTicks--;
if (restockingChestBlockEntity.coolDownTicks > 0) {
private static boolean tickCooldown(FabricationChestBlockEntity fabricationChestBlockEntity) {
fabricationChestBlockEntity.coolDownTicks--;
if (fabricationChestBlockEntity.coolDownTicks > 0) {
return false;
} else {
restockingChestBlockEntity.coolDownTicks = 0;
fabricationChestBlockEntity.coolDownTicks = 0;
}
return true;
}
Expand Down Expand Up @@ -180,19 +180,19 @@ public boolean hasValidRecipes() {

@Override
protected Text getContainerName() {
return Text.translatable("block.spectrum.restocking_chest");
return Text.translatable("block.spectrum.fabrication_chest");
}

@Override
protected ScreenHandler createScreenHandler(int syncId, PlayerInventory playerInventory) {
return new RestockingChestScreenHandler(syncId, playerInventory, this);
return new FabricationChestScreenHandler(syncId, playerInventory, this);
}

private void setCooldown(RestockingChestBlockEntity restockingChestBlockEntity, int cooldownTicks) {
restockingChestBlockEntity.coolDownTicks = cooldownTicks;
private void setCooldown(FabricationChestBlockEntity fabricationChestBlockEntity, int cooldownTicks) {
fabricationChestBlockEntity.coolDownTicks = cooldownTicks;
}

private boolean tryCraft(RestockingChestBlockEntity chest, int index) {
private boolean tryCraft(FabricationChestBlockEntity chest, int index) {
ItemStack craftingTabletItemStack = chest.inventory.get(RECIPE_SLOTS[index]);
if (craftingTabletItemStack.isOf(SpectrumItems.CRAFTING_TABLET)) {
var recipe = CraftingTabletItem.getStoredRecipe(world, craftingTabletItemStack);
Expand Down Expand Up @@ -295,7 +295,7 @@ public void updateFullState() {
if (world != null && !world.isClient()) {
isFull = isFull();
hasValidRecipes = hasValidRecipes();
SpectrumS2CPacketSender.sendRestockingChestStatusUpdate(this);
SpectrumS2CPacketSender.sendFabricationChestStatusUpdate(this);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
import de.dafuqs.spectrum.registries.*;
import net.fabricmc.api.*;
import net.minecraft.block.*;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.*;
import net.minecraft.client.model.*;
import net.minecraft.client.render.*;
import net.minecraft.client.render.block.entity.*;
import net.minecraft.client.render.model.json.ModelTransformationMode;
import net.minecraft.client.render.model.json.*;
import net.minecraft.client.util.*;
import net.minecraft.client.util.math.*;
import net.minecraft.item.ItemStack;
import net.minecraft.item.*;
import net.minecraft.screen.*;
import net.minecraft.util.math.*;
import net.minecraft.world.*;
import org.jetbrains.annotations.*;

@Environment(EnvType.CLIENT)
public class RestockingChestBlockEntityRenderer implements BlockEntityRenderer<RestockingChestBlockEntity> {
public class FabricationChestBlockEntityRenderer implements BlockEntityRenderer<FabricationChestBlockEntity> {

private static final SpriteIdentifier spriteIdentifier = new SpriteIdentifier(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE, SpectrumCommon.locate("block/fabrication_chest"));
private final ModelPart rootNode;
Expand All @@ -28,7 +28,7 @@ public class RestockingChestBlockEntityRenderer implements BlockEntityRenderer<R
private final ModelPart assembly;
private final ModelPart rings;

public RestockingChestBlockEntityRenderer(BlockEntityRendererFactory.Context ctx) {
public FabricationChestBlockEntityRenderer(BlockEntityRendererFactory.Context ctx) {
TexturedModelData texturedModelData = getTexturedModelData();
this.rootNode = texturedModelData.createModel();
this.root = rootNode.getChild("root");
Expand Down Expand Up @@ -56,10 +56,10 @@ public RestockingChestBlockEntityRenderer(BlockEntityRendererFactory.Context ctx
}

@Override
public void render(RestockingChestBlockEntity chest, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) {
public void render(FabricationChestBlockEntity chest, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) {
World world = chest.getWorld();
boolean bl = world != null;
BlockState blockState = bl ? chest.getCachedState() : SpectrumBlocks.RESTOCKING_CHEST.getDefaultState().with(ChestBlock.FACING, Direction.SOUTH);
BlockState blockState = bl ? chest.getCachedState() : SpectrumBlocks.FABRICATION_CHEST.getDefaultState().with(ChestBlock.FACING, Direction.SOUTH);

matrices.push();
float f = (blockState.get(ChestBlock.FACING)).asRotation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import net.minecraft.inventory.*;
import net.minecraft.item.*;
import net.minecraft.nbt.*;
import net.minecraft.registry.RegistryWrapper;
import net.minecraft.registry.*;
import net.minecraft.screen.*;
import net.minecraft.sound.*;
import net.minecraft.util.collection.*;
Expand Down Expand Up @@ -55,8 +55,8 @@ protected boolean isPlayerViewing(PlayerEntity player) {
Inventory inventory = null;
if (screenHandler instanceof GenericContainerScreenHandler) {
inventory = ((GenericContainerScreenHandler) screenHandler).getInventory();
} else if (screenHandler instanceof RestockingChestScreenHandler restockingChestScreenHandler) {
inventory = restockingChestScreenHandler.getInventory();
} else if (screenHandler instanceof FabricationChestScreenHandler fabricationChestScreenHandler) {
inventory = fabricationChestScreenHandler.getInventory();
} else if (screenHandler instanceof BlackHoleChestScreenHandler blackHoleChestScreenHandler) {
inventory = blackHoleChestScreenHandler.getInventory();
} else if (screenHandler instanceof CompactingChestScreenHandler compactingChestScreenHandler) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public boolean canPathfindThrough(BlockState state, NavigationType type) {
return SpectrumBlocks.SLUSH.getDefaultState();
} else if (otherState.isIn(FluidTags.LAVA)) {
return Blocks.BLACKSTONE.getDefaultState();
} else if (otherState.isIn(SpectrumFluidTags.MUD)) {
} else if (otherState.isIn(SpectrumFluidTags.GOO)) {
return Blocks.COARSE_DIRT.getDefaultState();
} else if (otherState.isIn(SpectrumFluidTags.LIQUID_CRYSTAL)) {
return SpectrumBlocks.ROTTEN_GROUND.getDefaultState();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,31 @@
import net.minecraft.util.math.random.*;
import net.minecraft.world.*;

public abstract class MudFluid extends SpectrumFluid {
public abstract class GooFluid extends SpectrumFluid {

@Override
public Fluid getStill() {
return SpectrumFluids.MUD;
return SpectrumFluids.GOO;
}

@Override
public Fluid getFlowing() {
return SpectrumFluids.FLOWING_MUD;
return SpectrumFluids.FLOWING_GOO;
}

@Override
public Item getBucketItem() {
return SpectrumItems.MUD_BUCKET;
return SpectrumItems.GOO_BUCKET;
}

@Override
protected BlockState toBlockState(FluidState fluidState) {
return SpectrumBlocks.MUD.getDefaultState().with(Properties.LEVEL_15, getBlockStateLevel(fluidState));
return SpectrumBlocks.GOO.getDefaultState().with(Properties.LEVEL_15, getBlockStateLevel(fluidState));
}

@Override
public boolean matchesType(Fluid fluid) {
return fluid == SpectrumFluids.MUD || fluid == SpectrumFluids.FLOWING_MUD;
return fluid == SpectrumFluids.GOO || fluid == SpectrumFluids.FLOWING_GOO;
}

@Override
Expand All @@ -51,7 +51,7 @@ public void randomDisplayTick(World world, BlockPos pos, FluidState state, Rando
BlockPos topPos = pos.up();
BlockState topState = world.getBlockState(topPos);
if (topState.isAir() && !topState.isOpaqueFullCube(world, topPos) && random.nextInt(1000) == 0) {
world.playSound(pos.getX(), pos.getY(), pos.getZ(), SpectrumSoundEvents.MUD_AMBIENT, SoundCategory.BLOCKS, 0.2F + random.nextFloat() * 0.2F, 0.9F + random.nextFloat() * 0.15F, false);
world.playSound(pos.getX(), pos.getY(), pos.getZ(), SpectrumSoundEvents.GOO_AMBIENT, SoundCategory.BLOCKS, 0.2F + random.nextFloat() * 0.2F, 0.9F + random.nextFloat() * 0.15F, false);
}
}

Expand All @@ -72,21 +72,21 @@ public int getTickRate(WorldView worldView) {

@Override
public ParticleEffect getParticle() {
return SpectrumParticleTypes.DRIPPING_MUD;
return SpectrumParticleTypes.DRIPPING_GOO;
}

@Override
public ParticleEffect getSplashParticle() {
return SpectrumParticleTypes.MUD_SPLASH;
return SpectrumParticleTypes.GOO_SPLASH;
}

@Override
public RecipeType<? extends FluidConvertingRecipe> getDippingRecipeType() {
return SpectrumRecipeTypes.MUD_CONVERTING;
return SpectrumRecipeTypes.GOO_CONVERTING;
}

/**
* Entities colliding with mud will get a slowness effect
* Entities colliding with goo will get a slowness effect
* and losing their breath far quicker
*/
@Override
Expand All @@ -96,7 +96,7 @@ public void onEntityCollision(BlockState state, World world, BlockPos pos, Entit
if (!world.isClient && entity instanceof LivingEntity livingEntity) {
// the entity is hurt at air == -20 and then reset to air = 0
// this way the entity loses its breath way faster, but gets damaged just as slow afterwards
if (livingEntity.isSubmergedIn(SpectrumFluidTags.MUD) && world.getTime() % 2 == 0 && livingEntity.getAir() > 0) {
if (livingEntity.isSubmergedIn(SpectrumFluidTags.GOO) && world.getTime() % 2 == 0 && livingEntity.getAir() > 0) {
livingEntity.setAir(livingEntity.getAir() - 1);
}

Expand All @@ -111,7 +111,7 @@ public void onEntityCollision(BlockState state, World world, BlockPos pos, Entit
}
}

public static class FlowingMud extends MudFluid {
public static class FlowingGoo extends GooFluid {

@Override
protected void appendProperties(StateManager.Builder<Fluid, FluidState> builder) {
Expand All @@ -131,7 +131,7 @@ public boolean isStill(FluidState fluidState) {

}

public static class StillMud extends MudFluid {
public static class StillGoo extends GooFluid {

@Override
public int getLevel(FluidState fluidState) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import net.minecraft.world.*;
import org.jetbrains.annotations.*;

public class MudFluidBlock extends SpectrumFluidBlock {
public class GooFluidBlock extends SpectrumFluidBlock {

public MudFluidBlock(SpectrumFluid fluid, BlockState ultrawarmReplacementBlockState, Settings settings) {
public GooFluidBlock(SpectrumFluid fluid, BlockState ultrawarmReplacementBlockState, Settings settings) {
super(fluid, ultrawarmReplacementBlockState, settings);
}

Expand All @@ -26,19 +26,19 @@ public MudFluidBlock(SpectrumFluid fluid, BlockState ultrawarmReplacementBlockSt

@Override
public SimpleParticleType getSplashParticle() {
return SpectrumParticleTypes.MUD_SPLASH;
return SpectrumParticleTypes.GOO_SPLASH;
}

@Override
public Pair<SimpleParticleType, SimpleParticleType> getFishingParticles() {
return new Pair<>(SpectrumParticleTypes.MUD_POP, SpectrumParticleTypes.MUD_FISHING);
return new Pair<>(SpectrumParticleTypes.GOO_POP, SpectrumParticleTypes.GOO_FISHING);
}

@Override
public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) {
super.randomDisplayTick(state, world, pos, random);
if (!world.getBlockState(pos.up()).isSolidBlock(world, pos.up()) && random.nextFloat() < 0.03F) {
world.addParticle(SpectrumParticleTypes.MUD_POP, pos.getX() + random.nextDouble(), pos.getY() + 1, pos.getZ() + random.nextDouble(), 0, random.nextDouble() * 0.1, 0);
world.addParticle(SpectrumParticleTypes.GOO_POP, pos.getX() + random.nextDouble(), pos.getY() + 1, pos.getZ() + random.nextDouble(), 0, random.nextDouble() * 0.1, 0);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
import de.dafuqs.spectrum.registries.*;
import net.minecraft.block.*;
import net.minecraft.entity.ai.pathing.*;
import net.minecraft.fluid.FluidState;
import net.minecraft.fluid.*;
import net.minecraft.particle.*;
import net.minecraft.registry.tag.*;
import net.minecraft.util.*;
import net.minecraft.util.math.*;
import net.minecraft.util.math.random.*;
import net.minecraft.world.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.*;

public class LiquidCrystalFluidBlock extends SpectrumFluidBlock {

Expand Down Expand Up @@ -57,8 +56,7 @@ public void randomDisplayTick(BlockState state, World world, BlockPos pos, Rando
}
else if (otherState.isIn(FluidTags.LAVA)) {
return state.isStill() ? SpectrumBlocks.BLAZING_CRYSTAL.getDefaultState() : Blocks.COBBLED_DEEPSLATE.getDefaultState();
}
else if (otherState.isIn(SpectrumFluidTags.MUD)) {
} else if (otherState.isIn(SpectrumFluidTags.GOO)) {
return Blocks.CLAY.getDefaultState();
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private static int execute(ServerCommandSource source) {
if (!SpectrumCommon.CONFIG.CloversFavorEnchantmentEnabled) {
disabledEnchantments += "Clovers Favor ";
}
if (!SpectrumCommon.CONFIG.SniperEnchantmentEnabled) {
if (!SpectrumCommon.CONFIG.SnipingEnchantmentEnabled) {
disabledEnchantments += "Sniping ";
}
if (!SpectrumCommon.CONFIG.TightGripEnchantmentEnabled) {
Expand Down
Loading

0 comments on commit 07cba9d

Please sign in to comment.