Skip to content

Commit

Permalink
made everything run properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Ellpeck committed Sep 26, 2024
1 parent 32baa11 commit c5e8935
Show file tree
Hide file tree
Showing 387 changed files with 649 additions and 599 deletions.
6 changes: 0 additions & 6 deletions src/generated/resources/data/curios/tags/items/belt.json

This file was deleted.

6 changes: 0 additions & 6 deletions src/generated/resources/data/curios/tags/items/charm.json

This file was deleted.

5 changes: 0 additions & 5 deletions src/generated/resources/data/curios/tags/items/necklace.json

This file was deleted.

5 changes: 0 additions & 5 deletions src/generated/resources/data/curios/tags/items/ring.json

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
}
]
]
}
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
}
]
]
}
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
}
]
]
}
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
}
]
]
}
}
}
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "neoforge:add_features",
"biomes": "#forge:is_sandy",
"biomes": "#c:is_sandy",
"features": "naturesaura:aura_cactus",
"step": "vegetal_decoration"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "neoforge:add_features",
"biomes": "#forge:is_mushroom",
"biomes": "#c:is_mushroom",
"features": "naturesaura:aura_mushroom",
"step": "vegetal_decoration"
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public BlockAnimalGenerator() {
}

@SubscribeEvent
public void onLivingUpdate(EntityTickEvent event) {
public void onLivingUpdate(EntityTickEvent.Post event) {
var entity = event.getEntity();
if (entity.level().isClientSide || entity.level().getGameTime() % 40 != 0 || !(entity instanceof Animal) || entity instanceof Npc)
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void writeNBT(CompoundTag compound, SaveType type, HolderLookup.Provider

public void readNBT(CompoundTag compound, SaveType type, HolderLookup.Provider registries) {
if (type != SaveType.BLOCK) {
super.loadWithComponents(compound, registries);
super.loadAdditional(compound, registries);
this.redstonePower = compound.getInt("redstone");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void render(BlockEntityAuraTimer tile, float partialTicks, PoseStack stac
var r = (type.getColor() >> 16 & 255) / 255F;
var g = (type.getColor() >> 8 & 255) / 255F;
var b = (type.getColor() & 255) / 255F;
this.model.renderToBuffer(stack, buffer.getBuffer(this.model.renderType(RenderAuraTimer.RES)), combinedLightIn, combinedOverlayIn, FastColor.ARGB32.colorFromFloat(r, g, b, 0.75F));
this.model.renderToBuffer(stack, buffer.getBuffer(this.model.renderType(RenderAuraTimer.RES)), combinedLightIn, combinedOverlayIn, FastColor.ARGB32.colorFromFloat(0.75F, r, g, b));
stack.popPose();

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static void renderGlint(PoseStack stack, MultiBufferSource buffer, ModelL
stack.translate(-0.002F + xOff, 1 + 0.002F + yOff, 1 + 0.002F + zOff);
stack.mulPose(Axis.XP.rotationDegrees(180F));
stack.scale(1.004F, 1.004F, 1.004F);
model.renderToBuffer(stack, buffer.getBuffer(model.renderType(texture)), brightness, combinedOverlayIn, FastColor.ARGB32.colorFromFloat(1, 1, 1, alpha * maxAlpha));
model.renderToBuffer(stack, buffer.getBuffer(model.renderType(texture)), brightness, combinedOverlayIn, FastColor.ARGB32.colorFromFloat(alpha * maxAlpha, 1, 1, 1));
stack.popPose();
}

Expand Down
10 changes: 7 additions & 3 deletions src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public void onLevelRender(RenderLevelStageEvent event) {
if (mc.getDebugOverlay().showDebugScreen() && (mc.player.isCreative() || mc.player.isSpectator()) && ModConfig.instance.debugLevel.get()) {
var playerEye = mc.player.getEyePosition(event.getPartialTick().getGameTimeDeltaPartialTick(true));
var playerView = mc.player.getViewVector(event.getPartialTick().getGameTimeDeltaPartialTick(true)).normalize();
var range = mc.gameMode.getDestroyStage();
var range = mc.player.blockInteractionRange();
var builder = tesselator.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR);
IAuraChunk.getSpotsInArea(mc.level, mc.player.blockPosition(), 64, (pos, spot) -> {
Helper.renderWeirdBox(builder, pos.getX(), pos.getY(), pos.getZ(), 1, 1, 1, spot > 0 ? 0F : 1F, spot > 0 ? 1F : 0F, 0F, 0.35F);
Expand All @@ -202,7 +202,9 @@ public void onLevelRender(RenderLevelStageEvent event) {
}

});
BufferUploader.drawWithShader(builder.build());
var data = builder.build();
if (data != null)
BufferUploader.drawWithShader(data);
}

// range visualizer
Expand All @@ -224,7 +226,9 @@ public void onLevelRender(RenderLevelStageEvent event) {
continue;
this.renderVisualize(builder, (IVisualizable) entity, mc.level, entity.blockPosition());
}
BufferUploader.drawWithShader(builder.build());
var data = builder.build();
if (data != null)
BufferUploader.drawWithShader(data);
RenderSystem.enableCull();
}

Expand Down
25 changes: 13 additions & 12 deletions src/main/java/de/ellpeck/naturesaura/gen/ModFeatures.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.data.worldgen.features.FeatureUtils;
import net.minecraft.data.worldgen.placement.PlacementUtils;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
Expand All @@ -25,13 +26,13 @@ public final class ModFeatures {

public static final class Configured {

public static final ResourceKey<ConfiguredFeature<?, ?>> ANCIENT_TREE = FeatureUtils.createKey(NaturesAura.MOD_ID + ":ancient_tree");
public static final ResourceKey<ConfiguredFeature<?, ?>> NETHER_WART_MUSHROOM = FeatureUtils.createKey(NaturesAura.MOD_ID + ":nether_wart_mushroom");
public static final ResourceKey<ConfiguredFeature<?, ?>> AURA_BLOOM = FeatureUtils.createKey(NaturesAura.MOD_ID + ":aura_bloom");
public static final ResourceKey<ConfiguredFeature<?, ?>> AURA_CACTUS = FeatureUtils.createKey(NaturesAura.MOD_ID + ":aura_cactus");
public static final ResourceKey<ConfiguredFeature<?, ?>> WARPED_AURA_MUSHROOM = FeatureUtils.createKey(NaturesAura.MOD_ID + ":warped_aura_mushroom");
public static final ResourceKey<ConfiguredFeature<?, ?>> CRIMSON_AURA_MUSHROOM = FeatureUtils.createKey(NaturesAura.MOD_ID + ":crimson_aura_mushroom");
public static final ResourceKey<ConfiguredFeature<?, ?>> AURA_MUSHROOM = FeatureUtils.createKey(NaturesAura.MOD_ID + ":aura_mushroom");
public static final ResourceKey<ConfiguredFeature<?, ?>> ANCIENT_TREE = ResourceKey.create(Registries.CONFIGURED_FEATURE, ResourceLocation.parse(NaturesAura.MOD_ID + ":ancient_tree"));
public static final ResourceKey<ConfiguredFeature<?, ?>> NETHER_WART_MUSHROOM = ResourceKey.create(Registries.CONFIGURED_FEATURE, ResourceLocation.parse(NaturesAura.MOD_ID + ":nether_wart_mushroom"));
public static final ResourceKey<ConfiguredFeature<?, ?>> AURA_BLOOM = ResourceKey.create(Registries.CONFIGURED_FEATURE, ResourceLocation.parse(NaturesAura.MOD_ID + ":aura_bloom"));
public static final ResourceKey<ConfiguredFeature<?, ?>> AURA_CACTUS = ResourceKey.create(Registries.CONFIGURED_FEATURE, ResourceLocation.parse(NaturesAura.MOD_ID + ":aura_cactus"));
public static final ResourceKey<ConfiguredFeature<?, ?>> WARPED_AURA_MUSHROOM = ResourceKey.create(Registries.CONFIGURED_FEATURE, ResourceLocation.parse(NaturesAura.MOD_ID + ":warped_aura_mushroom"));
public static final ResourceKey<ConfiguredFeature<?, ?>> CRIMSON_AURA_MUSHROOM = ResourceKey.create(Registries.CONFIGURED_FEATURE, ResourceLocation.parse(NaturesAura.MOD_ID + ":crimson_aura_mushroom"));
public static final ResourceKey<ConfiguredFeature<?, ?>> AURA_MUSHROOM = ResourceKey.create(Registries.CONFIGURED_FEATURE, ResourceLocation.parse(NaturesAura.MOD_ID + ":aura_mushroom"));

public static void bootstrap(BootstrapContext<ConfiguredFeature<?, ?>> context) {
FeatureUtils.register(context, ModFeatures.Configured.AURA_BLOOM, ModFeatures.AURA_BLOOM, NoneFeatureConfiguration.INSTANCE);
Expand All @@ -48,11 +49,11 @@ public static void bootstrap(BootstrapContext<ConfiguredFeature<?, ?>> context)

public static final class Placed {

public static final ResourceKey<PlacedFeature> AURA_BLOOM = PlacementUtils.createKey(NaturesAura.MOD_ID + ":aura_bloom");
public static final ResourceKey<PlacedFeature> AURA_CACTUS = PlacementUtils.createKey(NaturesAura.MOD_ID + ":aura_cactus");
public static final ResourceKey<PlacedFeature> WARPED_AURA_MUSHROOM = PlacementUtils.createKey(NaturesAura.MOD_ID + ":warped_aura_mushroom");
public static final ResourceKey<PlacedFeature> CRIMSON_AURA_MUSHROOM = PlacementUtils.createKey(NaturesAura.MOD_ID + ":crimson_aura_mushroom");
public static final ResourceKey<PlacedFeature> AURA_MUSHROOM = PlacementUtils.createKey(NaturesAura.MOD_ID + ":aura_mushroom");
public static final ResourceKey<PlacedFeature> AURA_BLOOM = ResourceKey.create(Registries.PLACED_FEATURE, ResourceLocation.parse(NaturesAura.MOD_ID + ":aura_bloom"));
public static final ResourceKey<PlacedFeature> AURA_CACTUS = ResourceKey.create(Registries.PLACED_FEATURE, ResourceLocation.parse(NaturesAura.MOD_ID + ":aura_cactus"));
public static final ResourceKey<PlacedFeature> WARPED_AURA_MUSHROOM = ResourceKey.create(Registries.PLACED_FEATURE, ResourceLocation.parse(NaturesAura.MOD_ID + ":warped_aura_mushroom"));
public static final ResourceKey<PlacedFeature> CRIMSON_AURA_MUSHROOM = ResourceKey.create(Registries.PLACED_FEATURE, ResourceLocation.parse(NaturesAura.MOD_ID + ":crimson_aura_mushroom"));
public static final ResourceKey<PlacedFeature> AURA_MUSHROOM = ResourceKey.create(Registries.PLACED_FEATURE, ResourceLocation.parse(NaturesAura.MOD_ID + ":aura_mushroom"));

public static void bootstrap(BootstrapContext<PlacedFeature> context) {
var holdergetter = context.lookup(Registries.CONFIGURED_FEATURE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.util.FastColor;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
Expand Down Expand Up @@ -69,7 +70,7 @@ public Component getName(ItemStack stack) {
@Override
@OnlyIn(Dist.CLIENT)
public ItemColor getItemColor() {
return (stack, tintIndex) -> tintIndex > 0 ? ItemAuraBottle.getType(stack).getColor() : 0xFFFFFF;
return (stack, tintIndex) -> tintIndex > 0 ? FastColor.ARGB32.opaque(ItemAuraBottle.getType(stack).getColor()) : 0xFFFFFFFF;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import net.minecraft.core.component.DataComponentType;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.util.FastColor;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.InteractionResultHolder;
Expand Down Expand Up @@ -119,10 +120,10 @@ public ItemColor getItemColor() {
if (tintIndex > 0) {
var color = ItemColorChanger.getStoredColor(stack);
if (color != null) {
return color.getFireworkColor();
return FastColor.ARGB32.opaque(color.getFireworkColor());
}
}
return 0xFFFFFF;
return 0xFFFFFFFF;
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.core.component.DataComponentType;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.FastColor;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.UseOnContext;
Expand Down Expand Up @@ -63,7 +64,7 @@ public Component getName(ItemStack stack) {
@Override
@OnlyIn(Dist.CLIENT)
public ItemColor getItemColor() {
return (stack, tintIndex) -> NaturesAuraAPI.EFFECT_POWDERS.getOrDefault(ItemEffectPowder.getEffect(stack), 0xFFFFFF);
return (stack, tintIndex) -> FastColor.ARGB32.opaque(NaturesAuraAPI.EFFECT_POWDERS.getOrDefault(ItemEffectPowder.getEffect(stack), 0xFFFFFF));
}

public record Data(String effect) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public ItemGoldFiber() {

@Override
public ItemColor getItemColor() {
return (stack, tintIndex) -> 0xF2FF00;
return (stack, tintIndex) -> 0xFFF2FF00;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public ItemPetReviver() {
private static class Events {

@SubscribeEvent
public void onEntityTick(EntityTickEvent event) {
public void onEntityTick(EntityTickEvent.Post event) {
var entity = event.getEntity();
if (entity.level().isClientSide || entity.level().getGameTime() % 20 != 0 || !(entity instanceof TamableAnimal tameable))
return;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/de/ellpeck/naturesaura/items/ModItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import net.minecraft.world.item.Item;

@SuppressWarnings("NonConstantFieldWithUpperCaseName")
@SuppressWarnings({"NonConstantFieldWithUpperCaseName", "FieldNamingConvention"})
public final class ModItems {

public static Item INFUSED_IRON_PICKAXE;
Expand Down Expand Up @@ -75,4 +75,5 @@ public final class ModItems {
public static Item DEPTH_CHEST;
public static Item DEPTH_PANTS;
public static Item DEPTH_SHOES;

}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public static void onAttack(LivingIncomingDamageEvent event) {
}

@SubscribeEvent
public static void update(PlayerTickEvent event) {
public static void update(PlayerTickEvent.Post event) {
var player = event.getEntity();
var speed = player.getAttribute(Attributes.MOVEMENT_SPEED);
var step = player.getAttribute(Attributes.STEP_HEIGHT);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Effect Powder",
"icon": "naturesaura:effect_powder{effect:'naturesaura:plant_boost'}",
"icon": "naturesaura:effect_powder[naturesaura:effect_powder_data={'effect':'naturesaura:plant_boost'}]",
"category": "naturesaura:effects",
"advancement": "naturesaura:positive_imbalance",
"priority": true,
Expand All @@ -14,4 +14,4 @@
"text": "To use it, simply placing a stack of any size down on the ground will cause it to either stop its effect or create it, depending on the type of powder used. The $(thing)range$() the effect will have in blocks is equal to the size of the stack placed down. Hitting it while it is on the ground will cause it to go back into its item form.$(p)Each effect that has an $(item)Effect Powder$() attached to it will show the recipe in its chapter."
}
]
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "This Book",
"icon": "patchouli:guide_book{'patchouli:book':'naturesaura:book'}",
"icon": "patchouli:guide_book[patchouli:book='naturesaura:book']",
"category": "naturesaura:intro",
"priority": true,
"pages": [
Expand All @@ -13,4 +13,4 @@
"text": "Additionally, to guide the user through the development of their research, some chapters will display $(thing)orange icons$(). These notify the reader of the next step they will have to take to advance their research further. Additionally, there is a direct link to the $(item)Advancement menu$() on the front page, which allows a greater overview of the overall progress."
}
]
}
}
Loading

0 comments on commit c5e8935

Please sign in to comment.