<?xml version="1.0" encoding="UTF-8" ?><rdf:RDF 
  xmlns="http://purl.org/rss/1.0/"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:atom="http://www.w3.org/2005/Atom"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xml:lang="ja">
  <channel rdf:about="http://w.atwiki.jp/bbc_mc/">
    <title>bbc_mc @ moddingメモ</title>
    <link>http://w.atwiki.jp/bbc_mc/</link>
    <atom:link href="https://w.atwiki.jp/bbc_mc/rss10.xml" rel="self" type="application/rss+xml" />
    <atom:link rel="hub" href="https://pubsubhubbub.appspot.com" />
    <description>bbc_mc @ moddingメモ</description>

    <dc:language>ja</dc:language>
    <dc:date>2016-07-12T21:29:47+09:00</dc:date>
    <utime>1468326587</utime>

    <items>
      <rdf:Seq>
                <rdf:li rdf:resource="https://w.atwiki.jp/bbc_mc/pages/1.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/bbc_mc/pages/32.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/bbc_mc/pages/2.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/bbc_mc/pages/30.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/bbc_mc/pages/27.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/bbc_mc/pages/31.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/bbc_mc/pages/28.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/bbc_mc/pages/20.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/bbc_mc/pages/15.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/bbc_mc/pages/19.html" />
              </rdf:Seq>
    </items>
	
		
    
  </channel>
    <item rdf:about="https://w.atwiki.jp/bbc_mc/pages/1.html">
    <title>トップページ</title>
    <link>https://w.atwiki.jp/bbc_mc/pages/1.html</link>
    <description>
      * 本Wikiについて

bbc_mc が minecraft の modding について書き散らしているメモです。

大半はメニューからアクセスできます。たぶん。

----
&amp;link_edit(text=編集)    </description>
    <dc:date>2016-07-12T21:29:47+09:00</dc:date>
    <utime>1468326587</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/bbc_mc/pages/32.html">
    <title>Netty Packet Handling(和訳)</title>
    <link>https://w.atwiki.jp/bbc_mc/pages/32.html</link>
    <description>
      &amp;link_edit(text=編集)
 
翻訳者コメント
以下のページの個人的和訳です。http://www.minecraftforge.net/wiki/Netty_Packet_Handling 

現在、翻訳中です。(2014/07/09)

なるたけ原文(英文)を併記しますので、意味不明・曖昧な場合は参照下さい。

AKさん日本語訳 http://forum.minecraftuser.jp/viewtopic.php?f=21&amp;t=18255 リンク切れ？
----
&amp;link_edit(text=編集)

*Netty Packet Handling

 Warning
  This page is marked as Outdated.
  It was made for older content and may cause problems.
  Please improve this article if you can.

注意！！
このページの内容は「古い」と申告されています。
古い情報に基づき判断すると、問題が生じる可能性があります。
もし可能であれば、このページの内容を改善して下さい。

 This is a How-To guide or Tutorial detailing a practice or process for Minecraft Forge or related software.
このガイドは「How-to:どうやってやるか」のガイド、またはチュートリアルです。
Minecraft Forge やその関係ソフトウェアを使う方法を示したものです。

 This page was made for Minecraft 1.7.2.
 It might not work with other versions.
 This is a poor example of using Netty. It can cause memory leaks. 
 It doesn&#039;t separate handlers from codecs properly.
 It reimplements functionality existant in FML for months.
 If you are using this, consider switching to using FMLIndexedMessageToMessageCodec, or better yet,use the simpleimpl Message functionality.

このページの内容は Minecraft 1.7.2 に対応していますが、他のバージョンでは動作しない可能性があります。

本ページで紹介するコードは Netty を使用するための簡易なものであり、メモリーリークを生じる可能性もあります。

Handler 類を正しく切り離していません。

FML に何ヶ月も既に存在している機能を再実装しています。

もし FML を使用しているのであれば、FMLIndexedMessageToMessageCodec や simpleimpl Message 機能を使用する事を検討してみて下さい。

コンテンツ/
 1 DO NOT USE THIS IN NEW CODE OR CONVERSIONS
 2 Example Packet Structure
   2.1 AbstractPacket Class
 3 The Packet Handler
   3.1 PacketPipeline Class
 4 Registering the Pipeline
   4.1 Within your @Mod Class
 5 Registering Packets
 6 Implementation
 7 Authors

* DO NOT USE THIS IN NEW CODE OR CONVERSIONS / 本文書の内容を新しいバージョンで使用しないでください
 Below is a short alternative to the SimpleChannelHandler now present within FML.
 It allows for automatic discriminator generation and sided packet handling within the packets themselves.

以下の内容は、FML の SimpleChannelHandler に現在は含まれている内容と僅かに異なるものです。

以下では、パケット自体に自動的にサイド(Server/Client)を識別し、ハンドリングする機能を追加しています。

&amp;link_edit(text=編集)
* Example Packet Structure / 例示するパケットの構造

 Below is a common abstract packet that should be extended by any packet that you wish to send.
 Any resultant behaviour from the packet can be described in the side specific *handle* methods.
 NOTE: All children of this class *MUST* have an empty constructor (multiple constructors is fine!)

以下に示すのは、あなたが作成したいパケットの拡張元とする汎用的な抽象クラスです。

パケットの受け取り処理は、それぞれ処理サイド(Server/Client)を指定した handle 関数で処理します。

メモ：この抽象クラスを拡張する全てのクラスは、”必ず”空のコンストラクタを持たなくてはなりません。

AbstractPacket Class
 package you.packethandling
 
 import io.netty.buffer.ByteBuf;
 import io.netty.channel.ChannelHandlerContext;
 
 import net.minecraft.entity.player.EntityPlayer;
 
 /**
  * AbstractPacket class. Should be the parent of all packets wishing to use the PacketPipeline.
  * パケットの汎用抽象クラス。
  * 以下で示す PacketPipeline を使用したい場合は、本クラスから拡張した packet クラスを使用する事。
  * 
  * @author sirgingalot
  */
 public abstract class AbstractPacket {
 
    /**
     * Encode the packet data into the ByteBuf stream.
     *   Complex data sets may need specific data handlers
     *    (See @link{cpw.mods.fml.common.network.ByteBuffUtils})
     *
     * @param ctx    channel context
     * @param buffer the buffer to encode into
     */
   public abstract void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer);
 
    /**
     * Decode the packet data from the ByteBuf stream.
     *   Complex data sets may need specific data handlers
     *    (See @link{cpw.mods.fml.common.network.ByteBuffUtils})
     *
     * @param ctx    channel context
     * @param buffer the buffer to decode from
     */
   public abstract void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer);
 
    /**
     * Handle a packet on the client side.
     *   Note this occurs after decoding has completed.
     *
     * @param player the player reference
     */
   public abstract void handleClientSide(EntityPlayer player);
 
    /**
     * Handle a packet on the server side.
     *   Note this occurs after decoding has completed.
     *
     * @param player the player reference
     */
   public abstract void handleServerSide(EntityPlayer player);
 }

&amp;link_edit(text=編集)
* The Packet Handler

 Core packet handling.
 Essentially it automatically maps a packet to a discriminator, allowing in line encoding/decoding of packet specific data.
 It also allows sided behaviour to be handled by the packets themselves.
 NOTE: Remember to rename the channel as it is currently &quot;TUT&quot;

 以下、パケット処理クラスの主要部を説明する。
 

PacketPipeline Class
 package you.packethandling;
 
 import java.util.*;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelHandlerContext;
 import io.netty.handler.codec.MessageToMessageCodec;
 
 import net.minecraft.client.Minecraft;
 import net.minecraft.entity.player.EntityPlayer;
 import net.minecraft.entity.player.EntityPlayerMP;
 import net.minecraft.network.INetHandler;
 import net.minecraft.network.NetHandlerPlayServer;
 
 import cpw.mods.fml.common.FMLCommonHandler;
 import cpw.mods.fml.common.network.FMLEmbeddedChannel;
 import cpw.mods.fml.common.network.FMLOutboundHandler;
 import cpw.mods.fml.common.network.NetworkRegistry;
 import cpw.mods.fml.common.network.internal.FMLProxyPacket;
 import cpw.mods.fml.relauncher.Side;
 import cpw.mods.fml.relauncher.SideOnly;
 
 /**
  * Packet pipeline class. Directs all registered packet data to be handled by the packets themselves.
  * @author sirgingalot
  * some code from: cpw
  */
 @ChannelHandler.Sharable
 public class PacketPipeline extends MessageToMessageCodec&lt;FMLProxyPacket, AbstractPacket&gt; {
 
    private EnumMap&lt;Side, FMLEmbeddedChannel&gt;           channels;
    private LinkedList&lt;Class&lt;? extends AbstractPacket&gt;&gt; packets           = new LinkedList&lt;Class&lt;? extends AbstractPacket&gt;&gt;();
    private boolean                                     isPostInitialised = false;
 
    /**
     * Register your packet with the pipeline. Discriminators are automatically set.
     *
     * @param clazz the class to register
     *
     * @return whether registration was successful. Failure may occur if 256 packets have been registered or if the registry already contains this packet
     */
    public boolean registerPacket(Class&lt;? extends AbstractPacket&gt; clazz) {
        if (this.packets.size() &gt; 256) {
            // You should log here!!
            return false;
        }
 
        if (this.packets.contains(clazz)) {
            // You should log here!!
            return false;
        }
 
        if (this.isPostInitialised) {
            // You should log here!!
            return false;
        }
 
        this.packets.add(clazz);
        return true;
    }
 
    // In line encoding of the packet, including discriminator setting
    @Override
    protected void encode(ChannelHandlerContext ctx, AbstractPacket msg, List&lt;Object&gt; out) throws Exception {
        ByteBuf buffer = Unpooled.buffer();
        Class&lt;? extends AbstractPacket&gt; clazz = msg.getClass();
        if (!this.packets.contains(msg.getClass())) {
            throw new NullPointerException(&quot;No Packet Registered for: &quot; + msg.getClass().getCanonicalName());
        }
 
        byte discriminator = (byte) this.packets.indexOf(clazz);
        buffer.writeByte(discriminator);
        msg.encodeInto(ctx, buffer);
        FMLProxyPacket proxyPacket = new FMLProxyPacket(buffer.copy(), ctx.channel().attr(NetworkRegistry.FML_CHANNEL).get());
        out.add(proxyPacket);
    }
 
    // In line decoding and handling of the packet
    @Override
    protected void decode(ChannelHandlerContext ctx, FMLProxyPacket msg, List&lt;Object&gt; out) throws Exception {
        ByteBuf payload = msg.payload();
        byte discriminator = payload.readByte();
        Class&lt;? extends AbstractPacket&gt; clazz = this.packets.get(discriminator);
        if (clazz == null) {
            throw new NullPointerException(&quot;No packet registered for discriminator: &quot; + discriminator);
        }
 
        AbstractPacket pkt = clazz.newInstance();
        pkt.decodeInto(ctx, payload.slice());
 
        EntityPlayer player;
        switch (FMLCommonHandler.instance().getEffectiveSide()) {
            case CLIENT:
                player = this.getClientPlayer();
                pkt.handleClientSide(player);
                break;
 
            case SERVER:
                INetHandler netHandler = ctx.channel().attr(NetworkRegistry.NET_HANDLER).get();
                player = ((NetHandlerPlayServer) netHandler).playerEntity;
                pkt.handleServerSide(player);
                break;
 
            default:
        }
 
        out.add(pkt);
    }
 
    // Method to call from FMLInitializationEvent
    public void initialise() {
        this.channels = NetworkRegistry.INSTANCE.newChannel(&quot;TUT&quot;, this);
    }
 
    // Method to call from FMLPostInitializationEvent
    // Ensures that packet discriminators are common between server and client by using logical sorting
    public void postInitialise() {
        if (this.isPostInitialised) {
            return;
        }
 
        this.isPostInitialised = true;
        Collections.sort(this.packets, new Comparator&lt;Class&lt;? extends AbstractPacket&gt;&gt;() {
 
            @Override
            public int compare(Class&lt;? extends AbstractPacket&gt; clazz1, Class&lt;? extends AbstractPacket&gt; clazz2) {
                int com = String.CASE_INSENSITIVE_ORDER.compare(clazz1.getCanonicalName(), clazz2.getCanonicalName());
                if (com == 0) {
                    com = clazz1.getCanonicalName().compareTo(clazz2.getCanonicalName());
                }
 
                return com;
            }
        });
    }
 
    @SideOnly(Side.CLIENT)
    private EntityPlayer getClientPlayer() {
        return Minecraft.getMinecraft().thePlayer;
    }
 
    /**
     * Send this message to everyone.
     * &lt;p/&gt;
     * Adapted from CPW&#039;s code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper
     *
     * @param message The message to send
     */
    public void sendToAll(AbstractPacket message) {
        this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALL);
        this.channels.get(Side.SERVER).writeAndFlush(message);
    }
 
    /**
     * Send this message to the specified player.
     * &lt;p/&gt;
     * Adapted from CPW&#039;s code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper
     *
     * @param message The message to send
     * @param player  The player to send it to
     */
    public void sendTo(AbstractPacket message, EntityPlayerMP player) {
        this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER);
        this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player);
        this.channels.get(Side.SERVER).writeAndFlush(message);
    }
 
    /**
     * Send this message to everyone within a certain range of a point.
     * &lt;p/&gt;
     * Adapted from CPW&#039;s code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper
     *
     * @param message The message to send
     * @param point   The {@link cpw.mods.fml.common.network.NetworkRegistry.TargetPoint} around which to send
     */
    public void sendToAllAround(AbstractPacket message, NetworkRegistry.TargetPoint point) {
        this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT);
        this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(point);
        this.channels.get(Side.SERVER).writeAndFlush(message);
    }
 
    /**
     * Send this message to everyone within the supplied dimension.
     * &lt;p/&gt;
     * Adapted from CPW&#039;s code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper
     *
     * @param message     The message to send
     * @param dimensionId The dimension id to target
     */
    public void sendToDimension(AbstractPacket message, int dimensionId) {
        this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.DIMENSION);
        this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(dimensionId);
        this.channels.get(Side.SERVER).writeAndFlush(message);
    }
 
    /**
     * Send this message to the server.
     * &lt;p/&gt;
     * Adapted from CPW&#039;s code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper
     *
     * @param message The message to send
     */
    public void sendToServer(AbstractPacket message) {
        this.channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.TOSERVER);
        this.channels.get(Side.CLIENT).writeAndFlush(message);
    }
 }

&amp;link_edit(text=編集)
* Registering the Pipeline

 Because of the self contained nature of the packet pipeline the following is all that needs to be done to register your handler within FML

Within your @Mod Class
 public static final PacketPipeline packetPipeline = new PacketPipeline();
 
 @EventHandler
 public void initialise(FMLInitializationEvent evt) {
    packetPipeline.initialise();
 }
 
 @EventHandler
 public void postInitialise(FMLPostInitializationEvent evt) {
    packetPipeline.postInitialise();
 }

&amp;link_edit(text=編集)
* Registering Packets

 Packets can be registered up to the postInitialisation phase of the packet pipeline.
 Packet registration is performed by calling the registerPacket(Class&lt;? extends AbstractPacket&gt; clazz) method in the Packet Pipeline.

&amp;link_edit(text=編集)
* Implementation

 Using the packet pipeline is as simple as writing a custom class extending AbstractPacket and registering it with the pipeline. For example implementations please look at the links below: 
 Tinker&#039;s Construct Packets (Many thanks to fuj1n)
 Authors

--Sirgingalot 15:59 19 January 2014


----
&amp;link_edit(text=編集)    </description>
    <dc:date>2015-06-27T18:31:57+09:00</dc:date>
    <utime>1435397517</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/bbc_mc/pages/2.html">
    <title>メニュー</title>
    <link>https://w.atwiki.jp/bbc_mc/pages/2.html</link>
    <description>
      &amp;link_editmenu(text=編集)
[[トップページ]]
----


*AI
- AI概要
-- [[AI概要&gt;概要]]
-- [[EntityAITasks]]
-- [[EntityAITaskEntry]]
-- [[EntityAIBase]]
-- [[mutexの動作]]
- AI 作成の流れ
-- AI作成 (新AI用)

*modding
- 翻訳
-- [[SMP coding guideline]](翻訳)
- 翻訳（未完）
-- [[Github_&amp;_jenkins_buildsystem]](翻訳)
-- [[coremods tutorial(和訳)]]
-- [[Netty Packet Handling(和訳)]]

*自作MOD
- EasyAIInterface&gt;EAIとは・機能説明

*private
- [[プライベート]]

----
アクセスログ
　　総計：&amp;counter(total)
　　本日：&amp;counter(today)
　　昨日：&amp;counter(yesterday)
----

&amp;link_editmenu(text=編集)    </description>
    <dc:date>2014-07-09T14:25:00+09:00</dc:date>
    <utime>1404883500</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/bbc_mc/pages/30.html">
    <title>Github_&amp;_jenkins_buildsystem</title>
    <link>https://w.atwiki.jp/bbc_mc/pages/30.html</link>
    <description>
      &amp;bold(){Github &amp; jenkins buildsystem 勝手な和訳}

   以下のページの個人的和訳です。
       http://www.minecraftforge.net/wiki/Github_%26_jenkins_buildsystem
 
   現在、翻訳中です。(2013/09/13)
   そのため、まだ以下の手順を実際に試してません。。。

 なるたけ原文(英文)を併記しますので、意味不明・曖昧な場合は参照下さい。

----
目次
|#contents()|
---- 
&amp;link_edit(text=編集)

*How-To
 これは Minecraft Forge（もしくは関連するソフトウェア）の利用方法に関する、ハウツーガイド もしくはチュートリアルです。
 このチュートリアルは完全ではありませんので、ご注意下さい！
&amp;link_edit(text=編集)

* GitHub と Jenkins

このチュートリアルでは、jenkins と github を使ったビルドシステムをどうやって作るか、を説明していきます。&amp;br()
状況によっていくらか違いがあるのですが、できる限りがんばります。&amp;br()
この方法はあなたのソースコードをインターネットに公開しますので、その結果誰かがあなたのコードをコピーして使っても私に怒らないでください。&amp;br()
この翻訳（和訳者註：英文）はオランダ語で書かれたものを翻訳したものですので、完全な翻訳となっているかは保証しかねる事をご承知ください。&amp;br()
 In this tutorial I’m going to (try to) explain how to create a jenkins and github build system, this is different for each scenario, but I’ll do my best.
 This will put your source code on the internet, don’t be mad at me if someone copies it.
 Please note that is written on a Dutch system, not all translations might be 100% accurate.

事前準備：
+ root 権限を持っている Linux サーバ（VPS のサーバでもおそらく動きます。ただし、あなたはそのサーバにソフトウェアをインストールできる必要があります。）
-- Linux サーバは windows に比べて 200% くらいは速い、という事をあなたは知っておくべきかもしれません
+ mod を作成するコンピュータ(windows ... ?)
-- windows、と書きましたが、Linux や Mac でも構いません。但し、ここではそれらの環境特有の問題については述べません。
-- ここで windows と書いた理由は、GitHub for Windows(PCアプリ) のほうが、コマンドラインよりも簡単だからです。
+ Linux サーバへのファイルアクセス
-- FTP や samba

 Needed for this:
 A linux server with root access (a VPS might work, but you need to be able to install software) 
   As you should know a linux server is like 200% faster than a windows equivalent....
 A (windows) computer on which you mod.
   I say windows, but with some common sense and research you should be able to adapt to linux and mac too, but I don’t provide the instructions for that.
   The reason for this is primarily “GitHub for windows”. &gt;&gt; Basic command line experience.
   I’m not going to explain how to use the terminal.
 Easy file acsess to the servers file system ((s)FTP or samba file server is recommended)

&amp;link_edit(text=編集)
** Modding 環境の準備 / Preparing your modding environment
*** a) 開発環境PCに必要なプログラム / Programs needed on your PC (the modding machine):

- Github for Windows
- プログラムを作成するエディタ (Notepad++とか)
- コピー/ペースト機能付きのターミナルクライアント (PuTTYとか）

 Github for windows: [2]
 A note making program (Notepad++)
 A terminal client that supports copy/paste (PuTTY)

*** b) GitHub のセットアップ / Setting up GitHub

1.&quot;GitHub for Windows&quot; を開く&amp;br()
　あなたのリポジトリをここに作成する事をお勧めしますが、どの位置に保存するかが重要です。&amp;br()
　もしデータドライブ(和訳者註：C(システムドライブ)以外、の意味か）にするのであれば、以下のような構成がお勧めです。&amp;br()
 D:\modding\github\ModName
2.Mincraft の jar を取得(client / server) し、MCP と Forge をインストールする&amp;br()
3.あなたの mod を作成する&amp;br()
　あなたの mod を区分された package にしておく事で、元々の Minecraft や Forge のコードとあなたのコードの見分けが付きやすくなります。&amp;br()
4.Minecraft や Forge のコードは、あなたのリポジトリに入れてはいけません！！！&amp;br()
&quot;.gitignore&quot; で指定する事で、リポジトリに登録されなくすることができます。&amp;br()

 /bin/*
 /conf/*
 /docs/*
 /eclipse/*
 /forge/*
 /jars/*
 /lib/*
 /logs/*
 /modsrc/*
 /reobf/*
 /runtime/*
 /temp/*
 
 /src/minecraft/*
 /src/minecraft_server/*
 /src/common/*
 !/src/common/dries007/
 !/src/common/mcmod.info
 !/src/common/SP.png
 
 *.bat
 *.sh

 Open github for windows.
   I recommend creating your repo here.
   The location you pick is important.
   If you have a data drive, I recommend this structure: D:\modding\github\ModName
 Now you download a fresh copy of Minecraft (both client and server) and install MCP and forge.
   Hint for easier modding:
       If you use eclipse, make a shortcut to it in your mods folder and open the properties of the shortcut, and
       add “-data PathToEclipseFolder” to the target box so you get something like this: 
         “C:\ProgramEXEs\eclipse\eclipse.exe -data C:\Modding\GitHub\SimpleCore\eclipse”
       This will open Eclipse in the right folder and make your life easier if you use more then 1 project.
 Now you make your mod (or only a basic mod class so we can go on with the tutuorial ;-) ) 
   Make the mod in a separate package so you can easily filter it out of the original Minecraft and Forge code.
 Original code (both MC and Forge) CAN’T be in your repo!
   That&#039;s where the .gitignore file comes in. 
     Open it with your notepad. 
     This is where you specify what doesn’t go in the repo, mine looks like this:
 /bin/*
 /conf/*
 /docs/*
 /eclipse/*
 /forge/*
 /jars/*
 /lib/*
 /logs/*
 /modsrc/*
 /reobf/*
 /runtime/*
 /temp/*
 
 /src/minecraft/*
 /src/minecraft_server/*
 /src/common/*
 !/src/common/dries007/
 !/src/common/mcmod.info
 !/src/common/SP.png
 
 *.bat
 *.sh

追加説明: &amp;br()
- &quot;.gitignore&quot; の記載は、リポジトリ登録時に無視するファイルのリストです。
- &quot;!&quot; から始まる記載の場合、「無視対象から外す」意味となります。
- 基本的に、あなたの mod のファイル以外をすべて無視するように設定する必要があります。
-- あなたの mod が　package で区分けされているのであれば、上位ディレクトリを無視した上で、mod 用ディレクトリを ! 付きで指定することができます。
-- そうでなければ。。。ファイルをひとつづつ指定するしかないかもしれませんね！グッドラック！

  Let me explain:
    All the lines in here make an ignore rule. 
    Except the ones that start with !
    You basically need to tell github to ignore all files except your mod.
    If your mod is in a seperate package, you can do this by ignoring /src/common, except for /src/common/MOD. 
    If you didn’t, well good luck specifying all the files separately.

&amp;link_edit(text=編集)
** サーバーの準備 / Preparing your server
*** a) サーバーに必要なプログラム / Programs needed on your server:

- Jenkins (もし ubuntu を使うのであれば、以下をどうぞ http://pkg.jenkins-ci.org/debian/)
- Java / OpenSDK (http://openjdk.java.net/install/index.html )
- Wine (Ubuntu: http://www.winehq.org/download/ubuntu)

Jenkins (If you use ubuntu: http://pkg.jenkins-ci.org/debian/)
Java / OpenSDK (http://openjdk.java.net/install/index.html )
Wine (Ubuntu: http://www.winehq.org/download/ubuntu)

&amp;link_edit(text=編集)
*** b) Jenkins の設定 / Setting up Jenkins

+ Linuxサーバの 8080 ポートへお好きなブラウザでアクセスしてください（Chrome(ium)お勧め)
　Jenkins の管理画面が見れたでしょうか？もし見えなければ、以下のコマンドで jenkins を開始して下さい。
  &quot;/etc/init.d/jenkins start&quot;
+ (管理画面が開いたら) &quot;Manage Jenkins&quot; を選択し、&quot;Configure Global Security&quot; の画面へ移動
+ 以下の設定を確認
++ “Enable security”
++ “Jenkins&#039;s own user database”
++ “Allow users to sign up”
+ 設定/変更を保存
+ ユーザーを作成してログインし、&quot;Global Security&quot; が下記の通りか確認
++ “Project-based Matrix Authorization Strategy”
++ &quot;In the table&quot; あなたの求める通りのユーザーを作成してください（おそらく管理者？）
--- ここで、追加するユーザーの名前は、すでに存在しておりアクセス可能であるべきです。
--- それ以外の場合、jenkins が影響を及ぼすことがあります
+ 設定/変更を保存
+ やっと jenkins の設定を変更できます。
++ &quot;manage&quot; から &quot;Plugin management&quot; へ
--- &quot;Available&quot; から　&quot;GitHub plugin&quot; を選択
--- チェックボックスにチェックをつけ、“Download now and install after restart”ボタンを押下
--- ダウンロード画面で、&quot;restart once no jobs are running&quot; にチェック
+ Jenkins の設定は完了
-- 但し、まだ job は何も走っていない状態です。

  Got to SERVERHOST:8080 in your favorite browser (should be chrome(ium)) 
    This will give you the jenkins interface, if not, run “/etc/init.d/jenkins start”
  Hit “Manage Jenkins” and “Configure Global Security” 
  Check the following options:
    “Enable security”
    “Jenkins&#039;s own user database”
    “Allow users to sign up”
  Save.
  Now create a user and log in, then return to the global security section and check:
    “Project-based Matrix Authorization Strategy”
    In the table: Add a user you want to be (admin perhaps?) 
         This should be a username that exists and you have access to (like the one you just created). 
         Otherwise, jenkins will cheerfully and quickly cut off your ability to manage your own server.
    For anonymous: &quot;Read&quot; in Overall
    For Admin(User you just added): Check it all!
  Save. 
  Now only you can edit Jenkins settings.
  Now go to manage and then Plugin management. 
    In the “Available” tab you look for “GitHub plugin” (Currently right at the bottom of &quot;External Site/Tool Integrations&quot;)
    Click the check box, and hit “Download now and install after restart”. 
    In the download screen, check “restart once no jobs are running”
  Now your jenkins is done, but no jobs are running just yet.

&amp;link_edit(text=編集)
*** c) Jenkins Job の設定 / Setting up a Jenkins job.

+ Jenkins にログインし、&quot;New Job&quot; を押下
+ job に名称を登録し、1つ目のオプション &quot;free-style software project&quot; を選択
+ &quot;Enable project-based security&quot; にチェックを入れ、現在のユーザーを追加
+ &quot;Anonymous&quot; アカウントについては、Read/Workspace のみにチェック
+ テキストボックス &quot;Github Project&quot; にて、Github 用のユーザーでアクセスするための URL を与える
+ &quot;buildの実行タイミング&quot; については、&quot;手動で指示がある場合のみ&quot; を設定
+ あなたのユーザー名を入力
+ &quot;ソースコード&quot; セクションにて、Git を選択
+ Github の URL を入力 ( Git:// みたいなやつ)
+ &quot;Github (のレポジトリ) に変更があった場合、ビルドする&quot; を設定
+ ビルドステップのセクションで、&quot;シェルスクリプトを実行&quot; を追加
++ 入力欄が開くので、以下のコマンドを登録
++ ここで入力したスクリプトは、この後 Github に変更を push するたびに実行されます

 rm -r builds
 mkdir builds
 python runtime/recompile.py
 python runtime/reobfuscate.py
 zip -r -9 $WORKSPACE/builds/SimpleCore_src_$BUILD_NUMBER src/common/dries007/*
 zip -r -9 $WORKSPACE/builds/SimpleCore_src_$BUILD_NUMBER src/common/mcmod.info
 zip -r -9 $WORKSPACE/builds/SimpleCore_src_$BUILD_NUMBER src/common/SP.png
 cd reobf/minecraft
 zip -r -D -9 $WORKSPACE/builds/SimpleCore_$BUILD_NUMBER *
 cd ../..
 cd src/common
 zip -r -D -9 $WORKSPACE/builds/SimpleCore_$BUILD_NUMBER mcmod.info
 zip -r -D -9 $WORKSPACE/builds/SimpleCore_$BUILD_NUMBER SP.png
 cd ../..

 In Jenkins, hit “New job”. 
 Give a name and select the 1st option (Build a free-style software project)
 Now, you check: “Enable project-based security” and add your user, In the table, check everything behind your user. 
 Behind Anonymous you check Read and Workspace.
 In the textbox “Github Project” you can give a URL to forward the user to Github.
 Check: “Promote builds when...”, “Only when manually approved”. 
 In the box, put your username.
 In the source code section, select Git. 
 In the box put the GitHub url (the Git:// one)
 Check: “Build when a change is pushed to GitHub”.
 In the building steps section: Add a step: “Execute a shell sript”
 This gives you a box. 
 Ever time you push a change to GitHub this box will be executed. 

ここで、上記のスクリプトの内容を説明していきます。

 rm -r builds

古いビルドを削除します。

 mkdir builds

新しいビルドのため、ディレクトリを作成し直します。

 python runtime/recompile.py
 python runtime/reobfuscate.py

（わかるよね…？）&amp;br();
(※翻訳者注: mcp に同梱されているスクリプトを実行し、recompile と reobfuscate します)&amp;br();

 zip -r -9 $WORKSPACE/builds/SimpleCore_src_$BUILD_NUMBER src/common/dries007/*
 zip -r -9 $WORKSPACE/builds/SimpleCore_src_$BUILD_NUMBER src/common/mcmod.info
 zip -r -9 $WORKSPACE/builds/SimpleCore_src_$BUILD_NUMBER src/common/SP.png

ここで行っている事は OPTIONAL(しなくても良い) です。&amp;br();
あなたのコードもまた github にある場合、この工程は不要です。&amp;br();
この工程では mod のファイルをビルドフォルダ内の zip に含めています。&amp;br();
OPTIONAL: (Your code is on github too, you don’t need this, but it copies the mod’s files to a zip in the builds folder)

 cd reobf/minecraft
 zip -r -D -9 $WORKSPACE/builds/SimpleCore_$BUILD_NUMBER *
 cd ../..
 cd src/common
 zip -r -D -9 $WORKSPACE/builds/SimpleCore_$BUILD_NUMBER mcmod.info
 zip -r -D -9 $WORKSPACE/builds/SimpleCore_$BUILD_NUMBER SP.png
 cd ../..

この部分では、mod のコード(.javaではなく .class等)（と、mcmod.info やロゴファイル) を zip へ含めています。&amp;br();
&quot;SimpleCore&quot; と書いている部分は、あなたの mod 名に書き換えて下さい。&amp;br();
 This part copies the actual mod code (And the mcmod.info and my logo) to a zip.
 You should replace the “SimpleCore” with your mods name.

これらの作業結果が正しく動作するかどうかをテストするために、&quot;Archiving the artifacts&quot; という post-build action を追加します。
+ 実行内容を記載する欄が表示されたら、以下を記入します。

 builds/*.zip

==&gt; builds/*.zip に関するエラーが表示されたとしても気にしないで下さい。&amp;br();
これは .zip フォルダがあなたの builds フォルダ内に無い事による警告表示であり、無視できます。&amp;br();
builds フォルダ内に .zip フォルダを配置することでこのエラーを回避できますが、どちらでもお好きな対策でかまいません。
 Now we need to tell jenkins what the result of the hard work is by adding a post-build action: “Archiving the artifacts” (? translation....) In the little box you put this: “builds/*.zip”
 ==&gt; If you get an error about “builds/*.zip” not meaning anything, it simply detects no .zip in your freshly made builds folder. 
 You can make an empty .zip to evade that, but it doesn&#039;t matter.
 Now you have a configured job. 
 Now you need to:

&amp;link_edit(text=編集)
*** d) Build 環境の設定 / set up the building environment

+ サーバへファイルを送受信する準備をして下さい。
+ /var/lib/jenkins/jobs フォルダへ移動します
++ このフォルダにはあなたの mod 名のフォルダがあるはずです。このフォルダを開き、&quot;workspace&quot; という名前の新しいフォルダを作成して下さい。
++ このフォルダ内に、あなたの modding フォルダの中身を &quot;完全に全て&quot; コピーして下さい。(例: D:\modding\github\ModName)
++ workspace フォルダ内に builds フォルダがある事を必ず確認して下さい。（無い場合、ビルドが失敗します）。さて、お好きな飲み物を飲んできて下さい！コピーには時間がかかりますからね。
++ コピーが終わったら、コピーしたファイルへのアクセス権限を jenkins に与えて下さい。
ターミナルからだと、以下の様な感じでしょう。

 “chmod 777 /var/lib/jenkins/jobs/ModName -R”

forge や MC をアップデートする度に、上記の工程が必要となります。
jenkinsサーバと開発用PCで、forge や MC のバージョンを合わせておく必要があります。

さて、では build をテストしてみましょう。

+ 手動でテストを行い、次に github との連携確認を行います。
+ 手動で build を開始するには、jenkins の画面をブラウザで開いて job を選択し、&quot;build now&quot; ボタンを押下します。
+ 結果を見るには、スタートさせた build の画面を開き、&quot;コンソール&quot; ボタンを押下します。

ログの末尾が「Finished: SUCCESS」で終わっていれば OK です。

最後に、github へ変更を push して、この結果が幸運によらないものである事を確認したら、パーティへ出かけましょう！

 Open the way you send files back and forth with your server. 
 Go (on the server) to /var/lib/jenkins/jobs/
 In this folder there will be a folder with the name of your mod, open it and make a new folder here called “workspace”. 
 In here you copy the entire(!) modding folder (D:\modding\github\ModName)
 Make sure there is a builds folder in the workspace or your build WILL FAIL.
 Go get a coffie/wathever you like, this might take a while. 
 If its done you need to give jenkins permission to edit these files, do this by executing this command in terminal: “chmod 777 /var/lib/jenkins/jobs/ModName -R”
 Every time you update forge or MC this needs to happen, you need the same version of Forge and MC on your server and your PC.
 Now you can test a build (begin manually, after that do a test by pushing something in github) To manually start a build, go to jenkins (in browser) and click on your job, then hit “build now”. 
 To see the result, go to the build you just started and hit “Console”.
 If your log ends with “Finished: SUCCESS”, try again (with github) to make sure it wasn’t luck and then go and throw a party.
----
&amp;link_edit(text=編集)    </description>
    <dc:date>2013-10-07T08:37:25+09:00</dc:date>
    <utime>1381102645</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/bbc_mc/pages/27.html">
    <title>SMP coding guideline</title>
    <link>https://w.atwiki.jp/bbc_mc/pages/27.html</link>
    <description>
      &amp;bold(){SMP Coding Guideline 勝手な和訳}

 以下ページの勝手な和訳です。
 http://www.minecraftforge.net/wiki/SMP_Coding_Guidelines
 
 2013/09/09 訳終了

----
目次
|#contents()|
---- 
&amp;link_edit(text=編集)
*はじめに In general

Minecraft のサーバ (もしくは、その他の一般的なゲームサーバ) がどのように動いているか、考えてみて下さい。&amp;br();
基本的にクライアントとサーバでは同じゲームが動いていますが、サーバはあなたが何をすることが出来て何をすることが出来ないかの判定を受け持っているため、クライアント側で何が起きているかの更新を受け取り続ける必要があります。
Minecraft のサーバは非常に柔軟であり、(特にplayerの動きについては) 鷹揚に受け入れてしまいます。そのため、「一段の段差を登れるようにする」ような簡単な動作を行う mod であれば、サーバ側に変更を加えることなく動作させることが出来ます。
しかし、これには限度があります。default では、明白に飛んでいるような動作や異常な移動速度は kick されます。
Minecraft の同期の仕組みは &quot;おおざっぱ&quot; であり、Block や Entity の位置情報は数秒に一回程度しかクライアントへ送信されません。そのため、クライアントの動作はサーバ側と極力同じように動作する必要があるのです。

 Consider how Minecraft servers (or any game servers) work.
 Basically, both your client and the server are running the same game, but the server has authority over what you can or cannot do, and because of that, needs to be kept updated about what your client does.
 The Minecraft server is very flexible when it comes to allowing things (especially player movement), so simple clientside mods like stepping over 1 height blocks are possible without changing anything on the server.
 However, it does by default make sure you cannot fly too obviously, and does only allow you to move so fast before kicking.
 Minecraft synchronizes very lazyily, Blocks and Entity Positions only get sent every couple seconds to a client, so your clientside needs to do pretty much the same as your serverside.

「…で、SMP 用のコードはどう書けばいいの？」って？&amp;br();
では何が必要か見ていきましょう。

So how do I code now for SMP?
Let&#039;s clarify what needs to be networked: 

&amp;link_edit(text=編集)
* ブロックの配置/破壊 Blocks setting/breaking

特に通常の Modding と変わりません。&amp;br();
あなたは Block を変更する Mod を作る場合、クライアントとサーバのどちらにあるかを区別する必要はありません。
クライアント側のワールドを構成するブロックは数秒ごとに更新されますし、クライアント側での World.setBlock はサーバ側へ影響を及ぼしません。

 No.
 You do not have to change anything to have a Block-changing mod work on server, you do not have to think about distinguishing client/server, the clientside &quot;Block ID at World XYZ&quot; is synchronized every couple seconds, and a clientside World.setBlock wont do anything on a server.
 ( It will only make your client already presume the new Block, which means you will have no glitch until the server sends you the new data )


*Tile Entities

変更点があります。&amp;br();
すべての Inventory や Container はクライアント側とサーバ側の双方で保存されますが、もし差異が生じた場合、サーバ側のデータによってクライアント側のデータが上書きされます。
Forge の IGuiHandler クラスや、MinecraftForge.registerGuiHandler 関数のコードを参照すれば、利用方法のアイデアが浮かぶと思います。
&amp;br();
Strong Hint:&amp;br();
EntityPlayer.openGui をクライアント/サーバのどちらでも利用するのがお勧めです。

 Yes.
 Any Inventory/Container is stored both client and serverside, but if they differ, the server will always override (and overwrite) your client&#039;s inventory.
 Read the Forge IGuiHandler and MinecraftForge.registerGuiHandler source to get an idea of how to accomplish networking here.
 Strong Hint: Use EntityPlayer.openGui both client and server, in which case you don&#039;t even need to have differing client/server sources.
 Check out existing Forge Mods on how to pull it off.


&amp;link_edit(text=編集)
*Items

特に変更点はありません。&amp;br();
アイテムを使用する関数はクライアント/サーバの双方で呼び出されますが、SMP で機能するようにするためにあなたが変更を加えなければならない部分はありません。
&amp;br();Note: ただし！ Entity を発生されるアイテムについては注意が必要です。&quot;Entity&quot; の項目を参照してください。
&amp;br();Note2: 地面に落ちているアイテムは含みません。落ちているアイテムは EntityItem のインスタンスですが、これについて何かしなくてはならない事はありません。

 No.
 The item usage methods are called both on client and server, which generally means you don&#039;t have to change anything to keep your Item working in SMP.
 NOTE: This does not include an Item that spawns Entities of any kind! See &quot;Entities&quot;.
 NOTE #2: This does not include dropped Items.
 Dropped anything is an instance of EntityItem, which generally does not need any actions on your part.


&amp;link_edit(text=編集)
* Entity (EntityItem 以外) Entities (that aren&#039;t EntityItem)

対応が必要です。&amp;br();
少なくとも、クライアントが Entity の発生を伝える Packet を受け取れるように Forge に EntityTracker を登録する必要があります。
あなたの Mod が Entity を発生させる時は、実施するワールドがリモートであることを確認してください。（ worldObj.isRemote == false）
もし間違えると、見た目だけのにせものの Entity が発生します。

 Yes.
 At the very least, you need to tell Forge to register an EntityTracker for clients to receive spawn packets about your Entities.
 Whenever your mod spawns an Entity, make sure the World is not a remote World (so worldObj.isRemote must be false), or you will have a dummy dupe Entity.

あなたは通常必要です network field の値をサーバからクライアントへ&amp;br();
バニラの DataWatchers のコードを読んでみてください。狼のテイムに関するコードは、教材として非常に良いものです。
できる限り、DataWatchers を使用するようにしてください。
あなたの DataWatcher 用に値を選択する場合、Overclasses DataWatcher value のために空きを残すようにしたほうが良いです。
それらが、いつ・より多くの数字を占有しようとするかわからないからです。

&amp;br();Hint: クライアント側で dataWatchers を変更しないようにしてください。もし変更した場合、サーバ側からの更新との仁義なき戦いが待っています。

 You will usually need to network field values from server to client (prominent vanilla example being taming).
 Read the vanilla code on DataWatchers, the Wolf taming code is an excellent learning example.
 Use DataWatchers whenever possible.
 When selecting a value for your DataWatcher better leave space to the Overclasses DataWatcher values - you never know if and when they decide to occupy more numbers.
 Hint: Make sure the client cannot *write* to dataWatchers or there will be a merciless update battle.

あなたがしようとしていることによっては、dataWatchers では達成できないかもしれません。&amp;br();
特に迅速な反応が必要な場合には、Forge Packets のコードを読んで、利用してみてください。&amp;br();

 For stuff you absolutely cannot do through dataWatchers, perhaps because response time is critical, read up on Forge Packets and how to use them.

もしあなたが Forge ISpawnHandler Interface を実装した場合、新たに発生した Entity には追加の ByteStream が用意されるため、好きなものをやり取りすることができます。

 If you implement the Forge ISpawnHandler Interface, it will automatically pass an additional ByteStream to newly spawned Entities of yours, and you can put anything you desire and need into that stream.

&amp;br();注意:あなたのクライアントは、基本的にはサーバと同じコードで Entity を処理しています。しかし、そのためにはサーバと同じ情報が必要です。あなたの Entity が World に変化を生じさせる場合は、クライアント側がそれを知る方法を準備する必要があります。
 Remember:
  Your client simulates any given Entity with basically the same code the server is running.
  But it needs to have the same data! So if your World changes something in your Entity, make sure the client gets notified about it!

&amp;link_edit(text=編集)
*Graphics/Models/Rendering/Sound

音声・描画に関する事柄は、完全にすべてクライアント側にあります。&amp;br();

もしブロックや Entity が音を生じるようにした場合、クライアント側のクラスはクライアント側とサーバ側の両方の world でそれが起こるようにしなくてはなりません。
もしどのような音が生じるかを決めるために何かのデータが必要な場合は、Forge Packets を読んで、サーバからクライアントへデータパケットを送るようにする必要があります。
&amp;br();&amp;br();テクスチャについても同様です。
もしクライアントのデフォルト設定から何か変更があった場合、クライアント側へどうにかして伝える必要があります。
もしなにもなければ、特になにもする必要はありません。

 Anything audiovisual is completely clientside.
 If your Blocks or Entities create sounds, make sure the clientside classes will create those in both client and server worlds.
 If you need any data to decide what sounds need to be played - read up on Forge Packets and send Packets with that data from sever to client.
 Same for textures.
 If they change from the client default at any moment in time, you need to notify clients about it somehow.
 If not, you need not do anything.

「何も教えてくれてないじゃないか！」&amp;br();
その通り！&amp;br();
手取り足取りでは、modding が出来るようにならない、と私は考えています。&amp;br();
バニラのコードを読んでください。&amp;br();
他の人々が作成した SMP版 mod のコードを読んでください。&amp;br();

&amp;br();そして、観察し、学んでください。&amp;br();&amp;br();

基本的なコンセプトを理解しさえすれば、それは難しい事ではありません。
詳細について知りたければ、IRC で質問をするという方法もあるのですから。

 「You still havent told me anything!!」

 Correct! I do not believe holding someone&#039;s hand will make any decent modder out of him.
 Read the vanilla source, read other people&#039;s SMP mods source, OBSERVE AND LEARN.
 It&#039;s not particularly hard once you get the concepts.
 And you can always ask in the IRC channels for specifics.

一般的なポイントをあといくつか挙げておきます。

 Some more pointers for coding in general

-すべきこと Do
-- あなたのコードにコメントを書きましょう。また、名前をつける時は意味のある名前にしましょう
---あなた自身や誰かが数ヵ月後にそのコードを見たときに、関数のことを「何かしているヤツ」と呼ぶ羽目になります。
-- Notch のクラスから継承しているあなたのクラスの全ての関数には、@Override アノテーションをつけましょう
---MCP が関数名のマッピングを変更した場合、すぐに知ることが出来ます。
-- World に変化を及ぼす「すべての」関数は、現在の World （そして必要なら player）を引数として渡すようにしましょう
---サーバ側から見ると、多くの world と多くの player が居るのです。
-- Minecraft のコードやクラスを出来るだけ利用しましょう
---利用したほうが作業が減りますし、Minecraft との親和性も増します。
-- World.isRemote を利用して、modが動作している world がクライアントかサーバかを判別しましょう。そして、明確なコードを書きましょう
---コード上のその場所で何をしているかを明確にすることで、厄介なバグを取り除く作業が後々楽になります。
-- MinecraftForge のクラスをいろいろと見てみてください
---特に、ModLoader.getMinecraftServerInstance.configManager が何をしているかを見てみてください。

 comment your code, and give everything meaningful names.
   If you or someone else looks at it months later, you will curse the guy who called this method &quot;doStuff&quot;
 put @Override annotations on every method your custom classes inherit from Notch classes.
   If MCP changes mappings, you will know immediatly.
 make sure *any* World interaction methods always pass the current World as argument, and the player if one is concerned.
   A server has multiple Worlds and many players.
 use MC code and -classes wherever possible.
   It saves work and makes your mod comply better with Minecraft.
 use World.isRemote to decide if a world is client or serverside, and act accordingly write clean, legible code.
   It makes the pesky bug hunting later a lot easier if you can actually comprehend what you did there.
 check out the MinecraftForge class on what it has to offer you
   also check out ModLoader.getMinecraftServerInstance.configManager on what it offers (in particular, sending Packets to players) 

-すべきではないこと Don&#039;t
-- 絶対確実にクライアント側であることが保証できないが、ModLoader.getMinecraftInstance.theWorld や ModLoader.getMinecraftInstance.thePlayer を使用する
---これらの関数は、サーバ側では決して動作しません。
-- 2 行の変更のために、minecraft のクラスをまるごとコピーする
---extends や @Override を利用して、変更したい部分だけを変更しましょう。
-- World.isRemote が true の時（サーバ側ではない）に、World.spawnEntity を使う
---やめましょう。
-- 特に方針や方向性は決まってないが、とりあえずコードを書いてみる
---後になってコードを修正しようとしたときに、少なくとも 3 倍以上の労力が必要となるでしょう

 use ModLoader.getMinecraftInstance.theWorld and ModLoader.getMinecraftInstance.thePlayer in anything that isn&#039;t strictly client.
   This will NEVER work on a server.
 copy entire minecraft classes only to change 2 lines.
   Use &quot;extends&quot; and &quot;@Override&quot; on what you need changed!
 use World.spawnEntity when World.isRemote is true.
   Never.
 code without a plan.
   If you have to unscrew your code later, you will do the triple amount of work at least.

&amp;link_edit(text=編集)
----    </description>
    <dc:date>2013-09-24T14:10:07+09:00</dc:date>
    <utime>1379999407</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/bbc_mc/pages/31.html">
    <title>coremods tutorial(和訳)</title>
    <link>https://w.atwiki.jp/bbc_mc/pages/31.html</link>
    <description>
      &amp;link_edit(text=編集)
 翻訳者コメント
   以下のページの個人的和訳です。
       http://www.minecraftforum.net/topic/1854988-tutorial-162-changing-vanilla-without-editing-base-classes-coremods-and-events-very-advanced/
 
   現在、翻訳中です。(2013/09/16)
   そのため、まだ以下の手順を実際に試してません。。。

 なるたけ原文(英文)を併記しますので、意味不明・曖昧な場合は参照下さい。

----
&amp;link_edit(text=編集)





----
&amp;link_edit(text=編集)    </description>
    <dc:date>2013-09-17T00:31:48+09:00</dc:date>
    <utime>1379345508</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/bbc_mc/pages/28.html">
    <title>mutexの動作</title>
    <link>https://w.atwiki.jp/bbc_mc/pages/28.html</link>
    <description>
      &amp;bold(){mutexの動作}

----
目次
|#contents()|
----
* mutex

EntityAIBase クラスの mutex の動作について記載する。&amp;br()

&amp;link_edit(text=編集)
** mutexとは

同時実行できないタスクを示すために、bit フラグを利用する。
二つのタスクの mutex_bit を AND 処理し、同じフラグが一つでも立っていた場合はそれらのタスクは同時に実行できないと判断する。
 例) taskA (0001(10進数表記で 1)), taskB(0010(10進数表記で 2)) は、同時に実行可能
     
     taskA  0001
     taskB  0010
     -----  ----
            0000 =&gt; 同時実行可能

 例) taskA (0001(10進数表記で 1)), taskC(0011(10進数表記で 3)) は、同時に実行不可能
     
     taskA  0001
     taskC  0011
     -----  ----
            0001 =&gt; 同時実行不可能


&amp;link_edit(text=編集)
** 各AIのmutex値

1.6.2 forge804

|Filename|mutex|1|2|4|8|h
|EntityAIAvoidEntity.java|1|1|0|0|0|
|EntityAICreeperSwell.java|1|1|0|0|0|
|EntityAIDefendVillage.java|1|1|0|0|0|
|EntityAIFleeSun.java|1|1|0|0|0|
|EntityAIHurtByTarget.java|1|1|0|0|0|
|EntityAIMoveIndoors.java|1|1|0|0|0|
|EntityAIMoveThroughVillage.java|1|1|0|0|0|
|EntityAIMoveTowardsRestriction.java|1|1|0|0|0|
|EntityAIMoveTowardsTarget.java|1|1|0|0|0|
|EntityAINearestAttackableTarget.java|1|1|0|0|0|
|EntityAIOwnerHurtByTarget.java|1|1|0|0|0|
|EntityAIOwnerHurtTarget.java|1|1|0|0|0|
|EntityAIPanic.java|1|1|0|0|0|
|EntityAIPlay.java|1|1|0|0|0|
|EntityAIRunAroundLikeCrazy.java|1|1|0|0|0|
|EntityAIWander.java|1|1|0|0|0|
|EntityAIArrowAttack.java|3|1|1|0|0|
|EntityAIAttackOnCollide.java|3|1|1|0|0|
|EntityAIFollowGolem.java|3|1|1|0|0|
|EntityAIFollowOwner.java|3|1|1|0|0|
|EntityAILookAtVillager.java|3|1|1|0|0|
|EntityAILookIdle.java|3|1|1|0|0|
|EntityAIMate.java|3|1|1|0|0|
|EntityAIOcelotAttack.java|3|1|1|0|0|
|EntityAITempt.java|3|1|1|0|0|
|EntityAIVillagerMate.java|3|1|1|0|0|
|EntityAIWatchClosest2.java|3|1|1|0|0|
|EntityAILeapAtTarget.java|5|1|0|1|0|
|EntityAIOcelotSit.java|5|1|0|1|0|
|EntityAISit.java|5|1|0|1|0|
|EntityAITradePlayer.java|5|1|0|1|0|
|EntityAIControlledByPlayer.java|7|1|1|1|0|
|EntityAIEatGrass.java|7|1|1|1|0|
|EntityAIBeg.java|2|0|1|0|0|
|EntityAIWatchClosest.java|2|0|1|0|0|
|EntityAISwimming.java|4|0|0|1|0|
|EntityAIAvoidEntitySelector.java|その他|0|0|0|0|
|EntityAIBase.java|その他|0|0|0|0|
|EntityAIBreakDoor.java|その他|0|0|0|0|
|EntityAIDoorInteract.java|その他|0|0|0|0|
|EntityAIFollowParent.java|その他|0|0|0|0|
|EntityAILookAtTradePlayer.java|その他|0|0|0|0|
|EntityAINearestAttackableTargetSelector.java|その他|0|0|0|0|
|EntityAINearestAttackableTargetSorter.java|その他|0|0|0|0|
|EntityAIOpenDoor.java|その他|0|0|0|0|
|EntityAIRestrictOpenDoor.java|その他|0|0|0|0|
|EntityAIRestrictSun.java|その他|0|0|0|0|
|EntityAITarget.java|その他|0|0|0|0|
|EntityAITargetNonTamed.java|その他|0|0|0|0|
|EntityAITaskEntry.java|その他|0|0|0|0|
|EntityAITasks.java|その他|0|0|0|0|

----
&amp;link_edit(text=編集)
----    </description>
    <dc:date>2013-09-14T00:11:12+09:00</dc:date>
    <utime>1379085072</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/bbc_mc/pages/20.html">
    <title>EntityAITasks</title>
    <link>https://w.atwiki.jp/bbc_mc/pages/20.html</link>
    <description>
      &amp;bold(){EntityAITasks}

 10/10
   本ページは作成中です。
   項目の不足・不備が多数あります。

----
目次
|#contents()|
----
* EntityAITasks

EntityAITasks クラスの機能・実装について記載する。&amp;br()

&amp;link_edit(text=編集)
** 機能
EntityAITasks クラスは、AI の管理クラスである。&amp;br()

主な機能は以下の通り。&amp;br()

- 実行候補 AI リスト (taskEntries) の保持
- 実行する AI リスト (executingTaskEntries) の作成
- 実行する AI リストの更新
- 実行する AI リストの保持
- AIの実行

このクラスは EntityLiving クラスの変数として宣言されており、継承した生物クラスは全てこのクラス変数を持つ。&amp;br()
このクラスの更新関数 onUpdateTasks() は EntityLiving の onUpdate() から呼び出されている。&amp;br()

** フィールド
*** public List taskEntries
実行候補となる AIを登録しておくリスト。&amp;br()
登録は EntityAITaskEntry クラスを利用する。&amp;br()

*** private List executingTaskEntries
現在実行している AI を登録しておくリスト。&amp;br()
後述する onUpdateTasks() でリストのメンバーは更新・実行され続ける。&amp;br()

&amp;link_edit(text=編集)
** 関数

&amp;link_edit(text=編集)
*** void addTask(int, EntityAIBase)
 int proiority
 EntityAIBase 

実行対象とする AI を登録する。&amp;br()
priority の値が小さい AI の方が (基本的には) 優先的に実行される。&amp;br()
priority の値についての詳細は[[こちら&gt;EntityAITasksEntry]]に記載した。&amp;br()

*** void removeTask(EntityAIBase)

登録されている AI を削除する。

引数に渡す EntityAIBase は、登録に使用したインスタンスである必要がある。

*** void onUpdateTasks()

実行対象 AI の update を行う。
実行される内容は以下の通り。
+ taskEntries (実行候補AIリスト) に属する AI について、executingTaskEntries(実行するAIリスト) への登録判定・処理を行う

*** boolean canContinue(EntityAITaskEntry)

引数に与えられたAIが動作を続行するかどうかを返す。

*** boolean canUse(EntityAITaskEntry)

引数に与えられたAIと現在実行中のAI(あれば)を比較し、どちらを実行するかを判定し、結果を返す。&amp;br()

priorityのチェックや mutexBit を使った同時実行可能性の確認(areTasksCompatible呼び出し) が行われる。&amp;br()

*** boolean areTasksCompatible(EntityAITaskEntry, EntityAITaskEntry)

引数に与えられた AI が同時実行可能かどうかをチェックし、結果を返す。&amp;br()
mutexBit を使った同時実行可能性の確認が行われる。
詳細は [[別ページ&gt;http://www50.atwiki.jp/bbc_mc/pages/28.html]] に記載する。

&amp;link_edit(text=編集)

----    </description>
    <dc:date>2013-09-14T00:10:23+09:00</dc:date>
    <utime>1379085023</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/bbc_mc/pages/15.html">
    <title>概要</title>
    <link>https://w.atwiki.jp/bbc_mc/pages/15.html</link>
    <description>
      &amp;link_edit(text=編集)
----
目次
|#contents()|
----
* 概要
** &quot;旧&quot;AI、&quot;新&quot;AIとは
Minecraft ver1.2 で、それまでの AI とは異なる &quot;新&quot; AI が実装された。
ただし、いまだに一部 mob は &quot;新&quot; AI で動作していない。
&quot;新&quot; AI では mob の動作ロジックが改善され、例えば移動時にダメージを受けるような高所から降りる経路を取らなくなった。その結果として、それまで Creeper がダメージを受けてでも飛び降りて襲  ってきていたのが無くなった。

&quot;旧&quot; AI システムと &quot;新&quot; AI システムの大きな違いとしては、&quot;旧&quot; AI ではEntityLiving の onUpdate 内で AI としての処理を行っていた所、&quot;新&quot; AI ではタスクベースの管理システムが実装された。(EntityAITasks)

現在見られる EntityAI～ というクラスは、&quot;新&quot; AI システムで利用される個別タスクの実装クラスとなっている。

以下では、&quot;新&quot;AI システムについて、説明を行う

** AIの基礎を構成するファイル
AI システムを構成するファイルは、大きく分けると以下の通りである。
-EntityAITasks
  AI のリストを保持し、どの AI を実行するかを切り替える管理用クラス。各Mobでインスタンスを持つ。
  EntityLiving で宣言されており、EntityLiving.onUpdate 内から定期的に update を呼び出されている。
  EntityLiving では、通常動作用と戦闘用の 2 つのインスタンスを保持している。
-EntityAITasksEntry
  EntityAITasks に登録する単位。
  登録先の EntityAITasks と、AI の実行重要度(priority)、EntityAIBase を継承したクラスへの参照を持つ。
-EntityAIBase
  すべての AI の基礎となるベースクラス。
  新AI はこのクラスを継承して作成されている。
-EntityAITarget
  EntityAIBase を継承する抽象クラス。
  戦闘に関する AI はこのクラスを継承して作成されている。

* 基礎となるクラス
** EntityAITasks

Mob の AI は、EntityLiving で定義されている以下に格納されている。

&gt;EntityAITasks tasks;
&gt;EntityAITasks targetTasks;

** EntityAITaskEntry

** EntityAI～
&amp;link_edit(text=編集)

* 特徴的な仕組み
** shouldExecute
 EntityAIBase を継承するタスクは全てこの関数を実装している。 
 この関数は EntityAITasks により実行され、タスクを今実行すべきかどうかをタスクが判断し、真偽値を返す。
 # これは重要なポイントで、&quot;タスク自身&quot; が判断しており、管理クラスはそれをそのまま受け入れている。
 真を返した場合、より優先されるタスクが実行されていない限り、そのタスクが実行される。

** mutex_bit
同時実行できないタスクを示すために、bit フラグを利用する。&amp;br()
詳細は [[別ページ&gt;http://www50.atwiki.jp/bbc_mc/pages/28.html]] に記載する。


** priority
より小さい値をもつタスクが優先的に実行される。
- 同時に実行できないタスクの場合に、executingList への登録が優先される
ただし、priority 値が大きい AI が executingList へ先に登録される場合、後から priority 値が小さい AI が登録されるが、先に登録された AI には特に何も影響がない。(要・確認）

&amp;link_edit(text=編集)

----    </description>
    <dc:date>2013-09-14T00:01:03+09:00</dc:date>
    <utime>1379084463</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/bbc_mc/pages/19.html">
    <title>EntityAIBase</title>
    <link>https://w.atwiki.jp/bbc_mc/pages/19.html</link>
    <description>
      &amp;link_edit(text=編集)
----
目次
|#contents()|
----
* EntityAIBase ってなに？

EntityAIBase は、これから作成する AI のベースとなる、抽象クラスである。&amp;br()

既に作成されている AI を探してソースを読むと、このクラスを継承していくつかの関数を Override していることが分かる。&amp;br()
今後自作の AI を作成する場合は、このクラスを継承したクラスを作成していく事になるので、&amp;br()
このクラスにどんな変数や関数があるか、その機能はどんなものかを理解しておく事が重要になる。

* 一覧
** mutexBits

この値は、複数の AI 間で同時に実行できるかどうかを示すために使用する。&amp;br()
この値をうまく利用する事で、作成した AI の行動が他の AI によって邪魔される事を防ぐ事ができる。&amp;br()

例えば、「右へ行け！」という指示をあなたの AI が出していたとする。&amp;br()
この時に、mutexBits が適切に設定されていないと、「左へ行け！」という他の AI の指示が上書きされてしまうかもしれない。&amp;br()

詳細は [[別ページ&gt;http://www50.atwiki.jp/bbc_mc/pages/28.html]] に記載する。

** shouldExecute

「今の状況で、この AI を実行し&amp;color(red){始める};べきか」を返す関数。&amp;br()
EntityAITasks という、複数の AI を管理しているクラスから呼び出される。&amp;br()

** continueExecuting

「今の状況で、この AI を実行し&amp;color(red){続ける};べきか」を返す関数。&amp;br()
EntityAITasks という、複数の AI を管理しているクラスから呼び出される。&amp;br()

** isInterruptible()

「より priority の小さい（優先されるべき）AI を実行しようとする場合に、この AI を途中で中止できるか」を返す関数。&amp;br()
true を返すと、priority の差にかかわらずこの AI の動作が完了するかこの AI 自ら停止するまで、他の AI に邪魔される事がない。&amp;br()

** startExecuting()

AI の動作を行う（１つ目）&amp;br()
後述の updateTask() の前に実行されるようになっているため、AI の本格的動作前の初期化処理や、簡単ですぐ終わる処理が記載される。&amp;br()

特に理由がなければ、主な処理は updateTask() に書けばよいはず。

** resetTask() &amp;br()

AI の動作の後処理を行う。

** updateTask()

メインの処理を記載する。&amp;br()

** setMutexBits() / getMutexBits()

MutexBit の getter / setter。
詳細は [[別ページ&gt;http://www50.atwiki.jp/bbc_mc/pages/28.html]] に記載する。


&amp;link_edit(text=編集)

----    </description>
    <dc:date>2013-09-13T23:56:39+09:00</dc:date>
    <utime>1379084199</utime>
  </item>
  </rdf:RDF>
