- Obtain a source distribution from forge's [files][] site. (Look for the Mdk file type, or Src in older 1.8/1.7 versions).
- Extract the downloaded source distribution to an empty directory. You should see a bunch of files, and an example mod is placed in
src/main/java
for you to look at. Only a few of these files are strictly necessary for mod development:build.gradle
gradlew
(both.bat
and.sh
)- The
gradle
folder - You may reuse these files for all your projects.
- Move the files listed above to a new folder, this will be your mod project folder.
This file contains hidden or 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
public void download(final ImageType type) { | |
if (locations.get(type) == MISSING_TEXTURE) { | |
TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager(); | |
final String filepath = "creations/" + owner.user_id + "/" + type.name() + "/" + owner.id; | |
final ResourceLocation res = new ResourceLocation(CTBMod.DOMAIN, filepath); | |
ITextureObject texture = texturemanager.getTexture(res); | |
if (texture == null) { | |
downloadExecutor.execute(new Runnable() { |
This file contains hidden or 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
public final class ParticleFixer { | |
public static void addHitEffects(World world, BlockPos pos, EnumFacing side) { | |
IBlockState state = world.getBlockState(pos); | |
Block block = state.getBlock(); | |
state = block.getActualState(state, world, pos); | |
if (block.getRenderType() != -1) { | |
int i = pos.getX(); | |
int j = pos.getY(); |
This file contains hidden or 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
package com.enderio.core.client.gui.serverlist; | |
import java.io.Closeable; | |
import java.net.InetAddress; | |
import java.net.UnknownHostException; | |
import java.util.Collections; | |
import java.util.Iterator; | |
import java.util.Map; | |
import java.util.Map.Entry; |
This file contains hidden or 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
package tterrag.fourier; | |
import lombok.Getter; | |
import lombok.RequiredArgsConstructor; | |
public class CoefficientTable | |
{ | |
@Getter | |
@RequiredArgsConstructor | |
public static class Pair |
This file contains hidden or 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
package crazypants.enderio.api.teleport; | |
import java.util.concurrent.Callable; | |
import com.google.common.util.concurrent.Callables; | |
import crazypants.enderio.EnderIO; | |
import crazypants.enderio.config.Config; | |
public enum TravelSource { |
This file contains hidden or 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
package team.chisel.item; | |
import java.util.List; | |
import net.minecraft.block.Block; | |
import net.minecraft.entity.player.EntityPlayer; | |
import net.minecraft.item.Item; | |
import net.minecraft.item.ItemStack; | |
import net.minecraft.nbt.NBTTagCompound; | |
import net.minecraft.world.World; |
This file contains hidden or 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
def buildUrl = System.getenv().BUILD_URL | |
if (buildUrl != null) { | |
def auth = "<USER>:<APITOKEN>".getBytes().encodeBase64().toString() | |
def url = new URL("$buildUrl/api/xml?depth=20").openConnection() | |
url.setRequestProperty("Authorization", "Basic " + auth) | |
String data = url.getInputStream().text | |
def changelog = "" |
This file contains hidden or 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
public class SpecialFont extends FontRenderer { | |
private FontRenderer wrapped; | |
private ItemStack stack = EnderFood.ENDERIOS.getStack(); | |
public SpecialFont(FontRenderer wrapped) { | |
super(Minecraft.getMinecraft().gameSettings, new ResourceLocation("textures/font/ascii.png"), Minecraft.getMinecraft().renderEngine, false); | |
this.wrapped = wrapped; | |
} | |
@Override |
This file contains hidden or 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
package com.enderio.core.common.util; | |
import io.netty.buffer.ByteBuf; | |
import lombok.NoArgsConstructor; | |
import lombok.experimental.UtilityClass; | |
import net.minecraft.client.Minecraft; | |
import net.minecraft.client.gui.GuiNewChat; | |
import net.minecraft.entity.player.EntityPlayer; | |
import net.minecraft.entity.player.EntityPlayerMP; | |
import net.minecraft.util.ChatComponentText; |