-
Notifications
You must be signed in to change notification settings - Fork 755
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Right now is just used for a spilling effect, not sure if I will do anything more with it in the future, but it felt wrong to not have it
- Loading branch information
1 parent
cfab09e
commit 76df1d5
Showing
13 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
src/generated/resources/data/forge/tags/fluids/powdered_snow.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"replace": false, | ||
"values": [ | ||
"tconstruct:powdered_snow" | ||
] | ||
} |
12 changes: 12 additions & 0 deletions
12
src/generated/resources/data/tconstruct/tinkering/spilling/powdered_snow.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"fluid": { | ||
"tag": "forge:powdered_snow", | ||
"amount": 100 | ||
}, | ||
"effects": [ | ||
{ | ||
"type": "tconstruct:set_freeze", | ||
"time": 160 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...a/slimeknights/tconstruct/library/modifiers/spilling/effects/SetFreezeSpillingEffect.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package slimeknights.tconstruct.library.modifiers.spilling.effects; | ||
|
||
import com.google.gson.JsonDeserializer; | ||
import com.google.gson.JsonObject; | ||
import com.google.gson.JsonSerializationContext; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.util.GsonHelper; | ||
import net.minecraft.world.entity.Entity; | ||
import net.minecraftforge.fluids.FluidStack; | ||
import slimeknights.tconstruct.TConstruct; | ||
import slimeknights.tconstruct.library.modifiers.spilling.ISpillingEffect; | ||
import slimeknights.tconstruct.library.tools.context.ToolAttackContext; | ||
import slimeknights.tconstruct.library.utils.JsonUtils; | ||
|
||
/** | ||
* Effect to set an entity freezing | ||
*/ | ||
public record SetFreezeSpillingEffect(int time) implements ISpillingEffect { | ||
public static final ResourceLocation ID = TConstruct.getResource("set_freeze"); | ||
|
||
@Override | ||
public void applyEffects(FluidStack fluid, float scale, ToolAttackContext context) { | ||
Entity target = context.getTarget(); | ||
if (target.canFreeze()) { | ||
target.setTicksFrozen(Math.max(target.getTicksRequiredToFreeze(), target.getTicksFrozen()) + time); | ||
target.setRemainingFireTicks(0); | ||
} | ||
} | ||
|
||
@Override | ||
public JsonObject serialize(JsonSerializationContext context) { | ||
JsonObject json = JsonUtils.withType(ID); | ||
json.addProperty("time", time); | ||
return json; | ||
} | ||
|
||
/** Loader for this effect */ | ||
public static final JsonDeserializer<SetFreezeSpillingEffect> LOADER = (element, type, context) -> | ||
new SetFreezeSpillingEffect(GsonHelper.getAsInt(element.getAsJsonObject(), "time")); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+332 Bytes
...main/resources/assets/tconstruct/textures/block/fluid/powdered_snow/flowing.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
src/main/resources/assets/tconstruct/textures/block/fluid/powdered_snow/flowing.png.mcmeta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"animation": { | ||
"frametime": 4 | ||
} | ||
} |
Binary file added
BIN
+205 Bytes
src/main/resources/assets/tconstruct/textures/block/fluid/powdered_snow/still.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.