Skip to content

Commit

Permalink
1.20.2 Port
Browse files Browse the repository at this point in the history
  • Loading branch information
FirstMegaGame4 committed Feb 11, 2024
1 parent 37b31d8 commit a48f70b
Show file tree
Hide file tree
Showing 41 changed files with 465 additions and 435 deletions.
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ dependencies {
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// MixinExtras
include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:${project.mixinextras_version}")))

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
}
Expand Down
19 changes: 10 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.4
loader_version=0.15.6
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.4
loader_version=0.15.6

# Mod Properties
mod_version=1.6-release
maven_group=com.mmodding.notenoughgamerules
archives_base_name=NEG-FABRIC-1.20.2
mod_version=1.6-release
maven_group=com.mmodding.notenoughgamerules
archives_base_name=NEG-FABRIC-1.20.2

# Dependencies
# check this on https://modmuss50.me/fabric.html
fabric_version=0.91.6+1.20.2
# check this on https://modmuss50.me/fabric.html
mixinextras_version=0.3.5
fabric_version=0.91.6+1.20.2
140 changes: 70 additions & 70 deletions src/main/java/com/mmodding/notenoughgamerules/Gamerules.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,75 +6,75 @@

public class Gamerules {

public static GameRules.Key<GameRules.BooleanRule> ALWAYS_SPAWN_DRAGON_EGG;
public static GameRules.Key<GameRules.BooleanRule> ANVIL_DAMAGE;
public static GameRules.Key<GameRules.BooleanRule> CAN_COPPER_OXIDE;
public static GameRules.Key<GameRules.BooleanRule> CAN_ENTITY_INTERACT_WITH_BLOCK;
public static GameRules.Key<GameRules.BooleanRule> CAN_ENTITY_INTERACT_WITH_ENTITIES;
public static GameRules.Key<GameRules.BooleanRule> CAN_ENTITY_INTERACT_WITH_WORLD;
public static GameRules.Key<GameRules.BooleanRule> CAN_HURT_PET_MOBS;
public static GameRules.Key<GameRules.BooleanRule> CAN_PLAYER_SLEEP;
public static GameRules.Key<GameRules.BooleanRule> CAN_PLAYER_TAKE_DAMAGE;
public static GameRules.Key<GameRules.BooleanRule> DISABLE_CHAT;
public static GameRules.Key<GameRules.BooleanRule> DISABLE_DIMENSION_CHANGE;
public static GameRules.Key<GameRules.BooleanRule> DISABLE_KNOCKBACK;
public static GameRules.Key<GameRules.BooleanRule> DISABLE_PISTONS;
public static GameRules.Key<GameRules.BooleanRule> DO_BABIES_SPAWN;
public static GameRules.Key<GameRules.BooleanRule> DO_CORAL_NEED_WATER;
public static GameRules.Key<GameRules.BooleanRule> DO_ICE_FORM;
public static GameRules.Key<GameRules.BooleanRule> DO_ICE_MELT;
public static GameRules.Key<GameRules.BooleanRule> DO_SNOW_FORM;
public static GameRules.Key<GameRules.BooleanRule> DO_SNOW_MELT;
public static GameRules.Key<GameRules.BooleanRule> DO_TRANSFORMATIONS;
public static GameRules.Key<GameRules.IntRule> DRAGON_BREATH_DAMAGE;
public static GameRules.Key<GameRules.IntRule> EXPLOSION_DAMAGE;
public static GameRules.Key<GameRules.BooleanRule> FALLING_BLOCKS_DAMAGE;
public static GameRules.Key<GameRules.BooleanRule> KEEP_EFFECTS;
public static GameRules.Key<GameRules.BooleanRule> KEEP_XP;
public static GameRules.Key<GameRules.IntRule> LIGHTNING_DAMAGE;
public static GameRules.Key<GameRules.IntRule> NATURAL_HUNGER;
public static GameRules.Key<GameRules.IntRule> POISON_HEALTH;
public static GameRules.Key<GameRules.BooleanRule> PVP;
public static GameRules.Key<GameRules.IntRule> RAW_MEAT_HUNGER;
public static GameRules.Key<GameRules.IntRule> SKY_HIGH;
public static GameRules.Key<GameRules.BooleanRule> STALACTITE_DAMAGE;
public static GameRules.Key<GameRules.BooleanRule> TNT_EXPLODES;
public static GameRules.Key<GameRules.IntRule> VILLAGER_CONVERSION;
public static GameRules.Key<GameRules.BooleanRule> ALWAYS_SPAWN_DRAGON_EGG;
public static GameRules.Key<GameRules.BooleanRule> ANVIL_DAMAGE;
public static GameRules.Key<GameRules.BooleanRule> CAN_COPPER_OXIDE;
public static GameRules.Key<GameRules.BooleanRule> CAN_ENTITY_INTERACT_WITH_BLOCK;
public static GameRules.Key<GameRules.BooleanRule> CAN_ENTITY_INTERACT_WITH_ENTITIES;
public static GameRules.Key<GameRules.BooleanRule> CAN_ENTITY_INTERACT_WITH_WORLD;
public static GameRules.Key<GameRules.BooleanRule> CAN_HURT_PET_MOBS;
public static GameRules.Key<GameRules.BooleanRule> CAN_PLAYER_SLEEP;
public static GameRules.Key<GameRules.BooleanRule> CAN_PLAYER_TAKE_DAMAGE;
public static GameRules.Key<GameRules.BooleanRule> DISABLE_CHAT;
public static GameRules.Key<GameRules.BooleanRule> DISABLE_DIMENSION_CHANGE;
public static GameRules.Key<GameRules.BooleanRule> DISABLE_KNOCKBACK;
public static GameRules.Key<GameRules.BooleanRule> DISABLE_PISTONS;
public static GameRules.Key<GameRules.BooleanRule> DO_BABIES_SPAWN;
public static GameRules.Key<GameRules.BooleanRule> DO_CORAL_NEED_WATER;
public static GameRules.Key<GameRules.BooleanRule> DO_ICE_FORM;
public static GameRules.Key<GameRules.BooleanRule> DO_ICE_MELT;
public static GameRules.Key<GameRules.BooleanRule> DO_SNOW_FORM;
public static GameRules.Key<GameRules.BooleanRule> DO_SNOW_MELT;
public static GameRules.Key<GameRules.BooleanRule> DO_TRANSFORMATIONS;
public static GameRules.Key<GameRules.IntRule> DRAGON_BREATH_DAMAGE;
public static GameRules.Key<GameRules.IntRule> EXPLOSION_DAMAGE;
public static GameRules.Key<GameRules.BooleanRule> FALLING_BLOCKS_DAMAGE;
public static GameRules.Key<GameRules.BooleanRule> KEEP_EFFECTS;
public static GameRules.Key<GameRules.BooleanRule> KEEP_XP;
public static GameRules.Key<GameRules.IntRule> LIGHTNING_DAMAGE;
public static GameRules.Key<GameRules.IntRule> NATURAL_HUNGER;
public static GameRules.Key<GameRules.IntRule> POISON_HEALTH;
public static GameRules.Key<GameRules.BooleanRule> PVP;
public static GameRules.Key<GameRules.IntRule> RAW_MEAT_HUNGER;
public static GameRules.Key<GameRules.IntRule> SKY_HIGH;
public static GameRules.Key<GameRules.BooleanRule> STALACTITE_DAMAGE;
public static GameRules.Key<GameRules.BooleanRule> TNT_EXPLODES;
public static GameRules.Key<GameRules.IntRule> VILLAGER_CONVERSION;

public static void setupGamerules() {
ALWAYS_SPAWN_DRAGON_EGG = GameRuleRegistry.register("alwaysSpawnDragonEgg", GameRules.Category.MOBS, GameRuleFactory.createBooleanRule(false));
ANVIL_DAMAGE = GameRuleRegistry.register("anvilDamage", GameRules.Category.PLAYER, GameRuleFactory.createBooleanRule(true));
CAN_COPPER_OXIDE = GameRuleRegistry.register("canCopperOxide", GameRules.Category.UPDATES, GameRuleFactory.createBooleanRule(true));
CAN_ENTITY_INTERACT_WITH_BLOCK = GameRuleRegistry.register("canEntityInteractWithBlock", GameRules.Category.MOBS, GameRuleFactory.createBooleanRule(true));
CAN_ENTITY_INTERACT_WITH_ENTITIES = GameRuleRegistry.register("canEntityInteractWithEntities", GameRules.Category.MOBS, GameRuleFactory.createBooleanRule(true));
CAN_ENTITY_INTERACT_WITH_WORLD = GameRuleRegistry.register("canEntityInteractWithWorld", GameRules.Category.MOBS, GameRuleFactory.createBooleanRule(true));
CAN_HURT_PET_MOBS = GameRuleRegistry.register("canHurtPetMobs", GameRules.Category.MOBS, GameRuleFactory.createBooleanRule(true));
CAN_PLAYER_SLEEP = GameRuleRegistry.register("canPlayerSleep", GameRules.Category.PLAYER, GameRuleFactory.createBooleanRule(true));
CAN_PLAYER_TAKE_DAMAGE = GameRuleRegistry.register("canPlayerTakeDamage", GameRules.Category.PLAYER, GameRuleFactory.createBooleanRule(true));
DISABLE_CHAT = GameRuleRegistry.register("disableChat", GameRules.Category.PLAYER, GameRuleFactory.createBooleanRule(false));
DISABLE_DIMENSION_CHANGE = GameRuleRegistry.register("disableDimensionChange", GameRules.Category.PLAYER, GameRuleFactory.createBooleanRule(false));
DISABLE_KNOCKBACK = GameRuleRegistry.register("disableKnockback", GameRules.Category.PLAYER, GameRuleFactory.createBooleanRule(false));
DISABLE_PISTONS = GameRuleRegistry.register("disablePistons", GameRules.Category.UPDATES, GameRuleFactory.createBooleanRule(false));
DO_BABIES_SPAWN = GameRuleRegistry.register("doBabiesSpawn", GameRules.Category.SPAWNING, GameRuleFactory.createBooleanRule(true));
DO_CORAL_NEED_WATER = GameRuleRegistry.register("doCoralNeedWater", GameRules.Category.UPDATES, GameRuleFactory.createBooleanRule(true));
DO_ICE_FORM = GameRuleRegistry.register("doIceForm", GameRules.Category.UPDATES, GameRuleFactory.createBooleanRule(true));
DO_ICE_MELT = GameRuleRegistry.register("doIceMelt", GameRules.Category.UPDATES, GameRuleFactory.createBooleanRule(true));
DO_SNOW_FORM = GameRuleRegistry.register("doSnowForm", GameRules.Category.UPDATES, GameRuleFactory.createBooleanRule(true));
DO_SNOW_MELT = GameRuleRegistry.register("doSnowMelt", GameRules.Category.UPDATES, GameRuleFactory.createBooleanRule(true));
DO_TRANSFORMATIONS = GameRuleRegistry.register("doTransformations", GameRules.Category.MOBS, GameRuleFactory.createBooleanRule(true));
DRAGON_BREATH_DAMAGE = GameRuleRegistry.register("dragonBreathDamage", GameRules.Category.PLAYER, GameRuleFactory.createIntRule(-1));
EXPLOSION_DAMAGE = GameRuleRegistry.register("explosionDamage", GameRules.Category.PLAYER, GameRuleFactory.createIntRule(-1));
FALLING_BLOCKS_DAMAGE = GameRuleRegistry.register("fallingBlocksDamage", GameRules.Category.PLAYER, GameRuleFactory.createBooleanRule(true));
KEEP_EFFECTS = GameRuleRegistry.register("keepEffects", GameRules.Category.PLAYER, GameRuleFactory.createBooleanRule(false));
KEEP_XP = GameRuleRegistry.register("keepXp", GameRules.Category.PLAYER, GameRuleFactory.createBooleanRule(false));
LIGHTNING_DAMAGE = GameRuleRegistry.register("lightningDamage", GameRules.Category.PLAYER, GameRuleFactory.createIntRule(-1));
NATURAL_HUNGER = GameRuleRegistry.register("naturalHunger", GameRules.Category.PLAYER, GameRuleFactory.createIntRule(-1));
POISON_HEALTH = GameRuleRegistry.register("poisonHealth", GameRules.Category.PLAYER, GameRuleFactory.createIntRule(1));
PVP = GameRuleRegistry.register("pvp", GameRules.Category.PLAYER, GameRuleFactory.createBooleanRule(true));
RAW_MEAT_HUNGER = GameRuleRegistry.register("rawMeatHunger", GameRules.Category.PLAYER, GameRuleFactory.createIntRule(30));
SKY_HIGH = GameRuleRegistry.register("skyHigh", GameRules.Category.MISC, GameRuleFactory.createIntRule(-64));
STALACTITE_DAMAGE = GameRuleRegistry.register("stalactiteDamage", GameRules.Category.PLAYER, GameRuleFactory.createBooleanRule(true));
TNT_EXPLODES = GameRuleRegistry.register("tntExplodes", GameRules.Category.MISC, GameRuleFactory.createBooleanRule(true));
VILLAGER_CONVERSION = GameRuleRegistry.register("villagerConversion", GameRules.Category.MOBS, GameRuleFactory.createIntRule(50));
}
public static void setupGamerules() {
ALWAYS_SPAWN_DRAGON_EGG = GameRuleRegistry.register("alwaysSpawnDragonEgg", GameRules.Category.MOBS, GameRuleFactory.createBooleanRule(false));
ANVIL_DAMAGE = GameRuleRegistry.register("anvilDamage", GameRules.Category.PLAYER, GameRuleFactory.createBooleanRule(true));
CAN_COPPER_OXIDE = GameRuleRegistry.register("canCopperOxide", GameRules.Category.UPDATES, GameRuleFactory.createBooleanRule(true));
CAN_ENTITY_INTERACT_WITH_BLOCK = GameRuleRegistry.register("canEntityInteractWithBlock", GameRules.Category.MOBS, GameRuleFactory.createBooleanRule(true));
CAN_ENTITY_INTERACT_WITH_ENTITIES = GameRuleRegistry.register("canEntityInteractWithEntities", GameRules.Category.MOBS, GameRuleFactory.createBooleanRule(true));
CAN_ENTITY_INTERACT_WITH_WORLD = GameRuleRegistry.register("canEntityInteractWithWorld", GameRules.Category.MOBS, GameRuleFactory.createBooleanRule(true));
CAN_HURT_PET_MOBS = GameRuleRegistry.register("canHurtPetMobs", GameRules.Category.MOBS, GameRuleFactory.createBooleanRule(true));
CAN_PLAYER_SLEEP = GameRuleRegistry.register("canPlayerSleep", GameRules.Category.PLAYER, GameRuleFactory.createBooleanRule(true));
CAN_PLAYER_TAKE_DAMAGE = GameRuleRegistry.register("canPlayerTakeDamage", GameRules.Category.PLAYER, GameRuleFactory.createBooleanRule(true));
DISABLE_CHAT = GameRuleRegistry.register("disableChat", GameRules.Category.PLAYER, GameRuleFactory.createBooleanRule(false));
DISABLE_DIMENSION_CHANGE = GameRuleRegistry.register("disableDimensionChange", GameRules.Category.PLAYER, GameRuleFactory.createBooleanRule(false));
DISABLE_KNOCKBACK = GameRuleRegistry.register("disableKnockback", GameRules.Category.PLAYER, GameRuleFactory.createBooleanRule(false));
DISABLE_PISTONS = GameRuleRegistry.register("disablePistons", GameRules.Category.UPDATES, GameRuleFactory.createBooleanRule(false));
DO_BABIES_SPAWN = GameRuleRegistry.register("doBabiesSpawn", GameRules.Category.SPAWNING, GameRuleFactory.createBooleanRule(true));
DO_CORAL_NEED_WATER = GameRuleRegistry.register("doCoralNeedWater", GameRules.Category.UPDATES, GameRuleFactory.createBooleanRule(true));
DO_ICE_FORM = GameRuleRegistry.register("doIceForm", GameRules.Category.UPDATES, GameRuleFactory.createBooleanRule(true));
DO_ICE_MELT = GameRuleRegistry.register("doIceMelt", GameRules.Category.UPDATES, GameRuleFactory.createBooleanRule(true));
DO_SNOW_FORM = GameRuleRegistry.register("doSnowForm", GameRules.Category.UPDATES, GameRuleFactory.createBooleanRule(true));
DO_SNOW_MELT = GameRuleRegistry.register("doSnowMelt", GameRules.Category.UPDATES, GameRuleFactory.createBooleanRule(true));
DO_TRANSFORMATIONS = GameRuleRegistry.register("doTransformations", GameRules.Category.MOBS, GameRuleFactory.createBooleanRule(true));
DRAGON_BREATH_DAMAGE = GameRuleRegistry.register("dragonBreathDamage", GameRules.Category.PLAYER, GameRuleFactory.createIntRule(-1));
EXPLOSION_DAMAGE = GameRuleRegistry.register("explosionDamage", GameRules.Category.PLAYER, GameRuleFactory.createIntRule(-1));
FALLING_BLOCKS_DAMAGE = GameRuleRegistry.register("fallingBlocksDamage", GameRules.Category.PLAYER, GameRuleFactory.createBooleanRule(true));
KEEP_EFFECTS = GameRuleRegistry.register("keepEffects", GameRules.Category.PLAYER, GameRuleFactory.createBooleanRule(false));
KEEP_XP = GameRuleRegistry.register("keepXp", GameRules.Category.PLAYER, GameRuleFactory.createBooleanRule(false));
LIGHTNING_DAMAGE = GameRuleRegistry.register("lightningDamage", GameRules.Category.PLAYER, GameRuleFactory.createIntRule(-1));
NATURAL_HUNGER = GameRuleRegistry.register("naturalHunger", GameRules.Category.PLAYER, GameRuleFactory.createIntRule(-1));
POISON_HEALTH = GameRuleRegistry.register("poisonHealth", GameRules.Category.PLAYER, GameRuleFactory.createIntRule(1));
PVP = GameRuleRegistry.register("pvp", GameRules.Category.PLAYER, GameRuleFactory.createBooleanRule(true));
RAW_MEAT_HUNGER = GameRuleRegistry.register("rawMeatHunger", GameRules.Category.PLAYER, GameRuleFactory.createIntRule(30));
SKY_HIGH = GameRuleRegistry.register("skyHigh", GameRules.Category.MISC, GameRuleFactory.createIntRule(-64));
STALACTITE_DAMAGE = GameRuleRegistry.register("stalactiteDamage", GameRules.Category.PLAYER, GameRuleFactory.createBooleanRule(true));
TNT_EXPLODES = GameRuleRegistry.register("tntExplodes", GameRules.Category.MISC, GameRuleFactory.createBooleanRule(true));
VILLAGER_CONVERSION = GameRuleRegistry.register("villagerConversion", GameRules.Category.MOBS, GameRuleFactory.createIntRule(50));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

public class NEGDamageTypes {

public static final RegistryKey<DamageType> SKY_HIGH = RegistryKey.of(RegistryKeys.DAMAGE_TYPE, NotEnoughGamerules.createId("sky_high"));
public static final RegistryKey<DamageType> DIFFERED_EXPLOSION = RegistryKey.of(RegistryKeys.DAMAGE_TYPE, NotEnoughGamerules.createId("differed_explosion"));
public static final RegistryKey<DamageType> SKY_HIGH = RegistryKey.of(RegistryKeys.DAMAGE_TYPE, NotEnoughGamerules.createId("sky_high"));
public static final RegistryKey<DamageType> DIFFERED_EXPLOSION = RegistryKey.of(RegistryKeys.DAMAGE_TYPE, NotEnoughGamerules.createId("differed_explosion"));

public static void register(Registry<DamageType> damageTypeRegistry) {
Registry.register(damageTypeRegistry, NEGDamageTypes.SKY_HIGH, new DamageType("skyHigh", DamageScaling.ALWAYS, 0.1f));
Registry.register(damageTypeRegistry, NEGDamageTypes.DIFFERED_EXPLOSION, new DamageType("explosion", DamageScaling.ALWAYS, 0.1f));
}
public static void register(Registry<DamageType> damageTypeRegistry) {
Registry.register(damageTypeRegistry, NEGDamageTypes.SKY_HIGH, new DamageType("skyHigh", DamageScaling.ALWAYS, 0.1f));
Registry.register(damageTypeRegistry, NEGDamageTypes.DIFFERED_EXPLOSION, new DamageType("explosion", DamageScaling.ALWAYS, 0.1f));
}
}
Loading

0 comments on commit a48f70b

Please sign in to comment.