Skip to content

Commit

Permalink
Added safety mechanism
Browse files Browse the repository at this point in the history
+Added safety mechanism that stops the initial value of an attribute being set to below it's minimum value when being added to an entity's attribute container.
*Incremented version
  • Loading branch information
CleverNucleus committed Sep 22, 2021
1 parent 9c17d87 commit cf84a11
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.11.6

# Mod Properties
mod_version = 1.0.4
mod_version = 1.0.5
maven_group = com.github.clevernucleus
archives_base_name = dataattributes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public final class DataAttributes implements ModInitializer {
public static final LoaderJsonManager MANAGER = new LoaderJsonManager();
public static final Identifier SYNC = new Identifier(API.MODID, "sync");
/** Manual; ugh, I know. */
public static final String VERSION = "1.0.4";
public static final String VERSION = "1.0.5";

private static void loginQueryStart(ServerLoginNetworkHandler handler, MinecraftServer server, PacketSender sender, ServerLoginNetworking.LoginSynchronizer synchronizer) {
PacketByteBuf buf = PacketByteBufs.create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ public void buildContainer(DefaultAttributeContainer.Builder builderIn, DefaultA
if(attribute == null) continue;

double value = this.attributes.get(identifier);
double clamp = attribute.clamp(value);

builderIn.add(attribute, value);
builderIn.add(attribute, clamp);
}
}

Expand Down

0 comments on commit cf84a11

Please sign in to comment.