mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-16 18:45:09 +00:00
Initial 1.13.2 update. Major thing to note is that Dimensions have been completely revamped.
DimensionType is not unique per Dimension. See DimensionManager for more details. Vanilla now has a chunk loading system, so Forge's will need to be deprecated/adapted.
This commit is contained in:
1 parent
9a1688599a
commit
ca72710937
361 files changed
+3166
-3547
No files matched your search
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package net.minecraftforge.common;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.world.dimension.Dimension;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraftforge.registries.ForgeRegistryEntry;
|
||||
|
||||
/**
|
||||
* In 1.13.2, Mojang made DimensionType as the unique holder/identifier for each Dimension.
|
||||
* We used to be able to create custom Dimensions separate from DimensionType.
|
||||
* But now that they are hard linked to a single instance, this is the new class that
|
||||
* defines the 'template' for new dimensions.
|
||||
*/
|
||||
public abstract class ModDimension extends ForgeRegistryEntry<ModDimension>
|
||||
{
|
||||
public abstract Function<DimensionType, ? extends Dimension> getFactory();
|
||||
|
||||
/**
|
||||
* Serialize any necessary data, this is called both when saving the world on the server.
|
||||
* And when sent over the network to the client.
|
||||
*
|
||||
* @param buffer The data buffer to write to.
|
||||
* @param network true when sent over the network, so you can only data needed by the client.
|
||||
*/
|
||||
public void write(PacketBuffer buffer, boolean network){}
|
||||
|
||||
/**
|
||||
* Deserialize any necessary data, this is called both when saving the world on the server.
|
||||
* And when sent over the network to the client.
|
||||
*
|
||||
* @param buffer The data buffer to write to.
|
||||
* @param network true when sent over the network, so you can only data needed by the client.
|
||||
*/
|
||||
public void read(PacketBuffer buffer, boolean network){}
|
||||
}
|
||||
Reference in new issue
Block a user