Skip to content

Commit

Permalink
Merge branch 'DaFuqs:1.20.1-main' into manor-loot
Browse files Browse the repository at this point in the history
  • Loading branch information
f-raZ0R authored Oct 19, 2024
2 parents 4d4ea86 + 08c55fc commit 53abece
Show file tree
Hide file tree
Showing 804 changed files with 17,724 additions and 834 deletions.
8 changes: 8 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ repositories {
maven { url = "https://maven.jamieswhiteshirt.com/libs-release/" } // Entity Reach Attribute
maven { url = "https://api.modrinth.com/maven" } // Revelationary, Additional Entity Attributes, Fractal Lib, Colorful Hearts, idwtialsimmoedm
maven { url = "https://cfa2.cursemaven.com" }
maven { url = "https://mvn.devos.one/releases/" } // Porting Lib
maven { url = "https://repo.unascribed.com" } // Ears API
maven { url = "https://dl.cloudsmith.io/public/klikli-dev/mods/maven/" } // Modonomicon
maven { url = "https://maven.is-immensely.gay/releases" } // Matchbooks
Expand Down Expand Up @@ -93,10 +94,17 @@ dependencies {
modCompileOnly("com.unascribed:ears-api:${project.ears_version}")
modCompileOnly("maven.modrinth:create-fabric:${project.create_version}") { transitive = false }
modCompileOnly("maven.modrinth:neepmeat:${project.neepmeat_version}") { transitive = false }
modCompileOnly("maven.modrinth:lodestonelib:${project.lodestone_version}") { transitive = false}
modCompileOnly("maven.modrinth:malum:${project.malum_version}") { transitive = false}
// modCompileOnly("maven.modrinth:enchantment-descriptions:${project.enchantment_descriptions_version}")
modCompileOnly("maven.modrinth:travelersbackpack:${project.travelers_backpack_version}")
modCompileOnly("maven.modrinth:botania:${project.botania_version}")
modImplementation("maven.modrinth:idwtialsimmoedm:${project.idwtialsimmoedm_version}")

//Porting Lib
for (String module in port_lib_modules.split(",")) {
modCompileOnly("io.github.fabricators_of_create.Porting-Lib:$module:${project.port_lib_version}") { transitive = false }
}
}

loom {
Expand Down
6 changes: 6 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ auth_me_version=7.0.2+1.20
create_version=0.5.1-f-build.1417+mc1.20.1
# https://modrinth.com/mod/neepmeat
neepmeat_version=0.6.2-beta+1.20.1
# https://modrinth.com/mod/malum
malum_version=1.20.1-1.6.3.0b-fabric
# https://modrinth.com/mod/lodestonelib
lodestone_version=1.20.1-1.6.2.3f
port_lib_version = 2.3.4+1.20.1
port_lib_modules = lazy_registration
# https://modrinth.com/mod/exclusions-lib
exclusionslib_version=0.6

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/dafuqs/spectrum/SpectrumCommon.java
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ public void onInitialize() {
Optional<ModContainer> modContainer = FabricLoader.getInstance().getModContainer(SpectrumCommon.MOD_ID);
if (modContainer.isPresent()) {
ResourceManagerHelper.registerBuiltinResourcePack(locate("spectrum_style_amethyst"), modContainer.get(), Text.of("Spectrum Style Amethyst"), ResourcePackActivationType.NORMAL);
ResourceManagerHelper.registerBuiltinResourcePack(locate("spectrum_generation_1"), modContainer.get(), Text.of("Generation 1 Spectrum textures"), ResourcePackActivationType.NORMAL);
ResourceManagerHelper.registerBuiltinResourcePack(locate("spectrum_programmer_art"), modContainer.get(), Text.of("Spectrum's Programmer Art"), ResourcePackActivationType.NORMAL);
//ResourceManagerHelper.registerBuiltinResourcePack(locate("jinc"), modContainer.get(), Text.of("Alternate Spectrum textures"), ResourcePackActivationType.NORMAL);
}

logInfo("Common startup completed!");
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/de/dafuqs/spectrum/api/energy/InkPowered.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
package de.dafuqs.spectrum.api.energy;

import com.sammy.malum.registry.common.MobEffectRegistry;
import de.dafuqs.revelationary.api.advancements.*;
import de.dafuqs.spectrum.*;
import de.dafuqs.spectrum.api.energy.color.*;
import de.dafuqs.spectrum.compat.SpectrumIntegrationPacks;
import de.dafuqs.spectrum.helpers.*;
import de.dafuqs.spectrum.progression.*;
import de.dafuqs.spectrum.registries.SpectrumStatusEffects;
import dev.emi.trinkets.api.*;
import net.fabricmc.api.*;
import net.minecraft.client.*;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.player.*;
import net.minecraft.inventory.*;
import net.minecraft.item.*;
import net.minecraft.registry.Registries;
import net.minecraft.server.network.*;
import net.minecraft.text.*;
import net.minecraft.util.*;
import org.jetbrains.annotations.*;


import java.util.*;

public interface InkPowered {
Expand Down Expand Up @@ -135,6 +141,10 @@ static boolean tryDrainEnergy(@NotNull PlayerEntity player, @NotNull InkColor co
if (!canUse(player)) {
return false;
}
if(SpectrumIntegrationPacks.isIntegrationPackActive(SpectrumIntegrationPacks.MALUM_ID) && player.hasStatusEffect(Registries.STATUS_EFFECT.get(new Identifier("malum:silenced"))))
{
return false;
}

// hands (main hand, too, if someone uses the staff from the offhand)
for (ItemStack itemStack : player.getHandItems()) {
Expand Down Expand Up @@ -206,6 +216,11 @@ static boolean hasAvailableInk(PlayerEntity player, InkColor color, long amount)
if (!canUse(player)) {
return false;
}

if(SpectrumIntegrationPacks.isIntegrationPackActive(SpectrumIntegrationPacks.MALUM_ID) && player.hasStatusEffect(Registries.STATUS_EFFECT.get(new Identifier("malum:silenced"))))
{
return false;
}

if (player.isCreative()) {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ public void readNbt(NbtCompound nbt) {

// Trivial sync methods. Call whenever bundle/storage contents need to be synced with each other [(de)serialization, bundle stack set, bundle block break loot]
private void syncBundleWithStorage() {
BottomlessBundleItem.setBundledStack(this.bottomlessBundleStack, this.storage.variant.toStack(), (int) this.storage.amount);
if (this.storage.variant == null || this.storage.amount == 0) {
BottomlessBundleItem.setBundledStack(this.bottomlessBundleStack, ItemStack.EMPTY, 0);
} else {
BottomlessBundleItem.setBundledStack(this.bottomlessBundleStack, this.storage.variant.toStack(), (int) this.storage.amount);
}
}

private void syncStorageWithBundle() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package de.dafuqs.spectrum.blocks.conditional;

import de.dafuqs.revelationary.api.revelations.*;
import de.dafuqs.spectrum.*;
import de.dafuqs.spectrum.blocks.decoration.*;
import de.dafuqs.spectrum.registries.*;
import net.minecraft.block.*;
Expand All @@ -19,7 +18,7 @@ public FourLeafCloverBlock(Settings settings) {

@Override
public Identifier getCloakAdvancementIdentifier() {
return SpectrumCommon.locate("milestones/reveal_four_leaf_clover");
return SpectrumAdvancements.REVEAL_FOUR_LEAF_CLOVER;
}

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

import de.dafuqs.revelationary.api.revelations.*;
import de.dafuqs.spectrum.*;
import de.dafuqs.spectrum.blocks.*;
import de.dafuqs.spectrum.registries.*;
import net.minecraft.block.*;
Expand All @@ -26,8 +25,6 @@ public class MermaidsBrushBlock extends PlantBlock implements Fertilizable, Reve

private static final VoxelShape SHAPE = Block.createCuboidShape(1.0, 0.0, 1.0, 15.0, 16.0, 15.0);

public static final Identifier UNLOCK_IDENTIFIER = SpectrumCommon.locate("milestones/reveal_mermaids_brush");

public static final EnumProperty<FluidLogging.State> LOGGED = FluidLogging.ANY_EXCLUDING_NONE;
public static final IntProperty AGE = Properties.AGE_7;

Expand Down Expand Up @@ -56,7 +53,7 @@ public void onEntityCollision(BlockState state, World world, BlockPos pos, Entit

@Override
public Identifier getCloakAdvancementIdentifier() {
return UNLOCK_IDENTIFIER;
return SpectrumAdvancements.REVEAL_MERMAIDS_BRUSH;
}

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

import de.dafuqs.revelationary.api.revelations.*;
import de.dafuqs.spectrum.*;
import de.dafuqs.spectrum.blocks.*;
import de.dafuqs.spectrum.registries.*;
import net.minecraft.block.*;
Expand Down Expand Up @@ -46,7 +45,7 @@ public QuitoxicReedsBlock(Settings settings) {

@Override
public Identifier getCloakAdvancementIdentifier() {
return SpectrumCommon.locate("milestones/reveal_quitoxic_reeds");
return SpectrumAdvancements.REVEAL_QUITOXIC_REEDS;
}

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

import de.dafuqs.revelationary.api.revelations.*;
import de.dafuqs.spectrum.*;
import de.dafuqs.spectrum.registries.*;
import net.minecraft.block.*;
import net.minecraft.entity.*;
Expand All @@ -21,7 +20,7 @@ public RadiatingEnderBlock(Settings settings) {

@Override
public Identifier getCloakAdvancementIdentifier() {
return SpectrumCommon.locate("milestones/reveal_radiating_ender");
return SpectrumAdvancements.REVEAL_RADIATING_ENDER;
}

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

import de.dafuqs.revelationary.api.revelations.*;
import de.dafuqs.spectrum.*;
import de.dafuqs.spectrum.registries.*;
import net.minecraft.block.*;
import net.minecraft.entity.*;
Expand Down Expand Up @@ -86,7 +85,7 @@ public void onDestroyedByExplosion(World world, BlockPos pos, Explosion explosio

@Override
public Identifier getCloakAdvancementIdentifier() {
return SpectrumCommon.locate("milestones/reveal_storm_stones");
return SpectrumAdvancements.REVEAL_STORM_STONES;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package de.dafuqs.spectrum.blocks.conditional.amaranth;

import de.dafuqs.revelationary.api.revelations.*;
import de.dafuqs.spectrum.registries.*;
import de.dafuqs.spectrum.registries.client.*;
import net.minecraft.block.*;
import net.minecraft.entity.effect.*;
Expand All @@ -19,7 +20,7 @@ public AmaranthBushelBlock(StatusEffect suspiciousStewEffect, int effectDuration

@Override
public Identifier getCloakAdvancementIdentifier() {
return AmaranthCropBlock.ADVANCEMENT_IDENTIFIER;
return SpectrumAdvancements.REVEAL_AMARANTH;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package de.dafuqs.spectrum.blocks.conditional.amaranth;

import de.dafuqs.revelationary.api.revelations.*;
import de.dafuqs.spectrum.*;
import de.dafuqs.spectrum.blocks.*;
import de.dafuqs.spectrum.registries.*;
import de.dafuqs.spectrum.registries.client.*;
import de.dafuqs.spectrum.blocks.*;
import net.minecraft.block.*;
import net.minecraft.block.enums.*;
import net.minecraft.item.*;
Expand All @@ -18,7 +17,6 @@

public class AmaranthCropBlock extends TallCropBlock implements RevelationAware {

public static final Identifier ADVANCEMENT_IDENTIFIER = SpectrumCommon.locate("milestones/reveal_amaranth");
protected static final int LAST_SINGLE_BLOCK_AGE = 2;
protected static final int MAX_AGE = 7;

Expand Down Expand Up @@ -50,7 +48,7 @@ protected ItemConvertible getSeedsItem() {

@Override
public Identifier getCloakAdvancementIdentifier() {
return ADVANCEMENT_IDENTIFIER;
return SpectrumAdvancements.REVEAL_AMARANTH;
}

@Override
Expand All @@ -61,7 +59,8 @@ public Map<BlockState, BlockState> getBlockStateCloaks() {

Map<BlockState, BlockState> map = new Hashtable<>();
for (int age = 0; age <= LAST_SINGLE_BLOCK_AGE; age++) {
map.put(this.withAge(age), smallFern);
map.put(this.withAgeAndHalf(age, DoubleBlockHalf.LOWER), smallFern);
map.put(this.withAgeAndHalf(age, DoubleBlockHalf.UPPER), smallFern);
}
for (int age = LAST_SINGLE_BLOCK_AGE + 1; age <= MAX_AGE; age++) {
map.put(this.withAgeAndHalf(age, DoubleBlockHalf.LOWER), largeFernLower);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package de.dafuqs.spectrum.blocks.conditional.amaranth;

import de.dafuqs.revelationary.api.revelations.*;
import de.dafuqs.spectrum.registries.*;
import net.minecraft.block.*;
import net.minecraft.item.*;
import net.minecraft.util.*;
Expand All @@ -17,7 +18,7 @@ public PottedAmaranthBushelBlock(Block content, Settings settings) {

@Override
public Identifier getCloakAdvancementIdentifier() {
return AmaranthCropBlock.ADVANCEMENT_IDENTIFIER;
return SpectrumAdvancements.REVEAL_AMARANTH;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
package de.dafuqs.spectrum.blocks.conditional.colored_tree;

import de.dafuqs.spectrum.*;
import de.dafuqs.spectrum.registries.*;
import net.minecraft.util.*;

public interface ColoredTree {

Identifier SAPLING_CMY_ADVANCEMENT_IDENTIFIER = SpectrumCommon.locate("milestones/reveal_colored_saplings_cmy");
Identifier TREES_CMY_IDENTIFIER = SpectrumCommon.locate("milestones/reveal_colored_trees_cmy");
Identifier TREES_B_IDENTIFIER = SpectrumCommon.locate("milestones/reveal_colored_trees_k");
Identifier TREES_W_IDENTIFIER = SpectrumCommon.locate("milestones/reveal_colored_trees_w");

enum TreePart {
SAPLING,
LOG,
Expand All @@ -22,13 +17,13 @@ enum TreePart {
static Identifier getTreeCloakAdvancementIdentifier(TreePart treePart, DyeColor color) {
switch (color) {
case WHITE, LIGHT_GRAY, GRAY -> {
return TREES_W_IDENTIFIER;
return SpectrumAdvancements.REVEAL_COLORED_TREES_WHITE;
}
case BLACK, BROWN -> {
return TREES_B_IDENTIFIER;
return SpectrumAdvancements.REVEAL_COLORED_TREES_BLACK;
}
default -> {
return treePart == TreePart.SAPLING ? SAPLING_CMY_ADVANCEMENT_IDENTIFIER : TREES_CMY_IDENTIFIER;
return treePart == TreePart.SAPLING ? SpectrumAdvancements.REVEAL_COLORED_SAPLINGS_CMY : SpectrumAdvancements.REVEAL_COLORED_TREES_CMY;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import net.minecraft.item.*;
import net.minecraft.state.*;
import net.minecraft.state.property.*;
import net.minecraft.util.BlockMirror;
import net.minecraft.util.BlockRotation;
import net.minecraft.util.math.*;

public class CardinalFacingBlock extends Block {
Expand All @@ -26,6 +28,10 @@ public BlockState getPlacementState(ItemPlacementContext ctx) {
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
builder.add(CARDINAL_FACING);
}



@Override
public BlockState rotate(BlockState state, BlockRotation rotation) {
boolean cardinal = state.get(CARDINAL_FACING);
return state.with(CARDINAL_FACING, (rotation.ordinal() % 2 == 1) != cardinal);
}
}
10 changes: 10 additions & 0 deletions src/main/java/de/dafuqs/spectrum/blocks/decoration/PylonBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,16 @@ protected void appendProperties(StateManager.Builder<Block, BlockState> builder)
builder.add(FACING, SECTION, PEDESTAL, WATERLOGGED);
}

@Override
public BlockState rotate(BlockState state, BlockRotation rotation) {
return state.with(FACING, rotation.rotate(state.get(FACING)));
}

@Override
public BlockState mirror(BlockState state, BlockMirror mirror) {
return state.with(FACING, mirror.apply(state.get(FACING)));
}

@Override
public FluidState getFluidState(BlockState state) {
return state.get(WATERLOGGED) ? Fluids.WATER.getStill(false) : super.getFluidState(state);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package de.dafuqs.spectrum.blocks.deeper_down;

import de.dafuqs.revelationary.api.revelations.*;
import de.dafuqs.spectrum.*;
import de.dafuqs.spectrum.api.block.*;
import de.dafuqs.spectrum.registries.*;
import net.minecraft.block.*;
Expand Down Expand Up @@ -48,7 +47,7 @@ public BlockState getStateForExplosion(World world, BlockPos blockPos, BlockStat

@Override
public Identifier getCloakAdvancementIdentifier() {
return SpectrumCommon.locate("milestones/reveal_dragonbone");
return SpectrumAdvancements.REVEAL_DRAGONBONE;
}

@Override
Expand Down
Loading

0 comments on commit 53abece

Please sign in to comment.