Skip to content

Commit

Permalink
Added an item tag to prevent certain items from being absorbed by the…
Browse files Browse the repository at this point in the history
… paradox for #154
  • Loading branch information
Direwolf20-MC committed Sep 26, 2024
1 parent 9041ea7 commit 74127aa
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.21.1 2024-09-25T19:57:16.0643187 JustDireThings Item Tags
// 1.21.1 2024-09-25T22:41:05.4413696 JustDireThings Item Tags
c144a5adcf337b1e974a62a8dc0d8f29311210b4 data/c/tags/item/gems.json
55719b9c6f0430ad38bf081d697aa5406cc27cfb data/c/tags/item/ingots.json
d7ad09b1e8fb0835b7f14f744fa7866dd3521c60 data/c/tags/item/ingots/blazegold.json
Expand All @@ -23,6 +23,7 @@ efe9e0caf089100a228c46379f3aa70d7f602ddc data/justdirethings/tags/item/deny_fuel
eeef6ccb8e598e021db2f245fbdff673e3106bf6 data/justdirethings/tags/item/goo_revive_tier_2.json
2b5f0c660ffe0de7f842859234134966481a7dfa data/justdirethings/tags/item/goo_revive_tier_3.json
76917a9392dc09a91e434edafbe257771ad2b621 data/justdirethings/tags/item/goo_revive_tier_4.json
cfab2ab481bf476a645d326b87627918009b9e50 data/justdirethings/tags/item/paradox_deny.json
1c8b03c523f967d55db17d349712035ad95cb1cd data/minecraft/tags/item/axes.json
873813c87b7f12c654fdc3272d5a65755a12146d data/minecraft/tags/item/chest_armor.json
37c1e694624af60a6cd59abf99cd9ad69c0d16ca data/minecraft/tags/item/cluster_max_harvestables.json
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"minecraft:bedrock"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.direwolf20.justdirethings.client.particles.paradoxparticle.ParadoxParticleData;
import com.direwolf20.justdirethings.datagen.JustDireBlockTags;
import com.direwolf20.justdirethings.datagen.JustDireEntityTags;
import com.direwolf20.justdirethings.datagen.JustDireItemTags;
import com.direwolf20.justdirethings.setup.Registration;
import net.minecraft.client.Minecraft;
import net.minecraft.core.BlockPos;
Expand Down Expand Up @@ -211,6 +212,13 @@ private void handleItemsPostShrink(int targetRadius) {
}
}

private boolean isValidItem(ItemEntity entity) {
ItemStack itemStack = entity.getItem();
if (itemStack.is(JustDireItemTags.PARADOX_DENY))
return false;
return true;
}

private boolean isValidEntity(Entity entity) {
if (entity.isMultipartEntity())
return false;
Expand All @@ -229,6 +237,8 @@ private void handleItemAbsorption(int currentRadius) {
List<ItemEntity> items = level().getEntitiesOfClass(ItemEntity.class, getBoundingBox().inflate(currentRadius + 0.25f));

for (ItemEntity item : items) {
if (!isValidItem(item))
continue;
if (collapsing) break;
Vec3 itemPosition = item.position();
Vec3 direction = position().subtract(itemPosition).normalize().scale(itemSuckSpeed);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ private static TagKey<Item> forgeTag(String name) {
public static final TagKey<Item> GOO_REVIVE_TIER_2 = ItemTags.create(ResourceLocation.fromNamespaceAndPath(JustDireThings.MODID, "goo_revive_tier_2"));
public static final TagKey<Item> GOO_REVIVE_TIER_3 = ItemTags.create(ResourceLocation.fromNamespaceAndPath(JustDireThings.MODID, "goo_revive_tier_3"));
public static final TagKey<Item> GOO_REVIVE_TIER_4 = ItemTags.create(ResourceLocation.fromNamespaceAndPath(JustDireThings.MODID, "goo_revive_tier_4"));
public static final TagKey<Item> PARADOX_DENY = ItemTags.create(ResourceLocation.fromNamespaceAndPath(JustDireThings.MODID, "paradox_deny"));

@Override
protected void addTags(HolderLookup.Provider provider) {
Expand Down Expand Up @@ -208,7 +209,8 @@ protected void addTags(HolderLookup.Provider provider) {
.add(Registration.EclipseAlloyPickaxe.get())
.add(Registration.CelestigemPaxel.get())
.add(Registration.EclipseAlloyPaxel.get());

tag(PARADOX_DENY)
.add(Items.BEDROCK);
}

@Override
Expand Down

0 comments on commit 74127aa

Please sign in to comment.