Skip to content

Commit

Permalink
UDOC-0 - Add ability to milk squids
Browse files Browse the repository at this point in the history
  • Loading branch information
telvarost committed May 13, 2024
1 parent e11e84c commit 63d5130
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ All fixes are disabled by default. You will need ModMenu and GlassConfigAPI to e
* Hide/Show Dead Shrubs
* Hide/Show Long Grass
* Hoe Grass For Seeds
* Milk Squids
* Minecart Boosters
* Have Pigs Drop Brown Mushrooms
* Punch Sheep For Wool
Expand Down
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ dependencies {
modImplementation "net.modificationstation:StationAPI:${project.stapi_version}"

// Optional, but convenient mods for mod creators and users alike.
modImplementation("com.github.DanyGames2014:spawneggs:55a2b88f20") {
transitive false
}
modImplementation("com.github.calmilamsy:ModMenu:${project.modmenu_version}") {
transitive false
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ yarn_mappings=b1.7.3-build.2
loader_version=0.14.24-babric.1

# Mod Properties
mod_version=2.1.0
mod_version=2.2.0
maven_group=com.github.telvarost
archives_base_name=BetaTweaks

Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/github/telvarost/betatweaks/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ public static class ConfigFields {
@ValueOnVanillaServer(booleanValue = TriBoolean.FALSE)
public Boolean hoeGrassForSeeds = false;

@ConfigName("Milk Squids")
@MultiplayerSynced
@ValueOnVanillaServer(booleanValue = TriBoolean.FALSE)
public Boolean milkSquids = false;

@ConfigName("Minecart Boosters")
@MultiplayerSynced
@ValueOnVanillaServer(booleanValue = TriBoolean.FALSE)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.github.telvarost.betatweaks.mixin;

import com.github.telvarost.betatweaks.Config;
import net.minecraft.entity.player.PlayerBase;
import net.minecraft.entity.swimming.Squid;
import net.minecraft.entity.swimming.SwimmingBase;
import net.minecraft.item.ItemBase;
import net.minecraft.item.ItemInstance;
import net.minecraft.level.Level;
import org.spongepowered.asm.mixin.Mixin;

@Mixin(Squid.class)
public class SquidMixin extends SwimmingBase {
public SquidMixin(Level arg) {
super(arg);
}

@Override
public boolean interact(PlayerBase arg) {
if (Config.config.milkSquids) {
ItemInstance var2 = arg.inventory.getHeldItem();
if (var2 != null && var2.itemId == ItemBase.bucket.id) {
arg.inventory.setInventoryItem(arg.inventory.selectedHotbarSlot, new ItemInstance(ItemBase.milk));
return true;
} else {
return false;
}
} else {
return false;
}
}
}
1 change: 1 addition & 0 deletions src/main/resources/betatweaks.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"PlayerBaseMixin",
"PlayerContainerMixin",
"SheepMixin",
"SquidMixin",
"TallGrassMixin",
"TntMixin"
],
Expand Down

0 comments on commit 63d5130

Please sign in to comment.