1
0
mirror of https://github.com/chylex/Hardcore-Ender-Expansion-2.git synced 2025-09-15 23:32:08 +02:00

2 Commits

Author SHA1 Message Date
32ea34fa0c SHELF 2021-01-15 18:42:49 +01:00
2ab4659da5 [WIP] Tomb Dungeon 2021-01-15 18:40:13 +01:00
54 changed files with 2995 additions and 0 deletions

1
.gitignore vendored
View File

@@ -14,6 +14,7 @@ out
!.idea/kotlinc.xml
!.idea/statistic.xml
!.idea/vcs.xml
!.idea/shelf
# eclipse
bin

4
.idea/shelf/Datagen_Recipes.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<changelist name="Datagen_Recipes" date="1601734824200" recycled="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Datagen_Recipes/shelved.patch" />
<option name="DESCRIPTION" value="Datagen Recipes" />
</changelist>

View File

@@ -0,0 +1,79 @@
Index: data/src/main/java/chylex/hee/datagen/DataGen.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
<+>package chylex.hee.datagen\nimport chylex.hee.HEE\nimport chylex.hee.datagen.client.BlockItemModels\nimport chylex.hee.datagen.client.BlockModels\nimport chylex.hee.datagen.client.BlockStates\nimport chylex.hee.datagen.client.ItemModels\nimport chylex.hee.system.forge.SubscribeAllEvents\nimport chylex.hee.system.forge.SubscribeEvent\nimport net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus.MOD\nimport net.minecraftforge.fml.event.lifecycle.GatherDataEvent\n\n@SubscribeAllEvents(modid = HEE.ID, bus = MOD)\nobject DataGen{\n\t@SubscribeEvent\n\tfun register(e: GatherDataEvent){\n\t\tval modid = HEE.ID\n\t\tval helper = e.existingFileHelper\n\t\t\n\t\twith(e.generator){\n\t\t\tif (e.includeClient()){\n\t\t\t\taddProvider(BlockStates(this, modid, helper))\n\t\t\t\taddProvider(BlockModels(this, modid, helper))\n\t\t\t\taddProvider(BlockItemModels(this, modid, helper))\n\t\t\t\taddProvider(ItemModels(this, modid, helper))\n\t\t\t}\n\t\t}\n\t}\n}\n
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- a/data/src/main/java/chylex/hee/datagen/DataGen.kt (revision f8888e0a3b33898551301124a0879cea12fc1f06)
+++ b/data/src/main/java/chylex/hee/datagen/DataGen.kt (date 1601732788951)
@@ -4,6 +4,7 @@
import chylex.hee.datagen.client.BlockModels
import chylex.hee.datagen.client.BlockStates
import chylex.hee.datagen.client.ItemModels
+import chylex.hee.datagen.server.Recipes
import chylex.hee.system.forge.SubscribeAllEvents
import chylex.hee.system.forge.SubscribeEvent
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus.MOD
@@ -23,6 +24,10 @@
addProvider(BlockItemModels(this, modid, helper))
addProvider(ItemModels(this, modid, helper))
}
+
+ if (e.includeServer()){
+ addProvider(Recipes(this))
+ }
}
}
}
Index: data/src/main/java/chylex/hee/datagen/server/Recipes.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- /dev/null (date 1601733265753)
+++ b/data/src/main/java/chylex/hee/datagen/server/Recipes.kt (date 1601733265753)
@@ -0,0 +1,15 @@
+package chylex.hee.datagen.server
+import chylex.hee.datagen.server.util.ingredients
+import chylex.hee.datagen.server.util.shapeless
+import chylex.hee.init.ModItems
+import net.minecraft.data.DataGenerator
+import net.minecraft.data.IFinishedRecipe
+import net.minecraft.data.RecipeProvider
+import net.minecraft.item.Items
+import java.util.function.Consumer
+
+class Recipes(generator: DataGenerator) : RecipeProvider(generator){
+ override fun registerRecipes(consumer: Consumer<IFinishedRecipe>) = with(consumer){
+ shapeless(ModItems.ALTERATION_NEXUS, 1){ ingredients(Items.DIAMOND, Items.ENDER_EYE, ModItems.ANCIENT_DUST, ModItems.ETHEREUM) }
+ }
+}
Index: data/src/main/java/chylex/hee/datagen/server/util/RecipeProviderExt.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- /dev/null (date 1601733249382)
+++ b/data/src/main/java/chylex/hee/datagen/server/util/RecipeProviderExt.kt (date 1601733249382)
@@ -0,0 +1,20 @@
+package chylex.hee.datagen.server.util
+import net.minecraft.data.IFinishedRecipe
+import net.minecraft.data.ShapedRecipeBuilder
+import net.minecraft.data.ShapelessRecipeBuilder
+import net.minecraft.util.IItemProvider
+import java.util.function.Consumer
+
+fun Consumer<IFinishedRecipe>.shaped(result: IItemProvider, amount: Int, callback: ShapedRecipeBuilder.() -> Unit){
+ ShapedRecipeBuilder(result, amount).apply(callback).build(this)
+}
+
+fun Consumer<IFinishedRecipe>.shapeless(result: IItemProvider, amount: Int, callback: ShapelessRecipeBuilder.() -> Unit){
+ ShapelessRecipeBuilder(result, amount).apply(callback).build(this)
+}
+
+fun ShapelessRecipeBuilder.ingredients(vararg ingredients: IItemProvider){
+ for(ingredient in ingredients){
+ this.addIngredient(ingredient)
+ }
+}

4
.idea/shelf/Development3.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<changelist name="Development3" date="1601983889370" recycled="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Development3/shelved.patch" />
<option name="DESCRIPTION" value="Development" />
</changelist>

18
.idea/shelf/Development3/shelved.patch generated Normal file

File diff suppressed because one or more lines are too long

4
.idea/shelf/Dust.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<changelist name="Dust" date="1590783410567" recycled="false">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Dust/shelved.patch" />
<option name="DESCRIPTION" value="Dust" />
</changelist>

210
.idea/shelf/Dust/shelved.patch generated Normal file

File diff suppressed because one or more lines are too long

4
.idea/shelf/EnderEyeAttack_kt.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<changelist name="EnderEyeAttack_kt" date="1601761992769" recycled="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/EnderEyeAttack_kt/shelved.patch" />
<option name="DESCRIPTION" value="EnderEyeAttack.kt" />
</changelist>

File diff suppressed because one or more lines are too long

4
.idea/shelf/Ender_Eye.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<changelist name="Ender_Eye" date="1595119986895" recycled="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Ender_Eye/shelved.patch" />
<option name="DESCRIPTION" value="Ender Eye" />
</changelist>

69
.idea/shelf/Ender_Eye/shelved.patch generated Normal file

File diff suppressed because one or more lines are too long

4
.idea/shelf/Ender_Eye_Stuff.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<changelist name="Ender_Eye_Stuff" date="1601351827334" recycled="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Ender_Eye_Stuff/shelved.patch" />
<option name="DESCRIPTION" value="Ender Eye Stuff" />
</changelist>

172
.idea/shelf/Ender_Eye_Stuff/shelved.patch generated Normal file

File diff suppressed because one or more lines are too long

4
.idea/shelf/Eye.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<changelist name="Eye" date="1605472809585" recycled="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Eye/shelved.patch" />
<option name="DESCRIPTION" value="Eye" />
</changelist>

723
.idea/shelf/Eye/shelved.patch generated Normal file

File diff suppressed because one or more lines are too long

4
.idea/shelf/Ideas.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<changelist name="Ideas" date="1595089578362" recycled="false">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Ideas/shelved.patch" />
<option name="DESCRIPTION" value="Ideas" />
</changelist>

54
.idea/shelf/Ideas/shelved.patch generated Normal file

File diff suppressed because one or more lines are too long

4
.idea/shelf/Later.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<changelist name="Later" date="1579750352473" recycled="false">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Later/shelved.patch" />
<option name="DESCRIPTION" value="Later" />
</changelist>

36
.idea/shelf/Later/shelved.patch generated Normal file

File diff suppressed because one or more lines are too long

4
.idea/shelf/Later1.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<changelist name="Later1" date="1607753523089" recycled="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Later1/shelved.patch" />
<option name="DESCRIPTION" value="Later" />
</changelist>

81
.idea/shelf/Later1/shelved.patch generated Normal file

File diff suppressed because one or more lines are too long

4
.idea/shelf/Later2.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<changelist name="Later2" date="1610732422264" recycled="false">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Later2/shelved.patch" />
<option name="DESCRIPTION" value="Later" />
</changelist>

19
.idea/shelf/Later2/shelved.patch generated Normal file
View File

@@ -0,0 +1,19 @@
Index: src/system/src/main/java/chylex/hee/game/entity/EntitySelector.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
<+>package chylex.hee.game.entity\n\nimport chylex.hee.system.math.square\nimport net.minecraft.entity.Entity\nimport net.minecraft.util.math.AxisAlignedBB\nimport net.minecraft.util.math.Vec3d\nimport net.minecraft.world.IEntityReader\nimport java.util.function.Predicate\n\n@Suppress(\"NOTHING_TO_INLINE\")\nclass EntitySelector(private val world: IEntityReader, private val predicate: Predicate<in Entity>) {\n\tfun <T : Entity> inBox(cls: Class<T>, aabb: AxisAlignedBB): List<T> {\n\t\treturn world.getEntitiesWithinAABB(cls, aabb, predicate)\n\t}\n\t\n\tfun <T : Entity> inRange(cls: Class<T>, point: Vec3d, range: Double): List<T> {\n\t\tval aabb = AxisAlignedBB(point.x - range, point.y - range, point.z - range, point.x + range, point.y + range, point.z + range)\n\t\tval rangeSq = square(range)\n\t\t\n\t\treturn world.getEntitiesWithinAABB(cls, aabb) { predicate.test(it) && it!!.posVec.squareDistanceTo(point) <= rangeSq }\n\t}\n\t\n\t// Reified\n\t\n\tinline fun <reified T : Entity> inBox(aabb: AxisAlignedBB) = inBox(T::class.java, aabb)\n\tinline fun <reified T : Entity> inRange(point: Vec3d, range: Double) = inRange(T::class.java, point, range)\n\t\n\t// General\n\t\n\tinline fun allInBox(aabb: AxisAlignedBB) = inBox(Entity::class.java, aabb)\n\tinline fun allInRange(point: Vec3d, range: Double) = inRange(Entity::class.java, point, range)\n}\n
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/system/src/main/java/chylex/hee/game/entity/EntitySelector.kt b/src/system/src/main/java/chylex/hee/game/entity/EntitySelector.kt
--- a/src/system/src/main/java/chylex/hee/game/entity/EntitySelector.kt (revision 276df769798cbd4fd8154c5ebca0001dd8639545)
+++ b/src/system/src/main/java/chylex/hee/game/entity/EntitySelector.kt (date 1609259090000)
@@ -20,6 +20,8 @@
return world.getEntitiesWithinAABB(cls, aabb) { predicate.test(it) && it!!.posVec.squareDistanceTo(point) <= rangeSq }
}
+ // TODO only loaded? fuck
+
// Reified
inline fun <reified T : Entity> inBox(aabb: AxisAlignedBB) = inBox(T::class.java, aabb)

4
.idea/shelf/Recipe_Datagen.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<changelist name="Recipe_Datagen" date="1601740449134" recycled="false">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Recipe_Datagen/shelved.patch" />
<option name="DESCRIPTION" value="Recipe Datagen" />
</changelist>

47
.idea/shelf/Recipe_Datagen/shelved.patch generated Normal file
View File

@@ -0,0 +1,47 @@
Index: data/src/main/java/chylex/hee/datagen/server/Recipes.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- /dev/null (date 1601740133630)
+++ b/data/src/main/java/chylex/hee/datagen/server/Recipes.kt (date 1601740133630)
@@ -0,0 +1,11 @@
+package chylex.hee.datagen.server
+import net.minecraft.data.DataGenerator
+import net.minecraft.data.IFinishedRecipe
+import net.minecraft.data.RecipeProvider
+import java.util.function.Consumer
+
+class Recipes(generator: DataGenerator) : RecipeProvider(generator){
+ override fun registerRecipes(consumer: Consumer<IFinishedRecipe>) = with(consumer){
+ // shapeless(ModItems.ALTERATION_NEXUS, 1){ ingredients(Items.DIAMOND, Items.ENDER_EYE, ModItems.ANCIENT_DUST, ModItems.ETHEREUM) }
+ }
+}
Index: data/src/main/java/chylex/hee/datagen/server/util/RecipeProviderExt.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- /dev/null (date 1601734823610)
+++ b/data/src/main/java/chylex/hee/datagen/server/util/RecipeProviderExt.kt (date 1601734823610)
@@ -0,0 +1,20 @@
+package chylex.hee.datagen.server.util
+import net.minecraft.data.IFinishedRecipe
+import net.minecraft.data.ShapedRecipeBuilder
+import net.minecraft.data.ShapelessRecipeBuilder
+import net.minecraft.util.IItemProvider
+import java.util.function.Consumer
+
+fun Consumer<IFinishedRecipe>.shaped(result: IItemProvider, amount: Int, callback: ShapedRecipeBuilder.() -> Unit){
+ ShapedRecipeBuilder(result, amount).apply(callback).build(this)
+}
+
+fun Consumer<IFinishedRecipe>.shapeless(result: IItemProvider, amount: Int, callback: ShapelessRecipeBuilder.() -> Unit){
+ ShapelessRecipeBuilder(result, amount).apply(callback).build(this)
+}
+
+fun ShapelessRecipeBuilder.ingredients(vararg ingredients: IItemProvider){
+ for(ingredient in ingredients){
+ this.addIngredient(ingredient)
+ }
+}

4
.idea/shelf/Shulker_Box_Animation.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<changelist name="Shulker_Box_Animation" date="1590248312609" recycled="false">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Shulker_Box_Animation/shelved.patch" />
<option name="DESCRIPTION" value="Shulker Box Animation" />
</changelist>

File diff suppressed because one or more lines are too long

4
.idea/shelf/StructureFile.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<changelist name="StructureFile" date="1601888541958" recycled="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/StructureFile/shelved.patch" />
<option name="DESCRIPTION" value="StructureFile" />
</changelist>

19
.idea/shelf/StructureFile/shelved.patch generated Normal file

File diff suppressed because one or more lines are too long

4
.idea/shelf/TODO.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<changelist name="TODO" date="1601072216412" recycled="false">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/TODO/shelved.patch" />
<option name="DESCRIPTION" value="TODO" />
</changelist>

124
.idea/shelf/TODO/shelved.patch generated Normal file

File diff suppressed because one or more lines are too long

14
.idea/shelf/Territories.xml generated Normal file
View File

@@ -0,0 +1,14 @@
<changelist name="Territories" date="1593174807954" recycled="false">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Territories/shelved.patch" />
<option name="DESCRIPTION" value="Territories" />
<binary>
<option name="BEFORE_PATH" />
<option name="AFTER_PATH" value="src/main/resources/assets/hee/textures/environment/end_sky_blurry.png" />
<option name="SHELVED_PATH" value="$PROJECT_DIR$/.idea/shelf/Territories/end_sky_blurry.png" />
</binary>
<binary>
<option name="BEFORE_PATH" />
<option name="AFTER_PATH" value="src/main/resources/assets/hee/textures/environment/end_sky_smooth.png" />
<option name="SHELVED_PATH" value="$PROJECT_DIR$/.idea/shelf/Territories/end_sky_smooth.png" />
</binary>
</changelist>

BIN
.idea/shelf/Territories/end_sky_blurry.png generated Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
.idea/shelf/Territories/end_sky_smooth.png generated Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

24
.idea/shelf/Territories/shelved.patch generated Normal file
View File

@@ -0,0 +1,24 @@
Index: src/main/java/chylex/hee/game/block/BlockDustyStoneUnstable.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- a/src/main/java/chylex/hee/game/block/BlockDustyStoneUnstable.kt (revision f6f631f6f3dc9b347b19db913cf2be4535813fc7)
+++ b/src/main/java/chylex/hee/game/block/BlockDustyStoneUnstable.kt (date 1590584304217)
@@ -26,7 +26,6 @@
import net.minecraft.util.math.shapes.EntitySelectionContext
import net.minecraft.util.math.shapes.ISelectionContext
import net.minecraft.util.math.shapes.VoxelShape
-import net.minecraft.util.math.shapes.VoxelShapes
import net.minecraft.world.IBlockReader
import net.minecraft.world.World
import java.util.Random
@@ -68,7 +67,7 @@
return if (context is EntitySelectionContext && context.entity is EntityLivingBase)
MagicValues.BLOCK_COLLISION_SHRINK_SHAPE
else
- VoxelShapes.fullCube()
+ MagicValues.BLOCK_COLLISION_SHRINK_SHAPE //VoxelShapes.fullCube()
}
override fun causesSuffocation(state: BlockState, world: IBlockReader, pos: BlockPos): Boolean{

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

119
.idea/shelf/Territories1/shelved.patch generated Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
<changelist name="Work_on_Ender_Eye_spawn_animation,_movement,_and_attack_logic" date="1601092950910" recycled="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Work_on_Ender_Eye_spawn_animation,_movement,_and_attack_logic/shelved.patch" />
<option name="DESCRIPTION" value="Work on Ender Eye spawn animation, movement, and attack logic" />
</changelist>

4
.idea/shelf/thing.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<changelist name="thing" date="1608060366436" recycled="false">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/thing/shelved.patch" />
<option name="DESCRIPTION" value="thing" />
</changelist>

74
.idea/shelf/thing/shelved.patch generated Normal file
View File

@@ -0,0 +1,74 @@
Index: src/main/resources/hee.mixins.json
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
<+>{\n \"required\": true,\n \"minVersion\": \"0.8\",\n \"package\": \"chylex.hee.mixin\",\n \"compatibilityLevel\": \"JAVA_8\",\n \"mixins\": [\n \"HookAnvilRepair\",\n \"HookBlockDrops\",\n \"HookChorusFlowerSoil\",\n \"HookChorusPlantSoil\",\n \"HookEffectCorruption\",\n \"HookEffectInstanceCorruption\",\n \"HookEndBiome\",\n \"HookEndermanParticles\",\n \"HookEndermiteParticles\",\n \"HookEntityHelmetBreaking\",\n \"HookEntityPotionCorruption\",\n \"HookFireSpread\",\n \"HookItemEntityLavaCheck\",\n \"HookLightMapColors\",\n \"HookPlayerInventoryArmorBreaking\",\n \"HookPotionCreativeMenu\",\n \"HookThornsArmorBreaking\"\n ],\n \"injectors\": {\n \"defaultRequire\": 1\n }\n}\n
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/main/resources/hee.mixins.json b/src/main/resources/hee.mixins.json
--- a/src/main/resources/hee.mixins.json (revision 7f9202bceb9aa7b8fac24437a2190a87857573a7)
+++ b/src/main/resources/hee.mixins.json (date 1608060366293)
@@ -3,25 +3,7 @@
"minVersion": "0.8",
"package": "chylex.hee.mixin",
"compatibilityLevel": "JAVA_8",
- "mixins": [
- "HookAnvilRepair",
- "HookBlockDrops",
- "HookChorusFlowerSoil",
- "HookChorusPlantSoil",
- "HookEffectCorruption",
- "HookEffectInstanceCorruption",
- "HookEndBiome",
- "HookEndermanParticles",
- "HookEndermiteParticles",
- "HookEntityHelmetBreaking",
- "HookEntityPotionCorruption",
- "HookFireSpread",
- "HookItemEntityLavaCheck",
- "HookLightMapColors",
- "HookPlayerInventoryArmorBreaking",
- "HookPotionCreativeMenu",
- "HookThornsArmorBreaking"
- ],
+ "mixins": [ "HookAnvilRepair", "HookBlockDrops", "HookChorusFlowerSoil", "HookChorusPlantSoil", "HookEffectCorruption", "HookEffectInstanceCorruption", "HookElytraBreaking", "HookEndBiome", "HookEndermanParticles", "HookEndermiteParticles", "HookEntityHelmetBreaking", "HookEntityPotionCorruption", "HookFireSpread", "HookItemEntityLavaCheck", "HookLightMapColors", "HookPlayerInventoryArmorBreaking", "HookPotionCreativeMenu", "HookThornsArmorBreaking" ],
"injectors": {
"defaultRequire": 1
}
Index: src/main/java/chylex/hee/mixin/HookElytraBreaking.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/main/java/chylex/hee/mixin/HookElytraBreaking.java b/src/main/java/chylex/hee/mixin/HookElytraBreaking.java
new file mode 100644
--- /dev/null (date 1608060322378)
+++ b/src/main/java/chylex/hee/mixin/HookElytraBreaking.java (date 1608060322378)
@@ -0,0 +1,27 @@
+package chylex.hee.mixin;
+
+import chylex.hee.init.ModItems;
+import net.minecraft.entity.LivingEntity;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.item.ElytraItem;
+import net.minecraft.item.ItemStack;
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.injection.At;
+import org.spongepowered.asm.mixin.injection.Redirect;
+import java.util.function.Consumer;
+
+@Mixin(ElytraItem.class)
+public abstract class HookElytraBreaking{
+ @Redirect(
+ method = "elytraFlightTick",
+ at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;damageItem(ILnet/minecraft/entity/LivingEntity;Ljava/util/function/Consumer;)V")
+ )
+ public void damageItem(final ItemStack stack, final int amount, final LivingEntity entity, final Consumer<LivingEntity> onBroken){
+ final ItemStack originalStack = stack.copy();
+ stack.damageItem(amount, entity, onBroken);
+
+ if (ElytraItem.isUsable(originalStack) && !ElytraItem.isUsable(stack) && entity instanceof PlayerEntity){
+ ModItems.RING_OF_PRESERVATION.onArmorDestroyed((PlayerEntity)entity, originalStack, stack);
+ }
+ }
+}

4
.idea/shelf/todo1.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<changelist name="todo1" date="1601711471885" recycled="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/todo1/shelved.patch" />
<option name="DESCRIPTION" value="todo" />
</changelist>

182
.idea/shelf/todo1/shelved.patch generated Normal file

File diff suppressed because one or more lines are too long

View File

@@ -9,6 +9,7 @@ import chylex.hee.game.world.feature.stronghold.piece.StrongholdRoom_Main_Portal
import chylex.hee.game.world.feature.stronghold.piece.StrongholdRoom_Trap_CornerHoles
import chylex.hee.game.world.feature.stronghold.piece.StrongholdRoom_Trap_Prison
import chylex.hee.game.world.feature.stronghold.piece.StrongholdRoom_Trap_TallIntersection
import chylex.hee.game.world.feature.tombdungeon.piece.TombDungeonRoom_Tomb
import chylex.hee.init.ModEntities
import chylex.hee.system.delegate.NotifyOnChange
import chylex.hee.system.serialization.TagCompound
@@ -28,6 +29,10 @@ class EntityTechnicalTrigger(type: EntityType<EntityTechnicalTrigger>, world: Wo
this.type = type
}
constructor(world: World, type: Types, nbt: TagCompound) : this(world, type) {
handler.deserializeNBT(nbt)
}
private companion object {
private const val TYPE_TAG = "Type"
private const val DATA_TAG = "Data"
@@ -62,6 +67,7 @@ class EntityTechnicalTrigger(type: EntityType<EntityTechnicalTrigger>, world: Wo
STRONGHOLD_TRAP_TALL_INTERSECTION({ StrongholdRoom_Trap_TallIntersection.Trigger }),
ENERGY_SHRINE_GENERATOR({ EnergyShrineGenerator.GeneratorTrigger }),
ENERGY_SHRINE_GLOBAL({ EnergyShrineRoom_Main_Start.Particles }),
TOMB_DUNGEON_UNDREAD_SPAWNER(TombDungeonRoom_Tomb::UndreadSpawnerTrigger),
OBSIDIAN_TOWER_TOP_GLOWSTONE(ObsidianTowerLevel_Top::GlowstoneTrigger),
OBSIDIAN_TOWER_DEATH_ANIMATION(ObsidianTowerLevel_Top::DeathAnimationTrigger)
}

View File

@@ -1,5 +1,7 @@
package chylex.hee.game.world.feature.tombdungeon
import chylex.hee.game.world.feature.tombdungeon.TombDungeonLevel.MobAmount.HIGH
import chylex.hee.game.world.feature.tombdungeon.TombDungeonLevel.MobAmount.MEDIUM
import chylex.hee.game.world.feature.tombdungeon.TombDungeonPieces.PIECE_TOMB_RANDOM_MASS_5X_BASIC
import chylex.hee.game.world.feature.tombdungeon.TombDungeonPieces.PIECE_TOMB_RANDOM_MASS_5X_BORDER
import chylex.hee.game.world.feature.tombdungeon.TombDungeonPieces.PIECE_TOMB_RANDOM_MASS_5X_SPLIT
@@ -101,4 +103,61 @@ enum class TombDungeonLevel(val isFancy: Boolean, private val corridorFactor: In
}
}
}
fun pickUndreadAndSpiderlingSpawns(rand: Random, amount: MobAmount): Pair<Int, Int> {
val m = if (amount >= MEDIUM) 1 else 0
val h = if (amount >= HIGH) 1 else 0
return when(this) {
FIRST -> when(rand.nextInt(0, 3)) {
0 -> MOBS(undreads = rand.nextInt(0, h), spiderlings = 1 + m)
1 -> MOBS(undreads = rand.nextInt(0, h), spiderlings = 2 + m)
2 -> MOBS(undreads = 1 + h, spiderlings = 0 + rand.nextInt(0, m))
else -> MOBS(undreads = 1 + h, spiderlings = 1 + rand.nextInt(0, m))
}
SECOND -> when(rand.nextInt(0, 3)) {
0 -> MOBS(undreads = rand.nextInt(0, m + h), spiderlings = 1 + rand.nextInt(0, m + h))
1 -> MOBS(undreads = 1 + rand.nextInt(0, m + h), spiderlings = rand.nextInt(0, m + h))
2 -> MOBS(undreads = 1 + m + rand.nextInt(h, h * 2), spiderlings = 0)
else -> MOBS(undreads = 1 + h, spiderlings = 1 + m + rand.nextInt(h, h * 3))
}
// TODO
else -> 0 to 0
}
/*
import chylex.hee.game.world.feature.tombdungeon.TombDungeonLevel
import chylex.hee.game.world.feature.tombdungeon.TombDungeonLevel.MobAmount
import chylex.hee.system.math.floorToInt
import com.google.common.collect.Comparators
import java.util.Random
val rand = Random()
val level = TombDungeonLevel.FIRST
val reps = 100000
MobAmount.values().map { amount ->
"\n\n" + amount.name + "\n" + "-".repeat(amount.name.length) + "\n" + (1..reps)
.map { level.pickUndreadAndSpiderlingSpawns(rand, amount) }
.groupingBy { it }
.eachCount()
.entries
.map { ((it.value * 100.0) / reps).floorToInt() to it.key }
.sortedWith(compareBy({ it.first }, { it.second.first }, { it.second.second }))
.map { "U = ${it.second.first}, S = ${it.second.second} ... ${it.first} %" }
.joinToString("\n")
}.joinToString("\n")
*/
}
private fun MOBS(undreads: Int, spiderlings: Int) = undreads to spiderlings
enum class MobAmount {
LOW, MEDIUM, HIGH
}
}

View File

@@ -1,10 +1,39 @@
package chylex.hee.game.world.feature.tombdungeon.piece
import chylex.hee.game.entity.posVec
import chylex.hee.game.entity.technical.EntityTechnicalTrigger
import chylex.hee.game.entity.technical.EntityTechnicalTrigger.ITriggerHandler
import chylex.hee.game.entity.technical.EntityTechnicalTrigger.Types.TOMB_DUNGEON_UNDREAD_SPAWNER
import chylex.hee.game.world.Pos
import chylex.hee.game.world.distanceSqTo
import chylex.hee.game.world.feature.tombdungeon.TombDungeonLevel.MobAmount
import chylex.hee.game.world.feature.tombdungeon.connection.TombDungeonConnection
import chylex.hee.game.world.feature.tombdungeon.connection.TombDungeonConnectionType.TOMB_ENTRANCE_INSIDE
import chylex.hee.game.world.isAir
import chylex.hee.game.world.offsetWhile
import chylex.hee.game.world.structure.IStructureWorld
import chylex.hee.game.world.structure.piece.IStructurePieceConnection
import chylex.hee.game.world.structure.trigger.EntityStructureTrigger
import chylex.hee.init.ModEntities
import chylex.hee.system.math.Vec3
import chylex.hee.system.math.addY
import chylex.hee.system.math.square
import chylex.hee.system.migration.Facing.DOWN
import chylex.hee.system.migration.Facing.NORTH
import chylex.hee.system.migration.Facing.SOUTH
import chylex.hee.system.random.nextFloat
import chylex.hee.system.serialization.TagCompound
import chylex.hee.system.serialization.use
import net.minecraft.entity.EntitySpawnPlacementRegistry
import net.minecraft.entity.SpawnReason.SPAWNER
import net.minecraft.particles.RedstoneParticleData
import net.minecraft.util.Direction.EAST
import net.minecraft.util.Direction.WEST
import net.minecraft.util.math.AxisAlignedBB
import net.minecraft.util.math.BlockPos
import net.minecraft.world.World
import net.minecraft.world.server.ServerWorld
import java.util.Random
abstract class TombDungeonRoom_Tomb(file: String, entranceY: Int, allowSecrets: Boolean, isFancy: Boolean) : TombDungeonRoom(file, isFancy) {
final override val secretAttachWeight = if (allowSecrets) 2 else 0
@@ -13,4 +42,136 @@ abstract class TombDungeonRoom_Tomb(file: String, entranceY: Int, allowSecrets:
final override val connections = arrayOf<IStructurePieceConnection>(
TombDungeonConnection(TOMB_ENTRANCE_INSIDE, Pos(centerX, entranceY, maxZ), SOUTH)
)
protected abstract val mobAmount: MobAmount?
override fun generate(world: IStructureWorld, instance: Instance) {
super.generate(world, instance)
generateSpawnerTrigger(world, instance)
}
protected open fun generateSpawnerTrigger(world: IStructureWorld, instance: Instance) {
val rand = world.rand
val level = instance.context
if (rand.nextInt(3) == 0 && level != null) {
val mobAmount = mobAmount
if (mobAmount != null) {
val (undreads, spiderlings) = level.pickUndreadAndSpiderlingSpawns(rand, mobAmount)
UndreadSpawnerTrigger.place(world, entrance = connections.first().offset, width = maxX, depth = maxZ, undreads, spiderlings)
}
}
}
class UndreadSpawnerTrigger() : ITriggerHandler {
companion object {
private const val WIDTH_TAG = "Width"
private const val DEPTH_TAG = "Depth"
private const val UNDREADS_TAG = "Undreads"
private const val SPIDERLINGS_TAG = "Spiderlings"
fun place(world: IStructureWorld, entrance: BlockPos, width: Int, depth: Int, undreads: Int, spiderlings: Int) {
val nbt = UndreadSpawnerTrigger(width - 1.0, depth - 1.0, undreads, spiderlings).serializeNBT()
world.addTrigger(entrance, EntityStructureTrigger({ wrld ->
EntityTechnicalTrigger(wrld, TOMB_DUNGEON_UNDREAD_SPAWNER, nbt).apply { rotationYaw = NORTH.horizontalAngle }
}, yOffset = 0.5))
}
}
private var width = 0.0
private var depth = 0.0
private var undreads = 0
private var spiderlings = 0
constructor(width: Double, depth: Double, undreads: Int, spiderlings: Int) : this() {
this.width = width
this.depth = depth
this.undreads = undreads
this.spiderlings = spiderlings
}
override fun check(world: World): Boolean {
return !world.isRemote
}
override fun update(entity: EntityTechnicalTrigger) {
val world = entity.world
val facing = entity.horizontalFacing
val vecF = Vec3.fromYaw(facing.horizontalAngle)
val vecL = Vec3.fromYaw(facing.rotateYCCW().horizontalAngle)
val vecR = Vec3.fromYaw(facing.rotateY().horizontalAngle)
val aabb = AxisAlignedBB(
vecL.scale(width * 0.5).add(vecF.scale(0.3)),
vecR.scale(width * 0.5).add(vecF.scale(depth)).addY(2.5)
).offset(entity.posVec)
repeat(10) {
(world as ServerWorld).spawnParticle(RedstoneParticleData(if (facing == NORTH || facing == EAST) 1F else 0F, if (facing == SOUTH || facing == EAST) 1F else 0F, if (facing == WEST) 1F else 0F, 1F),
world.rand.nextFloat(aabb.minX, aabb.maxX),
world.rand.nextFloat(aabb.minY, aabb.maxY),
world.rand.nextFloat(aabb.minZ, aabb.maxZ),
1, 0.0, 0.0, 0.0, 0.0
)
}//TODO
if (world.players.none { aabb.contains(it.posVec) }) {
return
}
val rand = world.rand
for((entityCount, entityType) in listOf(
undreads to ModEntities.UNDREAD,
spiderlings to ModEntities.SPIDERLING
)) {
repeat(entityCount) {
for(attempt in 1..20) {
val pos = Pos(
rand.nextFloat(aabb.minX, aabb.maxX),
rand.nextFloat(aabb.minY, aabb.maxY) + 0.5,
rand.nextFloat(aabb.minZ, aabb.maxZ),
).offsetWhile(DOWN, 1..3) {
it.isAir(world)
}
if (EntitySpawnPlacementRegistry.func_223515_a(entityType, world, SPAWNER, pos, rand) &&
world.hasNoCollisions(entityType.getBoundingBoxWithSizeApplied(pos.x + 0.5, pos.y.toDouble(), pos.z + 0.5)) &&
world.players.none { pos.distanceSqTo(it) < square(2.75) }
) {
entityType.create(world)?.apply {
setLocationAndAngles(pos.x + 0.5, pos.y.toDouble(), pos.z + 0.5, rand.nextFloat(0F, 360F), 0F)
spawnExplosionParticle()
world.addEntity(this)
}
break
}
}
}
}
entity.remove()
}
override fun nextTimer(rand: Random): Int {
return 3
}
override fun serializeNBT() = TagCompound().apply {
putDouble(WIDTH_TAG, width)
putDouble(DEPTH_TAG, depth)
putInt(UNDREADS_TAG, undreads)
putInt(SPIDERLINGS_TAG, spiderlings)
}
override fun deserializeNBT(nbt: TagCompound) = nbt.use {
width = getDouble(WIDTH_TAG)
depth = getDouble(DEPTH_TAG)
undreads = getInt(UNDREADS_TAG)
spiderlings = getInt(SPIDERLINGS_TAG)
}
}
}

View File

@@ -2,9 +2,11 @@ package chylex.hee.game.world.feature.tombdungeon.piece
import chylex.hee.game.block.BlockGraveDirt
import chylex.hee.game.world.Pos
import chylex.hee.game.world.feature.tombdungeon.TombDungeonLevel.MobAmount
import chylex.hee.game.world.feature.tombdungeon.TombDungeonPieces
import chylex.hee.game.world.feature.tombdungeon.connection.TombDungeonConnection
import chylex.hee.game.world.feature.tombdungeon.connection.TombDungeonConnectionType.TOMB_ENTRANCE_INSIDE
import chylex.hee.game.world.feature.tombdungeon.piece.TombDungeonRoom_Tomb.UndreadSpawnerTrigger
import chylex.hee.game.world.generation.IBlockPicker.Single
import chylex.hee.game.world.generation.IBlockPicker.Single.Air
import chylex.hee.game.world.math.Size
@@ -32,11 +34,19 @@ class TombDungeonRoom_Tomb_Mass(width: Int, depth: Int, private val border: Bool
super.generate(world, instance)
val rand = world.rand
val level = instance.context
val centerX = size.centerX
val maxX = size.maxX
val maxY = size.maxY
val maxZ = size.maxZ
if (rand.nextInt(3) != 0 && level != null) {
val area = (size.x - 2) * (size.z - 2)
val (undreads, spiderlings) = level.pickUndreadAndSpiderlingSpawns(rand, if (area <= 30) MobAmount.LOW else MobAmount.MEDIUM)
UndreadSpawnerTrigger.place(world, entrance = connections.first().offset, width = maxX, depth = maxZ, undreads, spiderlings)
}
val distance = if (border) 2 else 1
val palette = if (isFancy) TombDungeonPieces.PALETTE_ENTRY_FANCY_GRAVE else TombDungeonPieces.PALETTE_ENTRY_PLAIN_GRAVE

View File

@@ -2,11 +2,15 @@ package chylex.hee.game.world.feature.tombdungeon.piece
import chylex.hee.game.world.Pos
import chylex.hee.game.world.feature.tombdungeon.TombDungeonLevel
import chylex.hee.game.world.feature.tombdungeon.TombDungeonLevel.MobAmount
import chylex.hee.game.world.structure.IStructureWorld
import chylex.hee.system.migration.Facing.NORTH
import chylex.hee.system.random.nextInt
class TombDungeonRoom_Tomb_MassSpacious(file: String, entranceY: Int, isFancy: Boolean) : TombDungeonRoom_Tomb(file, entranceY, allowSecrets = false, isFancy) {
override val mobAmount
get() = MobAmount.MEDIUM
override fun generate(world: IStructureWorld, instance: Instance) {
super.generate(world, instance)

View File

@@ -2,6 +2,7 @@ package chylex.hee.game.world.feature.tombdungeon.piece
import chylex.hee.game.block.BlockGraveDirt
import chylex.hee.game.world.Pos
import chylex.hee.game.world.feature.tombdungeon.TombDungeonLevel.MobAmount
import chylex.hee.game.world.structure.IStructureWorld
import chylex.hee.system.migration.Facing.EAST
import chylex.hee.system.migration.Facing.WEST
@@ -9,6 +10,13 @@ import chylex.hee.system.random.nextInt
import chylex.hee.system.random.nextRounded
class TombDungeonRoom_Tomb_MultiDeep(file: String, private val tombsPerColumn: Int, entranceY: Int, isFancy: Boolean) : TombDungeonRoom_Tomb(file, entranceY, allowSecrets = false, isFancy) {
override val mobAmount
get() = when {
tombsPerColumn <= 5 -> MobAmount.LOW
tombsPerColumn <= 7 -> MobAmount.MEDIUM
else -> MobAmount.HIGH
}
override fun generate(world: IStructureWorld, instance: Instance) {
super.generate(world, instance)

View File

@@ -1,9 +1,17 @@
package chylex.hee.game.world.feature.tombdungeon.piece
import chylex.hee.game.world.Pos
import chylex.hee.game.world.feature.tombdungeon.TombDungeonLevel.MobAmount
import chylex.hee.game.world.structure.IStructureWorld
class TombDungeonRoom_Tomb_MultiNarrow(file: String, private val tombsPerColumn: Int, entranceY: Int, isFancy: Boolean) : TombDungeonRoom_Tomb(file, entranceY, allowSecrets = false, isFancy) {
override val mobAmount
get() = when {
tombsPerColumn <= 5 -> MobAmount.LOW
tombsPerColumn <= 7 -> MobAmount.MEDIUM
else -> MobAmount.HIGH
}
override fun generate(world: IStructureWorld, instance: Instance) {
super.generate(world, instance)

View File

@@ -2,6 +2,7 @@ package chylex.hee.game.world.feature.tombdungeon.piece
import chylex.hee.game.block.BlockGraveDirt
import chylex.hee.game.world.Pos
import chylex.hee.game.world.feature.tombdungeon.TombDungeonLevel.MobAmount
import chylex.hee.game.world.structure.IStructureWorld
import chylex.hee.system.migration.Facing.EAST
import chylex.hee.system.migration.Facing.WEST
@@ -9,6 +10,13 @@ import chylex.hee.system.random.nextInt
import chylex.hee.system.random.nextRounded
class TombDungeonRoom_Tomb_MultiSpacious(file: String, private val tombsPerColumn: Int, entranceY: Int, isFancy: Boolean) : TombDungeonRoom_Tomb(file, entranceY, allowSecrets = false, isFancy) {
override val mobAmount
get() = when {
tombsPerColumn <= 5 -> MobAmount.LOW
tombsPerColumn <= 7 -> MobAmount.MEDIUM
else -> MobAmount.HIGH
}
override fun generate(world: IStructureWorld, instance: Instance) {
super.generate(world, instance)

View File

@@ -1,10 +1,14 @@
package chylex.hee.game.world.feature.tombdungeon.piece
import chylex.hee.game.world.Pos
import chylex.hee.game.world.feature.tombdungeon.TombDungeonLevel.MobAmount
import chylex.hee.game.world.structure.IStructureWorld
import chylex.hee.system.migration.Facing.SOUTH
open class TombDungeonRoom_Tomb_SingleNarrow(file: String, entranceY: Int, isFancy: Boolean) : TombDungeonRoom_Tomb(file, entranceY, allowSecrets = false, isFancy) {
override val mobAmount: MobAmount?
get() = null
override fun generate(world: IStructureWorld, instance: Instance) {
super.generate(world, instance)

View File

@@ -1,9 +1,13 @@
package chylex.hee.game.world.feature.tombdungeon.piece
import chylex.hee.game.world.Pos
import chylex.hee.game.world.feature.tombdungeon.TombDungeonLevel.MobAmount
import chylex.hee.game.world.structure.IStructureWorld
class TombDungeonRoom_Tomb_SingleSpacious(file: String, entranceY: Int, isFancy: Boolean) : TombDungeonRoom_Tomb_SingleNarrow(file, entranceY, isFancy) {
override val mobAmount: MobAmount?
get() = null
override fun generate(world: IStructureWorld, instance: Instance) {
super.generate(world, instance)