Skip to content

Commit

Permalink
the game opens at least :)
Browse files Browse the repository at this point in the history
  • Loading branch information
MBatt1 committed Aug 13, 2024
1 parent 767102b commit f14a131
Show file tree
Hide file tree
Showing 44 changed files with 546 additions and 382 deletions.
10 changes: 1 addition & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ val trinketsVersion: String by properties
val crowdinTranslateVersion: String by properties
val entityAttributesVersion: String by properties
val modmenuVersion: String by properties
val reiVersion: String by properties
val satinVersion: String by properties
val clothConfigVersion: String by properties

Expand Down Expand Up @@ -155,14 +154,7 @@ dependencies {
name = "modmenu",
version = modmenuVersion,
)
// Adds a dependency on the base cardinal components module (required by every other module)
// Replace modImplementation with modApi if you expose components in your own API

// modRuntimeOnly(
// group = "me.shedaniel",
// name = "RoughlyEnoughItems-fabric",
// version = reiVersion,
// )


}

Expand Down
12 changes: 5 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ loaderVersion=0.15.11
javaVersion=17

fabricApiVersion=0.87.2+1.19.4
customportalapiVersion=0.0.1-beta63.5-1.19.X
cardinalComponentsVersion=5.0.1
trinketsVersion=3.4.0
customportalapiVersion=0.0.1-beta63-1.19.4
cardinalComponentsVersion=5.1.0
trinketsVersion=3.6.0
crowdinTranslateVersion=1.19.4
entityAttributesVersion=2.3.2
modmenuVersion=4.0.6
reiVersion=9.1.530
moreTagsVersion=3.0.5
clothConfigVersion=8.2.88
modmenuVersion=6.3.1
clothConfigVersion=10.1.117
12 changes: 0 additions & 12 deletions src/main/java/net/id/paradiselost/config/ModMenuConfig.java

This file was deleted.

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;
}

}

This file was deleted.

This file was deleted.

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);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
public abstract class InGameHudMixin {

@Shadow
protected abstract void renderOverlay(Identifier texture, float opacity);
protected abstract void renderOverlay(MatrixStack matrices, Identifier texture, float opacity);

@Inject(method = "renderHotbar", at = @At("HEAD"))
public void renderOverlay(float tickDelta, MatrixStack matrices, CallbackInfo ci) {
Expand All @@ -32,7 +32,7 @@ public void renderOverlay(float tickDelta, MatrixStack matrices, CallbackInfo ci
if (entity instanceof LivingEntity player) {
overlays.forEach(overlay -> {
if (overlay.renderPredicate().test(player)) {
renderOverlay(overlay.path(), overlay.opacityProvider().apply(player));
renderOverlay(matrices, overlay.path(), overlay.opacityProvider().apply(player));
}
});
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
"max_inclusive": 4,
"min_inclusive": 1
}
},
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@
"max_inclusive": 6,
"min_inclusive": 3
}
},
}
}
}
Loading

0 comments on commit f14a131

Please sign in to comment.