Skip to content

Commit

Permalink
Git gut
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Nov 9, 2023
1 parent 1f7c7cb commit c72b4cc
Show file tree
Hide file tree
Showing 15 changed files with 212 additions and 79 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/mkdocs-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ jobs:
git config --global user.name Docs deploy
git config --global user.email [email protected]
mike set-default latest
mike deploy --push --update-aliases 0.5.x latest
mike deploy --push --update-aliases 0.6.x latest
52 changes: 31 additions & 21 deletions MODS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Mods using Polymer
A list of server-side Fabric/Quilt mods using Polymer, ordered alphabetically.
A list of server-side Fabric or Quilt mods using Polymer, ordered alphabetically.
*Some mods work best with Polymer's auto-generated resource pack: `/polymer generate-packs`*


Expand All @@ -21,15 +21,15 @@ into itself from any connected hopper chain.
- CurseForge: https://www.curseforge.com/minecraft/mc-mods/amazing-chest


## Biome Compass (1.19.2)
## Biome Compass (1.20.2 / latest)
*Biome Compass* adds a compass that works like [Nature's Compass](https://www.curseforge.com/minecraft/mc-mods/natures-compass), but is completely server-side!

### Links:
- GitHub: https://github.com/MayaqqDev/biome-compass
- Modrinth: https://modrinth.com/mod/biome-compass


## Brewery (1.20.1 / latest)
## Brewery (1.20.2 / latest)
*Brewery* allows you to create alcoholic and non-alcoholic drinks with cauldrons and barrels.
Aside from a few that are built-in, you can add any number of custom drinks with their own recipes and functionality
using datapacks. Additionally, this mod can work purely server side, allowing vanilla clients to join and use
Expand Down Expand Up @@ -60,7 +60,7 @@ introducing support for some new features while adding new content.
- Modrinth: https://modrinth.com/mod/dcdservback


## Eldritch Mobs (1.19.2)
## Eldritch Mobs (1.20.1)
*Eldritch Mobs* is a port of [AtomicStryker's Infernal Mobs](https://www.curseforge.com/minecraft/mc-mods/atomicstrykers-infernal-mobs).
This mod randomly imbues mobs in your world with powerful abilities that make them more challenging to fight.

Expand All @@ -70,7 +70,7 @@ This mod randomly imbues mobs in your world with powerful abilities that make th
- CurseForge: https://www.curseforge.com/minecraft/mc-mods/eldritch-mobs


## FabricAutoCrafter (1.20.1 / latest)
## FabricAutoCrafter (1.20.2 / latest)
*FabricAutoCrafter* adds a new block, the AutoCrafter.
It allows you to put items in the crafting table and get an output.
Hoppers and droppers do interact with the table.
Expand All @@ -89,7 +89,7 @@ Hoppers and droppers do interact with the table.
- Modrinth: https://modrinth.com/mod/polymer-ports-waystones


## Fishing 101 (1.20.1 / latest)
## Fishing 101 (1.20.1)
*Fishing 101* adds 23 new aquatic life forms to the game (items, not entities).

### Links:
Expand All @@ -108,7 +108,7 @@ or turn content mods on and off one by one to nail down that pesky bug.
- CurseForge: https://www.curseforge.com/minecraft/mc-mods/flashfreeze


## Get Off My Lawn ReServed (1.20.1 / latest)
## Get Off My Lawn ReServed (1.20.2 / latest)
*Get Off My Lawn ReServed* is a take on the popular concept of player claims for Survival/Freebuild servers.
This mod works fully server-side (no client mod required!) while being compatible with major Fabric modpacks.

Expand Down Expand Up @@ -156,7 +156,7 @@ of the Illagers before it's too late?
- CurseForge: https://www.curseforge.com/minecraft/mc-mods/interdimensional


## Jump Vader (1.20.1 / latest)
## Jump Vader (1.20.1)
*Jump Vader* is a mod that lets you place "Jump Vader" blocks similar to the OpenBlocks mod's elevators.
You simply place one above the other at any vertical distance, and jump/sneak on top of the block
to go between the different heights.
Expand All @@ -166,7 +166,7 @@ to go between the different heights.
- Modrinth: https://modrinth.com/mod/jumpvader


## Labyrinth (1.20.1 / latest)
## Labyrinth (1.20.1)
*Labyrinth* adds new weapons and a new custom crafting (forging) system!

### Links:
Expand All @@ -175,7 +175,7 @@ to go between the different heights.
- CurseForge: https://www.curseforge.com/minecraft/mc-mods/labyrinth


## LifeSteal (1.20.1 / latest)
## LifeSteal (1.20.2 / latest)
*LifeSteal* is an implementation of [LifeSteal SMP](https://store.lifestealsmp.com).
> We are a semi-vanilla Minecraft server with an additional feature where you can steal hearts from other players.
> When you kill another player, you receive their heart while they lose a heart.
Expand All @@ -187,7 +187,7 @@ to go between the different heights.
- CurseForge: https://www.curseforge.com/minecraft/mc-mods/lifesteal


## Lightning Podoboo (1.20.1 / latest)
## Lightning Podoboo (1.20.2 / latest)
*Lightning Podoboo* makes fire created by natural lightning cosmetic, meaning no blocks are destroyed from bad weather.
Keep the `doFireTick` gamerule enabled without worrying about random fire destroying your builds or nearby trees!

Expand All @@ -213,8 +213,7 @@ and a present threat.
- Modrinth: https://modrinth.com/mod/nox
- CurseForge: https://www.curseforge.com/minecraft/mc-mods/nox-a-mob-and-difficulty-overhaul


## Nox: Renoxed (1.20.1 / latest)
## Nox: Renoxed (1.20.2 / latest)
*Nox: Renoxed* is a continuation of *Nox* for Minecraft 1.20 and beyond.

### Links:
Expand All @@ -239,16 +238,27 @@ that lets players access their ender chest from anywhere.
- GitHub: https://github.com/NotNite/packy
- Modrinth: https://modrinth.com/mod/packy

## PolyFactory (1.20.2 / latest)
Ever wanted to play with tech mods, but people you play with don't want to install them?
Or maybe you are making a server, but vanilla gameplay isn't enough? If so, this project will be ideal for you!

PolyFactory is Fabric (and Quilt) server side modification powered by Polymer
which adds new mechanics, blocks and tools allowing for further automation,
processing and storage (or in simpler terms, it's a tech mod)!

### Links:
- GitHub: https://github.com/patbox/polyfactory
- Modrinth: https://modrinth.com/mod/polyfactory

## Polysit (1.20.1 / latest)
## Polysit (1.20.2 / latest)
*Polysit* allows you to right-click to sit on slabs or stairs.

### Links:
- GitHub: https://github.com/Modflower/polysit
- Modrinth: https://modrinth.com/mod/polysit


## Power Networks (1.20.1 / latest)
## Power Networks (1.20.2 / latest)
*Power Networks* adds coils and wires that the player can use to build energy transfer networks.
(does not include any energy producers or consumers)

Expand Down Expand Up @@ -312,7 +322,7 @@ and various blocks to speed up breeding and curing.
- CurseForge: https://www.curseforge.com/minecraft/mc-mods/simplevillagers


## Spice of Fabric (1.20.1 / latest)
## Spice of Fabric (1.20.2 / latest)
With *Spice of Fabric,* as you eat food, the nutrition value of the different kinds of food will decrease,
so you're forced to have a diverse diet.
By default, the last 20 meals are considered when calculating the nutrition values and the drop in the nutrition
Expand All @@ -337,15 +347,15 @@ for people who need vanilla physics) and adds multiple new minecarts with their
- CurseForge: https://www.curseforge.com/minecraft/mc-mods/tatercart


## Trinkets (Polymer Port) (1.20 / latest)
## Trinkets (Polymer Port) (1.20.2 / latest)
*Trinkets* is a data-driven accessory mod for Minecraft using Fabric.

### Links:
- GitHub: https://github.com/PolymerPorts/trinkets
- Modrinth: https://modrinth.com/mod/trinkets-polymer


## URLium (1.20.1 / latest)
## URLium (1.20.2 / latest)
*URLium* transmits redstone and blockstate data over HTTP(S) to a configurable URL.
Get data from the URLium Block, a Post Wand on any block, or Config Wand to turn
Chests, Lecterns, and Signs into HTTP-reporting blocks!
Expand All @@ -355,11 +365,11 @@ Chests, Lecterns, and Signs into HTTP-reporting blocks!

### Links:
- Github: https://github.com/JacobMunoz/urlium_1_20_1_public
- Modirnth: https://modrinth.com/mod/urlium
- Modrinth: https://modrinth.com/mod/urlium
- CurseForge: https://www.curseforge.com/minecraft/mc-mods/urlium


## Universal Graves (1.20.1 / latest)
## Universal Graves (1.20.2 / latest)
*Universal Graves* is a simple, but really customizable grave/death chest mod!
You can customize as you like, by modifying messages, blocks, and hologram texts,
how long graves will be protected, whether items should be dropped after expiring, etc.
Expand All @@ -370,7 +380,7 @@ how long graves will be protected, whether items should be dropped after expirin
- CurseForge: https://www.curseforge.com/minecraft/mc-mods/universal-graves


## Universal Shops (1.20.1 / latest)
## Universal Shops (1.20.2 / latest)
*Universal Shops* is a trade shop mod designed to be flexible and usable in many types of servers.
It includes craftable Trade Shop blocks for players and Admin Trade Shop blocks for admins/map makers. Setup of both is the same.
It also checks against Common Protection API to make sure players have access to source chests/containers.
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fabric_version=0.89.1+1.20.2

maven_group = eu.pb4

mod_version = 0.6.2
mod_version = 0.6.3

minecraft_version_supported = ">=1.20.2-"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,16 @@ public static boolean isPolymerServerItem(ItemStack itemStack, @Nullable ServerP
}
}

if (itemStack.getNbt().contains(BlockItem.BLOCK_ENTITY_TAG_KEY, NbtElement.COMPOUND_TYPE)
&& itemStack.getNbt().getCompound(BlockItem.BLOCK_ENTITY_TAG_KEY).contains("Items", NbtElement.LIST_TYPE)
) {
for (var itemNbt : itemStack.getNbt().getCompound(BlockItem.BLOCK_ENTITY_TAG_KEY).getList("Items", NbtElement.COMPOUND_TYPE)) {
if (isPolymerServerItem(ItemStack.fromNbt((NbtCompound) itemNbt), player)) {
return true;
}
}
}

if (CompatStatus.POLYMER_RESOURCE_PACK) {
var display = itemStack.getSubNbt("display");
if (display != null && display.contains("color", NbtElement.INT_TYPE)) {
Expand Down Expand Up @@ -434,6 +444,28 @@ public static ItemStack createItemStack(ItemStack itemStack, TooltipContext tool
e.printStackTrace();
}
}

try {
if (out.getNbt().contains(BlockItem.BLOCK_ENTITY_TAG_KEY, NbtElement.COMPOUND_TYPE)) {
var blockEntity = out.getNbt().getCompound(BlockItem.BLOCK_ENTITY_TAG_KEY);
if (blockEntity.contains("Items")) {
var list = blockEntity.getList("Items", NbtElement.COMPOUND_TYPE);
for (var i = 0; i < list.size(); i++) {
var itemNbt = list.getCompound(i);
var base = new NbtCompound();
var slot = itemNbt.get("Slot");
if (slot != null) {
base.put("Slot", slot);
}
list.set(i, getPolymerItemStack(ItemStack.fromNbt(itemNbt), tooltipContext, player).writeNbt(base));
}
}
}
} catch (Throwable e) {
if (PolymerImpl.LOG_MORE_ERRORS) {
e.printStackTrace();
}
}
} else {
if (itemStack.hasGlint()) {
var list = new NbtList();
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package eu.pb4.polymer.core.impl.interfaces;

import net.minecraft.nbt.NbtByte;
import net.minecraft.nbt.NbtElement;
import net.minecraft.nbt.NbtString;

public interface TypeAwareNbtCompound {
String MARKER_KEY = "$$polymer:type";

NbtString STACK_TYPE = NbtString.of( "item_stack");
NbtString STATE_TYPE = NbtString.of("block_state");
default void polymerCore$setType(NbtString type) {};
default NbtString polymerCore$getType() {
return null;
};
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
package eu.pb4.polymer.core.mixin.item;

import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import com.llamalad7.mixinextras.sugar.Local;
import eu.pb4.polymer.common.api.PolymerCommonUtils;
import eu.pb4.polymer.core.api.item.PolymerItemUtils;
import eu.pb4.polymer.core.api.utils.PolymerUtils;
import eu.pb4.polymer.core.impl.PolymerImpl;
import eu.pb4.polymer.core.impl.PolymerImplUtils;
import eu.pb4.polymer.core.impl.interfaces.ItemStackAwareNbtCompound;
import eu.pb4.polymer.core.impl.interfaces.TypeAwareNbtCompound;
import eu.pb4.polymer.core.impl.other.PolymerTooltipContext;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.registry.Registries;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -30,7 +24,7 @@ public class ItemStackMixin {

/*@ModifyReturnValue(method = "fromNbt(Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/item/ItemStack;", at = @At("RETURN"))
private static ItemStack polymerCore$swapToRealStack(ItemStack stack, @Local NbtCompound nbt) {
if (nbt.contains(ItemStackAwareNbtCompound.MARKER_KEY) && PolymerCommonUtils.isServerBound()) {
if (nbt.contains(TypeAwareNbtCompound.MARKER_KEY) && PolymerCommonUtils.isServerBound()) {
return PolymerItemUtils.getRealItemStack(stack);
}
Expand All @@ -43,7 +37,7 @@ public class ItemStackMixin {
var self = (ItemStack) (Object) this;
var player = PolymerUtils.getPlayerContext();
if (PolymerItemUtils.isPolymerServerItem(self, player)) {
((ItemStackAwareNbtCompound) nbt).polymerCore$setItemStack(true);
((TypeAwareNbtCompound) nbt).polymerCore$setType(TypeAwareNbtCompound.STACK_TYPE);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package eu.pb4.polymer.core.mixin.item;

import eu.pb4.polymer.core.impl.interfaces.ItemStackAwareNbtCompound;
import net.minecraft.item.ItemStack;
import eu.pb4.polymer.core.impl.interfaces.TypeAwareNbtCompound;
import net.minecraft.nbt.NbtCompound;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Inject;

@Mixin(NbtCompound.class)
public class NbtCompoundFallbackMixin implements ItemStackAwareNbtCompound {
public class NbtCompoundFallbackMixin implements TypeAwareNbtCompound {

}
Loading

0 comments on commit c72b4cc

Please sign in to comment.