Category: Tips

How To Setup ”Witchcraft and Wizardry” On The Server For Multi User

This is the log to setup Minecraft server and client to play “Witchcraft and Wizardry” map for multiplayer.

Though there is a detailed documents, I summarized my way to setup the server for beginners. Please note that we will not be liable for any damages caused by use of this add-on and scripts.

The environment

Minecraft Java Edition version 1.16.3 (Select Minecraft Java Edition 1.16 – 1.16.5)
CentOS Linux release 7.8.2003 (Core)
java version 1.8.0_332

I used rental VPS from ConoHa. You can use other rental servers , too.

Method

  1. Prepare the server
    1. Download server.jar
    2. Generate Minecraft vanilla data with server.jar
    3. Put “Witchcraft and Wizardry” files into Minecraft directory
    4. Change server settings
    5. Run
  2. Prepare the client
    1. Download resource.zip of “Witchcraft and Wizardry”
    2. Change the resource pack
    3. Access the server

1. Prepare the server

1.1 Download server.jar

If you have the vanilla server and the vanilla data, the default world data for Minecraft, on the server, you can skip section 1 and 2. Go to the step 3 Put “Witchcraft and Wizardry” files into minecraft directory!

There are 2 way to download, “download files on the local PC and upload” or “download files on the server directly.”

Download server.jar on the local PC and upload it

Download the server from mcversions.net. Select the version of your Minecraft and click the button “Download Server jar.” Be careful to select the correct version for your Minecraft!!

Then access the server with WinSCP. Generate “minecraft_server” directory and put the server.jar into the minecraft_server. Rename server.jar into minecraft_server.jar.

Download server.jar on the server directly with command

Access the server with Teraterm and download server.jar directly using “wget” command on the server. Be careful to select the correct version for your Minecraft!!

mkdir ~/opt/
cd opt
mkdir minecraft_server   # create directory where you'd like to setup server
cd minecraft_server

# this is the server for 1.16.3, check the link url on mcversions.net
wget https://launcher.mojang.com/v1/objects/f02f4473dbf152c23d7d484952121db0b36698cb/server.jar

mv server.jar minecraft_server.jar

1.2 Generate Minecraft vanilla data with server.jar

Run minecraft_server.jar

Then run the minecraft_server.jar, and the vanilla world, default world, is generated in “minecraft_server” directory. Remove all items in world directory.

java -Xmx1G -Xms1G -jar minecraft_server.jar nogui

stop # after generating minecraft data

If you are using Forge or fabric, put them on the minecraft_server directory instead of minecraft_server.jar. Be careful to select the correct version for your Minecraft!!

Reference: Setting up a Minecraft Forge server

1.3 Put “Witchcraft and Wizardry” files into Minecraft directory

There are 2 way to setup, “download files on the local PC and upload” or “download files on the server directly.”

Download “Witchcraft and Wizardry” on the local PC and upload it

Access the Floo Network page and download the map. I selected “Light version”.

Extract the downloaded zip.
Remove files in “world” directory on minecraft_server.
Then copy all files in the extracted directory “Witchcraft and Wizardry – Light” into the “world.”

Download “Witchcraft and Wizardry” on the server directly with command

Access the server with Teraterm and download server.jar directly using “wget” command.

mkdir ~/download_wichcraft
cd ~/download_wichcraft

wget http://download2391.mediafire.com/sqwru7rill4g/xke143473zi4ytp/Witchcraft+and+Wizardry+-+Light.zip
unzip Witchcraft+and+Wizardry+-+Light.zip -d Witchcraft_and_Wizardry

rm -r ~/opt/minecraft_server/world/
mkdir ~/opt/minecraft_server/world/ # remove all items from minecraft_server/world/

cp -r Witchcraft_and_Wizardry/* ~/opt/minecraft_server/world/  # copy all items into minecraft_server/world/

1.4 Change server settings

minecraft_server/eula.txt

eula=true

minecraft_server /server.propaties

enable-query=true
allow-flight=true
enable-command-block=true
resouce-pack-sha1=/home/username/Harry_Potter/1_server/resouces

1.5 Run

cd ~/opt/minecraft_server
java -Xmx1G -Xms1G -jar minecraft_server.jar nogui

You can run Forge or fabric, too.

# for Forge
java -server -Xms1G -Xmx1G -jar forge-1.16.3-34.1.0.jar

Prepare the client

Reference: Getting Started from Witchcraft And Wizardry Wiki

2.1 Download resource.zip of “Witchcraft and Wizardry”

Access the Floo Network page and download the map. I selected “Light version”.

Extract the downloaded zip.

2.2 Change the resource pack

Put resource.zip in your .minecraft/resourcepacks.

To change resource, start Minecraft and click Options > Resource Packs > resources.zip

Then the look changes as below.

2.3 Access the server

Click Multiplayer > Add server and put IP address of the server and any server name you like.

[Tips] How To Resize Image In markdown

In markdown documents such as GitHub, there are 2 style of putting image.

![alternate text](url/to/image.jpg"Image Title")

<img src="url/to/image.jpg" alt="alternate text" title="Image Title">

Use the latter style to resize the image as below.

<img src="url/to/image.jpg" alt="alternate text" title="Image Title" width="300" height="200">

How To Import Another Blender File

GOAL

Today’s goal is to show how to import data from another blender file.

We can import .fbx, .obj and so on by “menu File>import”, but how can we import .blend file to current scene?

The way to import fbx file

I have 2 blender scene and want to import scene_from.blend to scene_to.blend directly.

Environment

Blender2.83(LTS)
Windows 10

Method

Click File>Append

Double click the scene you want to import. Then select what you want. In my case, I imported collection that contains all objects.

Result of “Append”

The objects in scene_from.blend is imported to scene_to.blend with their materials.

Supplement

Link

You can use File>Link too, but the result is different.

Result of “Link”

You can’t modify linked objects in scene_to.blend. If you’d like to modify the object, change the scene_from.blend.

Token Authentication For GitHub

GOAL

Today’s goal is to setup for using token-based authentication in GitHub.

Background

In July 2020, we announced our intent to require the use of token-based authentication (for example, a personal access, OAuth, or GitHub App installation token) for all authenticated Git operations. Beginning August 13, 2021, we will no longer accept account passwords when authenticating Git operations on GitHub.com.

from “Token authentication requirements for Git operations”

Refer to “Token authentication requirements for Git operations” in the GitHub blog for more information.

Environment

Windows10
Git 2.19.0
GitHub

Method

See Creating a personal access token.

You can use generated token instead of the password for GitHub in Git Bash or Git GUI.

How To Use Human Meta-Rig in Rigify

GOAL

Today’s goal is to summarize the rigging method of Human Meta-Rig with Rigify addon in Blender.

I used a human model with MakeHuman.

Environment

Blender 2.83
Windows10

Method

1. Add Human meta rig

Activate addon “RIgging: Rigify” at first.

Import the model with Y-axis front.

Change the mode to “Object Mode” and click Add > Armature > Human(Meta-Rig).

Open metarig tab > Viewport Display and check “In Front” on to show the rig in front of all in the 3D View.

The human rig with “In Front” on

2. Adjust bones

Adjust rig size and locations of bone to fit the target mesh.
Don’t change the transforms of the object. Be sure to change transforms in “Edit Mode” not in “Object Mode“.

(more…)

[tips]How To Convert Tab To Space In Sublime

This is just a tip about editor “sublime”.

GOAL

Today’s goal is to summarize the 3 way to convert tab to space in sublime.

  1. How to convert tabs in the current code to the spaces
  2. How to convert the spaces in the current code to the tab
  3. How to change the tab into spaces. In other words, how to insert spaces when tab key is pressed.

Method

1. How to convert tabs in the current code to the spaces

Use command pallet. Open command pallet with Ctrl+Shift+P on Windows and Cmd+Shift+P on OSX.

The command pallet

And click “Indentation: Convert to Spaces“.

(more…)

[Tips] How To Get Attribute By String In Python

GOAL

Today’s goal is to access attributes of objects by the string of its name.
What I’d like to do is the following.

class MyClass:
  class_attr = 1
  def __init__(self, num):
    self.attr1 = 100 + num
    self.attr2 = 200 + num
  def func1(self):
    print("this is func1")
    
item = MyClass(5)
attr = "attr2"
print(item.get_attr(attr)) # output should be 205

Environment

Python 3.8.7

Method

Use getattr(objectname) to get attributes. And setattr(objectname) to set attributes.

item = MyClass(5)
attr = "attr2"
print(getattr(item, attr))
# output => 205

You can get methods and class variable too.

getattr(item, "func1")()
# output => this is func1

print(getattr(MyClass, "class_attr"))
# output => 1

How To Get The Class Of Object

GOAL

To get object name from the object.

Environment

Python 3.8.7

Method

Use special attributes “__class__” of the object.

Example

f = open('test.txt', 'r')

# getting class name
print(f.__class__.__name__) 
#output => TextIOWrapper

# getting the module where the class is defined
print(f.__class__.__module__) 
#output => _io

f.close()

special attributes

Reference: Special Attributes

  • object.__dict__
    • A dictionary or other mapping object used to store an object’s (writable) attributes.
  • instance.__class__
    • The class to which a class instance belongs.
  • class.__bases__
    • The class to which a class instance belongs.
  • class.__bases__
    • The tuple of base classes of a class object.
  • definition.__name__
    • The name of the class, function, method, descriptor, or generator instance.
  • definition.__qualname__
    • The qualified name of the class, function, method, descriptor, or generator instance.
  • class.__mro__
    • This attribute is a tuple of classes that are considered when looking for base classes during method resolution.