Skip to content

Commit

Permalink
fix a client bug, expanded origins
Browse files Browse the repository at this point in the history
  • Loading branch information
IAFEnvoy committed Jan 2, 2025
1 parent 58bed02 commit 3798254
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 85 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Add some origins related to the animation.
| Origin | Impact | Advantages | Disadvantages |
|:----------|:-------|:---------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------|
| Ardoni | High | +10 Health **(Recommend Max Health Fix)** <br> Use song ability <br> Invulnerable to potions | Cannot use redstone <br> Cannot wear armor greater than leather <br> Cannot use elytra |
| Felina | Medium | Can climb <br> Speed and jump boost <br> Invulnerable to fall | Afraid of water <br> Cannot wear armor greater than iron |
| Felina | Medium | Can climb <br> Speed and jump boost <br> Invulnerable to fall | Afraid of water <br> Cannot wear armor greater than iron <br> Can only eat meat |
| Magnorite | High | Invulnerable to fire, lava and fall <br> Faster in lava <br> +10 Defense | Very afraid of water&cold <br> Cannot use elytra |
| Netharan | Low | Invulnerable to fire | Afraid of water&cold <br> Cannot use elytra |
| Glacian | Medium | Invulnerable to powder snow <br> +5 Defense | Afraid of hot |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import com.iafenvoy.sow.util.BookUtils;
import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.item.ItemStack;
Expand Down Expand Up @@ -42,8 +44,12 @@ protected void writeNbt(NbtCompound nbt) {
nbt.put("content", WotContents.CODEC.encodeStart(NbtOps.INSTANCE, this.contents).resultOrPartial(SongsOfWar.LOGGER::error).orElse(new NbtCompound()));
}

public WotContents getContents() {
@Environment(EnvType.CLIENT)
public void checkIfFulfilled(){
if (!this.fulfilled) ClientNetworkHelper.requestBlockEntityData(this.pos);
}

public WotContents getContents() {
return this.contents;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public WallsOfTimeBlockEntityRenderer(BlockEntityRendererFactory.Context ctx) {
@Override
public void render(WallsOfTimeBlockEntity entity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) {
matrices.push();
entity.checkIfFulfilled();
WallsOfTimeBlockEntity.WotContents contents = entity.getContents();
matrices.translate(0.5, 0.5, 0.5);
matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(180 - contents.getDirection().getHorizontal() * 90));
Expand Down
3 changes: 2 additions & 1 deletion common/src/main/resources/data/sow/origins/felina.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"sow:agile",
"sow:fall_invulnerable",
"sow:afraid_water",
"sow:felina_no_armor"
"sow:felina_no_armor",
"sow:carnivore"
],
"icon": "minecraft:cod",
"impact": 2,
Expand Down

This file was deleted.

33 changes: 33 additions & 0 deletions common/src/main/resources/data/sow/powers/carnivore.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"type": "origins:prevent_item_use",
"item_condition": {
"type": "origins:and",
"conditions": [
{
"type": "origins:or",
"conditions": [
{
"type": "origins:ingredient",
"ingredient": {
"tag": "origins:meat"
}
},
{
"type": "origins:meat"
}
],
"inverted": true
},
{
"type": "origins:food"
},
{
"type": "origins:ingredient",
"ingredient": {
"tag": "origins:ignore_diet"
},
"inverted": true
}
]
}
}
51 changes: 0 additions & 51 deletions common/src/main/resources/data/sow/powers/climbing.json

This file was deleted.

This file was deleted.

0 comments on commit 3798254

Please sign in to comment.