-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
546 additions
and
382 deletions.
There are no files selected for viewing
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
12 changes: 0 additions & 12 deletions
12
src/main/java/net/id/paradiselost/config/ModMenuConfig.java
This file was deleted.
Oops, something went wrong.
107 changes: 94 additions & 13 deletions
107
src/main/java/net/id/paradiselost/items/armor/ParadiseLostArmorMaterials.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 |
---|---|---|
@@ -1,23 +1,104 @@ | ||
package net.id.paradiselost.items.armor; | ||
|
||
import net.id.paradiselost.items.ParadiseLostItems; | ||
import net.id.paradiselost.items.utils.IngredientUtil; | ||
import net.id.paradiselost.mixin.item.ArmorMaterialsAccessor; | ||
import net.id.paradiselost.util.ParadiseLostSoundEvents; | ||
import net.minecraft.item.ArmorItem; | ||
import net.minecraft.item.ArmorMaterial; | ||
import net.minecraft.recipe.Ingredient; | ||
import net.minecraft.sound.SoundEvent; | ||
import net.minecraft.util.Lazy; | ||
import net.minecraft.util.StringIdentifiable; | ||
import net.minecraft.util.Util; | ||
|
||
import java.util.EnumMap; | ||
import java.util.function.Supplier; | ||
|
||
@SuppressWarnings("unused") | ||
public class ParadiseLostArmorMaterials { | ||
|
||
public static final ArmorMaterial OLVITE = ArmorMaterialsAccessor.callInit("PARADISE_LOST_OLVITE", -1, | ||
"paradise_lost_olvite", 15, new int[]{2, 4, 6, 2}, 9, ParadiseLostSoundEvents.ITEM_ARMOR_EQUIP_OLVITE, | ||
0f, 0f, IngredientUtil.itemIngredient(ParadiseLostItems.OLVITE)); | ||
public static final ArmorMaterial GLAZED_GOLD = ArmorMaterialsAccessor.callInit("PARADISE_LOST_GLAZED_GOLD", -1, | ||
"paradise_lost_glazed_gold", 14, new int[]{1, 3, 5, 2}, 25, ParadiseLostSoundEvents.ITEM_ARMOR_EQUIP_GLAZED_GOLD, | ||
0f, 0f, IngredientUtil.itemIngredient(ParadiseLostItems.GOLDEN_AMBER)); | ||
public static final ArmorMaterial SURTRUM = ArmorMaterialsAccessor.callInit("PARADISE_LOST_SURTRUM", -1, | ||
"paradise_lost_surtrum", 15, new int[]{2, 5, 6, 3}, 15, ParadiseLostSoundEvents.ITEM_ARMOR_EQUIP_SURTRUM, | ||
0f, 0.1f, IngredientUtil.itemIngredient(ParadiseLostItems.REFINED_SURTRUM)); | ||
public enum ParadiseLostArmorMaterials implements StringIdentifiable, ArmorMaterial { | ||
|
||
OLVITE("paradise_lost_olvite", 15, Util.make(new EnumMap<ArmorItem.Type, Integer>(ArmorItem.Type.class), (map) -> { | ||
map.put(ArmorItem.Type.BOOTS, 2); | ||
map.put(ArmorItem.Type.LEGGINGS, 4); | ||
map.put(ArmorItem.Type.CHESTPLATE, 6); | ||
map.put(ArmorItem.Type.HELMET, 2); | ||
}), 9, ParadiseLostSoundEvents.ITEM_ARMOR_EQUIP_OLVITE, 0.0F, 0.0F, () -> Ingredient.ofItems(ParadiseLostItems.OLVITE)), | ||
|
||
GLAZED_GOLD("paradise_lost_glazed_gold", 14, Util.make(new EnumMap<ArmorItem.Type, Integer>(ArmorItem.Type.class), (map) -> { | ||
map.put(ArmorItem.Type.BOOTS, 1); | ||
map.put(ArmorItem.Type.LEGGINGS, 3); | ||
map.put(ArmorItem.Type.CHESTPLATE, 5); | ||
map.put(ArmorItem.Type.HELMET, 2); | ||
}), 25, ParadiseLostSoundEvents.ITEM_ARMOR_EQUIP_GLAZED_GOLD, 0.0F, 0.0F, () -> Ingredient.ofItems(ParadiseLostItems.GOLDEN_AMBER)), | ||
|
||
SURTRUM("paradise_lost_surtrum", 15, Util.make(new EnumMap<ArmorItem.Type, Integer>(ArmorItem.Type.class), (map) -> { | ||
map.put(ArmorItem.Type.BOOTS, 2); | ||
map.put(ArmorItem.Type.LEGGINGS, 5); | ||
map.put(ArmorItem.Type.CHESTPLATE, 6); | ||
map.put(ArmorItem.Type.HELMET, 3); | ||
}), 15, ParadiseLostSoundEvents.ITEM_ARMOR_EQUIP_OLVITE, 0.0F, 0.1F, () -> Ingredient.ofItems(ParadiseLostItems.REFINED_SURTRUM)); | ||
|
||
// copied from base armor materials class | ||
|
||
private static final EnumMap<ArmorItem.Type, Integer> BASE_DURABILITY = Util.make(new EnumMap<ArmorItem.Type, Integer>(ArmorItem.Type.class), (map) -> { | ||
map.put(ArmorItem.Type.BOOTS, 13); | ||
map.put(ArmorItem.Type.LEGGINGS, 15); | ||
map.put(ArmorItem.Type.CHESTPLATE, 16); | ||
map.put(ArmorItem.Type.HELMET, 11); | ||
}); | ||
private final String name; | ||
private final int durabilityMultiplier; | ||
private final EnumMap<ArmorItem.Type, Integer> protectionAmounts; | ||
private final int enchantability; | ||
private final SoundEvent equipSound; | ||
private final float toughness; | ||
private final float knockbackResistance; | ||
private final Lazy<Ingredient> repairIngredientSupplier; | ||
|
||
ParadiseLostArmorMaterials(String name, int durabilityMultiplier, EnumMap protectionAmounts, int enchantability, SoundEvent equipSound, float toughness, float knockbackResistance, Supplier repairIngredientSupplier) { | ||
this.name = name; | ||
this.durabilityMultiplier = durabilityMultiplier; | ||
this.protectionAmounts = protectionAmounts; | ||
this.enchantability = enchantability; | ||
this.equipSound = equipSound; | ||
this.toughness = toughness; | ||
this.knockbackResistance = knockbackResistance; | ||
this.repairIngredientSupplier = new Lazy(repairIngredientSupplier); | ||
} | ||
|
||
public int getDurability(ArmorItem.Type type) { | ||
return (Integer)BASE_DURABILITY.get(type) * this.durabilityMultiplier; | ||
} | ||
|
||
public int getProtection(ArmorItem.Type type) { | ||
return (Integer)this.protectionAmounts.get(type); | ||
} | ||
|
||
public int getEnchantability() { | ||
return this.enchantability; | ||
} | ||
|
||
public SoundEvent getEquipSound() { | ||
return this.equipSound; | ||
} | ||
|
||
public Ingredient getRepairIngredient() { | ||
return (Ingredient)this.repairIngredientSupplier.get(); | ||
} | ||
|
||
public String getName() { | ||
return this.name; | ||
} | ||
|
||
public float getToughness() { | ||
return this.toughness; | ||
} | ||
|
||
public float getKnockbackResistance() { | ||
return this.knockbackResistance; | ||
} | ||
|
||
public String asString() { | ||
return this.name; | ||
} | ||
|
||
} |
11 changes: 0 additions & 11 deletions
11
src/main/java/net/id/paradiselost/mixin/client/MinecraftClientAccessor.java
This file was deleted.
Oops, something went wrong.
59 changes: 0 additions & 59 deletions
59
src/main/java/net/id/paradiselost/mixin/client/MinecraftClientMixin.java
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
src/main/java/net/id/paradiselost/mixin/client/render/ClientWorldPropertiesMixin.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,24 @@ | ||
package net.id.paradiselost.mixin.client.render; | ||
|
||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.id.paradiselost.world.dimension.ParadiseLostDimension; | ||
import net.minecraft.client.world.ClientWorld; | ||
import net.minecraft.world.HeightLimitView; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(ClientWorld.Properties.class) | ||
@Environment(EnvType.CLIENT) | ||
public class ClientWorldPropertiesMixin { | ||
|
||
@Inject(method = "getSkyDarknessHeight", at = @At("HEAD")) | ||
private void getSkyDarknessHeight(HeightLimitView world, CallbackInfoReturnable<Double> ci) { | ||
if (((ClientWorld) world).getRegistryKey() == ParadiseLostDimension.PARADISE_LOST_WORLD_KEY) { | ||
ci.setReturnValue(0.0D); | ||
} | ||
} | ||
|
||
} |
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
35 changes: 0 additions & 35 deletions
35
src/main/java/net/id/paradiselost/mixin/client/render/WorldRendererMixin.java
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
src/main/java/net/id/paradiselost/mixin/item/ArmorMaterialsAccessor.java
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
src/main/java/net/id/paradiselost/mixin/server/DimensionOptionsMixin.java
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -34,6 +34,6 @@ | |
"max_inclusive": 4, | ||
"min_inclusive": 1 | ||
} | ||
}, | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -45,6 +45,6 @@ | |
"max_inclusive": 6, | ||
"min_inclusive": 3 | ||
} | ||
}, | ||
} | ||
} | ||
} |
Oops, something went wrong.