Skip to content

Commit

Permalink
Clear credits and readme and work on Astral travel flight and potions
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan19 committed Aug 23, 2019
1 parent bdd7668 commit 78780aa
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 137 deletions.
65 changes: 0 additions & 65 deletions CREDITS.txt
Original file line number Diff line number Diff line change
@@ -1,65 +0,0 @@
Minecraft Forge: Credits/Thank You

Forge is a set of tools and modifications to the Minecraft base game code to assist
mod developers in creating new and exciting content. It has been in development for
several years now, but I would like to take this time thank a few people who have
helped it along it's way.

First, the people who originally created the Forge projects way back in Minecraft
alpha. Eloraam of RedPower, and SpaceToad of Buildcraft, without their acceptiance
of me taking over the project, who knows what Minecraft modding would be today.

Secondly, someone who has worked with me, and developed some of the core features
that allow modding to be as functional, and as simple as it is, cpw. For developing
FML, which stabelized the client and server modding ecosystem. As well as the base
loading system that allows us to modify Minecraft's code as elegently as possible.

Mezz, who has stepped up as the issue and pull request manager. Helping to keep me
sane as well as guiding the community into creating better additions to Forge.

Searge, Bspks, Fesh0r, ProfMobious, and all the rest over on the MCP team {of which
I am a part}. For creating some of the core tools needed to make Minecraft modding
both possible, and as stable as can be.
On that note, here is some specific information of the MCP data we use:
* Minecraft Coder Pack (MCP) *
Forge Mod Loader and Minecraft Forge have permission to distribute and automatically
download components of MCP and distribute MCP data files. This permission is not
transitive and others wishing to redistribute the Minecraft Forge source independently
should seek permission of MCP or remove the MCP data files and request their users
to download MCP separately.

And lastly, the countless community members who have spent time submitting bug reports,
pull requests, and just helping out the community in general. Thank you.

--LexManos

=========================================================================

This is Forge Mod Loader.

You can find the source code at all times at https://github.com/MinecraftForge/MinecraftForge/tree/1.12.x/src/main/java/net/minecraftforge/fml

This minecraft mod is a clean open source implementation of a mod loader for minecraft servers
and minecraft clients.

The code is authored by cpw.

It began by partially implementing an API defined by the client side ModLoader, authored by Risugami.
http://www.minecraftforum.net/topic/75440-
This support has been dropped as of Minecraft release 1.7, as Risugami no longer maintains ModLoader.

It also contains suggestions and hints and generous helpings of code from LexManos, author of MinecraftForge.
http://www.minecraftforge.net/

Additionally, it contains an implementation of topological sort based on that
published at http://keithschwarz.com/interesting/code/?dir=topological-sort

It also contains code from the Maven project for performing versioned dependency
resolution. http://maven.apache.org/

It also contains a partial repackaging of the javaxdelta library from http://sourceforge.net/projects/javaxdelta/
with credit to it's authors.

Forge Mod Loader downloads components from the Minecraft Coder Pack
(http://mcp.ocean-labs.de/index.php/Main_Page) with kind permission from the MCP team.

53 changes: 0 additions & 53 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,53 +0,0 @@
-------------------------------------------
Source installation information for modders
-------------------------------------------
This code follows the Minecraft Forge installation methodology. It will apply
some small patches to the vanilla MCP source code, giving you and it access
to some of the data and functions you need to build a successful mod.

Note also that the patches are built against "unrenamed" MCP source code (aka
srgnames) - this means that you will not be able to read them directly against
normal code.

Source pack installation information:

Standalone source installation
==============================

See the Forge Documentation online for more detailed instructions:
http://mcforge.readthedocs.io/en/latest/gettingstarted/

Step 1: Open your command-line and browse to the folder where you extracted the zip file.

Step 2: You're left with a choice.
If you prefer to use Eclipse:
1. Run the following command: "gradlew genEclipseRuns" (./gradlew genEclipseRuns if you are on Mac/Linux)
2. Open Eclipse, Import > Existing Gradle Project > Select Folder
or run "gradlew eclipse" to generate the project.
(Current Issue)
4. Open Project > Run/Debug Settings > Edit runClient and runServer > Environment
5. Edit MOD_CLASSES to show [modid]%%[Path]; 2 times rather then the generated 4.

If you prefer to use IntelliJ:
1. Open IDEA, and import project.
2. Select your build.gradle file and have it import.
3. Run the following command: "gradlew genIntellijRuns" (./gradlew genIntellijRuns if you are on Mac/Linux)
4. Refresh the Gradle Project in IDEA if required.

If at any point you are missing libraries in your IDE, or you've run into problems you can run "gradlew --refresh-dependencies" to refresh the local cache. "gradlew clean" to reset everything {this does not affect your code} and then start the processs again.

Should it still not work,
Refer to #ForgeGradle on EsperNet for more information about the gradle environment.
or the Forge Project Discord discord.gg/UvedJ9m

Forge source installation
=========================
MinecraftForge ships with this code and installs it as part of the forge
installation process, no further action is required on your part.

LexManos' Install Video
=======================
https://www.youtube.com/watch?v=8VEdtQLuLO0&feature=youtu.be

For more details update more often refer to the Forge Forums:
http://www.minecraftforge.net/forum/index.php/topic,14048.0.html
11 changes: 11 additions & 0 deletions src/main/java/com/alan199921/astral/Astral.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,33 @@
import com.alan199921.astral.capabilities.inner_realm_teleporter.InnerRealmTeleporterStorage;
import com.alan199921.astral.dimensions.ModDimensions;
import com.alan199921.astral.effects.AstralEffect;
import com.alan199921.astral.effects.ModEffects;
import com.alan199921.astral.items.EnlightenmentKey;
import com.alan199921.astral.items.Feverweed;
import com.alan199921.astral.items.IntrospectionMedicine;
import com.alan199921.astral.items.Snowberry;
import com.alan199921.astral.potions.AstralTravelPotion;
import com.alan199921.astral.setup.ClientProxy;
import com.alan199921.astral.setup.IProxy;
import com.alan199921.astral.setup.ModSetup;
import com.alan199921.astral.setup.ServerProxy;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.potion.Effect;
import net.minecraft.potion.EffectInstance;
import net.minecraft.potion.Potion;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.ModDimension;
import net.minecraftforge.common.brewing.BrewingRecipeRegistry;
import net.minecraftforge.common.capabilities.CapabilityManager;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.ForgeRegistries;

// The value here should match an entry in the META-INF/mods.toml file
@Mod(Astral.MOD_ID)
Expand Down Expand Up @@ -91,5 +97,10 @@ public static void onDimensionModRegistry(final RegistryEvent.Register<ModDimens
public static void onEffectRegistry(final RegistryEvent.Register<Effect> event){
event.getRegistry().register(new AstralEffect());
}

@SubscribeEvent
public static void onPotionRegistry(final RegistryEvent.Register<Potion> event){
event.getRegistry().register(new AstralTravelPotion());
}
}
}
13 changes: 0 additions & 13 deletions src/main/java/com/alan199921/astral/effects/AstralEffect.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.alan199921.astral.effects;

import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.potion.Effect;
import net.minecraft.potion.EffectType;

Expand All @@ -10,15 +8,4 @@ public AstralEffect() {
super(EffectType.NEUTRAL, 13158600);
setRegistryName("astral_travel");
}

@Override
public void performEffect(LivingEntity entityLivingBaseIn, int amplifier) {
super.performEffect(entityLivingBaseIn, amplifier);
entityLivingBaseIn.setInvisible(true);
entityLivingBaseIn.noClip = true;
if (entityLivingBaseIn instanceof PlayerEntity){
PlayerEntity p = (PlayerEntity) entityLivingBaseIn;
p.abilities.allowFlying = true;
}
}
}
32 changes: 28 additions & 4 deletions src/main/java/com/alan199921/astral/events/TravellingHandlers.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
import net.minecraft.client.Minecraft;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.MobEntity;
import net.minecraft.potion.Effect;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraftforge.client.event.RenderLivingEvent;
import net.minecraftforge.event.entity.living.LivingAttackEvent;
import net.minecraftforge.event.entity.living.LivingSetAttackTargetEvent;
import net.minecraftforge.event.entity.living.PotionEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

Expand Down Expand Up @@ -36,8 +37,6 @@ public static void nullifyAstralDamage(LivingAttackEvent event) {
event.setCanceled(true);
}
}


}

//Function for detecting if an Astral entity is interacting with a non astral entity
Expand All @@ -54,5 +53,30 @@ public static void renderAstralEntities(RenderLivingEvent event) {
event.setCanceled(true);
}
}
}

@SubscribeEvent
public static void travelEffectExpire(PotionEvent.PotionRemoveEvent event) {
if (event.getPotionEffect().getPotion().equals(ModEffects.astralEffect) && event.getEntityLiving() instanceof PlayerEntity) {
PlayerEntity p = (PlayerEntity) event.getEntityLiving();
if (!p.abilities.isCreativeMode){
p.abilities.allowFlying = false;
p.noClip = false;
p.abilities.setFlySpeed(.05F);
p.sendPlayerAbilities();
}
}
}

@SubscribeEvent
public static void travelEffectActivate(PotionEvent.PotionAddedEvent event) {
if (event.getPotionEffect().getPotion().equals(ModEffects.astralEffect) && event.getEntityLiving() instanceof PlayerEntity) {
PlayerEntity p = (PlayerEntity) event.getEntityLiving();
if (!p.abilities.isCreativeMode) {
p.abilities.allowFlying = true;
p.noClip = true;
p.abilities.setFlySpeed(.05F * (event.getPotionEffect().getAmplifier() + 1));
p.sendPlayerAbilities();
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.alan199921.astral.items;

import com.alan199921.astral.effects.AstralEffect;
import com.alan199921.astral.effects.ModEffects;
import net.minecraft.item.Food;
import net.minecraft.item.Item;
import net.minecraft.potion.EffectInstance;
Expand All @@ -10,6 +10,6 @@ public TravellingMedicine(Properties properties) {
super(new Item.Properties().food(new Food.Builder()
.fastToEat()
.setAlwaysEdible()
.effect(new EffectInstance(AstralEffect.get(8)), 1).build()));
.effect(new EffectInstance(ModEffects.astralEffect, 100, 1), 1).build()));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.alan199921.astral.potions;

import com.alan199921.astral.effects.ModEffects;
import net.minecraft.potion.EffectInstance;
import net.minecraft.potion.Potion;

public class AstralTravelPotion extends Potion {
public AstralTravelPotion(){
super(new EffectInstance(ModEffects.astralEffect, 1200, 0));
setRegistryName("astral_travel_potion");
}
}

0 comments on commit 78780aa

Please sign in to comment.